I am developing an anpr application and I have managed to locate the number plate area from the vehicle image.
when i feed this image to tesseract OCR engine it seems to detect a character "L" before "C" so im thinking of taking out the remaining black pixels around the number plate area. is there a particular approach that i can take to sort this out? I am using aforge.net library in this case
Cheers
One approach for semi-automatically removing the black pixel areas around the number plate could be to apply the PointedColorFloodFill filter four times, placing the flood fill starting points in the four corners of your image.
Here is some example code where I have applied the filter on a copy of the number plate image from your question above (cropped to remove the white border):
which provides the following image after completed filtering from all four corners:
You may want to experiment with a more grayish fill color and different tolerance, but this example could at least provide a reasonable starting point.
UPDATE I stumbled across the BradleyLocalThresholding filter which could give you an even better starting point for your OCR recognition. This filter can only be applied to 8bpp images, which you would be able to solve for example by first applying the Grayscale filter on your original image. If you add the following four lines before the
PointedColorFloodFill
code:and reduce the
PointedColorFloodFill
tolerance to e.g. 10 for each RGB component:the fully filtered number plate will now look like this: