Table of Contents

Method Run

Namespace
OpenCvSharp.Text
Assembly
OpenCvSharp.dll

Run(Mat, out string, out Rect[], out string?[], out float[], 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.

public override void Run(Mat image, out string outputText, out Rect[] componentRects, out string?[] componentTexts, out float[] componentConfidences, ComponentLevels componentLevel = ComponentLevels.Word)

Parameters

image Mat

Input image CV_8UC1 or CV_8UC3

outputText string

Output text of the tesseract-ocr.

componentRects Rect[]

If provided the method will output a list of Rects for the individual text elements found(e.g.words or text lines).

componentTexts string[]

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 float[]

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 ComponentLevels

OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXT_LINE.

Run(Mat, Mat, out string, out Rect[], out string?[], out float[], 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.

public override void Run(Mat image, Mat mask, out string outputText, out Rect[] componentRects, out string?[] componentTexts, out float[] componentConfidences, ComponentLevels componentLevel = ComponentLevels.Word)

Parameters

image Mat

Input image CV_8UC1 or CV_8UC3

mask Mat
outputText string

Output text of the tesseract-ocr.

componentRects Rect[]

If provided the method will output a list of Rects for the individual text elements found(e.g.words or text lines).

componentTexts string[]

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 float[]

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 ComponentLevels

OCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXT_LINE.