L_Doc2DetectOrientationDegreeExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2DetectOrientationDegreeExt(hDoc, nDocId, nPageIndex, pnRotate)

Determines the angle by which the specified page needs to be oriented. No rotation is performed.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

L_INT nPageIndex

Zero-based index of the page for which to get the orientation angle.

L_INT * pnRotate

Pointer to a variable to be updated with the orientation angle, in degrees. Possible values are: +90, +180, and +270. Rrotation is clockwise.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

✎ NOTE

This function just provides the angle of orientation that is needed. No rotation is performed. To automatically orient the page, call L_Doc2AutoOrientPage / L_Doc2AutoOrientPageExt.

If the specified page does not need to be oriented, the pnRotate parameter is updated with 0.

Orienting the page makes it more readable during recognition by making sure the top of the page is positioned properly. That is, a page that is oriented correctly like this:

image\DetectOrientationDegree1.gif

is much more readable than the same page oriented like this:

image\DetectOrientationDegree2.gif

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2DetectOrientationDegreeExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex) 
{ 
   L_INT nRet; 
   L_INT nRotate = 0; 
 
   nRet = L_Doc2DetectOrientationDegreeExt(hDoc, nDocId, nPageIndex, &nRotate); 
   if (nRet == SUCCESS) 
   { 
      L_TCHAR szBuffer[1024]; 
      wsprintf(szBuffer, TEXT("Orientation degree = %d"), nRotate); 
      MessageBox(NULL, szBuffer, TEXT("Notice!"), MB_OK); 
   } 
   else 
      return nRet; 
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.