MSER

Objective-C

@interface MSER : Feature2D

Swift

class MSER : Feature2D

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: CITE: 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: CITE: forssen2007maximally ; it should be much slower than grey image method ( 3~4 times ); the chi_table.h file is taken directly from paper’s source code which is distributed under GPL.

  • (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py

Member of Features2d

Methods

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation
              _min_diversity:(double)_min_diversity
              _max_evolution:(int)_max_evolution
             _area_threshold:(double)_area_threshold
                 _min_margin:(double)_min_margin
             _edge_blur_size:(int)_edge_blur_size;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double, _min_diversity: Double, _max_evolution: Int32, _area_threshold: Double, _min_margin: Double, _edge_blur_size: Int32) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

    _min_diversity

    for color image, trace back to cut off mser with diversity less than min_diversity

    _max_evolution

    for color image, the evolution steps

    _area_threshold

    for color image, the area threshold to cause re-initialize

    _min_margin

    for color image, ignore too small margin

    _edge_blur_size

    for color image, the aperture size for edge blur

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation
              _min_diversity:(double)_min_diversity
              _max_evolution:(int)_max_evolution
             _area_threshold:(double)_area_threshold
                 _min_margin:(double)_min_margin;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double, _min_diversity: Double, _max_evolution: Int32, _area_threshold: Double, _min_margin: Double) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

    _min_diversity

    for color image, trace back to cut off mser with diversity less than min_diversity

    _max_evolution

    for color image, the evolution steps

    _area_threshold

    for color image, the area threshold to cause re-initialize

    _min_margin

    for color image, ignore too small margin

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation
              _min_diversity:(double)_min_diversity
              _max_evolution:(int)_max_evolution
             _area_threshold:(double)_area_threshold;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double, _min_diversity: Double, _max_evolution: Int32, _area_threshold: Double) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

    _min_diversity

    for color image, trace back to cut off mser with diversity less than min_diversity

    _max_evolution

    for color image, the evolution steps

    _area_threshold

    for color image, the area threshold to cause re-initialize

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation
              _min_diversity:(double)_min_diversity
              _max_evolution:(int)_max_evolution;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double, _min_diversity: Double, _max_evolution: Int32) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

    _min_diversity

    for color image, trace back to cut off mser with diversity less than min_diversity

    _max_evolution

    for color image, the evolution steps

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation
              _min_diversity:(double)_min_diversity;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double, _min_diversity: Double) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

    _min_diversity

    for color image, trace back to cut off mser with diversity less than min_diversity

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area
              _max_variation:(double)_max_variation;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32, _max_variation: Double) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

    _max_variation

    prune the area have similar size to its children

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta
                   _min_area:(int)_min_area
                   _max_area:(int)_max_area;

    Swift

    class func create(_delta: Int32, _min_area: Int32, _max_area: Int32) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

    _max_area

    prune the area which bigger than maxArea

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta _min_area:(int)_min_area;

    Swift

    class func create(_delta: Int32, _min_area: Int32) -> MSER

    Parameters

    _min_area

    prune the area which smaller than minArea

  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create:(int)_delta;

    Swift

    class func create(_delta: Int32) -> MSER
  • Full constructor for %MSER detector

    Declaration

    Objective-C

    + (nonnull MSER *)create;

    Swift

    class func create() -> MSER
  • Declaration

    Objective-C

    - (nonnull NSString *)getDefaultName;

    Swift

    func getDefaultName() -> String
  • Declaration

    Objective-C

    - (BOOL)getPass2Only NS_SWIFT_NAME(getPass2Only());

    Swift

    func getPass2Only() -> Bool
  • Declaration

    Objective-C

    - (int)getDelta NS_SWIFT_NAME(getDelta());

    Swift

    func getDelta() -> Int32
  • Declaration

    Objective-C

    - (int)getMaxArea NS_SWIFT_NAME(getMaxArea());

    Swift

    func getMaxArea() -> Int32
  • Declaration

    Objective-C

    - (int)getMinArea NS_SWIFT_NAME(getMinArea());

    Swift

    func getMinArea() -> Int32
  • Detect %MSER regions

    Declaration

    Objective-C

    - (void)detectRegions:(nonnull Mat *)image
                    msers:
                        (nonnull NSMutableArray<NSMutableArray<Point2i *> *> *)msers
                   bboxes:(nonnull NSMutableArray<Rect2i *> *)bboxes;

    Swift

    func detectRegions(image: Mat, msers: NSMutableArray, bboxes: NSMutableArray)

    Parameters

    image

    input image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3)

    msers

    resulting list of point sets

    bboxes

    resulting bounding boxes

  • Declaration

    Objective-C

    - (void)setDelta:(int)delta NS_SWIFT_NAME(setDelta(delta:));

    Swift

    func setDelta(delta: Int32)
  • Declaration

    Objective-C

    - (void)setMaxArea:(int)maxArea NS_SWIFT_NAME(setMaxArea(maxArea:));

    Swift

    func setMaxArea(maxArea: Int32)
  • Declaration

    Objective-C

    - (void)setMinArea:(int)minArea NS_SWIFT_NAME(setMinArea(minArea:));

    Swift

    func setMinArea(minArea: Int32)
  • Declaration

    Objective-C

    - (void)setPass2Only:(BOOL)f NS_SWIFT_NAME(setPass2Only(f:));

    Swift

    func setPass2Only(f: Bool)