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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIEVisionOCR.getOrientation Issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jeffp Posted - Jan 14 2025 : 12:25:07
I'm using the code below to get the rotation angle or orientation of a scanned document image. However, the issue is some documents scanned upside down are giving a result of ievOCROrientPAGE_UP instead of ievOCROrientPAGE_DOWN.

Here is an example. It seems documents with lots of text are fine. But the more sparse the text it fails.

Attached is an example.


function TEnOCR.GetRotation(ABitmap: TIEBitmap): Integer;
var
  AOCR: TIEVisionOCR;
  AStr: String;
begin
  Result := 0;

  try //Seems to crash on a blank page

    if not Assigned(ABitmap) and Assigned(FViewer) then ABitmap := FViewer.IEBitmap;
    if not Assigned(ABitmap) then exit;

    AOCR := GetVisionOCR;
    try
      AOCR.setSegmentationMode(ievOCRAUTO_OSD); //Must be ievOCRAUTO_OSD
      FTextAngle := AOCR.getTextAngle(ABitmap.GetIEVisionImage) * 180 / PI; //From Radians to Degree
      AOCR.getOrientation(FOrientation, FWritingDirection, FTextlineOrder, FDeskewAngle);
    finally
      AOCR := nil;
    end;

    case FOrientation of
      ievOCROrientPAGE_UP:    Result := 0;
      ievOCROrientPAGE_RIGHT: Result := 90;
      ievOCROrientPAGE_DOWN:  Result := 180;
      ievOCROrientPAGE_LEFT:  Result := 270;
    end;
  except end;
end;



attach/jeffp/2025114123143_Orientation-Down2.tif
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 15 2025 : 21:23:09
Hi Jeff

Thanks, we'll need to investigate that further.

Nigel
Xequte Software
www.imageen.com
jeffp Posted - Jan 14 2025 : 18:42:02
IEVision 8.1.5

ImageEn 13.7.1 Beta 0112

jp
xequte Posted - Jan 14 2025 : 18:22:52
Hi Jeff

Please confirm what version of ImageEn and IEVision you are using.

Nigel
Xequte Software
www.imageen.com