Ask Your Question
0

Image Recognition Issue-Image to Text

asked 2014-01-23 06:10:25 -0600

prachis gravatar image

updated 2015-11-14 07:44:40 -0600

berak gravatar image

I am working on OCR using opencv and now I am currently able to detect individual character by drawing a rectangle around them .Now I am not sure how to proceed to convert the image into textfile containing all the characters in the image. please help.Coding language-c++

edit retag flag offensive close merge delete

Comments

Since you have the individual characters and you know their corresponding label (which is the actual OCR part) it should not be too hard to write them to a file. For lines you look at the coordinates of the bounding box, if the y dimension changes, a new line is started. If x is larger then a specific threshold, there is a space instead of a next letter. To output the data to a text file you can simply use the ofstream class of C++!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-23 06:23:16 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2015-11-14 07:39:03 -0600

Since you have the individual characters and you know their corresponding label (which is the actual OCR part) it should not be too hard to write them to a file. For lines you look at the coordinates of the bounding box, if the y dimension changes, a new line is started. If x is larger then a specific threshold, there is a space instead of a next letter. To output the data to a text file you can simply use the ofstream class of C++!

Yes, directly save the str pointer to text file by ofstream class.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-01-23 06:10:25 -0600

Seen: 362 times

Last updated: Nov 14 '15