opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

MSER Class Reference

Maximally stable extremal region extractor. More...

#include <features2d.hpp>

Inherits cv::Feature2D.

Public Member Functions

virtual CV_WRAP void detectRegions (InputArray image, CV_OUT std::vector< std::vector< Point > > &msers, std::vector< Rect > &bboxes)=0
 Detect MSER regions.
virtual CV_WRAP void detect (InputArray image, CV_OUT std::vector< KeyPoint > &keypoints, InputArray mask=noArray())
 Detects keypoints in an image (first variant) or image set (second variant).
virtual void detect (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, InputArrayOfArrays masks=noArray())
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual CV_WRAP void compute (InputArray image, CV_OUT CV_IN_OUT std::vector< KeyPoint > &keypoints, OutputArray descriptors)
 Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
virtual void compute (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, OutputArrayOfArrays descriptors)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual CV_WRAP void detectAndCompute (InputArray image, InputArray mask, CV_OUT std::vector< KeyPoint > &keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
 Detects keypoints and computes the descriptors.
virtual CV_WRAP bool empty () const
 Return true if detector object is empty.
virtual CV_WRAP void clear ()
 Clears the algorithm state.
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
virtual void read (const FileNode &fn)
 Reads algorithm parameters from a file storage.
virtual CV_WRAP void save (const String &filename) const
 Saves the algorithm to a file.
virtual CV_WRAP String getDefaultName () const
 Returns the algorithm string identifier.

Static Public Member Functions

static CV_WRAP Ptr< MSERcreate (int _delta=5, int _min_area=60, int _max_area=14400, double _max_variation=0.25, double _min_diversity=.2, int _max_evolution=200, double _area_threshold=1.01, double _min_margin=0.003, int _edge_blur_size=5)
 Full consturctor for MSER detector.
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node.
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file.
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String.

Detailed Description

Maximally stable extremal region extractor.

The class encapsulates all the parameters of the MSER extraction algorithm (see [wiki article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)).

  • 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 ); 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

Definition at line 336 of file features2d.hpp.


Member Function Documentation

virtual CV_WRAP void clear (  ) [virtual, inherited]

Clears the algorithm state.

Reimplemented in DescriptorMatcher, and FlannBasedMatcher.

Definition at line 2984 of file core.hpp.

virtual CV_WRAP void compute ( InputArray  image,
CV_OUT CV_IN_OUT std::vector< KeyPoint > &  keypoints,
OutputArray  descriptors 
) [virtual, inherited]

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

Parameters:
imageImage.
keypointsInput 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).
descriptorsComputed 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.
virtual void compute ( InputArrayOfArrays  images,
std::vector< std::vector< KeyPoint > > &  keypoints,
OutputArrayOfArrays  descriptors 
) [virtual, inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
imagesImage set.
keypointsInput 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).
descriptorsComputed 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.
static CV_WRAP Ptr<MSER> create ( int  _delta = 5,
int  _min_area = 60,
int  _max_area = 14400,
double  _max_variation = 0.25,
double  _min_diversity = .2,
int  _max_evolution = 200,
double  _area_threshold = 1.01,
double  _min_margin = 0.003,
int  _edge_blur_size = 5 
) [static]

Full consturctor for MSER detector.

Parameters:
_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 simliar 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
virtual CV_WRAP void detect ( InputArray  image,
CV_OUT std::vector< KeyPoint > &  keypoints,
InputArray  mask = noArray() 
) [virtual, inherited]

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

Parameters:
imageImage.
keypointsThe detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .
maskMask specifying where to look for keypoints (optional). It must be a 8-bit integer matrix with non-zero values in the region of interest.
virtual void detect ( InputArrayOfArrays  images,
std::vector< std::vector< KeyPoint > > &  keypoints,
InputArrayOfArrays  masks = noArray() 
) [virtual, inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
imagesImage set.
keypointsThe detected keypoints. In the second variant of the method keypoints[i] is a set of keypoints detected in images[i] .
masksMasks for each input image specifying where to look for keypoints (optional). masks[i] is a mask for images[i].
virtual CV_WRAP void detectAndCompute ( InputArray  image,
InputArray  mask,
CV_OUT std::vector< KeyPoint > &  keypoints,
OutputArray  descriptors,
bool  useProvidedKeypoints = false 
) [virtual, inherited]

Detects keypoints and computes the descriptors.

virtual CV_WRAP void detectRegions ( InputArray  image,
CV_OUT std::vector< std::vector< Point > > &  msers,
std::vector< Rect > &  bboxes 
) [pure virtual]

Detect MSER regions.

Parameters:
imageinput image (8UC1, 8UC3 or 8UC4)
msersresulting list of point sets
bboxesresulting bounding boxes
virtual CV_WRAP bool empty (  ) const [virtual, inherited]

Return true if detector object is empty.

Reimplemented from Algorithm.

virtual CV_WRAP String getDefaultName (  ) const [virtual, inherited]

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.

static Ptr<_Tp> load ( const String &  filename,
const String &  objname = String() 
) [static, inherited]

Loads algorithm from the file.

Parameters:
filenameName of the file to read.
objnameThe optional name of the node to read (if empty, the first top-level node will be used)

This is static template method of Algorithm. It's usage is following (in the case of SVM):

     Ptr<SVM> svm = Algorithm::load<SVM>("my_svm_model.xml");

In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn).

Definition at line 3027 of file core.hpp.

static Ptr<_Tp> loadFromString ( const String &  strModel,
const String &  objname = String() 
) [static, inherited]

Loads algorithm from a String.

Parameters:
strModelThe string variable containing the model you want to load.
objnameThe optional name of the node to read (if empty, the first top-level node will be used)

This is static template method of Algorithm. It's usage is following (in the case of SVM):

     Ptr<SVM> svm = Algorithm::loadFromString<SVM>(myStringModel);

Definition at line 3046 of file core.hpp.

static Ptr<_Tp> read ( const FileNode fn ) [static, inherited]

Reads algorithm from the file node.

This is static template method of Algorithm. It's usage is following (in the case of SVM):

     Ptr<SVM> svm = Algorithm::read<SVM>(fn);

In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn) and also have static create() method without parameters (or with all the optional parameters)

Reimplemented in DescriptorMatcher, and FlannBasedMatcher.

Definition at line 3008 of file core.hpp.

virtual void read ( const FileNode fn ) [virtual, inherited]

Reads algorithm parameters from a file storage.

Reimplemented in DescriptorMatcher, and FlannBasedMatcher.

Definition at line 2992 of file core.hpp.

virtual CV_WRAP void save ( const String &  filename ) const [virtual, inherited]

Saves the algorithm to a file.

In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).

virtual void write ( FileStorage fs ) const [virtual, inherited]

Stores algorithm parameters in a file storage.

Reimplemented in DescriptorMatcher, and FlannBasedMatcher.

Definition at line 2988 of file core.hpp.