pub struct MSER { /* private fields */ }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
Implementations§
Source§impl MSER
impl MSER
Sourcepub 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<MSER>>
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<MSER>>
Full constructor for %MSER detector
§Parameters
- delta: it compares
- 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
Sourcepub fn create_def() -> Result<Ptr<MSER>>
pub fn create_def() -> Result<Ptr<MSER>>
Full constructor for %MSER detector
§Parameters
- delta: it compares
- 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
§Note
This alternative version of MSER::create function uses the following default values for its arguments:
- 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
Trait Implementations§
Source§impl AlgorithmTrait for MSER
impl AlgorithmTrait for MSER
Source§impl AlgorithmTraitConst for MSER
impl AlgorithmTraitConst for MSER
fn as_raw_Algorithm(&self) -> *const c_void
Source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
Source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
Source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
Source§fn save(&self, filename: impl AsRef<OsStr>) -> Result<()>
fn save(&self, filename: impl AsRef<OsStr>) -> Result<()>
Source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
Source§impl Boxed for MSER
impl Boxed for MSER
Source§unsafe fn from_raw(ptr: <MSER as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <MSER as OpenCVFromExtern>::ExternReceive) -> Self
Source§fn into_raw(self) -> <MSER as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <MSER as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(&self) -> <MSER as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <MSER as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(&mut self) -> <MSER as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <MSER as OpenCVTypeExternContainer>::ExternSendMut
Source§impl Feature2DTrait for MSER
impl Feature2DTrait for MSER
fn as_raw_mut_Feature2D(&mut self) -> *mut c_void
Source§fn detect(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
mask: &impl ToInputArray,
) -> Result<()>
fn detect( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, mask: &impl ToInputArray, ) -> Result<()>
Source§fn detect_def(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
) -> Result<()>
fn detect_def( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, ) -> Result<()>
Source§fn detect_multiple(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>,
masks: &impl ToInputArray,
) -> Result<()>
fn detect_multiple( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>>, masks: &impl ToInputArray, ) -> Result<()>
Source§fn detect_multiple_def(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>,
) -> Result<()>
fn detect_multiple_def( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>>, ) -> Result<()>
Source§fn compute(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray,
) -> Result<()>
fn compute( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray, ) -> Result<()>
Source§fn compute_multiple(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>,
descriptors: &mut impl ToOutputArray,
) -> Result<()>
fn compute_multiple( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>>, descriptors: &mut impl ToOutputArray, ) -> Result<()>
Source§fn detect_and_compute(
&mut self,
image: &impl ToInputArray,
mask: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray,
use_provided_keypoints: bool,
) -> Result<()>
fn detect_and_compute( &mut self, image: &impl ToInputArray, mask: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray, use_provided_keypoints: bool, ) -> Result<()>
Source§fn detect_and_compute_def(
&mut self,
image: &impl ToInputArray,
mask: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray,
) -> Result<()>
fn detect_and_compute_def( &mut self, image: &impl ToInputArray, mask: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray, ) -> Result<()>
fn read(&mut self, file_name: impl AsRef<OsStr>) -> Result<()>
fn read_from_node(&mut self, unnamed: &impl FileNodeTraitConst) -> Result<()>
Source§impl Feature2DTraitConst for MSER
impl Feature2DTraitConst for MSER
fn as_raw_Feature2D(&self) -> *const c_void
fn descriptor_size(&self) -> Result<i32>
fn descriptor_type(&self) -> Result<i32>
fn default_norm(&self) -> Result<i32>
fn write(&self, file_name: impl AsRef<OsStr>) -> Result<()>
fn write_to_storage(&self, unnamed: &mut impl FileStorageTrait) -> Result<()>
fn get_default_name(&self) -> Result<String>
fn write_to_storage_with_name( &self, fs: &mut impl FileStorageTrait, name: &str, ) -> Result<()>
Source§impl MSERTrait for MSER
impl MSERTrait for MSER
fn as_raw_mut_MSER(&mut self) -> *mut c_void
Source§fn detect_regions(
&mut self,
image: &impl ToInputArray,
msers: &mut Vector<Vector<Point>>,
bboxes: &mut Vector<Rect>,
) -> Result<()>
fn detect_regions( &mut self, image: &impl 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<()>
Source§impl MSERTraitConst for MSER
impl MSERTraitConst for MSER
fn as_raw_MSER(&self) -> *const c_void
fn get_delta(&self) -> Result<i32>
fn get_min_area(&self) -> Result<i32>
fn get_max_area(&self) -> Result<i32>
fn get_max_variation(&self) -> Result<f64>
fn get_min_diversity(&self) -> Result<f64>
fn get_max_evolution(&self) -> Result<i32>
fn get_area_threshold(&self) -> Result<f64>
fn get_min_margin(&self) -> Result<f64>
fn get_edge_blur_size(&self) -> Result<i32>
fn get_pass2_only(&self) -> Result<bool>
fn get_default_name(&self) -> Result<String>
impl Send for MSER
Auto Trait Implementations§
impl !Sync for MSER
impl Freeze for MSER
impl RefUnwindSafe for MSER
impl Unpin for MSER
impl UnsafeUnpin for MSER
impl UnwindSafe for MSER
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat or another similar object. By passing
a mutable reference to the Mat to this function your closure will get called with the read reference and a write references
to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold. Read more