V
V
vipermagi2018-07-19 05:27:21
C++ / C#
vipermagi, 2018-07-19 05:27:21

How can I improve pattern recognition of single characters?

I'm trying to make a program for recognizing license plates. I tried tesseract, but it turned out to be terribly slow and will not be able to in real time. Therefore, I decided to do it with pens through reference templates.
I took a canonical picture with the alphabet of Russian letters and numbers. I import a picture, cut it into symbols, binarize it and resize it to 5x7, store it in a map. Now, at the stage when a piece of the picture arrives with only 1 character, the algorithm turns it into the same size and color as the standards and compares it all with the absdiff () function. The output is the same size and format picture with a difference. To evaluate success, I take the opencv sum(cv::Mat) function and it gives me the sum of all pixel values, then I divide this result by the number of pixels in the picture and get a number from 0 to 255. The lower this number, the more likely the correctness of the choice of the character that is taken from the map as a string. If the probability has not reached the set minimum, say 100, then it is considered that the character was not found at all, then an empty string is returned.
Actually, it seems to work, but compared to the tesseract, I didn’t see any improvement in the quality of recognition, there may be a deterioration, but it’s not very noticeable to me. The only plus, for which it was started, is getting real time speed instead of a slide show.
Can anyone advise how this algorithm can be made more suitable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2018-07-19
@Taraflex

I tried tesseract, but it turned out to be terribly slow and will not be able to in real time.

Reduce the image resolution.
Set in the settings to recognize only those letters that are found in the numbers.
Turn off dictionaries.
Before feeding the tesseract, clean up the image as much as possible (even the simple pixConvertRGBToLuminance from leptonics surprisingly improved recognition).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question