Identifying start and end XY vector of characters on image
I'm trying to recollect some information about letters to start开发者_开发技巧 some kind of OCR with Neural Networks. I've yet to really join all the things together, however, the problem I'm having right now is how to differentiate characters and separate them. Something like http://pp19dd.com/tesseract-ocr-chopper/?i=ocrFTYzRJ (nothing fancy, just common fonts)
I believe the better way is to make a big amount of for-loops to get top, lowest x and y considering each character and number have black pixels that join each other (although i is an exception).
Is there any kind of library or algorithm that can aid me with this? I'm using Cimg for image processing.
Is this really hard?
It sounds like you are looking for a connected component labeler. The idea is to scan the image for groups of pixels that are connected to one another, and return a collection of objects (usually called "blobs") where each object contains a list of the pixels in that blob.
I do not recommend trying to write your own. OpenCV has one built in that works very well and is based on
F.Chang,C.-J.Chen,andC.-J.Lu, "A linear-time component-labeling algorithm using contour tracing technique," Computer Vision and Image Understanding, vol. 93, no. 2, pp. 206–220, 2004.
There very well may be a better solution that is specifically geared to finding letters.
Have you checked out the OpenCV project? Here is a tutorial for doing number OCR with it.
精彩评论