[][src]Struct opencv::features2d::SimpleBlobDetector

pub struct SimpleBlobDetector { /* fields omitted */ }

Class for extracting blobs from an image. :

The class implements a simple algorithm for extracting blobs from an image:

  1. Convert the source image to binary images by applying thresholding with several thresholds from minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between neighboring thresholds.
  2. Extract connected components from every binary image by findContours and calculate their centers.
  3. Group centers from several binary images by their coordinates. Close centers form one group that corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter.
  4. From the groups, estimate final centers of blobs and their radiuses and return as locations and sizes of keypoints.

This class performs several filtrations of returned blobs. You should set filterBy* to true/false to turn on/off corresponding filtration. Available filtrations:

  • By color. This filter compares the intensity of a binary image at the center of a blob to blobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs and blobColor = 255 to extract light blobs.
  • By area. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive).
  • By circularity. Extracted blobs have circularity (\frac{4*\pi*Area}{perimeter * perimeter}) between minCircularity (inclusive) and maxCircularity (exclusive).
  • By ratio of the minimum inertia to maximum inertia. Extracted blobs have this ratio between minInertiaRatio (inclusive) and maxInertiaRatio (exclusive).
  • By convexity. Extracted blobs have convexity (area / area of blob convex hull) between minConvexity (inclusive) and maxConvexity (exclusive).

Default values of parameters are tuned to extract dark circular blobs.

Methods

impl SimpleBlobDetector[src]

pub fn create(
    parameters: SimpleBlobDetector_Params
) -> Result<PtrOfSimpleBlobDetector>
[src]

C++ default parameters

  • parameters: SimpleBlobDetector::Params()

pub fn get_default_name(&self) -> Result<String>[src]

Trait Implementations

impl Algorithm for SimpleBlobDetector[src]

fn clear(&mut self) -> Result<()>[src]

Clears the algorithm state

fn empty(&self) -> Result<bool>[src]

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

fn save(&self, filename: &str) -> Result<()>[src]

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). Read more

fn get_default_name(&self) -> Result<String>[src]

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. Read more

impl Feature2D for SimpleBlobDetector[src]

fn detect(
    &mut self,
    image: &Mat,
    keypoints: &VectorOfKeyPoint,
    mask: &Mat
) -> Result<()>
[src]

Detects keypoints in an image (first variant) or image set (second variant). Read more

fn detect_n(
    &mut self,
    images: &VectorOfMat,
    keypoints: &VectorOfVectorOfKeyPoint,
    masks: &VectorOfMat
) -> Result<()>
[src]

Parameters * images: Image set. * keypoints: The detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] . * masks: Masks for each input image specifying where to look for keypoints (optional). masks[i] is a mask for images[i]. Read more

fn compute(
    &mut self,
    image: &Mat,
    keypoints: &VectorOfKeyPoint,
    descriptors: &mut Mat
) -> Result<()>
[src]

Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant). Read more

fn compute_multiple(
    &mut self,
    images: &VectorOfMat,
    keypoints: &VectorOfVectorOfKeyPoint,
    descriptors: &mut VectorOfMat
) -> Result<()>
[src]

Parameters * images: Image set. * keypoints: Input collection of keypoints. Keypoints for which a descriptor cannot be computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint with several dominant orientations (for each orientation). * descriptors: Computed descriptors. In the second variant of the method descriptors[i] are descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the descriptor for keypoint j-th keypoint. Read more

fn detect_and_compute(
    &mut self,
    image: &Mat,
    mask: &Mat,
    keypoints: &VectorOfKeyPoint,
    descriptors: &mut Mat,
    use_provided_keypoints: bool
) -> Result<()>
[src]

Detects keypoints and computes the descriptors Read more

fn descriptor_size(&self) -> Result<i32>[src]

fn descriptor_type(&self) -> Result<i32>[src]

fn default_norm(&self) -> Result<i32>[src]

fn write(&self, file_name: &str) -> Result<()>[src]

fn read(&mut self, file_name: &str) -> Result<()>[src]

fn empty(&self) -> Result<bool>[src]

Return true if detector object is empty

fn get_default_name(&self) -> Result<String>[src]

impl Drop for SimpleBlobDetector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]