Click or drag to resize

OCRTesseractRun Method (Mat, String, Rect, String, Single, ComponentLevels)

Recognize text using the tesseract-ocr API. Takes image on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found(e.g.words), and the list of those text elements with their confidence values.

Namespace:  OpenCvSharp.Text
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public override void Run(
	Mat image,
	out string outputText,
	out Rect[] componentRects,
	out string[] componentTexts,
	out float[] componentConfidences,
	ComponentLevels componentLevel = ComponentLevels.Word
)

Parameters

image
Type: OpenCvSharpMat
Input image CV_8UC1 or CV_8UC3
outputText
Type: SystemString
Output text of the tesseract-ocr.
componentRects
Type: OpenCvSharpRect
If provided the method will output a list of Rects for the individual text elements found(e.g.words or text lines).
componentTexts
Type: SystemString
If provided the method will output a list of text strings for the recognition of individual text elements found(e.g.words or text lines).
componentConfidences
Type: SystemSingle
If provided the method will output a list of confidence values for the recognition of individual text elements found(e.g.words or text lines).
componentLevel (Optional)
Type: OpenCvSharp.TextComponentLevels
OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXT_LINE.
See Also