L_Doc2DetectOrientationDegree

#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2DetectOrientationDegree(hDoc, nPageIndex, pnRotate)

L_HDOC2 hDoc;

handle to the OCR document.

L_INT nPageIndex;

page index

L_INT * pnRotate;

pointer to a variable

Determines the angle by which the specified page needs to be oriented.

Parameter

Description

hDoc

Handle to the OCR document.

nPageIndex

Index of the page for which to get the orientation angle. This index is zero-based.

pnRotate

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

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The purpose of orientation is to make the page 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

Please note that this function just provides the angle of orientation that is needed. It does not actually orient the page. To orient the page, call the L_Doc2AutoOrientPage function.

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

To automatically orient a page, call the L_Doc2AutoOrientPage function.

Required DLLs and Libraries

LTDOC2

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_Doc2LockPage, L_Doc2UnlockPage, L_Doc2SetActivePage, L_Doc2SelectZoneByPoint, L_Doc2SelectZone, L_Doc2RemoveSelectedZone, L_Doc2SetZonePen, L_Doc2SetSelectedZonePen, L_Doc2GetSelectedZone, L_Doc2Zone, L_Doc2CleanupPages

Topics:

Working with Pages

 

OCR Functions: Pages

Example

L_INT Doc2DetectOrientationDegreeExample(L_HDOC2 hDoc,L_INT nPageIndex) 
{ 
   L_INT nRet; 
   L_INT nRotate = 0; 
   nRet = L_Doc2DetectOrientationDegree(hDoc, 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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Professional OCR C API Help