Archive | Image Processing

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 24

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 11

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 22

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 50

Removing contours from an image using Python and OpenCV

Awhile back I was going through /r/computervision when I stumbled across a question asking how to remove contours from an image using OpenCV. Intrigued, I posted a reply. The basic algorithm for removing contours from an image goes something like this: Step 1: Detect and find contours in your image. Step 2: Loop over contours individually. Step […]

Continue Reading 10