Yes, I do this with JavaScript in the browser.

You need:
- the dimension of the image-file on which the bbox coordinates are based
- the dimensions of the image in the HTML-page (scalable, scrollable, ...)
- parse the bbox numbers
- calculate CSS positions and size
- add the style to each element

Then highlight, frame, render or whatever on mouseover, on click, on focus.

HTH

Helmut Wollmersdorfer

Am Donnerstag, 17. September 2015 20:12:20 UTC+2 schrieb [email protected]:
>
> Hello.
>
> Im using Tess4j, a java wrapper for the Tesseract dll, and Im trying to 
> convert an hocr result to css coordinates.
>
> The reason Im doing this is that I need to position the ocr result over 
> the original image, in a web page.
>
> I noticed that hocr files contain a 'bbox' coordinate system:
>
> <div class='ocr_page' id='page_1' title='image "c:\ocr.jpg"; bbox 0 0 827 
> 1169; ppageno 0'>
>    <div class='ocr_carea' id='block_1_1' title="bbox 98 35 747 78">
> ....
> </div>
>
> Is there a way to generate "position: absolute; top, left, width, height", 
> based on the bbox information?
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/b310b150-5fe6-4ca7-967c-43c8e10c6a2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to