patcharats / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

add option to include position information in text output #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like the have the output look like

<0,10>This <15,10>is <17,10>some <25,10>text<30,10>.

Where the words are preceded by the x,y coordinate where the first character of 
the word 
occurred.

For our form processing needs, this would allow for a more flexible external 
layout engine.

It would also be helpful, if there was a some other tags, like <font-size:size> 
and possibly 
<font-faimly:name> that were included when the engine detected a font 
family/size change.

I would be willing to do the enhancements if someone could point me in the 
right direction.

Original issue reported on code.google.com by reng...@ix.netcom.com on 25 Aug 2007 at 8:03

GoogleCodeExporter commented 9 years ago
In thinking about this some more, it is may be sufficient to just have an mode 
that outputs

character X Y W H for each character, X Y W H is the rectangle that contains 
the character.

Original comment by reng...@ix.netcom.com on 25 Aug 2007 at 8:11

GoogleCodeExporter commented 9 years ago
You can already get the information you need through the dll API if you are 
working
on windows. If you are on any OS and don't mind linking statically, you can get 
the
information by deriving from TessBaseAPI and copying the model of 
TesseractToBoxText,
or use the new TesseractExtractResult. Alternatively if you prefer a separate 
process
and a command-line API, you can modify TesseractToBoxText to optionally output
spaces, and use this command line:
tesseract image.tif output nobatch makebox, which will create output.txt in a 
useful
format including bounding boxes of each character WITHOUT turning off the 
chopper
(which is for training). Most likely you will need to setup a new variable and
corresponding config file to control the output of spaces, as we don't want 
them for
training.

Original comment by theraysm...@gmail.com on 6 Sep 2007 at 1:01

GoogleCodeExporter commented 9 years ago
But where i can found this api ?

Original comment by ajay1kum...@gmail.com on 2 Mar 2008 at 6:39

GoogleCodeExporter commented 9 years ago
Issue 53 has been merged into this issue.

Original comment by theraysm...@gmail.com on 30 Dec 2008 at 9:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in 3.00 with hOCR output.

Original comment by theraysm...@gmail.com on 20 May 2010 at 6:56