One of first thing that one needs to learn in image processing is Connected Component Analysis.Connected components are large discrete regions of similar pixel intensity.There is really no point in talking about what exactly is “connected component analysis ” since you already have Wikipedia for that purpose . 🙂
OpenCv provides various methods for connected component analysis.The foremost methods are morphological operations and Contour extraction.The basic morphological transformations are called dilation and erosion, and they arise in a wide variety of contexts such as removing noise, isolating individual elements, and joining disparate elements in an image.
With respect to License Plate Recognition ,I have found dilation particularly effective after localization of the license plate.Let me show you an example of using canny and dilation together.
Dilation involves scanning an image with a kernel (may be user define ,or may be the default ones).Think about a 3*3 square.The square slides across the image.At any moment it is covering 9 pixels.The local maxima is computed and all the pixels are replaced with the values of that maxima.
With respect to License plates lets say we have a sample of partly localized preprocessed license plate.The original image is given below.
Most people would be tempted to apply canny edge detection for the text detection phase.So the result after cvCanny(img,img,100,500) is
As you can see a lot of unnecessary noise that can hamper your text detection process.Adjusting the threshold also doesn’t work every time.
So the better process would be to apply Dilation on the original Image ,this is the result after dilation.
Then apply Canny edge detection.
This image now forms the base for connected component analysis and text detection as well as license plate localization.The image is much more cleaner and is devoid of noise.The code is pretty basic
</p> <p>cvCanny(img3,img3,100,500);</p> <p>cvDilate(img3,img3,0,2);</p> <p>display(img3);</p> <p>
Thank you for a great post.
Till this point, its impressive… Lekhin how do you recognize the numbers?!?
Basically now you can easily isolate the numbers based on the histogram intensity.After isolation you can send that part to the OCR!
Or you can also detect the number of even edges to localize the portion containing numbers!
Good points