Archive | Image Processing

Ordering coordinates clockwise with Python and OpenCV

Today we are going to kick-off a three part series on calculating the size of objects in images along with measuring the distances between them. These tutorials have been some of the most heavily requested lessons on the PyImageSearch blog. I’m super excited to get them underway — and I’m sure you are too. However, before we start learning how to […]

Continue Reading 27

OpenCV shape detection

This tutorial is the second post in our three part series on shape detection and analysis. Last week we learned how to compute the center of a contour using OpenCV. Today, we are going to leverage contour properties to actually label and identify shapes in an image, just like in the figure at the top of this post. […]

Continue Reading 78

OpenCV center of contour

Today, we are going to start a new 3-part series of tutorials on shape detection and analysis. Throughout this series, we’ll learn how to: Compute the center of a contour/shape region. Recognize various shapes, such as circles, squares, rectangles, triangles, and pentagons using only contour properties. Label the color of a shape. While today’s post is […]

Continue Reading 41

Detecting machine-readable zones in passport images

Today’s blog post wouldn’t be possible without PyImageSearch Gurus member, Hans Boone. Hans is working on a computer vision project to automatically detect Machine-readable Zones (MRZs) in passport images — much like the region detected in the image above. The MRZ region in passports or travel cards fall into two classes: Type 1 and Type 3. Type 1 […]

Continue Reading 13

Watershed OpenCV

The watershed algorithm is a classic algorithm used for segmentation and is especially useful when extracting touching or overlapping objects in images, such as the coins in the figure above. Using traditional image processing methods such as thresholding and contour detection, we would be unable to extract each individual coin from the image — but by leveraging the […]

Continue Reading 32

OpenCV Gamma Correction

Did you know that the human eye perceives color and luminance differently than the sensor on your smartphone or digital camera? You see, when twice the number of photons hit the sensor of a digital camera, it receives twice the signal (a linear relationship). However, that’s not how our human eyes work. Instead, we perceive double the amount […]

Continue Reading 11

Blur detection with OpenCV

Between myself and my father, Jemma, the super-sweet, hyper-active, extra-loving family beagle may be the most photographed dog of all time. Since we got her as a 8-week old puppy, to now, just under three years later, we have accumulated over 6,000+ photos of the dog. Excessive? Perhaps. But I love dogs. A lot. Especially beagles. So […]

Continue Reading 60