ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Detect rotation
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mauriciopt

Portugal
34 Posts

Posted - Jul 15 2015 :  06:20:13  Show Profile  Reply
Hi,

i use this code to detect image rotation:

angle := m_OCR.getTextAngle(ImageEnVect1.IEBitmap.GetIEVisionImage()) * 180 / PI;
m_OCR.getOrientation(orientation, writingDirection, textlineOrder, deskewAngle);
deskewAngle := -deskewAngle * 180 / PI;
if orientation = ievOCROrientPAGE_RIGHT then
deskewAngle := deskewAngle - 90
else if orientation = ievOCROrientPAGE_DOWN then
deskewAngle := deskewAngle - 180
else if orientation = ievOCROrientPAGE_LEFT then
deskewAngle := deskewAngle - 270;

ImageEnVect1.IEBitmap.Origin := ieboBOTTOMLEFT;
ImageEnVect1.Proc.Rotate(-deskewAngle);

It works well if the page is not reversed (180º).
Can you correct this bug (i' m a registered user)?



Mauricio
http://sourceforge.net/projects/tcycomponents/

attach/mauriciopt/201572374311_attached.zip
130.59 KB

Download Attachment: 20157237432_attached.zip

attach/mauriciopt/201572374750_attached2.zip
129.44 KB

xequte

38514 Posts

Posted - Jul 16 2015 :  14:56:41  Show Profile  Reply
Hi Mauricio

What happens when the page is reversed?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Jul 20 2015 :  11:12:05  Show Profile  Reply
Hi,

let me explain better: the page still unchanged: reversed!
There' s no exeption but the page is not rotated.

I' m pretty sure that is a common problem with all images.

Regards,
Maurício

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38514 Posts

Posted - Jul 20 2015 :  19:08:28  Show Profile  Reply
Hi Maurício

Please change your code to:

deskewAngle := -deskewAngle * 180 / PI;
if orientation = ievOCROrientPAGE_RIGHT then
  deskewAngle := deskewAngle - 90
else
if orientation = ievOCROrientPAGE_DOWN then
  deskewAngle := deskewAngle - 180
else
if orientation = ievOCROrientPAGE_LEFT then
  deskewAngle := deskewAngle - 270;

if deskewAngle <> 0 then
  ImageEnView1.Proc.Rotate( -deskewAngle );


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Jul 22 2015 :  03:17:27  Show Profile  Reply
Hi Nigel,

same result :(
Did it worked with your own bitmap?

Note that my code comes from your own demo application named "OCRwithLayout.dproj".

Regards,
Mauricio

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38514 Posts

Posted - Jul 23 2015 :  05:42:49  Show Profile  Reply
Hi

Yes, it worked when i tested an inverted file. Perhaps you can send me a couple of examples and I will test again.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Jul 23 2015 :  07:48:40  Show Profile  Reply
Hi Nigel,

i have posted attched2.zip

Regards,
Mauricio

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38514 Posts

Posted - Aug 03 2015 :  20:46:15  Show Profile  Reply
Hi Mauricio

There seems to be an issue where IEVision may return ievOCROrientPAGE_UP even for rotated documents. We are investigating...

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

mauriciopt

Portugal
34 Posts

Posted - Aug 04 2015 :  03:22:57  Show Profile  Reply
Ok, waiting next release ...

Mauricio
http://sourceforge.net/projects/tcycomponents/
Go to Top of Page

xequte

38514 Posts

Posted - Sep 06 2015 :  23:25:02  Show Profile  Reply
Hi

It seems to be related only to low resolution images. We cannot reproduce the issue with photos of good resolution.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: