@ -1063,6 +1063,124 @@ public:
The class encapsulates all the parameters of MSER (see \url { http://en.wikipedia.org/wiki/Maximally_ stable_ extremal_ regions} ) extraction algorithm.
\cvclass { StarDetector}
Implements Star keypoint detector
\begin { lstlisting}
class StarDetector : CvStarDetectorParams
{
public:
// default constructor
StarDetector();
// the full constructor initialized all the algorithm parameters:
// maxSize - maximum size of the features. The following
// values of the parameter are supported:
// 4, 6, 8, 11, 12, 16, 22, 23, 32, 45, 46, 64, 90, 128
// responseThreshold - threshold for the approximated laplacian,
// used to eliminate weak features. The larger it is,
// the less features will be retrieved
// lineThresholdProjected - another threshold for the laplacian to
// eliminate edges
// lineThresholdBinarized - another threshold for the feature
// size to eliminate edges.
// The larger the 2 threshold, the more points you get.
StarDetector(int maxSize, int responseThreshold,
int lineThresholdProjected,
int lineThresholdBinarized,
int suppressNonmaxSize);
// finds keypoints in an image
void operator()(const Mat& image, vector<KeyPoint>& keypoints) const;
} ;
\end { lstlisting}
The class implements a modified version of CenSurE keypoint detector described in
\cite { Agrawal08}
\cvclass { SIFT}
Class for extracting keypoints and computing descriptors using approach named Scale Invariant Feature Transform (SIFT).
\begin { lstlisting}
class CV_ EXPORTS SIFT
{
public:
struct CommonParams
{
static const int DEFAULT_ NOCTAVES = 4;
static const int DEFAULT_ NOCTAVE_ LAYERS = 3;
static const int DEFAULT_ FIRST_ OCTAVE = -1;
enum{ FIRST_ ANGLE = 0, AVERAGE_ ANGLE = 1 } ;
CommonParams();
CommonParams( int _ nOctaves, int _ nOctaveLayers, int _ firstOctave,
int _ angleMode );
int nOctaves, nOctaveLayers, firstOctave;
int angleMode;
} ;
struct DetectorParams
{
static double GET_ DEFAULT_ THRESHOLD()
{ return 0.04 / SIFT::CommonParams::DEFAULT_ NOCTAVE_ LAYERS / 2.0; }
static double GET_ DEFAULT_ EDGE_ THRESHOLD() { return 10.0; }
DetectorParams();
DetectorParams( double _ threshold, double _ edgeThreshold );
double threshold, edgeThreshold;
} ;
struct DescriptorParams
{
static double GET_ DEFAULT_ MAGNIFICATION() { return 3.0; }
static const bool DEFAULT_ IS_ NORMALIZE = true;
static const int DESCRIPTOR_ SIZE = 128;
DescriptorParams();
DescriptorParams( double _ magnification, bool _ isNormalize,
bool _ recalculateAngles );
double magnification;
bool isNormalize;
bool recalculateAngles;
} ;
SIFT();
//! sift-detector constructor
SIFT( double _ threshold, double _ edgeThreshold,
int _ nOctaves=CommonParams::DEFAULT_ NOCTAVES,
int _ nOctaveLayers=CommonParams::DEFAULT_ NOCTAVE_ LAYERS,
int _ firstOctave=CommonParams::DEFAULT_ FIRST_ OCTAVE,
int _ angleMode=CommonParams::FIRST_ ANGLE );
//! sift-descriptor constructor
SIFT( double _ magnification, bool _ isNormalize=true,
bool _ recalculateAngles = true,
int _ nOctaves=CommonParams::DEFAULT_ NOCTAVES,
int _ nOctaveLayers=CommonParams::DEFAULT_ NOCTAVE_ LAYERS,
int _ firstOctave=CommonParams::DEFAULT_ FIRST_ OCTAVE,
int _ angleMode=CommonParams::FIRST_ ANGLE );
SIFT( const CommonParams& _ commParams,
const DetectorParams& _ detectorParams = DetectorParams(),
const DescriptorParams& _ descriptorParams = DescriptorParams() );
//! returns the descriptor size in floats (128)
int descriptorSize() const { return DescriptorParams::DESCRIPTOR_ SIZE; }
//! finds the keypoints using SIFT algorithm
void operator()(const Mat& img, const Mat& mask,
vector<KeyPoint>& keypoints) const;
//! finds the keypoints and computes descriptors for them using SIFT algorithm.
//! Optionally it can compute descriptors for the user-provided keypoints
void operator()(const Mat& img, const Mat& mask,
vector<KeyPoint>& keypoints,
Mat& descriptors,
bool useProvidedKeypoints=false) const;
CommonParams getCommonParams () const { return commParams; }
DetectorParams getDetectorParams () const { return detectorParams; }
DescriptorParams getDescriptorParams () const { return descriptorParams; }
protected:
...
} ;
\end { lstlisting}
\cvclass { SURF}
Class for extracting Speeded Up Robust Features from an image.
@ -1094,39 +1212,736 @@ There is fast multi-scale Hessian keypoint detector that can be used to find the
The function can be used for object tracking and localization, image stitching etc. See the
\texttt { find\_ obj.cpp} demo in OpenCV samples directory.
\subsection { Common Interfaces for Feature Detection and Descriptor Extraction}
\cvclass { Star Detector}
Implements Star keypoint detector
\cvclass { Feature Detector}
Abstract base class for 2D image feature detectors.
\begin { lstlisting}
class StarDetector : CvStarDetectorParams
class FeatureDetector
{
public:
// default constructor
StarDetector();
// the full constructor initialized all the algorithm parameters:
// maxSize - maximum size of the features. The following
// values of the parameter are supported:
// 4, 6, 8, 11, 12, 16, 22, 23, 32, 45, 46, 64, 90, 128
// responseThreshold - threshold for the approximated laplacian,
// used to eliminate weak features. The larger it is,
// the less features will be retrieved
// lineThresholdProjected - another threshold for the laplacian to
// eliminate edges
// lineThresholdBinarized - another threshold for the feature
// size to eliminate edges.
// The larger the 2 threshold, the more points you get.
StarDetector(int maxSize, int responseThreshold,
int lineThresholdProjected,
int lineThresholdBinarized,
int suppressNonmaxSize);
void detect( const Mat& image, vector<KeyPoint>& keypoints,
const Mat& mask=Mat() ) const;
virtual void read( const FileNode& fn ) { } ;
virtual void write( FileStorage& fs ) const { } ;
protected:
...
} ;
\end { lstlisting}
// finds keypoints in an image
void operator()(const Mat& image, vector<KeyPoint>& keypoints) const;
\cvCppFunc { FeatureDetector::detect}
Detect keypoints in an image.
\cvdefCpp {
void detect( const Mat\& image, vector<KeyPoint>\& keypoints, const Mat\& mask=Mat() ) const;
}
\begin { description}
\cvarg { image} { The image.}
\cvarg { keypoints} { The detected keypoints.}
\cvarg { mask} { Mask specifying where to look for keypoints (optional). Must be a char matrix with non-zero values in the region of interest.}
\end { description}
\cvCppFunc { FeatureDetector::read}
Read feature detector from file node.
\cvdefCpp {
void read( const FileNode\& fn );
}
\begin { description}
\cvarg { fn} { File node from which detector will be read.}
\end { description}
\cvCppFunc { FeatureDetector::write}
Write feature detector to file storage.
\cvdefCpp {
void write( FileStorage\& fs ) const;
}
\begin { description}
\cvarg { fs} { File storage in which detector will be written.}
\end { description}
\cvclass { FastFeatureDetector}
Wrapping class for feature detection using \cvCppCross { FAST} method.
\begin { lstlisting}
class FastFeatureDetector : public FeatureDetector
{
public:
FastFeatureDetector( int _ threshold = 1, bool _ nonmaxSuppression = true );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
} ;
\end { lstlisting}
The class implements a modified version of CenSurE keypoint detector described in
\cite { Agrawal08}
\cvclass { GoodFeaturesToTrackDetector}
Wrapping class for feature detection using \cvCppCross { goodFeaturesToTrack} method.
\begin { lstlisting}
class GoodFeaturesToTrackDetector : public FeatureDetector
{
public:
GoodFeaturesToTrackDetector( int _ maxCorners, double _ qualityLevel,
double _ minDistance, int _ blockSize=3,
bool _ useHarrisDetector=false, double _ k=0.04 );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { MserFeatureDetector}
Wrapping class for feature detection using \cvCppCross { MSER} class.
\begin { lstlisting}
class MserFeatureDetector : public FeatureDetector
{
public:
MserFeatureDetector( CvMSERParams params = cvMSERParams () );
MserFeatureDetector( int delta, int minArea, int maxArea, float maxVariation,
float minDiversity, int maxEvolution, double areaThreshold,
double minMargin, int edgeBlurSize );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { StarFeatureDetector}
Wrapping class for feature detection using \cvCppCross { StarDetector} class.
\begin { lstlisting}
class StarFeatureDetector : public FeatureDetector
{
public:
StarFeatureDetector( int maxSize=16, int responseThreshold=30,
int lineThresholdProjected = 10,
int lineThresholdBinarized=8, int suppressNonmaxSize=5 );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { SiftFeatureDetector}
Wrapping class for feature detection using \cvCppCross { SIFT} class.
\begin { lstlisting}
class SiftFeatureDetector : public FeatureDetector
{
public:
SiftFeatureDetector( double threshold=SIFT::DetectorParams::GET_ DEFAULT_ THRESHOLD(),
double edgeThreshold=SIFT::DetectorParams::GET_ DEFAULT_ EDGE_ THRESHOLD(),
int nOctaves=SIFT::CommonParams::DEFAULT_ NOCTAVES,
int nOctaveLayers=SIFT::CommonParams::DEFAULT_ NOCTAVE_ LAYERS,
int firstOctave=SIFT::CommonParams::DEFAULT_ FIRST_ OCTAVE,
int angleMode=SIFT::CommonParams::FIRST_ ANGLE );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { SurfFeatureDetector}
Wrapping class for feature detection using \cvCppCross { SURF} class.
\begin { lstlisting}
class SurfFeatureDetector : public FeatureDetector
{
public:
SurfFeatureDetector( double hessianThreshold = 400., int octaves = 3,
int octaveLayers = 4 );
virtual void read (const FileNode& fn);
virtual void write (FileStorage& fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { DescriptorExtractor}
Abstract base class for computing descriptors for image keypoints.
\begin { lstlisting}
class DescriptorExtractor
{
public:
virtual void compute( const Mat& image, vector<KeyPoint>& keypoints,
Mat& descriptors ) const = 0;
virtual void read (const FileNode & fn) { } ;
virtual void write (FileStorage & fs) const { } ;
protected:
...
} ;
\end { lstlisting}
In this interface we assume a keypoint descriptor can be represented as a
dense, fixed-dimensional vector of some basic type. Most descriptors used
in practice follow this pattern, as it makes it very easy to compute
distances between descriptors. Therefore we represent a collection of
descriptors as a \cvCppCross { Mat} , where each row is one keypoint descriptor.
\cvCppFunc { DescriptorExtractor::compute}
Compute the descriptors for a set of keypoints in an image. Must be implemented by the subclass.
\cvdefCpp {
void compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const;
}
\begin { description}
\cvarg { image} { The image.}
\cvarg { keypoints} { The keypoints. Keypoints for which a descriptor cannot be computed are removed.}
\cvarg { descriptors} { The descriptors. Row i is the descriptor for keypoint i.}
\end { description}
\cvCppFunc { DescriptorExtractor::read}
Read descriptor extractor from file node.
\cvdefCpp {
void read( const FileNode\& fn );
}
\begin { description}
\cvarg { fn} { File node from which detector will be read.}
\end { description}
\cvCppFunc { DescriptorExtractor::write}
Write descriptor extractor to file storage.
\cvdefCpp {
void write( FileStorage\& fs ) const;
}
\begin { description}
\cvarg { fs} { File storage in which detector will be written.}
\end { description}
\cvclass { SiftDescriptorExtractor}
Wrapping class for descriptors computing using \cvCppCross { SIFT} class.
\begin { lstlisting}
class SiftDescriptorExtractor : public DescriptorExtractor
{
public:
SiftDescriptorExtractor(
double magnification=SIFT::DescriptorParams::GET_ DEFAULT_ MAGNIFICATION(),
bool isNormalize=true, bool recalculateAngles=true,
int nOctaves=SIFT::CommonParams::DEFAULT_ NOCTAVES,
int nOctaveLayers=SIFT::CommonParams::DEFAULT_ NOCTAVE_ LAYERS,
int firstOctave=SIFT::CommonParams::DEFAULT_ FIRST_ OCTAVE,
int angleMode=SIFT::CommonParams::FIRST_ ANGLE );
virtual void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;
virtual void read (const FileNode & fn);
virtual void write (FileStorage & fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { SurfDescriptorExtractor}
Wrapping class for descriptors computing using \cvCppCross { SURF} class.
\begin { lstlisting}
class SurfDescriptorExtractor : public DescriptorExtractor
{
public:
SurfDescriptorExtractor( int nOctaves=4,
int nOctaveLayers=2, bool extended=false );
virtual void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;
virtual void read (const FileNode & fn);
virtual void write (FileStorage & fs) const;
protected:
...
}
\end { lstlisting}
\cvclass { DescriptorMatcher}
Abstract base class for matching two sets of descriptors.
\begin { lstlisting}
class DescriptorMatcher
{
public:
void add( const Mat& descriptors );
// Index the descriptors training set.
void index();
void match( const Mat& query, vector<int>& matches ) const;
void match( const Mat& query, const Mat& mask,
vector<int>& matches ) const;
virtual void clear();
protected:
...
} ;
\end { lstlisting}
\cvCppFunc { DescriptorMatcher::add}
Add descriptors to the training set.
\cvdefCpp {
void add( const Mat\& descriptors );
}
\begin { description}
\cvarg { descriptors} { Descriptors to add to the training set.}
\end { description}
\cvCppFunc { DescriptorMatcher::match}
Find the best match for each descriptor from a query set. In one version
of this method the mask is used to describe which descriptors can be matched.
\texttt { descriptors\_ 1[i]} can be matched with \texttt { descriptors\_ 2[j]} only if \texttt { mask.at<char>(i,j)} is non-zero.
\cvdefCpp {
void match( const Mat\& query, vector<int>\& matches ) const;
}
\cvdefCpp {
void match( const Mat\& query, const Mat\& mask,
vector<int>\& matches ) const;
}
\begin { description}
\cvarg { query} { The query set of descriptors.}
\cvarg { matches} { Indices of the closest matches from the training set}
\cvarg { mask} { Mask specifying permissible matches.}
\end { description}
\cvCppFunc { DescriptorMatcher::clear}
Clear training keypoints.
\cvdefCpp {
void clear();
}
\cvclass { BruteForceMatcher}
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest
descriptor in the second set by trying each one.
\begin { lstlisting}
template<class Distance>
class BruteForceMatcher : public DescriptorMatcher
{
public:
BruteForceMatcher( Distance d = Distance() ) : distance(d) { }
protected:
...
}
\end { lstlisting}
For efficiency, BruteForceMatcher is templated on the distance metric.
For float descriptors, a common choice would be \texttt { L2<float>} . Class \texttt { L2} is defined as:
\begin { lstlisting}
template<typename T>
struct Accumulator
{
typedef T Type;
} ;
template<> struct Accumulator<unsigned char> { typedef unsigned int Type; } ;
template<> struct Accumulator<unsigned short> { typedef unsigned int Type; } ;
template<> struct Accumulator<char> { typedef int Type; } ;
template<> struct Accumulator<short> { typedef int Type; } ;
/*
* Squared Euclidean distance functor
*/
template<class T>
struct L2
{
typedef T ValueType;
typedef typename Accumulator<T>::Type ResultType;
ResultType operator()( const T* a, const T* b, int size ) const;
{
ResultType result = ResultType();
for( int i = 0; i < size; i++ )
{
ResultType diff = a[i] - b[i];
result += diff*diff;
}
return sqrt(result);
}
} ;
\end { lstlisting}
\cvclass { KeyPointCollection}
A storage for sets of keypoints together with corresponding images and class IDs
\begin { lstlisting}
class KeyPointCollection
{
public:
// Adds keypoints from a single image to the storage.
// image Source image
// points A vector of keypoints
void add( const Mat& _ image, const vector<KeyPoint>& _ points );
// Returns the total number of keypoints in the collection
size_ t calcKeypointCount() const;
// Returns the keypoint by its global index
KeyPoint getKeyPoint( int index ) const;
// Clears images, keypoints and startIndices
void clear();
vector<Mat> images;
vector<vector<KeyPoint> > points;
// global indices of the first points in each image,
// startIndices.size() = points.size()
vector<int> startIndices;
} ;
\end { lstlisting}
\cvclass { GenericDescriptorMatch}
Abstract interface for a keypoint descriptor.
\begin { lstlisting}
class GenericDescriptorMatch
{
public:
enum IndexType
{
NoIndex,
KDTreeIndex
} ;
GenericDescriptorMatch() { }
virtual ~GenericDescriptorMatch() { }
virtual void add( KeyPointCollection& keypoints );
virtual void add( const Mat& image, vector<KeyPoint>& points ) = 0;
virtual void classify( const Mat& image, vector<KeyPoint>& points );
virtual void match( const Mat& image, vector<KeyPoint>& points,
vector<int>& indices ) = 0;
virtual void clear();
virtual void read( const FileNode& fn );
virtual void write( FileStorage& fs ) const;
protected:
KeyPointCollection collection;
} ;
\end { lstlisting}
\cvCppFunc { GenericDescriptorMatch::add}
Adds keypoints to the training set (descriptors are supposed to be calculated here).
Keypoints can be passed using \cvCppCross { KeyPointCollection} (with with corresponding images) or as a vector of \cvCppCross { KeyPoint} from a single image.
\cvdefCpp {
void add( KeyPointCollection\& keypoints );
}
\begin { description}
\cvarg { keypoints} { Keypoints collection with corresponding images.}
\end { description}
\cvdefCpp {
void add( const Mat\& image, vector<KeyPoint>\& points );
}
\begin { description}
\cvarg { image} { The source image.}
\cvarg { points} { Test keypoints from the source image.}
\end { description}
\cvCppFunc { GenericDescriptorMatch::classify}
Classifies test keypoints.
\cvdefCpp {
void classify( const Mat\& image, vector<KeyPoint>\& points );
}
\begin { description}
\cvarg { image} { The source image.}
\cvarg { points} { Test keypoints from the source image.}
\end { description}
\cvCppFunc { GenericDescriptorMatch::match}
Matches test keypoints to the training set.
\cvdefCpp {
void match( const Mat\& image, vector<KeyPoint>\& points, vector<int>\& indices );
}
\begin { description}
\cvarg { image} { The source image.}
\cvarg { points} { Test keypoints from the source image.}
\cvarg { indices} { A vector to be filled with keypoint class indices.}
\end { description}
\cvCppFunc { GenericDescriptorMatch::clear}
Clears keypoints storing in collection
\cvdefCpp {
void clear();
}
\cvCppFunc { GenericDescriptorMatch::read}
Reads match object from a file node
\cvdefCpp {
void read( const FileNode\& fn );
}
\cvCppFunc { GenericDescriptorMatch::write}
Writes match object to a file storage
\cvdefCpp {
virtual void write( FileStorage\& fs ) const;
}
\cvclass { VectorDescriptorMatch}
Class used for matching descriptors that can be described as vectors in a finite-dimensional space.
\begin { lstlisting}
template<class Extractor, class Matcher>
class VectorDescriptorMatch : public GenericDescriptorMatch
{
public:
VectorDescriptorMatch( const Extractor& _ extractor = Extractor(),
const Matcher& _ matcher = Matcher() );
~VectorDescriptorMatch();
// Builds flann index
void index();
// Calculates descriptors for a set of keypoints from a single image
virtual void add( const Mat& image, vector<KeyPoint>& keypoints );
// Matches a set of keypoints with the training set
virtual void match( const Mat& image, vector<KeyPoint>& points,
vector<int>& keypointIndices );
// Clears object (i.e. storing keypoints)
virtual void clear();
// Reads object from file node
virtual void read (const FileNode& fn);
// Writes object to file storage
virtual void write (FileStorage& fs) const;
protected:
Extractor extractor;
Matcher matcher;
} ;
\end { lstlisting}
\cvclass { OneWayDescriptorMatch}
Wrapping class for computing, matching and classification of descriptors using \cvCppCross { OneWayDescriptorBase} class.
\begin { lstlisting}
class OneWayDescriptorMatch : public GenericDescriptorMatch
{
public:
class Params
{
public:
static const int POSE_ COUNT = 500;
static const int PATCH_ WIDTH = 24;
static const int PATCH_ HEIGHT = 24;
static float GET_ MIN_ SCALE() { return 0.7f; }
static float GET_ MAX_ SCALE() { return 1.5f; }
static float GET_ STEP_ SCALE() { return 1.2f; }
Params( int _ poseCount = POSE_ COUNT,
Size _ patchSize = Size(PATCH_ WIDTH, PATCH_ HEIGHT),
string _ pcaFilename = string (),
string _ trainPath = string(),
string _ trainImagesList = string(),
float _ minScale = GET_ MIN_ SCALE(), float _ maxScale = GET_ MAX_ SCALE(),
float _ stepScale = GET_ STEP_ SCALE() );
int poseCount;
Size patchSize;
string pcaFilename;
string trainPath;
string trainImagesList;
float minScale, maxScale, stepScale;
} ;
OneWayDescriptorMatch();
// Equivalent to calling PointMatchOneWay() followed by Initialize(_ params)
OneWayDescriptorMatch( const Params& _ params );
virtual ~OneWayDescriptorMatch();
// Sets one way descriptor parameters
void initialize( const Params& _ params, OneWayDescriptorBase *_ base = 0 );
// Calculates one way descriptors for a set of keypoints
virtual void add( const Mat& image, vector<KeyPoint>& keypoints );
// Calculates one way descriptors for a set of keypoints
virtual void add( KeyPointCollection& keypoints );
// Matches a set of keypoints from a single image of the training set.
// A rectangle with a center in a keypoint and size
// (patch_ width/2*scale, patch_ height/2*scale) is cropped from the source image
// for each keypoint. scale is iterated from DescriptorOneWayParams::min_ scale
// to DescriptorOneWayParams::max_ scale. The minimum distance to each
// training patch with all its affine poses is found over all scales.
// The class ID of a match is returned for each keypoint. The distance
// is calculated over PCA components loaded with DescriptorOneWay::Initialize,
// kd tree is used for finding minimum distances.
virtual void match( const Mat& image, vector<KeyPoint>& points,
vector<int>& indices );
// Classify a set of keypoints. The same as match, but returns point
// classes rather than indices.
virtual void classify( const Mat& image, vector<KeyPoint>& points );
// Clears keypoints storing in collection and OneWayDescriptorBase
virtual void clear ();
// Reads match object from a file node
virtual void read (const FileNode & fn);
// Writes match object to a file storage
virtual void write (FileStorage& fs) const;
protected:
Ptr<OneWayDescriptorBase> base;
Params params;
} ;
\end { lstlisting}
\cvclass { CalonderDescriptorMatch}
Wrapping class for computing, matching and classification of descriptors using \cvCppCross { RTreeClassifier} class.
\begin { lstlisting}
class CV_ EXPORTS CalonderDescriptorMatch : public GenericDescriptorMatch
{
public:
class Params
{
public:
static const int DEFAULT_ NUM_ TREES = 80;
static const int DEFAULT_ DEPTH = 9;
static const int DEFAULT_ VIEWS = 5000;
static const size_ t DEFAULT_ REDUCED_ NUM_ DIM = 176;
static const size_ t DEFAULT_ NUM_ QUANT_ BITS = 4;
static const int DEFAULT_ PATCH_ SIZE = PATCH_ SIZE;
Params( const RNG& _ rng = RNG(),
const PatchGenerator& _ patchGen = PatchGenerator(),
int _ numTrees=DEFAULT_ NUM_ TREES,
int _ depth=DEFAULT_ DEPTH,
int _ views=DEFAULT_ VIEWS,
size_ t _ reducedNumDim=DEFAULT_ REDUCED_ NUM_ DIM,
int _ numQuantBits=DEFAULT_ NUM_ QUANT_ BITS,
bool _ printStatus=true,
int _ patchSize=DEFAULT_ PATCH_ SIZE );
Params( const string& _ filename );
RNG rng;
PatchGenerator patchGen;
int numTrees;
int depth;
int views;
int patchSize;
size_ t reducedNumDim;
int numQuantBits;
bool printStatus;
string filename;
} ;
CalonderDescriptorMatch();
CalonderDescriptorMatch( const Params& _ params );
virtual ~CalonderDescriptorMatch();
void initialize( const Params& _ params );
virtual void add( const Mat& image, vector<KeyPoint>& keypoints );
virtual void match( const Mat& image, vector<KeyPoint>& keypoints,
vector<int>& indices );
virtual void classify( const Mat& image, vector<KeyPoint>& keypoints );
virtual void clear ();
virtual void read( const FileNode & fn );
virtual void write( FileStorage& fs ) const;
protected:
...
} ;
\end { lstlisting}
\cvclass { FernDescriptorMatch}
Wrapping class for computing, matching and classification of descriptors using \cvCppCross { FernClassifier} class.
\begin { lstlisting}
class FernDescriptorMatch : public GenericDescriptorMatch
{
public:
class Params
{
public:
Params( int _ nclasses=0,
int _ patchSize=FernClassifier::PATCH_ SIZE,
int _ signatureSize=FernClassifier::DEFAULT_ SIGNATURE_ SIZE,
int _ nstructs=FernClassifier::DEFAULT_ STRUCTS,
int _ structSize=FernClassifier::DEFAULT_ STRUCT_ SIZE,
int _ nviews=FernClassifier::DEFAULT_ VIEWS,
int _ compressionMethod=FernClassifier::COMPRESSION_ NONE,
const PatchGenerator& patchGenerator=PatchGenerator() );
Params( const string& _ filename );
int nclasses;
int patchSize;
int signatureSize;
int nstructs;
int structSize;
int nviews;
int compressionMethod;
PatchGenerator patchGenerator;
string filename;
} ;
FernDescriptorMatch();
FernDescriptorMatch( const Params& _ params );
virtual ~FernDescriptorMatch();
void initialize( const Params& _ params );
virtual void add( const Mat& image, vector<KeyPoint>& keypoints );
virtual void match( const Mat& image, vector<KeyPoint>& keypoints,
vector<int>& indices );
virtual void classify( const Mat& image, vector<KeyPoint>& keypoints );
virtual void clear ();
virtual void read( const FileNode & fn );
virtual void write( FileStorage& fs ) const;
protected:
...
} ;
\end { lstlisting}
\fi