How to define exact, predefined forms with a hough transform, like "W"?

Let's say I have some kind of system that scans documents where all documents use the same font and font size.

These documents will always have the same letter "W". Let them say that he is always 20 px big. How can I customize the hough conversion to recognize this letter “W” at 20 px large in my docs?

+6
source share
2 answers

A quick Google search provides the following information of interest:

Hough transform generalization for detecting arbitrary shapes

and it looks like a lecture , using the above paper as a source.

Also, if it's an actual “W,” is it possible that an OCR engine like Tesseract would better suit your needs?

+3
source

The Hough transform for lines finds the best linear equations. You will need to do additional processing to find only line segments. If the thickness of the characters is several pixels, then you can reduce the thickness to one pixel to find lines effectively. There are methods for this, but also various algorithmic traps.

Once you have the line segments, you still have to write an algorithm to identify the characters based on the relative position and angle of the line segments. This is harder than it sounds.

Normalized cross-correlation (pattern matching) can work if you are sure that the image will always have a certain rotation, the characters will always be the same size, etc. But even for scanning, you will see some rotation and some differences in contrast.

Anything aside, probably in the long run, is likely to use a commercial OCR package or a fairly good open source project. OCR is difficult to implement if you are not familiar with image processing.

+1
source

Source: https://habr.com/ru/post/903959/


All Articles