I'm performing some rudimentary OCR on some images that I have. The image below is from a VIN tag in a car. The image was originally color with a lot of glare that made some of the characters illegible. I performed the following operations.
- Color Invert (tag was black and text was white, I wanted the reverse)
- Color Threshold to get rid of the worst of the glare.
- Make image black+white only
- Erode/Dilate in order to tinker with the text to make it easier for Tesseract OCR to read.
- Run Tesseract OCR to extract the characters
The issue that I'm having now is that the black "fuzz" that surrounds the sticker is slowing down Tesseract. What I would like is the name of some operation or a series of steps that I can regularly use in a case like this to get rid of these distortions. I could manually write something to look at squares of the image and if there's way more dark then light, replace with white. There has to be some formal image processing technique to handle this case that I just don't know of.
If I manually remove the black in the margins, my accuracy goes up substantially in Tesseract.