Table of Contents

Class ERFilter

Namespace
OpenCvSharp.Text
Assembly
OpenCvSharp.dll

Base class for the 1st and 2nd stages of the Neumann and Matas scene text detection algorithm. Extracts the component tree (if needed) and filters the extremal regions (ER's) using a given classifier.

public sealed class ERFilter : Algorithm, IDisposable
Inheritance
ERFilter
Implements
Inherited Members

Methods

CreateNM1(ERFilterCallback, int, float, float, float, bool, float)

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

public static ERFilter CreateNM1(ERFilterCallback cb, int thresholdDelta = 1, float minArea = 0.00025, float maxArea = 0.13, float minProbability = 0.4, bool nonMaxSuppression = true, float minProbabilityDiff = 0.1)

Parameters

cb ERFilterCallback

Callback with the classifier.

thresholdDelta int

Threshold step in subsequent thresholds when extracting the component tree.

minArea float

The minimum area (% of image size) allowed for retrieved ER's.

maxArea float

The maximum area (% of image size) allowed for retrieved ER's.

minProbability float

The minimum probability P(er|character) allowed for retrieved ER's.

nonMaxSuppression bool

Whether non-maximum suppression is done over the branch probabilities.

minProbabilityDiff float

The minimum probability difference between local maxima and local minima ERs.

Returns

ERFilter

CreateNM1(string, int, float, float, float, bool, float)

Creates an Extremal Region Filter for the 1st stage classifier of the N&M algorithm, reading the classifier from the given file (e.g. trained_classifierNM1.xml).

public static ERFilter CreateNM1(string filename, int thresholdDelta = 1, float minArea = 0.00025, float maxArea = 0.13, float minProbability = 0.4, bool nonMaxSuppression = true, float minProbabilityDiff = 0.1)

Parameters

filename string

The XML or YAML file with the classifier model.

thresholdDelta int

Threshold step in subsequent thresholds when extracting the component tree.

minArea float

The minimum area (% of image size) allowed for retrieved ER's.

maxArea float

The maximum area (% of image size) allowed for retrieved ER's.

minProbability float

The minimum probability P(er|character) allowed for retrieved ER's.

nonMaxSuppression bool

Whether non-maximum suppression is done over the branch probabilities.

minProbabilityDiff float

The minimum probability difference between local maxima and local minima ERs.

Returns

ERFilter

CreateNM2(ERFilterCallback, float)

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

public static ERFilter CreateNM2(ERFilterCallback cb, float minProbability = 0.3)

Parameters

cb ERFilterCallback

Callback with the classifier.

minProbability float

The minimum probability P(er|character) allowed for retrieved ER's.

Returns

ERFilter

CreateNM2(string, float)

Creates an Extremal Region Filter for the 2nd stage classifier of the N&M algorithm, reading the classifier from the given file (e.g. trained_classifierNM2.xml).

public static ERFilter CreateNM2(string filename, float minProbability = 0.3)

Parameters

filename string

The XML or YAML file with the classifier model.

minProbability float

The minimum probability P(er|character) allowed for retrieved ER's.

Returns

ERFilter

GetNumRejected()

Gets the number of rejected extremal regions.

public int GetNumRejected()

Returns

int

SetCallback(ERFilterCallback)

Sets the classifier callback used by this filter.

public void SetCallback(ERFilterCallback cb)

Parameters

cb ERFilterCallback

SetMaxArea(float)

Sets the maximum area (% of image size) allowed for retrieved ER's.

public void SetMaxArea(float maxArea)

Parameters

maxArea float

SetMinArea(float)

Sets the minimum area (% of image size) allowed for retrieved ER's.

public void SetMinArea(float minArea)

Parameters

minArea float

SetMinProbability(float)

Sets the minimum probability P(er|character) allowed for retrieved ER's.

public void SetMinProbability(float minProbability)

Parameters

minProbability float

SetMinProbabilityDiff(float)

Sets the minimum probability difference between local maxima and local minima ERs.

public void SetMinProbabilityDiff(float minProbabilityDiff)

Parameters

minProbabilityDiff float

SetNonMaxSuppression(bool)

Sets whether non-maximum suppression is done over the branch probabilities.

public void SetNonMaxSuppression(bool nonMaxSuppression)

Parameters

nonMaxSuppression bool

SetThresholdDelta(int)

Sets the threshold step in subsequent thresholds when extracting the component tree.

public void SetThresholdDelta(int thresholdDelta)

Parameters

thresholdDelta int