Click or drag to resize

OcrApiGetTextFromImage(OcrPix, Int32, Int32, Int32, Int32) Method

Recognize a rectangle from an image and return the result as a string.

Namespace: Patagames.Ocr
Assembly: Patagames.Ocr (in Patagames.Ocr.dll) Version: 4.6.411
Syntax
public string GetTextFromImage(
	OcrPix pix,
	int left,
	int top,
	int width,
	int height
)

Parameters

pix  OcrPix
The leptonica image
left  Int32
Left point of the rectangle.
top  Int32
Top point of the rectangle.
width  Int32
Width of the rectangle.
height  Int32
Height of the rectangle.

Return Value

String
The recognized text which is coded as UTF8.
Remarks
May be called many times for a single Init. Currently has no error checking. Greyscale of 8 and color of 24 or 32 bits per pixel may be given. Palette color images will not work properly and must be converted to 24 bit. Binary images of 1 bit per pixel may also be given but they must be byte packed with the MSB of the first byte being the first pixel, and a 1 represents WHITE. For binary images set bytes_per_pixel= 0.
Note  Note
Note that TesseractRect is the simplified convenience interface. For advanced uses, use SetImage, (optionally)Rectangle, Recognize, and one or more of the Get*Text functions.
See Also