Problems with OCRTesseractGetCharTop/Left

Discussions about OCR & MICR support 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: 5651
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 ??

thomb
Posts: 1
Joined: Tue Jul 12, 2016 2:26 pm

OCRTesseractGetCharTop/left/bottom/right to physical pixels

Post by thomb » Tue Jul 12, 2016 2:42 pm

We use Tesserect OCR to assist with screen reading. OCRTesserectGetCharTop/Left/Bottom/Right specify it returns 'in pixels'. However I use physical pixels for 'targeting' here to read.

The physical pixel conversion is important because I want to target an area of the screen, but not be perfectly specific. I will do a second pass taking the coordinates returned by OCRTesserectGetCharTop etc, to tune where to target the screen again.

I find that the size of the area being targeted is important for recognition accuracy.

Gabriela
Posts: 282
Joined: Wed Nov 22, 2017 9:52 am

Re: Problems with OCRTesseractGetCharTop/Left

Post by Gabriela » Thu Jan 31, 2019 11:31 am

Hello,

It is not quite clear what you mean by "the PDF has a rotated Image". To get rid of internal rotation in PDF documents, you should normalize pages in the document before OCR:
http://guides.gdpicture.com/content/web ... ePage.html
Kind regards,

Gabriela
GdPicture Team

Gabriela
Posts: 282
Joined: Wed Nov 22, 2017 9:52 am

Re: OCRTesseractGetCharTop/left/bottom/right to physical pixels

Post by Gabriela » Thu Jan 31, 2019 11:32 am

Hello,

I'm not sure what you mean by "physical pixels". Maybe the posts above in this topic can be useful for you.
Kind regards,

Gabriela
GdPicture Team

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest