Table of Contents

Method DetectRegions

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

DetectRegions(InputArray, ERFilter, ERFilter)

Extracts text regions from an image, as contours.

public static Point[][] DetectRegions(InputArray image, ERFilter erFilter1, ERFilter erFilter2)

Parameters

image InputArray

Source image where text blocks need to be extracted from. Should be CV_8UC3 (color).

erFilter1 ERFilter

Extremal Region Filter for the 1st stage classifier of the N&M algorithm.

erFilter2 ERFilter

Extremal Region Filter for the 2nd stage classifier of the N&M algorithm.

Returns

Point[][]

The detected text region contours.

DetectRegions(InputArray, ERFilter, ERFilter, ErGroupingModes, string, float)

Extracts text regions from an image, grouped as rectangular text blocks.

public static Rect[] DetectRegions(InputArray image, ERFilter erFilter1, ERFilter erFilter2, ErGroupingModes method = ErGroupingModes.OrientationHoriz, string filename = "", float minProbability = 0.5)

Parameters

image InputArray

Source image where text blocks need to be extracted from. Should be CV_8UC3 (color).

erFilter1 ERFilter

Extremal Region Filter for the 1st stage classifier of the N&M algorithm.

erFilter2 ERFilter

Extremal Region Filter for the 2nd stage classifier of the N&M algorithm.

method ErGroupingModes

Grouping method.

filename string

The XML or YAML file with the classifier model (e.g. trained_classifier_erGrouping.xml). Only used when the grouping method is ErGroupingModes.OrientationAny.

minProbability float

The minimum probability for accepting a group. Only used when the grouping method is ErGroupingModes.OrientationAny.

Returns

Rect[]

Output list of rectangle blocks with text.