OCR Xpress for Linux
OCRX_get_orientation

Gets the orientation of a given result. The orientation is the angle required to rotate the given result to its normal upright orientation.

Valid orientation values for a given result are 0, 90, 180 and 270.

Arguments:

Name Type Description
result const OCRX_Result Result for which to get the orientation.
orientation int32_t* Retrieved orientation.

Return Value:

OCRX_Status – Specifies whether an error occurred and, if so, specifies which error and any relevant details.

Example:

Copy Code
#include “ocrxpress.h”

intptr_t dib = 0;
OCRX_RecognitionParameters params = OCRX_DefaultRecognitionParameters;
OCRX_Result documentResult = 0;
OCRX_Result pageResult = 0;
int32_t orientation = 0;

OCRX_set_solution_name(“solutionName”);
OCRX_set_solution_key(0x00000001, 0x00000002, 0x00000003, 0x00000004);
OCRX_set_oem_license_key(“oemLicenseKey”);

OCRX_load_file(“/home/user/image.bmp”, &dib);
OCRX_recognize_to_memory(params, dib, &documentResult);
OCRX_free_dib(dib);
OCRX_get_descendant_result(documentResult, OCRX_ResultType_Page, 0, & pageResult);
OCRX_get_orientation(pageResult, &orientation);
OCRX_free_document_result(&documentResult);

 Remarks:

The orientation value for a document result is 0.

The orientation for a given result is its absolute orientation on the image and not relative to any of its parents result's orientation.

 

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback