MSER
import { MSER } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Feature2D.
example: samples/python/snippets/mser.py An example using Maximally stable extremal region(MSER) extractor in python Maximally stable extremal region extractor
The class encapsulates all the parameters of the %MSER extraction algorithm (see wiki article).
there are two different implementation of %MSER: one for grey image, one for color image
the grey image algorithm is taken from: [nister2008linear] ; the paper claims to be faster than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop.
the color image algorithm is taken from: [forssen2007maximally] ; it should be much slower than grey image method ( 3~4 times )
(Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py
Constructors and members
static create
Full constructor for %MSER detector
create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number, max_evolution: number, area_threshold: number, min_margin: number, edge_blur_size: number): MSER | null;10 available overloads
create(): MSER | null;create(delta: number): MSER | null;create(delta: number, min_area: number): MSER | null;create(delta: number, min_area: number, max_area: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number, max_evolution: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number, max_evolution: number, area_threshold: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number, max_evolution: number, area_threshold: number, min_margin: number): MSER | null;create(delta: number, min_area: number, max_area: number, max_variation: number, min_diversity: number, max_evolution: number, area_threshold: number, min_margin: number, edge_blur_size: number): MSER | null;deltait compares
(size_{i}-size_{i-delta})/size_{i-delta}min_areaprune the area which smaller than minArea
max_areaprune the area which bigger than maxArea
max_variationprune the area have similar size to its children
min_diversityfor color image, trace back to cut off mser with diversity less than min_diversity
max_evolutionfor color image, the evolution steps
area_thresholdfor color image, the area threshold to cause re-initialize
min_marginfor color image, ignore too small margin
edge_blur_sizefor color image, the aperture size for edge blur
The MSER | null result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
detectRegions
Detect %MSER regions
detectRegions(image: Mat, msers: PointVectorVector, bboxes: RectVector): void;imageinput image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3)
msersOutput destination, filled by the native operation. resulting list of point sets
bboxesOutput destination, filled by the native operation. resulting bounding boxes
setDelta
Set the delta used by this MSER object.
setDelta(delta: number): void;deltadelta argument (number).
getDelta
Return the delta configured on this MSER object.
getDelta(): number;The number result.
setMinArea
Set the min area used by this MSER object.
setMinArea(minArea: number): void;minAreamin area argument (number).
getMinArea
Return the min area configured on this MSER object.
getMinArea(): number;The number result.
setMaxArea
Set the max area used by this MSER object.
setMaxArea(maxArea: number): void;maxAreamax area argument (number).
getMaxArea
Return the max area configured on this MSER object.
getMaxArea(): number;The number result.
setMaxVariation
Set the max variation used by this MSER object.
setMaxVariation(maxVariation: number): void;maxVariationmax variation argument (number).
getMaxVariation
Return the max variation configured on this MSER object.
getMaxVariation(): number;The number result.
setMinDiversity
Set the min diversity used by this MSER object.
setMinDiversity(minDiversity: number): void;minDiversitymin diversity argument (number).
getMinDiversity
Return the min diversity configured on this MSER object.
getMinDiversity(): number;The number result.
setMaxEvolution
Set the max evolution used by this MSER object.
setMaxEvolution(maxEvolution: number): void;maxEvolutionmax evolution argument (number).
getMaxEvolution
Return the max evolution configured on this MSER object.
getMaxEvolution(): number;The number result.
setAreaThreshold
Set the area threshold used by this MSER object.
setAreaThreshold(areaThreshold: number): void;areaThresholdarea threshold argument (number).
getAreaThreshold
Return the area threshold configured on this MSER object.
getAreaThreshold(): number;The number result.
setMinMargin
Set the min margin used by this MSER object.
setMinMargin(min_margin: number): void;min_marginmin margin argument (number).
getMinMargin
Return the min margin configured on this MSER object.
getMinMargin(): number;The number result.
setEdgeBlurSize
Set the edge blur size used by this MSER object.
setEdgeBlurSize(edge_blur_size: number): void;edge_blur_sizeedge blur size argument (number).
getEdgeBlurSize
Return the edge blur size configured on this MSER object.
getEdgeBlurSize(): number;The number result.
setPass2Only
Set the pass2 only used by this MSER object.
setPass2Only(f: boolean): void;ff argument (boolean).
getPass2Only
Return the pass2 only configured on this MSER object.
getPass2Only(): boolean;The boolean result.
getDefaultName
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
getDefaultName(): string;The string 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.