E
E
Eugene2019-03-15 22:41:40
Pattern recognition
Eugene, 2019-03-15 22:41:40

What OCR can be used to train image recognition based on a pattern (not text)?

Good day!
White pictures will be cut out, the size will be different, they can be rotated up to 90% (well, this can be solved if you rotate them all by 1 degree and train them).
So, what OCR can be trained to recognize pictures? Maybe there are sharpened specifically for these purposes, and not the text?
Example (with background to be cut out):
a986821e220c68b2a21cb8a432507471.png
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2019-03-16
@rPman

opencv has a lot of stuff.
If you make a bike, then: if there are no problems with the efficiency of the algorithm, everything is simple for you - find all the white areas (threshold value, we build a monochrome one, putting the color where it is white in the image), calculate their size, and start rotating in steps of 1-3 degrees, after each rotation we scale to the size in which your templates are stored (it’s better to make smaller sizes to speed up, of course it’s more logical for templates to align the sizes on one side) and count the number of matches (plus to the score) and mismatches (minus to the score) , for example by doing xor (patterns and comparison done in monochrome versions) and minimizing the number (area) of dark areas.
If there are few template images, instead of iterating through all the corners, you can use a dichotomy (we turn in the direction at which the coincidence score becomes better, reducing the step), in this case, you will have to rotate for each template in your own way, in general, see what is more efficient.
This is not a very efficient algorithm, but it is very simple.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question