Skip to content

text_createERFilterNM1

textfunctionOpenCV 5.0.0
import { text_createERFilterNM1 } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

Create an Extremal Region Filter for the 1st stage classifier of N&M algorithm [Neumann12].

text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number, maxArea: number, minProbability: number, nonMaxSuppression: boolean, minProbabilityDiff: number): text_ERFilter | null;
7 available overloads
text_createERFilterNM1(cb: text_ERFilter_Callback | null): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number, maxArea: number): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number, maxArea: number, minProbability: number): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number, maxArea: number, minProbability: number, nonMaxSuppression: boolean): text_ERFilter | null;
text_createERFilterNM1(cb: text_ERFilter_Callback | null, thresholdDelta: number, minArea: number, maxArea: number, minProbability: number, nonMaxSuppression: boolean, minProbabilityDiff: number): text_ERFilter | null;
cb

: Callback with the classifier. Default classifier can be implicitly load with function loadClassifierNM1, e.g. from file in samples/cpp/trained_classifierNM1.xml

thresholdDelta

: Threshold step in subsequent thresholds when extracting the component tree

minArea

: The minimum area (% of image size) allowed for retreived ER's

maxArea

: The maximum area (% of image size) allowed for retreived ER's

minProbability

: The minimum probability P(er|character) allowed for retreived ER's

nonMaxSuppression

: Whenever non-maximum suppression is done over the branch probabilities

minProbabilityDiff

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

The component tree of the image is extracted by a threshold increased step by step from 0 to 255, incrementally computable descriptors (aspect_ratio, compactness, number of holes, and number of horizontal crossings) are computed for each ER and used as features for a classifier which estimates the class-conditional probability P(er|character). The value of P(er|character) is tracked using the inclusion relation of ER across all thresholds and only the ERs which correspond to local maximum of the probability P(er|character) are selected (if the local maximum of the probability is above a global limit pmin and the difference between local maximum and local minimum is greater than minProbabilityDiff).

Returns

The text_ERFilter | null result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.