Click or drag to resize
TesseractOcrEngineDetectOrientationAndScript Method (Int32, Int32, Int32)
Detects the orientation and script of a document image.

Namespace: DevScope.Ocr.Tesseract.WindowsPhone
Assembly: DevScope.Ocr.Tesseract.WindowsPhone (in DevScope.Ocr.Tesseract.WindowsPhone.dll) Version: 255.255.255.255
Syntax
public IAsyncOperation<TesseractOcrPageOrientationScriptInfo> DetectOrientationAndScript(
	int pixelWidth,
	int pixelHeight,
	int[] pixels
)

Parameters

pixelWidth
Type: SystemInt32
Width of image in pixels.
pixelHeight
Type: SystemInt32
Height of the image in pixels.
pixels
Type: SystemInt32
Array of image pixels in BGRA format.

Return Value

Type: IAsyncOperationTesseractOcrPageOrientationScriptInfo
The results of the detection
Remarks
To see a paper explaining the process check here : http://research.google.com/pubs/pub35506.html
Examples
This sample shows how to call the DetectOrientationAndScript method.
void RunOrientationAndScriptDetection()  
{ 
   ...
   // Init the OCR engine
   var ocrEngine = new TesseractOcrEngine(tessdataRootFolder.Path, languageCode);
   ...

   // Create the async operation 
   var imgBitmapToOcr = await ImageUtils.LoadImageFromIsolatedStorageAsync(CommonSettings.FileNameFullResImageSentToOcr);
   WriteableBitmap wb = new WriteableBitmap(imgBitmapToOcr);
   var osiOperation = ocrEngine.DetectOrientationAndScript(wb.PixelWidth, wb.PixelHeight, wb.Pixels);

   // now, run the Orientation and Script detection
   var osiResponse = await osiOperation;

   ........
}
See Also