update features2d documentation after changes create functions and DynamicAdaptedFeatureDetector

This commit is contained in:
Maria Dimashova 2010-11-25 17:44:16 +00:00
parent 1286c1db45
commit 362df22fac
2 changed files with 100 additions and 70 deletions

View File

@ -75,6 +75,8 @@ public:
virtual void read(const FileNode&); virtual void read(const FileNode&);
virtual void write(FileStorage&) const; virtual void write(FileStorage&) const;
static Ptr<FeatureDetector> create( const string& detectorType );
protected: protected:
... ...
@ -132,6 +134,31 @@ void FeatureDetector::write( FileStorage\& fs ) const;
\cvarg{fs}{File storage in which detector will be written.} \cvarg{fs}{File storage in which detector will be written.}
\end{description} \end{description}
\cvCppFunc{FeatureDetector::create}
Feature detector factory that creates \cvCppCross{FeatureDetector} of given type with
default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<FeatureDetector> FeatureDetector::create( const string& detectorType );
\end{lstlisting}
\begin{description}
\cvarg{detectorType}{Feature detector type.}
\end{description}
Now the following detector types are supported:\\
\texttt{"FAST"} -- \cvCppCross{FastFeatureDetector},\\
\texttt{"STAR"} -- \cvCppCross{StarFeatureDetector},\\
\texttt{"SIFT"} -- \cvCppCross{SiftFeatureDetector}, \\
\texttt{"SURF"} -- \cvCppCross{SurfFeatureDetector}, \\
\texttt{"MSER"} -- \cvCppCross{MserFeatureDetector}, \\
\texttt{"GFTT"} -- \cvCppCross{GfttFeatureDetector}, \\
\texttt{"HARRIS"} -- \cvCppCross{HarrisFeatureDetector}. \\
Also combined format is supported: feature detector adapter name (\texttt{"Grid"} --
\cvCppCross{GridAdaptedFeatureDetector}, \texttt{"Pyramid"} --
\cvCppCross{PyramidAdaptedFeatureDetector}) + feature detector name (see above),
e.g. \texttt{"GridFAST"}, \texttt{"PyramidSTAR"}, etc.
\cvclass{FastFeatureDetector} \cvclass{FastFeatureDetector}
Wrapping class for feature detection using \cvCppCross{FAST} method. Wrapping class for feature detection using \cvCppCross{FAST} method.
@ -302,21 +329,6 @@ protected:
%dynamic detectors doc %dynamic detectors doc
\input{features2d_dynamic_detectors} \input{features2d_dynamic_detectors}
\cvCppFunc{createFeatureDetector}
Feature detector factory that creates \cvCppCross{FeatureDetector} of given type with
default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<FeatureDetector> createFeatureDetector( const string& detectorType );
\end{lstlisting}
\begin{description}
\cvarg{detectorType}{Feature detector type.}
\end{description}
Now the following detector types are supported ''FAST'', ''STAR'', ''SIFT'',
''SURF'', ''MSER'', ''GFTT'', ''HARRIS''.
\section{Common Interfaces of Descriptor Extractors} \section{Common Interfaces of Descriptor Extractors}
Extractors of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily Extractors of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily
between different algorithms solving the same problem. This section is devoted to computing descriptors between different algorithms solving the same problem. This section is devoted to computing descriptors
@ -342,6 +354,8 @@ public:
virtual int descriptorSize() const = 0; virtual int descriptorSize() const = 0;
virtual int descriptorType() const = 0; virtual int descriptorType() const = 0;
static Ptr<DescriptorExtractor> create( const string& descriptorExtractorType );
protected: protected:
... ...
@ -407,6 +421,27 @@ void DescriptorExtractor::write( FileStorage\& fs ) const;
\cvarg{fs}{File storage in which detector will be written.} \cvarg{fs}{File storage in which detector will be written.}
\end{description} \end{description}
\cvCppFunc{DescriptorExtractor::create}
Descriptor extractor factory that creates \cvCppCross{DescriptorExtractor} of given type with
default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<DescriptorExtractor>
DescriptorExtractor::create( const string& descriptorExtractorType );
\end{lstlisting}
\begin{description}
\cvarg{descriptorExtractorType}{Descriptor extractor type.}
\end{description}
Now the following descriptor extractor types are supported:\\
\texttt{"SIFT"} -- \cvCppCross{SiftFeatureDetector},\\
\texttt{"SURF"} -- \cvCppCross{SurfFeatureDetector},\\
\texttt{"BRIEF"} -- \cvCppCross{BriefFeatureDetector}.\\
Also combined format is supported: descriptor extractor adapter name (\texttt{"Opponent"} --
\cvCppCross{OpponentColorDescriptorExtractor}) + descriptor extractor name (see above),
e.g. \texttt{"OpponentSIFT"}, etc.
\cvclass{SiftDescriptorExtractor} \cvclass{SiftDescriptorExtractor}
Wrapping class for descriptors computing using \cvCppCross{SIFT} class. Wrapping class for descriptors computing using \cvCppCross{SIFT} class.
@ -516,22 +551,6 @@ protected:
}; };
\end{lstlisting} \end{lstlisting}
\cvCppFunc{createDescriptorExtractor}
Descriptor extractor factory that creates \cvCppCross{DescriptorExtractor} of given type with
default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<DescriptorExtractor>
createDescriptorExtractor( const string& descriptorExtractorType );
\end{lstlisting}
\begin{description}
\cvarg{descriptorExtractorType}{Descriptor extractor type.}
\end{description}
Now the following descriptor extractor types are supported ''SIFT'', ''SURF'',
''OpponentSIFT'', ''OpponentSURF'', ''BRIEF''.
\section{Common Interfaces of Descriptor Matchers} \section{Common Interfaces of Descriptor Matchers}
Matchers of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily Matchers of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily
between different algorithms solving the same problem. This section is devoted to matching descriptors between different algorithms solving the same problem. This section is devoted to matching descriptors
@ -612,6 +631,8 @@ public:
virtual void write( FileStorage& ) const; virtual void write( FileStorage& ) const;
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0; virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
static Ptr<DescriptorMatcher> create( const string& descriptorMatcherType );
protected: protected:
vector<Mat> trainDescCollection; vector<Mat> trainDescCollection;
@ -769,6 +790,21 @@ DescriptorMatcher::clone( bool emptyTrainData ) const;
but with empty train data..} but with empty train data..}
\end{description} \end{description}
\cvCppFunc{DescriptorMatcher::create}
Descriptor matcher factory that creates \cvCppCross{DescriptorMatcher} of
given type with default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<DescriptorMatcher>
DescriptorMatcher::create( const string& descriptorMatcherType );
\end{lstlisting}
\begin{description}
\cvarg{descriptorMatcherType}{Descriptor matcher type.}
\end{description}
Now the following matcher types are supported: \texttt{"BruteForce"} (it uses \texttt{L2}), \texttt{"BruteForce-L1"},
\texttt{"BruteForce-Hamming"}, \texttt{"BruteForce-HammingLUT"}, \texttt{"FlannBased"}.
\cvclass{BruteForceMatcher} \cvclass{BruteForceMatcher}
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest 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. This descriptor matcher supports masking descriptor in the second set by trying each one. This descriptor matcher supports masking
@ -881,20 +917,6 @@ protected:
}; };
\end{lstlisting} \end{lstlisting}
\cvCppFunc{createDescriptorMatcher}
Descriptor matcher factory that creates \cvCppCross{DescriptorMatcher} of
given type with default parameters (rather using default constructor).
\begin{lstlisting}
Ptr<DescriptorMatcher> createDescriptorMatcher( const string& descriptorMatcherType );
\end{lstlisting}
\begin{description}
\cvarg{descriptorMatcherType}{Descriptor matcher type.}
\end{description}
Now the following matcher types are supported: ''BruteForce'' (it uses L2), ''BruteForce-L1'',
''BruteForce-Hamming'', ''BruteForce-HammingLUT''.
\section{Common Interfaces of Generic Descriptor Matchers} \section{Common Interfaces of Generic Descriptor Matchers}
Matchers of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily Matchers of keypoint descriptors in OpenCV have wrappers with common interface that enables to switch easily
between different algorithms solving the same problem. This section is devoted to matching descriptors between different algorithms solving the same problem. This section is devoted to matching descriptors

View File

@ -1,4 +1,4 @@
\cvclass{DynamicDetector} \cvclass{DynamicAdaptedFeatureDetector}
An adaptively adjusting detector that iteratively detects until the desired number An adaptively adjusting detector that iteratively detects until the desired number
of features are found. of features are found.
@ -7,7 +7,7 @@ used on the last detection. In this way, the detector may be used for consistent
of keypoints in a sets of images that are temporally related such as video streams or of keypoints in a sets of images that are temporally related such as video streams or
panorama series. panorama series.
The DynamicDetector uses another detector such as FAST or SURF to do the dirty work, The DynamicAdaptedFeatureDetector uses another detector such as FAST or SURF to do the dirty work,
with the help of an AdjusterAdapter. with the help of an AdjusterAdapter.
After a detection, and an unsatisfactory number of features are detected, After a detection, and an unsatisfactory number of features are detected,
the AdjusterAdapter will adjust the detection parameters so that the next detection will the AdjusterAdapter will adjust the detection parameters so that the next detection will
@ -20,52 +20,54 @@ AdjusterAdapter interface.
Beware that this is not thread safe - as the adjustment of parameters breaks the const Beware that this is not thread safe - as the adjustment of parameters breaks the const
of the detection routine... of the detection routine...
Here is a sample of how to create a DynamicDetector. Here is a sample of how to create a DynamicAdaptedFeatureDetector.
\begin{lstlisting} \begin{lstlisting}
//sample usage: //sample usage:
//will create a detector that attempts to find //will create a detector that attempts to find
//100 - 110 FAST Keypoints, and will at most run //100 - 110 FAST Keypoints, and will at most run
//FAST feature detection 10 times until that //FAST feature detection 10 times until that
//number of keypoints are found //number of keypoints are found
Ptr<FeatureDetector> detector(new DynamicDetector (100, 110, 10, Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector (100, 110, 10,
new FastAdjuster(20,true))); new FastAdjuster(20,true)));
\end{lstlisting} \end{lstlisting}
\begin{lstlisting} \begin{lstlisting}
class DynamicDetector: public FeatureDetector { class DynamicAdaptedFeatureDetector: public FeatureDetector
{
public: public:
DynamicDetector(int min_features, int max_features, int max_iters, DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjaster,
const Ptr<AdjusterAdapter>& a); int min_features=400, int max_features=500, int max_iters=5 );
... ...
}; };
\end{lstlisting} \end{lstlisting}
\cvCppFunc{DynamicDetector::DynamicDetector} \cvCppFunc{DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector}
DynamicDetector constructor. DynamicAdaptedFeatureDetector constructor.
\cvdefCpp{ \cvdefCpp{
DynamicDetector::DynamicDetector( \par int min\_features, \par int max\_features, \par int max\_iters, DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector(
\par const Ptr<AdjusterAdapter>\& a); \par const Ptr<AdjusterAdapter>\& adjaster,
\par int min\_features, \par int max\_features, \par int max\_iters );
} }
\begin{description} \begin{description}
\cvarg{adjaster}{ An \cvCppCross{AdjusterAdapter} that will do the detection and parameter
adjustment}
\cvarg{min\_features}{This minimum desired number features.} \cvarg{min\_features}{This minimum desired number features.}
\cvarg{max\_features}{The maximum desired number of features.} \cvarg{max\_features}{The maximum desired number of features.}
\cvarg{max\_iters}{The maximum number of times to try to adjust the feature detector parameters. For the \cvCppCross{FastAdjuster} this number can be high, \cvarg{max\_iters}{The maximum number of times to try to adjust the feature detector parameters. For the \cvCppCross{FastAdjuster} this number can be high,
but with Star or Surf, many iterations can get time consuming. At each iteration the detector is rerun, so keep this in mind when choosing this value.} but with Star or Surf, many iterations can get time consuming. At each iteration the detector is rerun, so keep this in mind when choosing this value.}
\cvarg{a}{ An \cvCppCross{AdjusterAdapter} that will do the detection and parameter
adjustment}
\end{description} \end{description}
\cvclass{AdjusterAdapter} \cvclass{AdjusterAdapter}
A feature detector parameter adjuster interface, this is used by the \cvCppCross{DynamicDetector} A feature detector parameter adjuster interface, this is used by the \cvCppCross{DynamicAdaptedFeatureDetector}
and is a wrapper for \cvCppCross{FeatureDetecto}r that allow them to be adjusted after a detection. and is a wrapper for \cvCppCross{FeatureDetecto}r that allow them to be adjusted after a detection.
See \cvCppCross{FastAdjuster}, \cvCppCross{StarAdjuster}, \cvCppCross{SurfAdjuster} for concrete implementations. See \cvCppCross{FastAdjuster}, \cvCppCross{StarAdjuster}, \cvCppCross{SurfAdjuster} for concrete implementations.
\begin{lstlisting} \begin{lstlisting}
class AdjusterAdapter: public FeatureDetector { class AdjusterAdapter: public FeatureDetector
{
public: public:
virtual ~AdjusterAdapter() { virtual ~AdjusterAdapter() {}
}
virtual void tooFew(int min, int n_detected) = 0; virtual void tooFew(int min, int n_detected) = 0;
virtual void tooMany(int max, int n_detected) = 0; virtual void tooMany(int max, int n_detected) = 0;
virtual bool good() const = 0; virtual bool good() const = 0;
@ -73,7 +75,7 @@ public:
\end{lstlisting} \end{lstlisting}
\cvCppFunc{AdjusterAdapter::tooFew} \cvCppFunc{AdjusterAdapter::tooFew}
\cvdefCpp{ \cvdefCpp{
virtual void tooFew(\par int min, int n\_detected) = 0; virtual void tooFew(int min, int n\_detected) = 0;
} }
Too few features were detected so, adjust the detector parameters accordingly - so that the next Too few features were detected so, adjust the detector parameters accordingly - so that the next
detection detects more features. detection detects more features.
@ -83,7 +85,8 @@ detection detects more features.
\end{description} \end{description}
An example implementation of this is An example implementation of this is
\begin{lstlisting} \begin{lstlisting}
void FastAdjuster::tooFew(int min, int n_detected) { void FastAdjuster::tooFew(int min, int n_detected)
{
thresh_--; thresh_--;
} }
\end{lstlisting} \end{lstlisting}
@ -100,7 +103,8 @@ virtual void tooMany(int max, int n\_detected) = 0;
\end{description} \end{description}
An example implementation of this is An example implementation of this is
\begin{lstlisting} \begin{lstlisting}
void FastAdjuster::tooMany(int min, int n_detected) { void FastAdjuster::tooMany(int min, int n_detected)
{
thresh_++; thresh_++;
} }
\end{lstlisting} \end{lstlisting}
@ -112,7 +116,8 @@ virtual bool good() const = 0;
} }
An example implementation of this is An example implementation of this is
\begin{lstlisting} \begin{lstlisting}
bool FastAdjuster::good() const { bool FastAdjuster::good() const
{
return (thresh_ > 1) && (thresh_ < 200); return (thresh_ > 1) && (thresh_ < 200);
} }
\end{lstlisting} \end{lstlisting}
@ -122,7 +127,8 @@ An \cvCppCross{AdjusterAdapter} for the \cvCppCross{FastFeatureDetector}. This w
threshhold by 1 threshhold by 1
\begin{lstlisting} \begin{lstlisting}
class FastAdjuster FastAdjuster: public AdjusterAdapter { class FastAdjuster FastAdjuster: public AdjusterAdapter
{
public: public:
FastAdjuster(int init_thresh = 20, bool nonmax = true); FastAdjuster(int init_thresh = 20, bool nonmax = true);
... ...
@ -133,7 +139,8 @@ public:
An \cvCppCross{AdjusterAdapter} for the \cvCppCross{StarFeatureDetector}. This adjusts the responseThreshhold of An \cvCppCross{AdjusterAdapter} for the \cvCppCross{StarFeatureDetector}. This adjusts the responseThreshhold of
StarFeatureDetector. StarFeatureDetector.
\begin{lstlisting} \begin{lstlisting}
class StarAdjuster: public AdjusterAdapter { class StarAdjuster: public AdjusterAdapter
{
StarAdjuster(double initial_thresh = 30.0); StarAdjuster(double initial_thresh = 30.0);
... ...
}; };
@ -144,7 +151,8 @@ class StarAdjuster: public AdjusterAdapter {
An \cvCppCross{AdjusterAdapter} for the \cvCppCross{SurfFeatureDetector}. This adjusts the hessianThreshold of An \cvCppCross{AdjusterAdapter} for the \cvCppCross{SurfFeatureDetector}. This adjusts the hessianThreshold of
SurfFeatureDetector. SurfFeatureDetector.
\begin{lstlisting} \begin{lstlisting}
class SurfAdjuster: public SurfAdjuster { class SurfAdjuster: public SurfAdjuster
{
SurfAdjuster(); SurfAdjuster();
... ...
}; };