Tire DOT OCR - Black Text, Black Background

83 views
Skip to first unread message

David Bess

unread,
May 20, 2019, 2:20:44 PM5/20/19
to tesseract-ocr
Hi All, 

I am facing challenges reading DOT from a tire.  As a person, I can clear make it out with no difficulty.  See attached image.  In this example the DOT is PJ40 KU1R 2011.  I have already tried inverting, and binarisation, but I just do not get any output.  Did a lot of research online, and it seems like a changeling problem, so I thought I would check with the smart folks here on the forum.  Thanks in advance for any help or advice. 

Best regards,  

David Bess
8829199908894.jpg

Lorenzo Bolzani

unread,
May 21, 2019, 11:08:28 AM5/21/19
to tesser...@googlegroups.com
Hi,
this looks hard. You have two problems here, straighten the text and clean it up.

Once you have straighten the text to something like this:

8829199908894_crop.jpg

google vision api recognize it correctly. So it can be done.

I do not know how they pre-process it, maybe they do not and throw it at a neural network trained with any kind of text.

If you want to try to clean up you need to look into edge detection (gaussian difference) and/or wavelet decomposition. I tried with gimp with weak results.
When you have something that barely looks like black on white you can try to fine tune the tesseract model but you need a lot of samples with hand transcribed text, unless you are so lucky to have pre-classified images.

I would also try to fine tune the existing model with the image as it is, with no pre-processing at all other than straightening. It may even work better.

To straighten the text you may try EAST text detection, rotate the bounding boxes. Or detect curved lines and dewarp it according to the radius. Or do component analysis, detect the letter boxes and dewarp accordingly. Not easy to do reliably on a random picture.



Bye

Lorenzo


--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/1902f58b-6131-4c9e-9711-096df60bfcec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason

unread,
May 21, 2019, 11:24:58 AM5/21/19
to tesseract-ocr
I would think that if you can use edge detection (sobel/laplacian) should be fine (DoG too),  you would have the outline of the characters. Then it's a matter of detecting the closed paths and filling them. If you account for the radial (get it!?) nature of the text alignment, then bucket fill the background,  white, and when you cross a gradient, fill the other side with black (if not already filled with white) you should be able to fill the colors accordingly. Lorenzo also recently posted this link that might help: https://www.quora.com/How-do-I-fill-holes-in-image-using-image-processing/answer/V-Sri-Chakra-Kumar

You biggest signal is the gradient around the letters. Use it. 
Reply all
Reply to author
Forward
0 new messages