primer on calculating image translation/rotation?

54 views
Skip to first unread message

fsbo.c...@gmail.com

unread,
Aug 24, 2015, 4:18:13 PM8/24/15
to tesseract-ocr
I'm using tesseract on forms and I need to call setRectangle to retrieve specific fields. Unfortunately the forms are sometimes translated, and sometimes a bit rotated or other transformations. Is there a good primer I can read on how to calculate the translation, rotation, etc? I'm assuming it would involve taking a recognizable object that occurs on all of the forms, such as a line, and calculating the position of this, then calling setRectangle with coordinates calculated from the position of this "landmark" object. (the line)

Helmut Wollmersdorfer

unread,
Aug 25, 2015, 6:21:10 AM8/25/15
to tesseract-ocr


Am Montag, 24. August 2015 22:18:13 UTC+2 schrieb fsbo.c...@gmail.com:
I'm using tesseract on forms and I need to call setRectangle to retrieve specific fields. Unfortunately the forms are sometimes translated, and sometimes a bit rotated or other transformations. Is there a good primer I can read on how to calculate the translation, rotation, etc? I'm assuming it would involve taking a recognizable object that occurs on all of the forms, such as a line, and calculating the position of this, then calling setRectangle with coordinates calculated from the position of this "landmark" object. (the line)

You need the coordinates of the four corners which you can use as parameters to an unperspective method of the image library of your choice.

Here is an example you can dig into the details (open source): http://www.fmwconcepts.com/imagemagick/unperspective/index.php -- scroll down to OCR like examples.

Leptonica also has distortion examples:


Reply all
Reply to author
Forward
0 new messages