#include "ltocr.h"
L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_GetRotateAngle(page, value, confidence)
Gets the angle of the rotation of this L_OcrPage in degrees.
Handle to the OCR page.
Address to L_INT variable to be updated with the page rotation angle.
Address to L_INT variable to be updated with the rotation angle detection confidence.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Gets the angle of the rotation of this L_OcrPage in degrees. A positive value indicates a counter-clockwise rotation.
This method will return one of the following values:
Value | Description |
---|---|
0 | The bitmap is not rotated |
90 | The bitmap is rotated 90 degrees (counter-clockwise rotation). |
180 | The bitmap is rotated 180 degrees (counter-clockwise rotation). |
270 | The bitmap is rotated 270 degrees (counter-clockwise rotation). |
Use L_OcrPage_AutoPreprocess with L_OcrAutoPreprocessPageCommands_Rotate to automatically rotate the page bitmap prior to calling L_OcrPage_Recognize. This could enhance the quality of the image before starting its recognition.
If the bitmap is rotated, L_OcrPage_GetRotateAngle will return the angle required to fix the orientation of the page, if you call L_OcrPage_AutoPreprocess on the page, all subsequent calls to L_OcrPage_GetRotateAngle will return 0 since the bitmap is not rotated. Hence, you must use L_OcrPage_GetRotateAngle before calling L_OcrPage_AutoPreprocess.
Use L_OcrPage_GetAutoPreprocessValues to obtain the accumulative pre-processing values applied to this L_OcrPage.
Required DLLs and Libraries
For an example, refer to L_OcrPage_GetDeskewAngle