Trait opencv::features2d::MSER

source ·
pub trait MSER: Feature2DTrait + MSERConst {
    // Required method
    fn as_raw_mut_MSER(&mut self) -> *mut c_void;

    // Provided methods
    fn detect_regions(
        &mut self,
        image: &dyn ToInputArray,
        msers: &mut Vector<Vector<Point>>,
        bboxes: &mut Vector<Rect>
    ) -> Result<()> { ... }
    fn set_delta(&mut self, delta: i32) -> Result<()> { ... }
    fn set_min_area(&mut self, min_area: i32) -> Result<()> { ... }
    fn set_max_area(&mut self, max_area: i32) -> Result<()> { ... }
    fn set_max_variation(&mut self, max_variation: f64) -> Result<()> { ... }
    fn set_min_diversity(&mut self, min_diversity: f64) -> Result<()> { ... }
    fn set_max_evolution(&mut self, max_evolution: i32) -> Result<()> { ... }
    fn set_area_threshold(&mut self, area_threshold: f64) -> Result<()> { ... }
    fn set_min_margin(&mut self, min_margin: f64) -> Result<()> { ... }
    fn set_edge_blur_size(&mut self, edge_blur_size: i32) -> Result<()> { ... }
    fn set_pass2_only(&mut self, f: bool) -> Result<()> { ... }
}
Expand description

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

Required Methods§

Provided Methods§

source

fn detect_regions( &mut self, image: &dyn ToInputArray, msers: &mut Vector<Vector<Point>>, bboxes: &mut Vector<Rect> ) -> Result<()>

Detect %MSER regions

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
source

fn set_delta(&mut self, delta: i32) -> Result<()>

source

fn set_min_area(&mut self, min_area: i32) -> Result<()>

source

fn set_max_area(&mut self, max_area: i32) -> Result<()>

source

fn set_max_variation(&mut self, max_variation: f64) -> Result<()>

source

fn set_min_diversity(&mut self, min_diversity: f64) -> Result<()>

source

fn set_max_evolution(&mut self, max_evolution: i32) -> Result<()>

source

fn set_area_threshold(&mut self, area_threshold: f64) -> Result<()>

source

fn set_min_margin(&mut self, min_margin: f64) -> Result<()>

source

fn set_edge_blur_size(&mut self, edge_blur_size: i32) -> Result<()>

source

fn set_pass2_only(&mut self, f: bool) -> Result<()>

Implementations§

source§

impl dyn MSER + '_

source

pub fn create( delta: i32, min_area: i32, max_area: i32, max_variation: f64, min_diversity: f64, max_evolution: i32, area_threshold: f64, min_margin: f64, edge_blur_size: i32 ) -> Result<Ptr<dyn MSER>>

Full constructor for %MSER detector

Parameters
  • delta: it compares inline formula
  • 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
C++ default parameters
  • delta: 5
  • min_area: 60
  • max_area: 14400
  • max_variation: 0.25
  • min_diversity: .2
  • max_evolution: 200
  • area_threshold: 1.01
  • min_margin: 0.003
  • edge_blur_size: 5

Implementors§

source§

impl MSER for Ptr<dyn MSER>