Answer the question
In order to leave comments, you need to log in
Where can I find a library for recognizing numbers in an image?
Colleagues, does anyone know a ready-made lib for recognizing numbers in an image? Images are two-color (background in one color, numbers in another). jpg and png format. The numbers are not distorted, the same size.
Interested in php under Linux, i.e. either an implementation in php, or a module for php. In principle, implementations in other languages are also suitable, if they can be kicked from a php script with an exec.
Answer the question
In order to leave comments, you need to log in
It didn't work out how to properly train phpOCR. I found a more powerful analogue - the tesseract-ocr utility. Debian has it in standard turnips.
If the numbers are not distorted, then it is possible without a library. Simple procedure:
- Making a "threshold" or high contrast;
- Select individual characters (according to empty rows and columns of pixels);
- We divide the resulting symbols into 9 parts, as in "tic-tac-toe";
- We count the number of black pixels in each part.
- Well, then we just compare all the parts with each other - the ratio for each number will be different.
As easy as pie...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question