scratchcard-ocr-feat-img

In this tutorial I will show you a possible solution for OCR-ing the digits from a scratchcard, as asked on the OpenCV Q&A. Actually it asked a different question: how to segment the LCD/LED display in an image. But the poster attached a scratchcard image which I found challenging to be ORC-ed. Read more…

Tags: C++ ocr

nike-rsvp-ocr-feat-img

Twitter RSVP is Nike’s program to help manage new product launches at their stores. On the RSVP date, the store will send a tweet at a random time to begin the Twitter RSVP process. This tweet will include an image with a specific hashtag as shown in Figure 1. The participants then required to send a Direct Message (DM) using the hashtag from the image to secure a spot in line for the requested size. Read more…

Tags: ocr python

Currently the skeleton morphological operation does not exist in OpenCV. But if you’re on Linux and code with Python, there is an easy way to get the skeleton of a binary image. The scikit-image module provides the function to skeletonize an image. Read more…

Tags: python skeleton

The Mathematica Stack Exchange is really a gold mine for image processing learners like us. A few days ago there was someone posted a question about how to detect small holes in walls. I first thought it was a very difficult problem, but it turns out the solution in Mathematica consists only a few lines of code. And I’m really amazed with the brilliance of the Mathematica fellows there. Read more…

Tags: Mathematica python

tv-commercials-feat-img

There is an interesting question on StackOverflow about how to detect and recognize commercials from TV content. The poster of the question had an idea to search for the first and the last frame of the commercial to solve this problem. Indeed that is the right solution since commercials are just recorded videos and the content won’t change dynamically. Read more…

Tags: python template matching

dot-patterns-feat-img

I was trying to write the code to achieve the same photo effect with this Photoshop tricks. With only a few lines of code, I’m pretty amazed with the result. Given a photo, the code will turn the photo into a colored dot patterns as shown in Figure 1d. Read more…

Tags: C++ photo effects

autocrop-image-feat-img

This is the code for auto-cropping image i.e. extract foreground object surrounded by unwanted borders. I was in a need for a function to extract foreground object after some binary image analysis. Since it is a binary image, mostly the foreground value is 1 and the background value is 0. But later I thought that it would be much better if the function also supports arbitraty foreground/background color e.g: foreground is red and background is blue. Read more…

Tags: C++

practical-image-morph-boundary-extract-feat-img

This entry is part 2 of 5 in the series Practical uses of image morphology

In the first article of this series, we looked at how basic image morphology operations –erosion, dilation, and hit-or-miss transform– can have many practical uses. In this post, we are going to explore the first two practical uses: boundary extraction & region filling. Read more…

Tags: C++ morphology transform

practical-image-morph-feat-img-2

This entry is part 1 of 5 in the series Practical uses of image morphology

In chapter 9 of “Digital Image Processing” by Gonzalez and Woods, it is explained about the basics of image morphology using dilation and erosion. Using the two operations, we can derive many interesting practical uses such as: boundary extraction, region filling, thinning, thickening, skeletons, and pruning.

In this series we will see how to implements the operations above using OpenCV based on the equations from the book. We’ll start with the basics of image morphology: dilation and erosion. Read more…

Tags: C++ morphology transform

straighten-image-feat-img

I came to this Mathematica demonstration project and cannot wait to see how it could be done in OpenCV. Given an image, we draw a line on the image and the image rotates so that the line is horizontal. Let’s see how we can code this using our library. Read more…

Tags: C++ geometric transform