OCRTesseractGetOrientation_" returns wrong rotation

Discussions about Tesseract OCR integration in GdPicture.
Post Reply
fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Wed Dec 02, 2015 6:05 pm

Hi,

when using the OCRTesseractGetOrientation_2 function for the attached image the return is a rotation angle even though it is not rotated.
Only when changing the confidence level to a low number it returns the correct result, but if confidence level is 10 it still returns wrong angle!

What is the cause and how can it be fixed?
Using 11.0.2.30 version.
Attachments
hand.tif
Test image
hand.tif (7.67 KiB) Viewed 2555 times

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Thu Dec 03, 2015 6:32 pm

Hi,

The OCR is for machine printed character recognition purpose. Your image contains only few handwritten characters, this functions is definitively not designed for such pattern.

With best regards,

Loïc

fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Thu Dec 03, 2015 10:17 pm

Hi,

I know that it is not designed for it but why does the function return a rotation other then zero?
The problem is that the software obviously does not know what is on the page so it should not rotate such a scan but if a rotation result is returned, it rotates the page.

Can you enhance your algorithm so it will simply not return a rotation angle for such a document?

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Fri Dec 04, 2015 3:50 pm

hi,

which dictionary are you using?

Regards,

Loïc

fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Fri Dec 04, 2015 4:40 pm

The function call looks like this:
rotationAngle = OCRTesseractGetOrientation_2 ( imageId, "deu+eng+fra+spa", , 4 )

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Fri Dec 04, 2015 4:47 pm

ok thanks.

We have experimented a bit and we will be able to detect the correct orientation for your case for the next minor release.
We will also push some r&d efforts for the next major release (probably for a medium release) in order to improve it more.

That said, I suggest to always use 10 for the accuracy. We frequently improve this method and we are clearly focused on providing better result (accuracy and speed) with this value.

Kind regards,

Loïc

fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Fri Dec 04, 2015 4:57 pm

Hi,

thanks!

the weird thing is, if we raise the accuracy setting to more than 3, we get the wrong result. If we set ti to 3 or below it does not return a rotation angle!

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Fri Dec 04, 2015 6:13 pm

Yes I've seen that. We need more to do experimentation on this method for document without machine printed characters. This is back-logged.

SarrasiM
Posts: 22
Joined: Thu Dec 17, 2015 6:20 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by SarrasiM » Thu Dec 17, 2015 6:27 pm

Good day,

I experimented the same behavior where lowering the accuracy settings returned the good orientation :)

Loic, can you give us more information on how the orientation is detected in the background? Is it checked for the whole image or only a part of it? I have some images with machine printed characters but very stylized font in the middle, while the rest of the image use a common font but still a little stylized and it returned a 180 degrees while it should not be rotated. Is there any way a confidence level could be returned in an overload as an out parameters or anything? On this image it does return a 0 degree if accuracy is <= 4.

SarrasiM
Posts: 22
Joined: Thu Dec 17, 2015 6:20 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by SarrasiM » Thu Dec 17, 2015 7:17 pm

Is the SetROI taken into account when using this method?

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Tue Jan 05, 2016 2:39 pm

Hello,
I experimented the same behavior where lowering the accuracy settings returned the good orientation :)
Please share your image and a code snippet reproducing your issue with our team. You can do that here: http://support.gdpicture.com
Is the SetROI taken into account when using this method?
No, otherwise it would have been mentioned into the documentation.

With best regards,

Loïc

fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Sun Feb 28, 2016 2:23 pm

Hi,

has this issue been addressed in the new version 12?

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

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by Loïc » Sun Feb 28, 2016 2:36 pm

Hi Ferdinand,

The V12 includes our latest R&D work about orientation detection. So yes, the issue has been "addressed" and will be continuously revisited.

With best regards,

Loïc

fs051268
Posts: 35
Joined: Wed May 22, 2013 4:00 pm

Re: OCRTesseractGetOrientation_" returns wrong rotation

Post by fs051268 » Fri Mar 25, 2016 12:08 pm

Great, thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest