Embossed-Text-Reader icon indicating copy to clipboard operation
Embossed-Text-Reader copied to clipboard

Not working on given images

Open harshalcse opened this issue 6 years ago • 2 comments

@DevashishPrasad I tried on following image but it does not gives expected output . img1

Can you please help me on these ? Also which research paper r u referging?

harshalcse avatar Jan 21 '19 04:01 harshalcse

The text on your metal is not embossed, its engraved. So, you need to filter it more. Try tuning the parameters of canny. Also try to change dilation and erosion iterations. I am not referring any paper. I m referring the official documentation of opencv python. https://docs.opencv.org/3.1.0/da/d22/tutorial_py_canny.html

DevashishPrasad avatar Jan 23 '19 08:01 DevashishPrasad

@harshalcse I used the code successfully on a very similar engraved pattern, but I ran the tesseract magic directly on the "dilated" version of the image, and skipped all the mask transformation.

That is, in this line: # Tesseract OCR on the image temp = pytesseract.image_to_string(th1)

Replace "th1" by "dilate"

Oh. One difference is that in my case my text is perfectly horizontal. I don't know if it's making it easier for tesseract?

If it still doesn't work, display the blurred/edged/dilated/new image/inverterd threshold version of the image and try to figure out at which step it becomes unreadable by tesseract, and then try to tweak it. But you're engraving is quite clear, it's definitely doable.

thelwyn avatar Nov 08 '19 09:11 thelwyn