Problems with OCRTesseractGetCharTop/Left

Discussions about Tesseract OCR integration in GdPicture.
Post Reply
win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Problems with OCRTesseractGetCharTop/Left

Post by win568 » Tue Sep 22, 2015 9:35 am

Hi

We have the following Problem: After Executing OCR, we extracted all Words and its Coordinates from the Recognized Text. This Words will be filtered and we tried to Show it for the Customer. For this we use AddRegion to Paint a Rectangle around the Word with the Coordinates from OCRTesseractGetCharTop/Left/Right/Bottom. Unfortunatelly this Coordinates are in Pixel and if we tried to Add the Region we have sometimes Troubles, when the Image in the PDF is rotated, or when the Resolution is other than the Resolution with OCR Recognition.
What can we do to paint the AddRegion every time on the Right Place on the PDF ??

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: Problems with OCRTesseractGetCharTop/Left

Post by win568 » Tue Sep 22, 2015 4:22 pm

Hi

I tried to Use CoordDocumentToViewer, but this function Returns Negative Values. What i Need would be like AddPageRotation on the PDF Document, to Add the Region on the Viewer on the Right Place. Do you have an advice for me ??

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: Problems with OCRTesseractGetCharTop/Left

Post by win568 » Mon Oct 12, 2015 9:40 am

Hi

Can you give me an advice ?? I tested a lot of combinations, but i have documents, were the Rectangles are not correct. To paint a Rectangle on a PDF, we use the AddRegionInches MEthod. This method Needs Inches. So we calculate the Coordinates with the Resolution of the OCR. Sometimes we got the wrong coordinates.
Is there another possibility ??

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: Problems with OCRTesseractGetCharTop/Left

Post by win568 » Thu Oct 15, 2015 12:18 pm

Hi

No answer ??

User avatar
Loïc
Site Admin
Posts: 5576
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Problems with OCRTesseractGetCharTop/Left

Post by Loïc » Mon Oct 26, 2015 7:35 pm

Hi,

Unfortunately your messages are really unclear to me, especially after reading "Sometimes we got the wrong coordinates".

What I can suggest you to go further is to simply reproduce your problem in a standalone application that you can share with our team through our helpdesk: http://support.gdpicture.com

Kind regards,

Loïc

win568
Posts: 44
Joined: Tue Mar 24, 2015 1:00 pm

Re: Problems with OCRTesseractGetCharTop/Left

Post by win568 » Thu Oct 29, 2015 12:18 pm

Oh, sorry. Let it clarify to you.

We automatically process PDF Documents. The User loads a PDF Document in the Viewer.

Than he starts the OCR Recognition. In this Action we Render the PDF Image to an unvisible GDPictureImage and execute the OCRTesseractDoOCR Function. After the Execution we build a word List (Through OCRTesseractGetChar and OCRTesseractGetCharSpaces) and search for phrases in this list. If we found the Phrase we calculate the rectangle coordinates of this word on the Document.

Up to this Point it works great.

So that the User can find the Phrase on the Document I use the AddRegionInches Method of the Viewer. I recalculate the Rectangle coordinates to Inches (Pixel / DPI) but on some Documentes the Rectangle is drawn wrong. This happend, when the PDF has a rotated Image. I tried the Method CoordDocumentToViewer but i did not get the right coordinates.

Do you have an advoce for me ??

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest