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
cbERFilterCallbackCallback with the classifier.
thresholdDeltaintThreshold step in subsequent thresholds when extracting the component tree.
minAreafloatThe minimum area (% of image size) allowed for retrieved ER's.
maxAreafloatThe maximum area (% of image size) allowed for retrieved ER's.
minProbabilityfloatThe minimum probability P(er|character) allowed for retrieved ER's.
nonMaxSuppressionboolWhether non-maximum suppression is done over the branch probabilities.
minProbabilityDifffloatThe minimum probability difference between local maxima and local minima ERs.
Returns
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
filenamestringThe XML or YAML file with the classifier model.
thresholdDeltaintThreshold step in subsequent thresholds when extracting the component tree.
minAreafloatThe minimum area (% of image size) allowed for retrieved ER's.
maxAreafloatThe maximum area (% of image size) allowed for retrieved ER's.
minProbabilityfloatThe minimum probability P(er|character) allowed for retrieved ER's.
nonMaxSuppressionboolWhether non-maximum suppression is done over the branch probabilities.
minProbabilityDifffloatThe minimum probability difference between local maxima and local minima ERs.
Returns
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
cbERFilterCallbackCallback with the classifier.
minProbabilityfloatThe minimum probability P(er|character) allowed for retrieved ER's.
Returns
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
filenamestringThe XML or YAML file with the classifier model.
minProbabilityfloatThe minimum probability P(er|character) allowed for retrieved ER's.
Returns
GetNumRejected()
Gets the number of rejected extremal regions.
public int GetNumRejected()
Returns
SetCallback(ERFilterCallback)
Sets the classifier callback used by this filter.
public void SetCallback(ERFilterCallback cb)
Parameters
SetMaxArea(float)
Sets the maximum area (% of image size) allowed for retrieved ER's.
public void SetMaxArea(float maxArea)
Parameters
maxAreafloat
SetMinArea(float)
Sets the minimum area (% of image size) allowed for retrieved ER's.
public void SetMinArea(float minArea)
Parameters
minAreafloat
SetMinProbability(float)
Sets the minimum probability P(er|character) allowed for retrieved ER's.
public void SetMinProbability(float minProbability)
Parameters
minProbabilityfloat
SetMinProbabilityDiff(float)
Sets the minimum probability difference between local maxima and local minima ERs.
public void SetMinProbabilityDiff(float minProbabilityDiff)
Parameters
minProbabilityDifffloat
SetNonMaxSuppression(bool)
Sets whether non-maximum suppression is done over the branch probabilities.
public void SetNonMaxSuppression(bool nonMaxSuppression)
Parameters
nonMaxSuppressionbool
SetThresholdDelta(int)
Sets the threshold step in subsequent thresholds when extracting the component tree.
public void SetThresholdDelta(int thresholdDelta)
Parameters
thresholdDeltaint