fixed docs

This commit is contained in:
Konstantin Matskevich 2014-01-15 10:01:40 +04:00
parent ca5689e0db
commit 3b7683e72f
3 changed files with 26 additions and 23 deletions

View File

@ -28,7 +28,7 @@ with an image set. ::
public:
virtual ~DescriptorMatcher();
virtual void add( const vector<Mat>& descriptors );
virtual void add( InputArray descriptors );
const vector<Mat>& getTrainDescriptors() const;
virtual void clear();
@ -40,23 +40,23 @@ with an image set. ::
/*
* Group of methods to match descriptors from an image pair.
*/
void match( const Mat& queryDescriptors, const Mat& trainDescriptors,
vector<DMatch>& matches, const Mat& mask=Mat() ) const;
void knnMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,
void match( InputArray queryDescriptors, InputArray trainDescriptors,
vector<DMatch>& matches, InputArray mask=Mat() ) const;
void knnMatch( InputArray queryDescriptors, InputArray trainDescriptors,
vector<vector<DMatch> >& matches, int k,
const Mat& mask=Mat(), bool compactResult=false ) const;
void radiusMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,
InputArray mask=Mat(), bool compactResult=false ) const;
void radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors,
vector<vector<DMatch> >& matches, float maxDistance,
const Mat& mask=Mat(), bool compactResult=false ) const;
InputArray mask=Mat(), bool compactResult=false ) const;
/*
* Group of methods to match descriptors from one image to an image set.
*/
void match( const Mat& queryDescriptors, vector<DMatch>& matches,
void match( InputArray queryDescriptors, vector<DMatch>& matches,
const vector<Mat>& masks=vector<Mat>() );
void knnMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches,
void knnMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches,
int k, const vector<Mat>& masks=vector<Mat>(),
bool compactResult=false );
void radiusMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches,
void radiusMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches,
float maxDistance, const vector<Mat>& masks=vector<Mat>(),
bool compactResult=false );
@ -69,15 +69,16 @@ with an image set. ::
protected:
vector<Mat> trainDescCollection;
vector<UMat> utrainDescCollection;
...
};
DescriptorMatcher::add
--------------------------
Adds descriptors to train a descriptor collection. If the collection ``trainDescCollectionis`` is not empty, the new descriptors are added to existing train descriptors.
Adds descriptors to train a CPU(``trainDescCollectionis``) or GPU(``utrainDescCollectionis``) descriptor collection. If the collection is not empty, the new descriptors are added to existing train descriptors.
.. ocv:function:: void DescriptorMatcher::add( const vector<Mat>& descriptors )
.. ocv:function:: void DescriptorMatcher::add( InputArrayOfArrays descriptors )
:param descriptors: Descriptors to add. Each ``descriptors[i]`` is a set of descriptors from the same train image.
@ -94,7 +95,7 @@ Returns a constant link to the train descriptor collection ``trainDescCollection
DescriptorMatcher::clear
----------------------------
Clears the train descriptor collection.
Clears the train descriptor collections.
.. ocv:function:: void DescriptorMatcher::clear()
@ -102,7 +103,7 @@ Clears the train descriptor collection.
DescriptorMatcher::empty
----------------------------
Returns true if there are no train descriptors in the collection.
Returns true if there are no train descriptors in the both collections.
.. ocv:function:: bool DescriptorMatcher::empty() const
@ -130,9 +131,9 @@ DescriptorMatcher::match
----------------------------
Finds the best match for each descriptor from a query set.
.. ocv:function:: void DescriptorMatcher::match( const Mat& queryDescriptors, const Mat& trainDescriptors, vector<DMatch>& matches, const Mat& mask=Mat() ) const
.. ocv:function:: void DescriptorMatcher::match( InputArray queryDescriptors, InputArray trainDescriptors, vector<DMatch>& matches, InputArray mask=Mat() ) const
.. ocv:function:: void DescriptorMatcher::match( const Mat& queryDescriptors, vector<DMatch>& matches, const vector<Mat>& masks=vector<Mat>() )
.. ocv:function:: void DescriptorMatcher::match(InputArray queryDescriptors, vector<DMatch>& matches, const vector<Mat>& masks=vector<Mat>() )
:param queryDescriptors: Query set of descriptors.
@ -152,9 +153,9 @@ DescriptorMatcher::knnMatch
-------------------------------
Finds the k best matches for each descriptor from a query set.
.. ocv:function:: void DescriptorMatcher::knnMatch( const Mat& queryDescriptors, const Mat& trainDescriptors, vector<vector<DMatch> >& matches, int k, const Mat& mask=Mat(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::knnMatch(InputArray queryDescriptors, InputArray trainDescriptors, vector<vector<DMatch> >& matches, int k, InputArray mask=Mat(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::knnMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int k, const vector<Mat>& masks=vector<Mat>(), bool compactResult=false )
.. ocv:function:: void DescriptorMatcher::knnMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, int k, const vector<Mat>& masks=vector<Mat>(), bool compactResult=false )
:param queryDescriptors: Query set of descriptors.
@ -178,9 +179,9 @@ DescriptorMatcher::radiusMatch
----------------------------------
For each query descriptor, finds the training descriptors not farther than the specified distance.
.. ocv:function:: void DescriptorMatcher::radiusMatch( const Mat& queryDescriptors, const Mat& trainDescriptors, vector<vector<DMatch> >& matches, float maxDistance, const Mat& mask=Mat(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors, vector<vector<DMatch> >& matches, float maxDistance, InputArray mask=Mat(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::radiusMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance, const vector<Mat>& masks=vector<Mat>(), bool compactResult=false )
.. ocv:function:: void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance, const vector<Mat>& masks=vector<Mat>(), bool compactResult=false )
:param queryDescriptors: Query set of descriptors.

View File

@ -998,7 +998,7 @@ public:
* Add descriptors to train descriptor collection.
* descriptors Descriptors to add. Each descriptors[i] is a descriptors set from one image.
*/
CV_WRAP virtual void add( InputArray descriptors );
CV_WRAP virtual void add( InputArrayOfArrays descriptors );
/*
* Get train descriptors collection.
*/

View File

@ -1085,9 +1085,10 @@ void BFMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<std::vec
int trainDescVectorSize = trainDescCollection.empty() ? (int)utrainDescCollection.size() : (int)trainDescCollection.size();
Size trainDescSize = trainDescCollection.empty() ? utrainDescCollection[0].size() : trainDescCollection[0].size();
int trainDescOffset = trainDescCollection.empty() ? (int)utrainDescCollection[0].offset : 0;
if ( ocl::useOpenCL() && _queryDescriptors.isUMat() && _queryDescriptors.dims()<=2 && trainDescVectorSize == 1 &&
_queryDescriptors.type() == CV_32FC1 &&
_queryDescriptors.type() == CV_32FC1 && _queryDescriptors.offset() == 0 && trainDescOffset == 0 &&
trainDescSize.width == _queryDescriptors.size().width && masks.size() == 1 && masks[0].total() == 0 )
{
if(knn == 1)
@ -1214,9 +1215,10 @@ void BFMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vector<std::
int trainDescVectorSize = trainDescCollection.empty() ? (int)utrainDescCollection.size() : (int)trainDescCollection.size();
Size trainDescSize = trainDescCollection.empty() ? utrainDescCollection[0].size() : trainDescCollection[0].size();
int trainDescOffset = trainDescCollection.empty() ? (int)utrainDescCollection[0].offset : 0;
if ( ocl::useOpenCL() && _queryDescriptors.isUMat() && _queryDescriptors.dims()<=2 && trainDescVectorSize == 1 &&
_queryDescriptors.type() == CV_32FC1 &&
_queryDescriptors.type() == CV_32FC1 && _queryDescriptors.offset() == 0 && trainDescOffset == 0 &&
trainDescSize.width == _queryDescriptors.size().width && masks.size() == 1 && masks[0].total() == 0 )
{
if(trainDescCollection.empty())