mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Merge pull request #296 from asmorkalov:html_docs_warning_fix
This commit is contained in:
commit
7341eaa654
@ -16,7 +16,7 @@ Today it is common to have a digital video recording system at your disposal. Th
|
|||||||
The source code
|
The source code
|
||||||
===============
|
===============
|
||||||
|
|
||||||
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/` folder of the OpenCV source library.
|
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/` folder of the OpenCV source library.
|
||||||
|
|
||||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video-input-psnr-ssim.cpp
|
.. literalinclude:: ../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video-input-psnr-ssim.cpp
|
||||||
:language: cpp
|
:language: cpp
|
||||||
|
@ -208,7 +208,7 @@ Retina::getMagno
|
|||||||
Retina::getParameters
|
Retina::getParameters
|
||||||
+++++++++++++++++++++
|
+++++++++++++++++++++
|
||||||
|
|
||||||
.. ocv:function:: struct Retina::RetinaParameters Retina::getParameters()
|
.. ocv:function:: Retina::RetinaParameters Retina::getParameters()
|
||||||
|
|
||||||
Retrieve the current parameters values in a *Retina::RetinaParameters* structure
|
Retrieve the current parameters values in a *Retina::RetinaParameters* structure
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ Retina::RetinaParameters
|
|||||||
.. ocv:struct:: Retina::RetinaParameters
|
.. ocv:struct:: Retina::RetinaParameters
|
||||||
|
|
||||||
This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
|
This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
|
||||||
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
|
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
|
||||||
|
|
||||||
class RetinaParameters{
|
class RetinaParameters{
|
||||||
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
|
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
|
||||||
|
@ -115,7 +115,7 @@ class CV_EXPORTS Retina {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel
|
// parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel
|
||||||
struct RetinaParameters{
|
struct RetinaParameters{
|
||||||
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
|
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
|
||||||
OPLandIplParvoParameters():colorMode(true),
|
OPLandIplParvoParameters():colorMode(true),
|
||||||
normaliseOutput(true),
|
normaliseOutput(true),
|
||||||
@ -166,14 +166,14 @@ public:
|
|||||||
virtual ~Retina();
|
virtual ~Retina();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* retreive retina input buffer size
|
* retreive retina input buffer size
|
||||||
*/
|
*/
|
||||||
Size inputSize();
|
Size inputSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* retreive retina output buffer size
|
* retreive retina output buffer size
|
||||||
*/
|
*/
|
||||||
Size outputSize();
|
Size outputSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* try to open an XML retina parameters file to adjust current retina instance setup
|
* try to open an XML retina parameters file to adjust current retina instance setup
|
||||||
@ -190,9 +190,9 @@ public:
|
|||||||
* => if the xml file does not exist, then default setup is applied
|
* => if the xml file does not exist, then default setup is applied
|
||||||
* => warning, Exceptions are thrown if read XML file is not valid
|
* => warning, Exceptions are thrown if read XML file is not valid
|
||||||
* @param fs : the open Filestorage which contains retina parameters
|
* @param fs : the open Filestorage which contains retina parameters
|
||||||
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
|
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
|
||||||
*/
|
*/
|
||||||
void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true);
|
void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* try to open an XML retina parameters file to adjust current retina instance setup
|
* try to open an XML retina parameters file to adjust current retina instance setup
|
||||||
@ -206,7 +206,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @return the current parameters setup
|
* @return the current parameters setup
|
||||||
*/
|
*/
|
||||||
struct Retina::RetinaParameters getParameters();
|
Retina::RetinaParameters getParameters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parameters setup display method
|
* parameters setup display method
|
||||||
@ -305,17 +305,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
void clearBuffers();
|
void clearBuffers();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated
|
* Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated
|
||||||
* @param activate: true if Magnocellular output should be activated, false if not
|
* @param activate: true if Magnocellular output should be activated, false if not
|
||||||
*/
|
*/
|
||||||
void activateMovingContoursProcessing(const bool activate);
|
void activateMovingContoursProcessing(const bool activate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated
|
* Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated
|
||||||
* @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not
|
* @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not
|
||||||
*/
|
*/
|
||||||
void activateContoursProcessing(const bool activate);
|
void activateContoursProcessing(const bool activate);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Parameteres setup members
|
// Parameteres setup members
|
||||||
|
@ -210,9 +210,9 @@ The sample below demonstrates how to use RotatedRect:
|
|||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
:ocv:cfunc:`CamShift`,
|
:ocv:func:`CamShift` ,
|
||||||
:ocv:func:`fitEllipse`,
|
:ocv:func:`fitEllipse` ,
|
||||||
:ocv:func:`minAreaRect`,
|
:ocv:func:`minAreaRect` ,
|
||||||
:ocv:struct:`CvBox2D`
|
:ocv:struct:`CvBox2D`
|
||||||
|
|
||||||
TermCriteria
|
TermCriteria
|
||||||
@ -1303,7 +1303,7 @@ because ``cvtColor`` , as well as the most of OpenCV functions, calls ``Mat::cre
|
|||||||
|
|
||||||
|
|
||||||
Mat::addref
|
Mat::addref
|
||||||
---------------
|
-----------
|
||||||
Increments the reference counter.
|
Increments the reference counter.
|
||||||
|
|
||||||
.. ocv:function:: void Mat::addref()
|
.. ocv:function:: void Mat::addref()
|
||||||
@ -1313,7 +1313,7 @@ The method increments the reference counter associated with the matrix data. If
|
|||||||
|
|
||||||
|
|
||||||
Mat::release
|
Mat::release
|
||||||
----------------
|
------------
|
||||||
Decrements the reference counter and deallocates the matrix if needed.
|
Decrements the reference counter and deallocates the matrix if needed.
|
||||||
|
|
||||||
.. ocv:function:: void Mat::release()
|
.. ocv:function:: void Mat::release()
|
||||||
@ -1324,7 +1324,7 @@ The method decrements the reference counter associated with the matrix data. Whe
|
|||||||
This method can be called manually to force the matrix data deallocation. But since this method is automatically called in the destructor, or by any other method that changes the data pointer, it is usually not needed. The reference counter decrement and check for 0 is an atomic operation on the platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in different threads.
|
This method can be called manually to force the matrix data deallocation. But since this method is automatically called in the destructor, or by any other method that changes the data pointer, it is usually not needed. The reference counter decrement and check for 0 is an atomic operation on the platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in different threads.
|
||||||
|
|
||||||
Mat::resize
|
Mat::resize
|
||||||
---------------
|
-----------
|
||||||
Changes the number of matrix rows.
|
Changes the number of matrix rows.
|
||||||
|
|
||||||
.. ocv:function:: void Mat::resize( size_t sz )
|
.. ocv:function:: void Mat::resize( size_t sz )
|
||||||
@ -1337,7 +1337,7 @@ The methods change the number of matrix rows. If the matrix is reallocated, the
|
|||||||
|
|
||||||
|
|
||||||
Mat::reserve
|
Mat::reserve
|
||||||
---------------
|
------------
|
||||||
Reserves space for the certain number of rows.
|
Reserves space for the certain number of rows.
|
||||||
|
|
||||||
.. ocv:function:: void Mat::reserve( size_t sz )
|
.. ocv:function:: void Mat::reserve( size_t sz )
|
||||||
@ -1370,7 +1370,7 @@ The method removes one or more rows from the bottom of the matrix.
|
|||||||
|
|
||||||
|
|
||||||
Mat::locateROI
|
Mat::locateROI
|
||||||
------------------
|
--------------
|
||||||
Locates the matrix header within a parent matrix.
|
Locates the matrix header within a parent matrix.
|
||||||
|
|
||||||
.. ocv:function:: void Mat::locateROI( Size& wholeSize, Point& ofs ) const
|
.. ocv:function:: void Mat::locateROI( Size& wholeSize, Point& ofs ) const
|
||||||
@ -1387,7 +1387,7 @@ After you extracted a submatrix from a matrix using
|
|||||||
|
|
||||||
|
|
||||||
Mat::adjustROI
|
Mat::adjustROI
|
||||||
------------------
|
--------------
|
||||||
Adjusts a submatrix size and position within the parent matrix.
|
Adjusts a submatrix size and position within the parent matrix.
|
||||||
|
|
||||||
.. ocv:function:: Mat& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright )
|
.. ocv:function:: Mat& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright )
|
||||||
@ -1417,7 +1417,7 @@ The function is used internally by the OpenCV filtering functions, like
|
|||||||
|
|
||||||
|
|
||||||
Mat::operator()
|
Mat::operator()
|
||||||
-------------------
|
---------------
|
||||||
Extracts a rectangular submatrix.
|
Extracts a rectangular submatrix.
|
||||||
|
|
||||||
.. ocv:function:: Mat Mat::operator()( Range rowRange, Range colRange ) const
|
.. ocv:function:: Mat Mat::operator()( Range rowRange, Range colRange ) const
|
||||||
@ -1955,202 +1955,6 @@ SparseMat
|
|||||||
---------
|
---------
|
||||||
.. ocv:class:: SparseMat
|
.. ocv:class:: SparseMat
|
||||||
|
|
||||||
Sparse n-dimensional array. ::
|
|
||||||
|
|
||||||
class SparseMat
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef SparseMatIterator iterator;
|
|
||||||
typedef SparseMatConstIterator const_iterator;
|
|
||||||
|
|
||||||
// internal structure - sparse matrix header
|
|
||||||
struct Hdr
|
|
||||||
{
|
|
||||||
...
|
|
||||||
};
|
|
||||||
|
|
||||||
// sparse matrix node - element of a hash table
|
|
||||||
struct Node
|
|
||||||
{
|
|
||||||
size_t hashval;
|
|
||||||
size_t next;
|
|
||||||
int idx[CV_MAX_DIM];
|
|
||||||
};
|
|
||||||
|
|
||||||
////////// constructors and destructor //////////
|
|
||||||
// default constructor
|
|
||||||
SparseMat();
|
|
||||||
// creates matrix of the specified size and type
|
|
||||||
SparseMat(int dims, const int* _sizes, int _type);
|
|
||||||
// copy constructor
|
|
||||||
SparseMat(const SparseMat& m);
|
|
||||||
// converts dense array to the sparse form,
|
|
||||||
// if try1d is true and matrix is a single-column matrix (Nx1),
|
|
||||||
// then the sparse matrix will be 1-dimensional.
|
|
||||||
SparseMat(const Mat& m, bool try1d=false);
|
|
||||||
// converts an old-style sparse matrix to the new style.
|
|
||||||
// all the data is copied so that "m" can be safely
|
|
||||||
// deleted after the conversion
|
|
||||||
SparseMat(const CvSparseMat* m);
|
|
||||||
// destructor
|
|
||||||
~SparseMat();
|
|
||||||
|
|
||||||
///////// assignment operations ///////////
|
|
||||||
|
|
||||||
// this is an O(1) operation; no data is copied
|
|
||||||
SparseMat& operator = (const SparseMat& m);
|
|
||||||
// (equivalent to the corresponding constructor with try1d=false)
|
|
||||||
SparseMat& operator = (const Mat& m);
|
|
||||||
|
|
||||||
// creates a full copy of the matrix
|
|
||||||
SparseMat clone() const;
|
|
||||||
|
|
||||||
// copy all the data to the destination matrix.
|
|
||||||
// the destination will be reallocated if needed.
|
|
||||||
void copyTo( SparseMat& m ) const;
|
|
||||||
// converts 1D or 2D sparse matrix to dense 2D matrix.
|
|
||||||
// If the sparse matrix is 1D, the result will
|
|
||||||
// be a single-column matrix.
|
|
||||||
void copyTo( Mat& m ) const;
|
|
||||||
// converts arbitrary sparse matrix to dense matrix.
|
|
||||||
// multiplies all the matrix elements by the specified scalar
|
|
||||||
void convertTo( SparseMat& m, int rtype, double alpha=1 ) const;
|
|
||||||
// converts sparse matrix to dense matrix with optional type conversion and scaling.
|
|
||||||
// When rtype=-1, the destination element type will be the same
|
|
||||||
// as the sparse matrix element type.
|
|
||||||
// Otherwise, rtype will specify the depth and
|
|
||||||
// the number of channels will remain the same as in the sparse matrix
|
|
||||||
void convertTo( Mat& m, int rtype, double alpha=1, double beta=0 ) const;
|
|
||||||
|
|
||||||
// not used now
|
|
||||||
void assignTo( SparseMat& m, int type=-1 ) const;
|
|
||||||
|
|
||||||
// reallocates sparse matrix. If it was already of the proper size and type,
|
|
||||||
// it is simply cleared with clear(), otherwise,
|
|
||||||
// the old matrix is released (using release()) and the new one is allocated.
|
|
||||||
void create(int dims, const int* _sizes, int _type);
|
|
||||||
// sets all the matrix elements to 0, which means clearing the hash table.
|
|
||||||
void clear();
|
|
||||||
// manually increases reference counter to the header.
|
|
||||||
void addref();
|
|
||||||
// decreses the header reference counter when it reaches 0.
|
|
||||||
// the header and all the underlying data are deallocated.
|
|
||||||
void release();
|
|
||||||
|
|
||||||
// converts sparse matrix to the old-style representation.
|
|
||||||
// all the elements are copied.
|
|
||||||
operator CvSparseMat*() const;
|
|
||||||
// size of each element in bytes
|
|
||||||
// (the matrix nodes will be bigger because of
|
|
||||||
// element indices and other SparseMat::Node elements).
|
|
||||||
size_t elemSize() const;
|
|
||||||
// elemSize()/channels()
|
|
||||||
size_t elemSize1() const;
|
|
||||||
|
|
||||||
// the same is in Mat
|
|
||||||
int type() const;
|
|
||||||
int depth() const;
|
|
||||||
int channels() const;
|
|
||||||
|
|
||||||
// returns the array of sizes and 0 if the matrix is not allocated
|
|
||||||
const int* size() const;
|
|
||||||
// returns i-th size (or 0)
|
|
||||||
int size(int i) const;
|
|
||||||
// returns the matrix dimensionality
|
|
||||||
int dims() const;
|
|
||||||
// returns the number of non-zero elements
|
|
||||||
size_t nzcount() const;
|
|
||||||
|
|
||||||
// compute element hash value from the element indices:
|
|
||||||
// 1D case
|
|
||||||
size_t hash(int i0) const;
|
|
||||||
// 2D case
|
|
||||||
size_t hash(int i0, int i1) const;
|
|
||||||
// 3D case
|
|
||||||
size_t hash(int i0, int i1, int i2) const;
|
|
||||||
// n-D case
|
|
||||||
size_t hash(const int* idx) const;
|
|
||||||
|
|
||||||
// low-level element-access functions,
|
|
||||||
// special variants for 1D, 2D, 3D cases, and the generic one for n-D case.
|
|
||||||
//
|
|
||||||
// return pointer to the matrix element.
|
|
||||||
// if the element is there (it is non-zero), the pointer to it is returned
|
|
||||||
// if it is not there and createMissing=false, NULL pointer is returned
|
|
||||||
// if it is not there and createMissing=true, the new element
|
|
||||||
// is created and initialized with 0. Pointer to it is returned.
|
|
||||||
// If the optional hashval pointer is not NULL, the element hash value is
|
|
||||||
// not computed but *hashval is taken instead.
|
|
||||||
uchar* ptr(int i0, bool createMissing, size_t* hashval=0);
|
|
||||||
uchar* ptr(int i0, int i1, bool createMissing, size_t* hashval=0);
|
|
||||||
uchar* ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval=0);
|
|
||||||
uchar* ptr(const int* idx, bool createMissing, size_t* hashval=0);
|
|
||||||
|
|
||||||
// higher-level element access functions:
|
|
||||||
// ref<_Tp>(i0,...[,hashval]) - equivalent to *(_Tp*)ptr(i0,...true[,hashval]).
|
|
||||||
// always return valid reference to the element.
|
|
||||||
// If it does not exist, it is created.
|
|
||||||
// find<_Tp>(i0,...[,hashval]) - equivalent to (_const Tp*)ptr(i0,...false[,hashval]).
|
|
||||||
// return pointer to the element or NULL pointer if the element is not there.
|
|
||||||
// value<_Tp>(i0,...[,hashval]) - equivalent to
|
|
||||||
// { const _Tp* p = find<_Tp>(i0,...[,hashval]); return p ? *p : _Tp(); }
|
|
||||||
// that is, 0 is returned when the element is not there.
|
|
||||||
// note that _Tp must match the actual matrix type -
|
|
||||||
// the functions do not do any on-fly type conversion
|
|
||||||
|
|
||||||
// 1D case
|
|
||||||
template<typename _Tp> _Tp& ref(int i0, size_t* hashval=0);
|
|
||||||
template<typename _Tp> _Tp value(int i0, size_t* hashval=0) const;
|
|
||||||
template<typename _Tp> const _Tp* find(int i0, size_t* hashval=0) const;
|
|
||||||
|
|
||||||
// 2D case
|
|
||||||
template<typename _Tp> _Tp& ref(int i0, int i1, size_t* hashval=0);
|
|
||||||
template<typename _Tp> _Tp value(int i0, int i1, size_t* hashval=0) const;
|
|
||||||
template<typename _Tp> const _Tp* find(int i0, int i1, size_t* hashval=0) const;
|
|
||||||
|
|
||||||
// 3D case
|
|
||||||
template<typename _Tp> _Tp& ref(int i0, int i1, int i2, size_t* hashval=0);
|
|
||||||
template<typename _Tp> _Tp value(int i0, int i1, int i2, size_t* hashval=0) const;
|
|
||||||
template<typename _Tp> const _Tp* find(int i0, int i1, int i2, size_t* hashval=0) const;
|
|
||||||
|
|
||||||
// n-D case
|
|
||||||
template<typename _Tp> _Tp& ref(const int* idx, size_t* hashval=0);
|
|
||||||
template<typename _Tp> _Tp value(const int* idx, size_t* hashval=0) const;
|
|
||||||
template<typename _Tp> const _Tp* find(const int* idx, size_t* hashval=0) const;
|
|
||||||
|
|
||||||
// erase the specified matrix element.
|
|
||||||
// when there is no such an element, the methods do nothing
|
|
||||||
void erase(int i0, int i1, size_t* hashval=0);
|
|
||||||
void erase(int i0, int i1, int i2, size_t* hashval=0);
|
|
||||||
void erase(const int* idx, size_t* hashval=0);
|
|
||||||
|
|
||||||
// return the matrix iterators,
|
|
||||||
// pointing to the first sparse matrix element,
|
|
||||||
SparseMatIterator begin();
|
|
||||||
SparseMatConstIterator begin() const;
|
|
||||||
// ... or to the point after the last sparse matrix element
|
|
||||||
SparseMatIterator end();
|
|
||||||
SparseMatConstIterator end() const;
|
|
||||||
|
|
||||||
// and the template forms of the above methods.
|
|
||||||
// _Tp must match the actual matrix type.
|
|
||||||
template<typename _Tp> SparseMatIterator_<_Tp> begin();
|
|
||||||
template<typename _Tp> SparseMatConstIterator_<_Tp> begin() const;
|
|
||||||
template<typename _Tp> SparseMatIterator_<_Tp> end();
|
|
||||||
template<typename _Tp> SparseMatConstIterator_<_Tp> end() const;
|
|
||||||
|
|
||||||
// return value stored in the sparse martix node
|
|
||||||
template<typename _Tp> _Tp& value(Node* n);
|
|
||||||
template<typename _Tp> const _Tp& value(const Node* n) const;
|
|
||||||
|
|
||||||
////////////// some internally used methods ///////////////
|
|
||||||
...
|
|
||||||
|
|
||||||
// pointer to the sparse matrix header
|
|
||||||
Hdr* hdr;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Such a sparse array can store elements of any type that
|
The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Such a sparse array can store elements of any type that
|
||||||
:ocv:class:`Mat` can store. *Sparse* means that only non-zero elements are stored (though, as a result of operations on a sparse matrix, some of its stored elements can actually become 0. It is up to you to detect such elements and delete them using ``SparseMat::erase`` ). The non-zero elements are stored in a hash table that grows when it is filled so that the search time is O(1) in average (regardless of whether element is there or not). Elements can be accessed using the following methods:
|
:ocv:class:`Mat` can store. *Sparse* means that only non-zero elements are stored (though, as a result of operations on a sparse matrix, some of its stored elements can actually become 0. It is up to you to detect such elements and delete them using ``SparseMat::erase`` ). The non-zero elements are stored in a hash table that grows when it is filled so that the search time is O(1) in average (regardless of whether element is there or not). Elements can be accessed using the following methods:
|
||||||
|
|
||||||
@ -2231,6 +2035,204 @@ The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Su
|
|||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
SparseMat::SparseMat
|
||||||
|
--------------------
|
||||||
|
Various SparseMat constructors.
|
||||||
|
|
||||||
|
.. ocv:function:: SparseMat::SparseMat()
|
||||||
|
.. ocv:function:: SparseMat::SparseMat(int dims, const int* _sizes, int _type)
|
||||||
|
.. ocv:function:: SparseMat::SparseMat(const SparseMat& m)
|
||||||
|
.. ocv:function:: SparseMat::SparseMat(const Mat& m, bool try1d=false)
|
||||||
|
.. ocv:function:: SparseMat::SparseMat(const CvSparseMat* m)
|
||||||
|
|
||||||
|
:param m: Source matrix for copy constructor. If m is dense matrix (ocv:class:`Mat`) then it will be converted to sparse representation.
|
||||||
|
:param dims: Array dimensionality.
|
||||||
|
:param _sizes: Sparce matrix size on all dementions.
|
||||||
|
:param _type: Sparse matrix data type.
|
||||||
|
:param try1d: if try1d is true and matrix is a single-column matrix (Nx1), then the sparse matrix will be 1-dimensional.
|
||||||
|
|
||||||
|
SparseMat::~SparseMat
|
||||||
|
---------------------
|
||||||
|
SparseMat object destructor.
|
||||||
|
|
||||||
|
.. ocv:function:: SparseMat::~SparseMat()
|
||||||
|
|
||||||
|
SparseMat::operator =
|
||||||
|
---------------------
|
||||||
|
Provides sparse matrix assignment operators.
|
||||||
|
|
||||||
|
.. ocv:function:: SparseMat& SparseMat::operator=(const SparseMat& m)
|
||||||
|
.. ocv:function:: SparseMat& SparseMat::operator=(const Mat& m)
|
||||||
|
|
||||||
|
The last variant is equivalent to the corresponding constructor with try1d=false.
|
||||||
|
|
||||||
|
|
||||||
|
SparseMat::clone
|
||||||
|
----------------
|
||||||
|
Creates a full copy of the matrix.
|
||||||
|
|
||||||
|
.. ocv:function:: SparseMat SparseMat::clone() const
|
||||||
|
|
||||||
|
SparseMat::copyTo
|
||||||
|
-----------------
|
||||||
|
Copy all the data to the destination matrix.The destination will be reallocated if needed.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::copyTo( SparseMat& m ) const
|
||||||
|
.. ocv:function:: void SparseMat::copyTo( Mat& m ) const
|
||||||
|
|
||||||
|
:param m: Target for copiing.
|
||||||
|
|
||||||
|
The last variant converts 1D or 2D sparse matrix to dense 2D matrix. If the sparse matrix is 1D, the result will be a single-column matrix.
|
||||||
|
|
||||||
|
SparceMat::convertTo
|
||||||
|
--------------------
|
||||||
|
Convert sparse matrix with possible type change and scaling.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::convertTo( SparseMat& m, int rtype, double alpha=1 ) const
|
||||||
|
.. ocv:function:: void SparseMat::convertTo( Mat& m, int rtype, double alpha=1, double beta=0 ) const
|
||||||
|
|
||||||
|
The first version converts arbitrary sparse matrix to dense matrix and multiplies all the matrix elements by the specified scalar.
|
||||||
|
The second versiob converts sparse matrix to dense matrix with optional type conversion and scaling.
|
||||||
|
When rtype=-1, the destination element type will be the same as the sparse matrix element type.
|
||||||
|
Otherwise, rtype will specify the depth and the number of channels will remain the same as in the sparse matrix.
|
||||||
|
|
||||||
|
SparseMat:create
|
||||||
|
----------------
|
||||||
|
Reallocates sparse matrix. If it was already of the proper size and type, it is simply cleared with clear(), otherwise,
|
||||||
|
the old matrix is released (using release()) and the new one is allocated.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::create(int dims, const int* _sizes, int _type)
|
||||||
|
|
||||||
|
:param dims: Array dimensionality.
|
||||||
|
:param _sizes: Sparce matrix size on all dementions.
|
||||||
|
:param _type: Sparse matrix data type.
|
||||||
|
|
||||||
|
SparseMat::clear
|
||||||
|
----------------
|
||||||
|
Sets all the matrix elements to 0, which means clearing the hash table.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::clear()
|
||||||
|
|
||||||
|
SparseMat::addref
|
||||||
|
-----------------
|
||||||
|
Manually increases reference counter to the header.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::addref()
|
||||||
|
|
||||||
|
SparseMat::release
|
||||||
|
------------------
|
||||||
|
Decreses the header reference counter when it reaches 0. The header and all the underlying data are deallocated.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::release()
|
||||||
|
|
||||||
|
SparseMat::CvSparseMat *
|
||||||
|
------------------------
|
||||||
|
Converts sparse matrix to the old-style representation. All the elements are copied.
|
||||||
|
|
||||||
|
.. ocv:function:: SparseMat::operator CvSparseMat*() const
|
||||||
|
|
||||||
|
SparseMat::elemSize
|
||||||
|
-------------------
|
||||||
|
Size of each element in bytes (the matrix nodes will be bigger because of element indices and other SparseMat::Node elements).
|
||||||
|
|
||||||
|
.. ocv:function:: size_t SparseMat::elemSize() const
|
||||||
|
|
||||||
|
SparseMat::elemSize1
|
||||||
|
--------------------
|
||||||
|
elemSize()/channels().
|
||||||
|
|
||||||
|
.. ocv:function:: size_t SparseMat::elemSize() const
|
||||||
|
|
||||||
|
SparseMat::type
|
||||||
|
---------------
|
||||||
|
Returns the type of a matrix element.
|
||||||
|
|
||||||
|
.. ocv:function:: int SparseMat::type() const
|
||||||
|
|
||||||
|
The method returns a sparse matrix element type. This is an identifier compatible with the ``CvMat`` type system, like ``CV_16SC3`` or 16-bit signed 3-channel array, and so on.
|
||||||
|
|
||||||
|
SparseMat::depth
|
||||||
|
----------------
|
||||||
|
Returns the depth of a sparse matrix element.
|
||||||
|
|
||||||
|
.. ocv:function:: int SparseMat::depth() const
|
||||||
|
|
||||||
|
The method returns the identifier of the matrix element depth (the type of each individual channel). For example, for a 16-bit signed 3-channel array, the method returns ``CV_16S``
|
||||||
|
|
||||||
|
* ``CV_8U`` - 8-bit unsigned integers ( ``0..255`` )
|
||||||
|
|
||||||
|
* ``CV_8S`` - 8-bit signed integers ( ``-128..127`` )
|
||||||
|
|
||||||
|
* ``CV_16U`` - 16-bit unsigned integers ( ``0..65535`` )
|
||||||
|
|
||||||
|
* ``CV_16S`` - 16-bit signed integers ( ``-32768..32767`` )
|
||||||
|
|
||||||
|
* ``CV_32S`` - 32-bit signed integers ( ``-2147483648..2147483647`` )
|
||||||
|
|
||||||
|
* ``CV_32F`` - 32-bit floating-point numbers ( ``-FLT_MAX..FLT_MAX, INF, NAN`` )
|
||||||
|
|
||||||
|
* ``CV_64F`` - 64-bit floating-point numbers ( ``-DBL_MAX..DBL_MAX, INF, NAN`` )
|
||||||
|
|
||||||
|
SparseMat::channels
|
||||||
|
-------------------
|
||||||
|
Returns the number of matrix channels.
|
||||||
|
|
||||||
|
.. ocv:function:: int SparseMat::channels() const
|
||||||
|
|
||||||
|
The method returns the number of matrix channels.
|
||||||
|
|
||||||
|
SparseMat::size
|
||||||
|
---------------
|
||||||
|
Returns the array of sizes or matrix size by i dimention and 0 if the matrix is not allocated.
|
||||||
|
|
||||||
|
.. ocv:function:: const int* SparseMat::size() const
|
||||||
|
.. ocv:function:: int SparseMat::size(int i) const
|
||||||
|
|
||||||
|
:param i: Dimention index.
|
||||||
|
|
||||||
|
SparseMat::dims
|
||||||
|
---------------
|
||||||
|
Returns the matrix dimensionality.
|
||||||
|
|
||||||
|
.. ocv:function:: int SparseMat::dims() const
|
||||||
|
|
||||||
|
SparseMat::nzcount
|
||||||
|
------------------
|
||||||
|
Returns the number of non-zero elements.
|
||||||
|
|
||||||
|
.. ocv:function:: size_t SparseMat::nzcount() const
|
||||||
|
|
||||||
|
SparseMat::hash
|
||||||
|
---------------
|
||||||
|
Compute element hash value from the element indices.
|
||||||
|
|
||||||
|
.. ocv:function:: size_t SparseMat::hash(int i0) const
|
||||||
|
.. ocv:function:: size_t SparseMat::hash(int i0, int i1) const
|
||||||
|
.. ocv:function:: size_t SparseMat::hash(int i0, int i1, int i2) const
|
||||||
|
.. ocv:function:: size_t SparseMat::hash(const int* idx) const
|
||||||
|
|
||||||
|
SparseMat::ptr
|
||||||
|
--------------
|
||||||
|
Low-level element-access functions, special variants for 1D, 2D, 3D cases, and the generic one for n-D case.
|
||||||
|
|
||||||
|
.. ocv:function:: uchar* SparseMat::ptr(int i0, bool createMissing, size_t* hashval=0)
|
||||||
|
.. ocv:function:: uchar* SparseMat::ptr(int i0, int i1, bool createMissing, size_t* hashval=0)
|
||||||
|
.. ocv:function:: uchar* SparseMat::ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval=0)
|
||||||
|
.. ocv:function:: uchar* SparseMat::ptr(const int* idx, bool createMissing, size_t* hashval=0)
|
||||||
|
|
||||||
|
Return pointer to the matrix element. If the element is there (it is non-zero), the pointer to it is returned.
|
||||||
|
If it is not there and ``createMissing=false``, NULL pointer is returned. If it is not there and ``createMissing=true``,
|
||||||
|
the new elementis created and initialized with 0. Pointer to it is returned. If the optional hashval pointer is not ``NULL``,
|
||||||
|
the element hash value is not computed but ``hashval`` is taken instead.
|
||||||
|
|
||||||
|
SparseMat::erase
|
||||||
|
----------------
|
||||||
|
Erase the specified matrix element. When there is no such an element, the methods do nothing.
|
||||||
|
|
||||||
|
.. ocv:function:: void SparseMat::erase(int i0, int i1, size_t* hashval=0)
|
||||||
|
.. ocv:function:: void SparseMat::erase(int i0, int i1, int i2, size_t* hashval=0)
|
||||||
|
.. ocv:function:: void SparseMat::erase(const int* idx, size_t* hashval=0)
|
||||||
|
|
||||||
SparseMat\_
|
SparseMat\_
|
||||||
-----------
|
-----------
|
||||||
.. ocv:class:: SparseMat_
|
.. ocv:class:: SparseMat_
|
||||||
@ -2286,7 +2288,7 @@ Template sparse n-dimensional array class derived from
|
|||||||
SparseMatConstIterator_<_Tp> end() const;
|
SparseMatConstIterator_<_Tp> end() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
``SparseMat_`` is a thin wrapper on top of :ocv:class:`SparseMat` created in the same way as ``Mat_`` .
|
``SparseMat_`` is a thin wrapper on top of :ocv:class:`SparseMat` created in the same way as ``Mat_`` .
|
||||||
It simplifies notation of some operations. ::
|
It simplifies notation of some operations. ::
|
||||||
|
|
||||||
int sz[] = {10, 20, 30};
|
int sz[] = {10, 20, 30};
|
||||||
@ -2340,6 +2342,11 @@ Here is example of SIFT use in your application via Algorithm interface: ::
|
|||||||
vector<KeyPoint> keypoints;
|
vector<KeyPoint> keypoints;
|
||||||
(*sift)(image, noArray(), keypoints, descriptors);
|
(*sift)(image, noArray(), keypoints, descriptors);
|
||||||
|
|
||||||
|
Algorithm::name
|
||||||
|
---------------
|
||||||
|
Returns the algorithm name
|
||||||
|
|
||||||
|
.. ocv:function:: string Algorithm::name() const
|
||||||
|
|
||||||
Algorithm::get
|
Algorithm::get
|
||||||
--------------
|
--------------
|
||||||
|
@ -166,6 +166,12 @@ field of the set is the total number of nodes both occupied and free. When an oc
|
|||||||
|
|
||||||
``CvSet`` is used to represent graphs (:ocv:struct:`CvGraph`), sparse multi-dimensional arrays (:ocv:struct:`CvSparseMat`), and planar subdivisions (:ocv:struct:`CvSubdiv2D`).
|
``CvSet`` is used to represent graphs (:ocv:struct:`CvGraph`), sparse multi-dimensional arrays (:ocv:struct:`CvSparseMat`), and planar subdivisions (:ocv:struct:`CvSubdiv2D`).
|
||||||
|
|
||||||
|
CvSetElem
|
||||||
|
---------
|
||||||
|
|
||||||
|
.. ocv:struct:: CvSetElem
|
||||||
|
|
||||||
|
The structure is represent single element of :ocv:struct:`CvSet`. It consists of two fields: element data pointer and flags.
|
||||||
|
|
||||||
CvGraph
|
CvGraph
|
||||||
-------
|
-------
|
||||||
@ -174,6 +180,24 @@ CvGraph
|
|||||||
The structure ``CvGraph`` is a base for graphs used in OpenCV 1.x. It inherits from
|
The structure ``CvGraph`` is a base for graphs used in OpenCV 1.x. It inherits from
|
||||||
:ocv:struct:`CvSet`, that is, it is considered as a set of vertices. Besides, it contains another set as a member, a set of graph edges. Graphs in OpenCV are represented using adjacency lists format.
|
:ocv:struct:`CvSet`, that is, it is considered as a set of vertices. Besides, it contains another set as a member, a set of graph edges. Graphs in OpenCV are represented using adjacency lists format.
|
||||||
|
|
||||||
|
CvGraphVtx
|
||||||
|
----------
|
||||||
|
.. ocv:struct:: CvGraphVtx
|
||||||
|
|
||||||
|
The structure represents single vertex in :ocv:struct:`CvGraph`. It consists of two filds: pointer to first edge and flags.
|
||||||
|
|
||||||
|
CvGraphEdge
|
||||||
|
-----------
|
||||||
|
.. ocv:struct:: CvGraphEdge
|
||||||
|
|
||||||
|
The structure represents edge in :ocv:struct:`CvGraph`. Each edge consists of:
|
||||||
|
|
||||||
|
- Two pointers to the starting and ending vertices (vtx[0] and vtx[1] respectively);
|
||||||
|
- Two pointers to next edges for the starting and ending vertices, where
|
||||||
|
next[0] points to the next edge in the vtx[0] adjacency list and
|
||||||
|
next[1] points to the next edge in the vtx[1] adjacency list;
|
||||||
|
- Weight;
|
||||||
|
- Flags.
|
||||||
|
|
||||||
CvGraphScanner
|
CvGraphScanner
|
||||||
--------------
|
--------------
|
||||||
|
@ -3243,7 +3243,7 @@ The constructors.
|
|||||||
|
|
||||||
* **SVD::NO_UV** indicates that only a vector of singular values ``w`` is to be processed, while ``u`` and ``vt`` will be set to empty matrices.
|
* **SVD::NO_UV** indicates that only a vector of singular values ``w`` is to be processed, while ``u`` and ``vt`` will be set to empty matrices.
|
||||||
|
|
||||||
* **SVD::FULL_UV** when the matrix is not square, by default the algorithm produces ``u`` and ``vt`` matrices of sufficiently large size for the further ``A`` reconstruction; if, however, ``FULL_UV`` flag is specified, ``u`` and ``vt``will be full-size square orthogonal matrices.
|
* **SVD::FULL_UV** when the matrix is not square, by default the algorithm produces ``u`` and ``vt`` matrices of sufficiently large size for the further ``A`` reconstruction; if, however, ``FULL_UV`` flag is specified, ``u`` and ``vt`` will be full-size square orthogonal matrices.
|
||||||
|
|
||||||
The first constructor initializes an empty ``SVD`` structure. The second constructor initializes an empty ``SVD`` structure and then calls
|
The first constructor initializes an empty ``SVD`` structure. The second constructor initializes an empty ``SVD`` structure and then calls
|
||||||
:ocv:funcx:`SVD::operator()` .
|
:ocv:funcx:`SVD::operator()` .
|
||||||
|
@ -41,7 +41,7 @@ Abstract base class for computing descriptors for image keypoints. ::
|
|||||||
|
|
||||||
|
|
||||||
In this interface, a keypoint descriptor can be represented as a
|
In this interface, a keypoint descriptor can be represented as a
|
||||||
dense, fixed-dimension vector of a basic type. Most descriptors
|
dense, fixed-dimension vector of a basic type. Most descriptors
|
||||||
follow this pattern as it simplifies computing
|
follow this pattern as it simplifies computing
|
||||||
distances between descriptors. Therefore, a collection of
|
distances between descriptors. Therefore, a collection of
|
||||||
descriptors is represented as
|
descriptors is represented as
|
||||||
|
@ -113,7 +113,7 @@ Detects keypoints in an image (first variant) or image set (second variant).
|
|||||||
:param masks: Masks for each input image specifying where to look for keypoints (optional). ``masks[i]`` is a mask for ``images[i]``.
|
:param masks: Masks for each input image specifying where to look for keypoints (optional). ``masks[i]`` is a mask for ``images[i]``.
|
||||||
|
|
||||||
FeatureDetector::create
|
FeatureDetector::create
|
||||||
---------------------------
|
-----------------------
|
||||||
Creates a feature detector by its name.
|
Creates a feature detector by its name.
|
||||||
|
|
||||||
.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const string& detectorType )
|
.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const string& detectorType )
|
||||||
@ -219,8 +219,7 @@ StarFeatureDetector
|
|||||||
-------------------
|
-------------------
|
||||||
.. ocv:class:: StarFeatureDetector : public FeatureDetector
|
.. ocv:class:: StarFeatureDetector : public FeatureDetector
|
||||||
|
|
||||||
Wrapping class for feature detection using the
|
The class implements the keypoint detector introduced by K. Konolige, synonym of ``StarDetector``. ::
|
||||||
:ocv:class:`StarDetector` class. ::
|
|
||||||
|
|
||||||
class StarFeatureDetector : public FeatureDetector
|
class StarFeatureDetector : public FeatureDetector
|
||||||
{
|
{
|
||||||
@ -412,7 +411,7 @@ Example of creating ``DynamicAdaptedFeatureDetector`` : ::
|
|||||||
|
|
||||||
|
|
||||||
DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
|
DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
|
||||||
----------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
The constructor
|
The constructor
|
||||||
|
|
||||||
.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 )
|
.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 )
|
||||||
@ -484,7 +483,7 @@ Example: ::
|
|||||||
|
|
||||||
|
|
||||||
AdjusterAdapter::good
|
AdjusterAdapter::good
|
||||||
-------------------------
|
---------------------
|
||||||
Returns false if the detector parameters cannot be adjusted any more.
|
Returns false if the detector parameters cannot be adjusted any more.
|
||||||
|
|
||||||
.. ocv:function:: bool AdjusterAdapter::good() const
|
.. ocv:function:: bool AdjusterAdapter::good() const
|
||||||
@ -497,7 +496,7 @@ Example: ::
|
|||||||
}
|
}
|
||||||
|
|
||||||
AdjusterAdapter::create
|
AdjusterAdapter::create
|
||||||
-------------------------
|
-----------------------
|
||||||
Creates an adjuster adapter by name
|
Creates an adjuster adapter by name
|
||||||
|
|
||||||
.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const string& detectorType )
|
.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const string& detectorType )
|
||||||
@ -528,3 +527,23 @@ StarAdjuster
|
|||||||
StarAdjuster(double initial_thresh = 30.0);
|
StarAdjuster(double initial_thresh = 30.0);
|
||||||
...
|
...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SurfAdjuster
|
||||||
|
------------
|
||||||
|
.. ocv:class:: SurfAdjuster: public AdjusterAdapter
|
||||||
|
|
||||||
|
:ocv:class:`AdjusterAdapter` for ``SurfFeatureDetector``. ::
|
||||||
|
|
||||||
|
class CV_EXPORTS SurfAdjuster: public AdjusterAdapter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SurfAdjuster( double initial_thresh=400.f, double min_thresh=2, double max_thresh=1000 );
|
||||||
|
|
||||||
|
virtual void tooFew(int minv, int n_detected);
|
||||||
|
virtual void tooMany(int maxv, int n_detected);
|
||||||
|
virtual bool good() const;
|
||||||
|
|
||||||
|
virtual Ptr<AdjusterAdapter> clone() const;
|
||||||
|
|
||||||
|
...
|
||||||
|
};
|
||||||
|
@ -10,11 +10,11 @@ Clusters features using hierarchical k-means algorithm.
|
|||||||
.. ocv:function:: template<typename Distance> int flann::hierarchicalClustering(const Mat& features, Mat& centers, const cvflann::KMeansIndexParams& params, Distance d = Distance())
|
.. ocv:function:: template<typename Distance> int flann::hierarchicalClustering(const Mat& features, Mat& centers, const cvflann::KMeansIndexParams& params, Distance d = Distance())
|
||||||
|
|
||||||
:param features: The points to be clustered. The matrix must have elements of type ``Distance::ElementType``.
|
:param features: The points to be clustered. The matrix must have elements of type ``Distance::ElementType``.
|
||||||
|
|
||||||
:param centers: The centers of the clusters obtained. The matrix must have type ``Distance::ResultType``. The number of rows in this matrix represents the number of clusters desired, however, because of the way the cut in the hierarchical tree is chosen, the number of clusters computed will be the highest number of the form ``(branching-1)*k+1`` that's lower than the number of clusters desired, where ``branching`` is the tree's branching factor (see description of the KMeansIndexParams).
|
:param centers: The centers of the clusters obtained. The matrix must have type ``Distance::ResultType``. The number of rows in this matrix represents the number of clusters desired, however, because of the way the cut in the hierarchical tree is chosen, the number of clusters computed will be the highest number of the form ``(branching-1)*k+1`` that's lower than the number of clusters desired, where ``branching`` is the tree's branching factor (see description of the KMeansIndexParams).
|
||||||
|
|
||||||
:param params: Parameters used in the construction of the hierarchical k-means tree.
|
:param params: Parameters used in the construction of the hierarchical k-means tree.
|
||||||
|
|
||||||
:param d: Distance to be used for clustering.
|
:param d: Distance to be used for clustering.
|
||||||
|
|
||||||
The method clusters the given feature vectors by constructing a hierarchical k-means tree and choosing a cut in the tree that minimizes the cluster's variance. It returns the number of clusters found.
|
The method clusters the given feature vectors by constructing a hierarchical k-means tree and choosing a cut in the tree that minimizes the cluster's variance. It returns the number of clusters found.
|
||||||
|
@ -6,6 +6,7 @@ Fast Approximate Nearest Neighbor Search
|
|||||||
|
|
||||||
This section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate Nearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest neighbor search in large datasets and for high dimensional features. More information about FLANN can be found in [Muja2009]_ .
|
This section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate Nearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest neighbor search in large datasets and for high dimensional features. More information about FLANN can be found in [Muja2009]_ .
|
||||||
|
|
||||||
|
.. [Muja2009] Marius Muja, David G. Lowe. Fast Approximate Nearest Neighbors with Automatic Algorithm Configuration, 2009
|
||||||
|
|
||||||
flann::Index\_
|
flann::Index\_
|
||||||
-----------------
|
-----------------
|
||||||
@ -20,40 +21,40 @@ flann::Index_<T>::Index\_
|
|||||||
Constructs a nearest neighbor search index for a given dataset.
|
Constructs a nearest neighbor search index for a given dataset.
|
||||||
|
|
||||||
.. ocv:function:: flann::Index_<T>::Index_(const Mat& features, const IndexParams& params)
|
.. ocv:function:: flann::Index_<T>::Index_(const Mat& features, const IndexParams& params)
|
||||||
|
|
||||||
:param features: Matrix of containing the features(points) to index. The size of the matrix is ``num_features x feature_dimensionality`` and the data type of the elements in the matrix must coincide with the type of the index.
|
:param features: Matrix of containing the features(points) to index. The size of the matrix is ``num_features x feature_dimensionality`` and the data type of the elements in the matrix must coincide with the type of the index.
|
||||||
|
|
||||||
:param params: Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. See the description.
|
:param params: Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. See the description.
|
||||||
|
|
||||||
The method constructs a fast search structure from a set of features using the specified algorithm with specified parameters, as defined by ``params``. ``params`` is a reference to one of the following class ``IndexParams`` descendants:
|
The method constructs a fast search structure from a set of features using the specified algorithm with specified parameters, as defined by ``params``. ``params`` is a reference to one of the following class ``IndexParams`` descendants:
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
**LinearIndexParams** When passing an object of this type, the index will perform a linear, brute-force search. ::
|
**LinearIndexParams** When passing an object of this type, the index will perform a linear, brute-force search. ::
|
||||||
|
|
||||||
struct LinearIndexParams : public IndexParams
|
struct LinearIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
**KDTreeIndexParams** When passing an object of this type the index constructed will consist of a set of randomized kd-trees which will be searched in parallel. ::
|
**KDTreeIndexParams** When passing an object of this type the index constructed will consist of a set of randomized kd-trees which will be searched in parallel. ::
|
||||||
|
|
||||||
struct KDTreeIndexParams : public IndexParams
|
struct KDTreeIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
KDTreeIndexParams( int trees = 4 );
|
KDTreeIndexParams( int trees = 4 );
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **trees** The number of parallel kd-trees to use. Good values are in the range [1..16]
|
* **trees** The number of parallel kd-trees to use. Good values are in the range [1..16]
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
**KMeansIndexParams** When passing an object of this type the index constructed will be a hierarchical k-means tree. ::
|
**KMeansIndexParams** When passing an object of this type the index constructed will be a hierarchical k-means tree. ::
|
||||||
|
|
||||||
struct KMeansIndexParams : public IndexParams
|
struct KMeansIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
KMeansIndexParams(
|
KMeansIndexParams(
|
||||||
@ -62,20 +63,20 @@ The method constructs a fast search structure from a set of features using the s
|
|||||||
flann_centers_init_t centers_init = CENTERS_RANDOM,
|
flann_centers_init_t centers_init = CENTERS_RANDOM,
|
||||||
float cb_index = 0.2 );
|
float cb_index = 0.2 );
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **branching** The branching factor to use for the hierarchical k-means tree
|
* **branching** The branching factor to use for the hierarchical k-means tree
|
||||||
|
|
||||||
* **iterations** The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence
|
* **iterations** The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence
|
||||||
|
|
||||||
* **centers_init** The algorithm to use for selecting the initial centers when performing a k-means clustering step. The possible values are ``CENTERS_RANDOM`` (picks the initial cluster centers randomly), ``CENTERS_GONZALES`` (picks the initial centers using Gonzales' algorithm) and ``CENTERS_KMEANSPP`` (picks the initial centers using the algorithm suggested in arthur_kmeanspp_2007 )
|
* **centers_init** The algorithm to use for selecting the initial centers when performing a k-means clustering step. The possible values are ``CENTERS_RANDOM`` (picks the initial cluster centers randomly), ``CENTERS_GONZALES`` (picks the initial centers using Gonzales' algorithm) and ``CENTERS_KMEANSPP`` (picks the initial centers using the algorithm suggested in arthur_kmeanspp_2007 )
|
||||||
|
|
||||||
* **cb_index** This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When ``cb_index`` is zero the next kmeans domain to be explored is chosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain.
|
* **cb_index** This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When ``cb_index`` is zero the next kmeans domain to be explored is chosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain.
|
||||||
|
|
||||||
*
|
*
|
||||||
**CompositeIndexParams** When using a parameters object of this type the index created combines the randomized kd-trees and the hierarchical k-means tree. ::
|
**CompositeIndexParams** When using a parameters object of this type the index created combines the randomized kd-trees and the hierarchical k-means tree. ::
|
||||||
|
|
||||||
struct CompositeIndexParams : public IndexParams
|
struct CompositeIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
CompositeIndexParams(
|
CompositeIndexParams(
|
||||||
@ -88,7 +89,7 @@ The method constructs a fast search structure from a set of features using the s
|
|||||||
|
|
||||||
*
|
*
|
||||||
**LshIndexParams** When using a parameters object of this type the index created uses multi-probe LSH (by ``Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search`` by Qin Lv, William Josephson, Zhe Wang, Moses Charikar, Kai Li., Proceedings of the 33rd International Conference on Very Large Data Bases (VLDB). Vienna, Austria. September 2007) ::
|
**LshIndexParams** When using a parameters object of this type the index created uses multi-probe LSH (by ``Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search`` by Qin Lv, William Josephson, Zhe Wang, Moses Charikar, Kai Li., Proceedings of the 33rd International Conference on Very Large Data Bases (VLDB). Vienna, Austria. September 2007) ::
|
||||||
|
|
||||||
struct LshIndexParams : public IndexParams
|
struct LshIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
LshIndexParams(
|
LshIndexParams(
|
||||||
@ -96,9 +97,9 @@ The method constructs a fast search structure from a set of features using the s
|
|||||||
unsigned int key_size,
|
unsigned int key_size,
|
||||||
unsigned int multi_probe_level );
|
unsigned int multi_probe_level );
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **table_number** the number of hash tables to use (between 10 and 30 usually).
|
* **table_number** the number of hash tables to use (between 10 and 30 usually).
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ The method constructs a fast search structure from a set of features using the s
|
|||||||
|
|
||||||
*
|
*
|
||||||
**AutotunedIndexParams** When passing an object of this type the index created is automatically tuned to offer the best performance, by choosing the optimal index type (randomized kd-trees, hierarchical kmeans, linear) and parameters for the dataset provided. ::
|
**AutotunedIndexParams** When passing an object of this type the index created is automatically tuned to offer the best performance, by choosing the optimal index type (randomized kd-trees, hierarchical kmeans, linear) and parameters for the dataset provided. ::
|
||||||
|
|
||||||
struct AutotunedIndexParams : public IndexParams
|
struct AutotunedIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
AutotunedIndexParams(
|
AutotunedIndexParams(
|
||||||
@ -118,80 +119,80 @@ The method constructs a fast search structure from a set of features using the s
|
|||||||
float memory_weight = 0,
|
float memory_weight = 0,
|
||||||
float sample_fraction = 0.1 );
|
float sample_fraction = 0.1 );
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **target_precision** Is a number between 0 and 1 specifying the percentage of the approximate nearest-neighbor searches that return the exact nearest-neighbor. Using a higher value for this parameter gives more accurate results, but the search takes longer. The optimum value usually depends on the application.
|
* **target_precision** Is a number between 0 and 1 specifying the percentage of the approximate nearest-neighbor searches that return the exact nearest-neighbor. Using a higher value for this parameter gives more accurate results, but the search takes longer. The optimum value usually depends on the application.
|
||||||
|
|
||||||
|
|
||||||
* **build_weight** Specifies the importance of the index build time raported to the nearest-neighbor search time. In some applications it's acceptable for the index build step to take a long time if the subsequent searches in the index can be performed very fast. In other applications it's required that the index be build as fast as possible even if that leads to slightly longer search times.
|
* **build_weight** Specifies the importance of the index build time raported to the nearest-neighbor search time. In some applications it's acceptable for the index build step to take a long time if the subsequent searches in the index can be performed very fast. In other applications it's required that the index be build as fast as possible even if that leads to slightly longer search times.
|
||||||
|
|
||||||
|
|
||||||
* **memory_weight** Is used to specify the tradeoff between time (index build time and search time) and memory used by the index. A value less than 1 gives more importance to the time spent and a value greater than 1 gives more importance to the memory usage.
|
* **memory_weight** Is used to specify the tradeoff between time (index build time and search time) and memory used by the index. A value less than 1 gives more importance to the time spent and a value greater than 1 gives more importance to the memory usage.
|
||||||
|
|
||||||
|
|
||||||
* **sample_fraction** Is a number between 0 and 1 indicating what fraction of the dataset to use in the automatic parameter configuration algorithm. Running the algorithm on the full dataset gives the most accurate results, but for very large datasets can take longer than desired. In such case using just a fraction of the data helps speeding up this algorithm while still giving good approximations of the optimum parameters.
|
* **sample_fraction** Is a number between 0 and 1 indicating what fraction of the dataset to use in the automatic parameter configuration algorithm. Running the algorithm on the full dataset gives the most accurate results, but for very large datasets can take longer than desired. In such case using just a fraction of the data helps speeding up this algorithm while still giving good approximations of the optimum parameters.
|
||||||
|
|
||||||
*
|
*
|
||||||
**SavedIndexParams** This object type is used for loading a previously saved index from the disk. ::
|
**SavedIndexParams** This object type is used for loading a previously saved index from the disk. ::
|
||||||
|
|
||||||
struct SavedIndexParams : public IndexParams
|
struct SavedIndexParams : public IndexParams
|
||||||
{
|
{
|
||||||
SavedIndexParams( std::string filename );
|
SavedIndexParams( std::string filename );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **filename** The filename in which the index was saved.
|
* **filename** The filename in which the index was saved.
|
||||||
|
|
||||||
|
|
||||||
flann::Index_<T>::knnSearch
|
flann::Index_<T>::knnSearch
|
||||||
----------------------------
|
----------------------------
|
||||||
Performs a K-nearest neighbor search for a given query point using the index.
|
Performs a K-nearest neighbor search for a given query point using the index.
|
||||||
|
|
||||||
.. ocv:function:: void flann::Index_<T>::knnSearch(const vector<T>& query, vector<int>& indices, vector<float>& dists, int knn, const SearchParams& params)
|
.. ocv:function:: void flann::Index_<T>::knnSearch(const vector<T>& query, vector<int>& indices, vector<float>& dists, int knn, const SearchParams& params)
|
||||||
|
|
||||||
.. ocv:function:: void flann::Index_<T>::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const SearchParams& params)
|
.. ocv:function:: void flann::Index_<T>::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const SearchParams& params)
|
||||||
|
|
||||||
:param query: The query point
|
:param query: The query point
|
||||||
|
|
||||||
:param indices: Vector that will contain the indices of the K-nearest neighbors found. It must have at least knn size.
|
:param indices: Vector that will contain the indices of the K-nearest neighbors found. It must have at least knn size.
|
||||||
|
|
||||||
:param dists: Vector that will contain the distances to the K-nearest neighbors found. It must have at least knn size.
|
:param dists: Vector that will contain the distances to the K-nearest neighbors found. It must have at least knn size.
|
||||||
|
|
||||||
:param knn: Number of nearest neighbors to search for.
|
:param knn: Number of nearest neighbors to search for.
|
||||||
|
|
||||||
:param params:
|
:param params:
|
||||||
|
|
||||||
Search parameters ::
|
Search parameters ::
|
||||||
|
|
||||||
struct SearchParams {
|
struct SearchParams {
|
||||||
SearchParams(int checks = 32);
|
SearchParams(int checks = 32);
|
||||||
};
|
};
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
* **checks** The number of times the tree(s) in the index should be recursively traversed. A higher value for this parameter would give better search precision, but also take more time. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, in which case this parameter is ignored.
|
* **checks** The number of times the tree(s) in the index should be recursively traversed. A higher value for this parameter would give better search precision, but also take more time. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, in which case this parameter is ignored.
|
||||||
|
|
||||||
|
|
||||||
flann::Index_<T>::radiusSearch
|
flann::Index_<T>::radiusSearch
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
Performs a radius nearest neighbor search for a given query point.
|
Performs a radius nearest neighbor search for a given query point.
|
||||||
|
|
||||||
.. ocv:function:: int flann::Index_<T>::radiusSearch(const vector<T>& query, vector<int>& indices, vector<float>& dists, float radius, const SearchParams& params)
|
.. ocv:function:: int flann::Index_<T>::radiusSearch(const vector<T>& query, vector<int>& indices, vector<float>& dists, float radius, const SearchParams& params)
|
||||||
|
|
||||||
.. ocv:function:: int flann::Index_<T>::radiusSearch(const Mat& query, Mat& indices, Mat& dists, float radius, const SearchParams& params)
|
.. ocv:function:: int flann::Index_<T>::radiusSearch(const Mat& query, Mat& indices, Mat& dists, float radius, const SearchParams& params)
|
||||||
|
|
||||||
:param query: The query point
|
:param query: The query point
|
||||||
|
|
||||||
:param indices: Vector that will contain the indices of the points found within the search radius in decreasing order of the distance to the query point. If the number of neighbors in the search radius is bigger than the size of this vector, the ones that don't fit in the vector are ignored.
|
:param indices: Vector that will contain the indices of the points found within the search radius in decreasing order of the distance to the query point. If the number of neighbors in the search radius is bigger than the size of this vector, the ones that don't fit in the vector are ignored.
|
||||||
|
|
||||||
:param dists: Vector that will contain the distances to the points found within the search radius
|
:param dists: Vector that will contain the distances to the points found within the search radius
|
||||||
|
|
||||||
:param radius: The search radius
|
:param radius: The search radius
|
||||||
|
|
||||||
:param params: Search parameters
|
:param params: Search parameters
|
||||||
|
|
||||||
|
|
||||||
flann::Index_<T>::save
|
flann::Index_<T>::save
|
||||||
@ -199,8 +200,8 @@ flann::Index_<T>::save
|
|||||||
Saves the index to a file.
|
Saves the index to a file.
|
||||||
|
|
||||||
.. ocv:function:: void flann::Index_<T>::save(std::string filename)
|
.. ocv:function:: void flann::Index_<T>::save(std::string filename)
|
||||||
|
|
||||||
:param filename: The file to save the index to
|
:param filename: The file to save the index to
|
||||||
|
|
||||||
|
|
||||||
flann::Index_<T>::getIndexParameters
|
flann::Index_<T>::getIndexParameters
|
||||||
|
@ -6,7 +6,7 @@ Initalization and Information
|
|||||||
|
|
||||||
|
|
||||||
gpu::getCudaEnabledDeviceCount
|
gpu::getCudaEnabledDeviceCount
|
||||||
----------------------------------
|
------------------------------
|
||||||
Returns the number of installed CUDA-enabled devices.
|
Returns the number of installed CUDA-enabled devices.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::getCudaEnabledDeviceCount()
|
.. ocv:function:: int gpu::getCudaEnabledDeviceCount()
|
||||||
@ -16,7 +16,7 @@ Use this function before any other GPU functions calls. If OpenCV is compiled wi
|
|||||||
|
|
||||||
|
|
||||||
gpu::setDevice
|
gpu::setDevice
|
||||||
------------------
|
--------------
|
||||||
Sets a device and initializes it for the current thread.
|
Sets a device and initializes it for the current thread.
|
||||||
|
|
||||||
.. ocv:function:: void gpu::setDevice(int device)
|
.. ocv:function:: void gpu::setDevice(int device)
|
||||||
@ -28,7 +28,7 @@ If the call of this function is omitted, a default device is initialized at the
|
|||||||
|
|
||||||
|
|
||||||
gpu::getDevice
|
gpu::getDevice
|
||||||
------------------
|
--------------
|
||||||
Returns the current device index set by :ocv:func:`gpu::setDevice` or initialized by default.
|
Returns the current device index set by :ocv:func:`gpu::setDevice` or initialized by default.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::getDevice()
|
.. ocv:function:: int gpu::getDevice()
|
||||||
@ -36,7 +36,7 @@ Returns the current device index set by :ocv:func:`gpu::setDevice` or initialize
|
|||||||
|
|
||||||
|
|
||||||
gpu::resetDevice
|
gpu::resetDevice
|
||||||
------------------
|
----------------
|
||||||
Explicitly destroys and cleans up all resources associated with the current device in the current process.
|
Explicitly destroys and cleans up all resources associated with the current device in the current process.
|
||||||
|
|
||||||
.. ocv:function:: void gpu::resetDevice()
|
.. ocv:function:: void gpu::resetDevice()
|
||||||
@ -47,8 +47,7 @@ Any subsequent API call to this device will reinitialize the device.
|
|||||||
|
|
||||||
gpu::FeatureSet
|
gpu::FeatureSet
|
||||||
---------------
|
---------------
|
||||||
|
Enumeration providing GPU computing features. ::
|
||||||
Class providing GPU computing features. ::
|
|
||||||
|
|
||||||
enum FeatureSet
|
enum FeatureSet
|
||||||
{
|
{
|
||||||
@ -64,7 +63,6 @@ Class providing GPU computing features. ::
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gpu::TargetArchs
|
gpu::TargetArchs
|
||||||
----------------
|
----------------
|
||||||
.. ocv:class:: gpu::TargetArchs
|
.. ocv:class:: gpu::TargetArchs
|
||||||
@ -132,7 +130,7 @@ Class providing functionality for querying the specified GPU properties. ::
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::DeviceInfo
|
gpu::DeviceInfo::DeviceInfo
|
||||||
-------------------------------
|
---------------------------
|
||||||
The constructors.
|
The constructors.
|
||||||
|
|
||||||
.. ocv:function:: gpu::DeviceInfo::DeviceInfo()
|
.. ocv:function:: gpu::DeviceInfo::DeviceInfo()
|
||||||
@ -146,7 +144,7 @@ Constructs the ``DeviceInfo`` object for the specified device. If ``device_id``
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::name
|
gpu::DeviceInfo::name
|
||||||
-------------------------
|
---------------------
|
||||||
Returns the device name.
|
Returns the device name.
|
||||||
|
|
||||||
.. ocv:function:: string gpu::DeviceInfo::name() const
|
.. ocv:function:: string gpu::DeviceInfo::name() const
|
||||||
@ -154,7 +152,7 @@ Returns the device name.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::majorVersion
|
gpu::DeviceInfo::majorVersion
|
||||||
---------------------------------
|
-----------------------------
|
||||||
Returns the major compute capability version.
|
Returns the major compute capability version.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::DeviceInfo::majorVersion()
|
.. ocv:function:: int gpu::DeviceInfo::majorVersion()
|
||||||
@ -162,7 +160,7 @@ Returns the major compute capability version.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::minorVersion
|
gpu::DeviceInfo::minorVersion
|
||||||
---------------------------------
|
-----------------------------
|
||||||
Returns the minor compute capability version.
|
Returns the minor compute capability version.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::DeviceInfo::minorVersion()
|
.. ocv:function:: int gpu::DeviceInfo::minorVersion()
|
||||||
@ -170,7 +168,7 @@ Returns the minor compute capability version.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::multiProcessorCount
|
gpu::DeviceInfo::multiProcessorCount
|
||||||
----------------------------------------
|
------------------------------------
|
||||||
Returns the number of streaming multiprocessors.
|
Returns the number of streaming multiprocessors.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::DeviceInfo::multiProcessorCount()
|
.. ocv:function:: int gpu::DeviceInfo::multiProcessorCount()
|
||||||
@ -178,7 +176,7 @@ Returns the number of streaming multiprocessors.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::freeMemory
|
gpu::DeviceInfo::freeMemory
|
||||||
-------------------------------
|
---------------------------
|
||||||
Returns the amount of free memory in bytes.
|
Returns the amount of free memory in bytes.
|
||||||
|
|
||||||
.. ocv:function:: size_t gpu::DeviceInfo::freeMemory()
|
.. ocv:function:: size_t gpu::DeviceInfo::freeMemory()
|
||||||
@ -186,7 +184,7 @@ Returns the amount of free memory in bytes.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::totalMemory
|
gpu::DeviceInfo::totalMemory
|
||||||
--------------------------------
|
----------------------------
|
||||||
Returns the amount of total memory in bytes.
|
Returns the amount of total memory in bytes.
|
||||||
|
|
||||||
.. ocv:function:: size_t gpu::DeviceInfo::totalMemory()
|
.. ocv:function:: size_t gpu::DeviceInfo::totalMemory()
|
||||||
@ -194,7 +192,7 @@ Returns the amount of total memory in bytes.
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::supports
|
gpu::DeviceInfo::supports
|
||||||
-----------------------------
|
-------------------------
|
||||||
Provides information on GPU feature support.
|
Provides information on GPU feature support.
|
||||||
|
|
||||||
.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const
|
.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const
|
||||||
@ -206,7 +204,7 @@ This function returns ``true`` if the device has the specified GPU feature. Othe
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::isCompatible
|
gpu::DeviceInfo::isCompatible
|
||||||
---------------------------------
|
-----------------------------
|
||||||
Checks the GPU module and device compatibility.
|
Checks the GPU module and device compatibility.
|
||||||
|
|
||||||
.. ocv:function:: bool gpu::DeviceInfo::isCompatible()
|
.. ocv:function:: bool gpu::DeviceInfo::isCompatible()
|
||||||
@ -216,7 +214,7 @@ This function returns ``true`` if the GPU module can be run on the specified dev
|
|||||||
|
|
||||||
|
|
||||||
gpu::DeviceInfo::deviceID
|
gpu::DeviceInfo::deviceID
|
||||||
---------------------------------
|
-------------------------
|
||||||
Returns system index of the GPU device starting with 0.
|
Returns system index of the GPU device starting with 0.
|
||||||
|
|
||||||
.. ocv:function:: int gpu::DeviceInfo::deviceID()
|
.. ocv:function:: int gpu::DeviceInfo::deviceID()
|
||||||
|
@ -785,7 +785,7 @@ Constructors.
|
|||||||
|
|
||||||
:param fps: Framerate of the created video stream.
|
:param fps: Framerate of the created video stream.
|
||||||
|
|
||||||
:param params: Encoder parameters. See :ocv:class:`gpu::VideoWriter_GPU::EncoderParams` .
|
:param params: Encoder parameters. See :ocv:struct:`gpu::VideoWriter_GPU::EncoderParams` .
|
||||||
|
|
||||||
:param format: Surface format of input frames ( ``SF_UYVY`` , ``SF_YUY2`` , ``SF_YV12`` , ``SF_NV12`` , ``SF_IYUV`` , ``SF_BGR`` or ``SF_GRAY``). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.
|
:param format: Surface format of input frames ( ``SF_UYVY`` , ``SF_YUY2`` , ``SF_YV12`` , ``SF_NV12`` , ``SF_IYUV`` , ``SF_BGR`` or ``SF_GRAY``). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.
|
||||||
|
|
||||||
|
@ -3,6 +3,171 @@ Common Interfaces of Generic Descriptor Matchers
|
|||||||
|
|
||||||
.. highlight:: cpp
|
.. highlight:: cpp
|
||||||
|
|
||||||
|
OneWayDescriptorBase
|
||||||
|
--------------------
|
||||||
|
.. ocv:class:: OneWayDescriptorBase
|
||||||
|
|
||||||
|
Class encapsulates functionality for training/loading a set of one way descriptors
|
||||||
|
and finding the nearest closest descriptor to an input feature. ::
|
||||||
|
|
||||||
|
class CV_EXPORTS OneWayDescriptorBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// creates an instance of OneWayDescriptor from a set of training files
|
||||||
|
// - patch_size: size of the input (large) patch
|
||||||
|
// - pose_count: the number of poses to generate for each descriptor
|
||||||
|
// - train_path: path to training files
|
||||||
|
// - pca_config: the name of the file that contains PCA for small patches (2 times smaller
|
||||||
|
// than patch_size each dimension
|
||||||
|
// - pca_hr_config: the name of the file that contains PCA for large patches (of patch_size size)
|
||||||
|
// - pca_desc_config: the name of the file that contains descriptors of PCA components
|
||||||
|
OneWayDescriptorBase(CvSize patch_size, int pose_count, const char* train_path = 0, const char* pca_config = 0,
|
||||||
|
const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1,
|
||||||
|
int pca_dim_high = 100, int pca_dim_low = 100);
|
||||||
|
|
||||||
|
OneWayDescriptorBase(CvSize patch_size, int pose_count, const string &pca_filename, const string &train_path = string(), const string &images_list = string(),
|
||||||
|
float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1,
|
||||||
|
int pca_dim_high = 100, int pca_dim_low = 100);
|
||||||
|
|
||||||
|
|
||||||
|
virtual ~OneWayDescriptorBase();
|
||||||
|
void clear ();
|
||||||
|
|
||||||
|
|
||||||
|
// Allocate: allocates memory for a given number of descriptors
|
||||||
|
void Allocate(int train_feature_count);
|
||||||
|
|
||||||
|
// AllocatePCADescriptors: allocates memory for pca descriptors
|
||||||
|
void AllocatePCADescriptors();
|
||||||
|
|
||||||
|
// returns patch size
|
||||||
|
CvSize GetPatchSize() const {return m_patch_size;};
|
||||||
|
// returns the number of poses for each descriptor
|
||||||
|
int GetPoseCount() const {return m_pose_count;};
|
||||||
|
|
||||||
|
// returns the number of pyramid levels
|
||||||
|
int GetPyrLevels() const {return m_pyr_levels;};
|
||||||
|
|
||||||
|
// returns the number of descriptors
|
||||||
|
int GetDescriptorCount() const {return m_train_feature_count;};
|
||||||
|
|
||||||
|
// CreateDescriptorsFromImage: creates descriptors for each of the input features
|
||||||
|
// - src: input image
|
||||||
|
// - features: input features
|
||||||
|
// - pyr_levels: the number of pyramid levels
|
||||||
|
void CreateDescriptorsFromImage(IplImage* src, const vector<KeyPoint>& features);
|
||||||
|
|
||||||
|
// CreatePCADescriptors: generates descriptors for PCA components, needed for fast generation of feature descriptors
|
||||||
|
void CreatePCADescriptors();
|
||||||
|
|
||||||
|
// returns a feature descriptor by feature index
|
||||||
|
const OneWayDescriptor* GetDescriptor(int desc_idx) const {return &m_descriptors[desc_idx];};
|
||||||
|
|
||||||
|
// FindDescriptor: finds the closest descriptor
|
||||||
|
// - patch: input image patch
|
||||||
|
// - desc_idx: output index of the closest descriptor to the input patch
|
||||||
|
// - pose_idx: output index of the closest pose of the closest descriptor to the input patch
|
||||||
|
// - distance: distance from the input patch to the closest feature pose
|
||||||
|
// - _scales: scales of the input patch for each descriptor
|
||||||
|
// - scale_ranges: input scales variation (float[2])
|
||||||
|
void FindDescriptor(IplImage* patch, int& desc_idx, int& pose_idx, float& distance, float* _scale = 0, float* scale_ranges = 0) const;
|
||||||
|
|
||||||
|
// - patch: input image patch
|
||||||
|
// - n: number of the closest indexes
|
||||||
|
// - desc_idxs: output indexes of the closest descriptor to the input patch (n)
|
||||||
|
// - pose_idx: output indexes of the closest pose of the closest descriptor to the input patch (n)
|
||||||
|
// - distances: distance from the input patch to the closest feature pose (n)
|
||||||
|
// - _scales: scales of the input patch
|
||||||
|
// - scale_ranges: input scales variation (float[2])
|
||||||
|
void FindDescriptor(IplImage* patch, int n, vector<int>& desc_idxs, vector<int>& pose_idxs,
|
||||||
|
vector<float>& distances, vector<float>& _scales, float* scale_ranges = 0) const;
|
||||||
|
|
||||||
|
// FindDescriptor: finds the closest descriptor
|
||||||
|
// - src: input image
|
||||||
|
// - pt: center of the feature
|
||||||
|
// - desc_idx: output index of the closest descriptor to the input patch
|
||||||
|
// - pose_idx: output index of the closest pose of the closest descriptor to the input patch
|
||||||
|
// - distance: distance from the input patch to the closest feature pose
|
||||||
|
void FindDescriptor(IplImage* src, cv::Point2f pt, int& desc_idx, int& pose_idx, float& distance) const;
|
||||||
|
|
||||||
|
// InitializePoses: generates random poses
|
||||||
|
void InitializePoses();
|
||||||
|
|
||||||
|
// InitializeTransformsFromPoses: generates 2x3 affine matrices from poses (initializes m_transforms)
|
||||||
|
void InitializeTransformsFromPoses();
|
||||||
|
|
||||||
|
// InitializePoseTransforms: subsequently calls InitializePoses and InitializeTransformsFromPoses
|
||||||
|
void InitializePoseTransforms();
|
||||||
|
|
||||||
|
// InitializeDescriptor: initializes a descriptor
|
||||||
|
// - desc_idx: descriptor index
|
||||||
|
// - train_image: image patch (ROI is supported)
|
||||||
|
// - feature_label: feature textual label
|
||||||
|
void InitializeDescriptor(int desc_idx, IplImage* train_image, const char* feature_label);
|
||||||
|
|
||||||
|
void InitializeDescriptor(int desc_idx, IplImage* train_image, const KeyPoint& keypoint, const char* feature_label);
|
||||||
|
|
||||||
|
// InitializeDescriptors: load features from an image and create descriptors for each of them
|
||||||
|
void InitializeDescriptors(IplImage* train_image, const vector<KeyPoint>& features,
|
||||||
|
const char* feature_label = "", int desc_start_idx = 0);
|
||||||
|
|
||||||
|
// Write: writes this object to a file storage
|
||||||
|
// - fs: output filestorage
|
||||||
|
void Write (FileStorage &fs) const;
|
||||||
|
|
||||||
|
// Read: reads OneWayDescriptorBase object from a file node
|
||||||
|
// - fn: input file node
|
||||||
|
void Read (const FileNode &fn);
|
||||||
|
|
||||||
|
// LoadPCADescriptors: loads PCA descriptors from a file
|
||||||
|
// - filename: input filename
|
||||||
|
int LoadPCADescriptors(const char* filename);
|
||||||
|
|
||||||
|
// LoadPCADescriptors: loads PCA descriptors from a file node
|
||||||
|
// - fn: input file node
|
||||||
|
int LoadPCADescriptors(const FileNode &fn);
|
||||||
|
|
||||||
|
// SavePCADescriptors: saves PCA descriptors to a file
|
||||||
|
// - filename: output filename
|
||||||
|
void SavePCADescriptors(const char* filename);
|
||||||
|
|
||||||
|
// SavePCADescriptors: saves PCA descriptors to a file storage
|
||||||
|
// - fs: output file storage
|
||||||
|
void SavePCADescriptors(CvFileStorage* fs) const;
|
||||||
|
|
||||||
|
// GeneratePCA: calculate and save PCA components and descriptors
|
||||||
|
// - img_path: path to training PCA images directory
|
||||||
|
// - images_list: filename with filenames of training PCA images
|
||||||
|
void GeneratePCA(const char* img_path, const char* images_list, int pose_count=500);
|
||||||
|
|
||||||
|
// SetPCAHigh: sets the high resolution pca matrices (copied to internal structures)
|
||||||
|
void SetPCAHigh(CvMat* avg, CvMat* eigenvectors);
|
||||||
|
|
||||||
|
// SetPCALow: sets the low resolution pca matrices (copied to internal structures)
|
||||||
|
void SetPCALow(CvMat* avg, CvMat* eigenvectors);
|
||||||
|
|
||||||
|
int GetLowPCA(CvMat** avg, CvMat** eigenvectors)
|
||||||
|
{
|
||||||
|
*avg = m_pca_avg;
|
||||||
|
*eigenvectors = m_pca_eigenvectors;
|
||||||
|
return m_pca_dim_low;
|
||||||
|
};
|
||||||
|
|
||||||
|
int GetPCADimLow() const {return m_pca_dim_low;};
|
||||||
|
int GetPCADimHigh() const {return m_pca_dim_high;};
|
||||||
|
|
||||||
|
void ConvertDescriptorsArrayToTree(); // Converting pca_descriptors array to KD tree
|
||||||
|
|
||||||
|
// GetPCAFilename: get default PCA filename
|
||||||
|
static string GetPCAFilename () { return "pca.yml"; }
|
||||||
|
|
||||||
|
virtual bool empty() const { return m_train_feature_count <= 0 ? true : false; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
OneWayDescriptorMatcher
|
OneWayDescriptorMatcher
|
||||||
-----------------------
|
-----------------------
|
||||||
.. ocv:class:: OneWayDescriptorMatcher : public GenericDescriptorMatcher
|
.. ocv:class:: OneWayDescriptorMatcher : public GenericDescriptorMatcher
|
||||||
@ -59,8 +224,89 @@ Wrapping class for computing, matching, and classifying descriptors using the
|
|||||||
...
|
...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FernClassifier
|
||||||
|
--------------
|
||||||
|
.. ocv:class:: FernClassifier
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
class CV_EXPORTS FernClassifier
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FernClassifier();
|
||||||
|
FernClassifier(const FileNode& node);
|
||||||
|
FernClassifier(const vector<vector<Point2f> >& points,
|
||||||
|
const vector<Mat>& refimgs,
|
||||||
|
const vector<vector<int> >& labels=vector<vector<int> >(),
|
||||||
|
int _nclasses=0, int _patchSize=PATCH_SIZE,
|
||||||
|
int _signatureSize=DEFAULT_SIGNATURE_SIZE,
|
||||||
|
int _nstructs=DEFAULT_STRUCTS,
|
||||||
|
int _structSize=DEFAULT_STRUCT_SIZE,
|
||||||
|
int _nviews=DEFAULT_VIEWS,
|
||||||
|
int _compressionMethod=COMPRESSION_NONE,
|
||||||
|
const PatchGenerator& patchGenerator=PatchGenerator());
|
||||||
|
virtual ~FernClassifier();
|
||||||
|
virtual void read(const FileNode& n);
|
||||||
|
virtual void write(FileStorage& fs, const String& name=String()) const;
|
||||||
|
virtual void trainFromSingleView(const Mat& image,
|
||||||
|
const vector<KeyPoint>& keypoints,
|
||||||
|
int _patchSize=PATCH_SIZE,
|
||||||
|
int _signatureSize=DEFAULT_SIGNATURE_SIZE,
|
||||||
|
int _nstructs=DEFAULT_STRUCTS,
|
||||||
|
int _structSize=DEFAULT_STRUCT_SIZE,
|
||||||
|
int _nviews=DEFAULT_VIEWS,
|
||||||
|
int _compressionMethod=COMPRESSION_NONE,
|
||||||
|
const PatchGenerator& patchGenerator=PatchGenerator());
|
||||||
|
virtual void train(const vector<vector<Point2f> >& points,
|
||||||
|
const vector<Mat>& refimgs,
|
||||||
|
const vector<vector<int> >& labels=vector<vector<int> >(),
|
||||||
|
int _nclasses=0, int _patchSize=PATCH_SIZE,
|
||||||
|
int _signatureSize=DEFAULT_SIGNATURE_SIZE,
|
||||||
|
int _nstructs=DEFAULT_STRUCTS,
|
||||||
|
int _structSize=DEFAULT_STRUCT_SIZE,
|
||||||
|
int _nviews=DEFAULT_VIEWS,
|
||||||
|
int _compressionMethod=COMPRESSION_NONE,
|
||||||
|
const PatchGenerator& patchGenerator=PatchGenerator());
|
||||||
|
virtual int operator()(const Mat& img, Point2f kpt, vector<float>& signature) const;
|
||||||
|
virtual int operator()(const Mat& patch, vector<float>& signature) const;
|
||||||
|
virtual void clear();
|
||||||
|
virtual bool empty() const;
|
||||||
|
void setVerbose(bool verbose);
|
||||||
|
|
||||||
|
int getClassCount() const;
|
||||||
|
int getStructCount() const;
|
||||||
|
int getStructSize() const;
|
||||||
|
int getSignatureSize() const;
|
||||||
|
int getCompressionMethod() const;
|
||||||
|
Size getPatchSize() const;
|
||||||
|
|
||||||
|
struct Feature
|
||||||
|
{
|
||||||
|
uchar x1, y1, x2, y2;
|
||||||
|
Feature() : x1(0), y1(0), x2(0), y2(0) {}
|
||||||
|
Feature(int _x1, int _y1, int _x2, int _y2)
|
||||||
|
: x1((uchar)_x1), y1((uchar)_y1), x2((uchar)_x2), y2((uchar)_y2)
|
||||||
|
{}
|
||||||
|
template<typename _Tp> bool operator ()(const Mat_<_Tp>& patch) const
|
||||||
|
{ return patch(y1,x1) > patch(y2, x2); }
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PATCH_SIZE = 31,
|
||||||
|
DEFAULT_STRUCTS = 50,
|
||||||
|
DEFAULT_STRUCT_SIZE = 9,
|
||||||
|
DEFAULT_VIEWS = 5000,
|
||||||
|
DEFAULT_SIGNATURE_SIZE = 176,
|
||||||
|
COMPRESSION_NONE = 0,
|
||||||
|
COMPRESSION_RANDOM_PROJ = 1,
|
||||||
|
COMPRESSION_PCA = 2,
|
||||||
|
DEFAULT_COMPRESSION_METHOD = COMPRESSION_NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
...
|
||||||
|
};
|
||||||
|
|
||||||
FernDescriptorMatcher
|
FernDescriptorMatcher
|
||||||
---------------------
|
---------------------
|
||||||
|
@ -124,7 +124,7 @@ CvBoostTree
|
|||||||
-----------
|
-----------
|
||||||
.. ocv:class:: CvBoostTree : public CvDTree
|
.. ocv:class:: CvBoostTree : public CvDTree
|
||||||
|
|
||||||
The weak tree classifier, a component of the boosted tree classifier :ocv:class:`CvBoost`, is a derivative of :ocv:class:`CvDTree`. Normally, there is no need to use the weak classifiers directly. However, they can be accessed as elements of the sequence :ocv:member:`CvBoost::weak`, retrieved by :ocv:func:`CvBoost::get_weak_predictors`.
|
The weak tree classifier, a component of the boosted tree classifier :ocv:class:`CvBoost`, is a derivative of :ocv:class:`CvDTree`. Normally, there is no need to use the weak classifiers directly. However, they can be accessed as elements of the sequence ``CvBoost::weak``, retrieved by :ocv:func:`CvBoost::get_weak_predictors`.
|
||||||
|
|
||||||
.. note:: In case of LogitBoost and Gentle AdaBoost, each weak predictor is a regression tree, rather than a classification tree. Even in case of Discrete AdaBoost and Real AdaBoost, the ``CvBoostTree::predict`` return value (:ocv:member:`CvDTreeNode::value`) is not an output class label. A negative value "votes" for class #0, a positive value - for class #1. The votes are weighted. The weight of each individual tree may be increased or decreased using the method ``CvBoostTree::scale``.
|
.. note:: In case of LogitBoost and Gentle AdaBoost, each weak predictor is a regression tree, rather than a classification tree. Even in case of Discrete AdaBoost and Real AdaBoost, the ``CvBoostTree::predict`` return value (:ocv:member:`CvDTreeNode::value`) is not an output class label. A negative value "votes" for class #0, a positive value - for class #1. The votes are weighted. The weight of each individual tree may be increased or decreased using the method ``CvBoostTree::scale``.
|
||||||
|
|
||||||
@ -233,4 +233,3 @@ CvBoost::get_data
|
|||||||
Returns used train data of the boosted tree classifier.
|
Returns used train data of the boosted tree classifier.
|
||||||
|
|
||||||
.. ocv:function:: const CvDTreeTrainData* CvBoost::get_data() const
|
.. ocv:function:: const CvDTreeTrainData* CvBoost::get_data() const
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ CvStatModel::predict
|
|||||||
--------------------
|
--------------------
|
||||||
Predicts the response for a sample.
|
Predicts the response for a sample.
|
||||||
|
|
||||||
.. ocv:function:: float CvStatModel::predict( const Mat& sample, <prediction_params> ) const
|
.. ocv:function:: float CvStatModel::predict( const Mat& sample, ... ) const
|
||||||
|
|
||||||
The method is used to predict the response for a new sample. In case of a classification, the method returns the class label. In case of a regression, the method returns the output function value. The input sample must have as many components as the ``train_data`` passed to ``train`` contains. If the ``var_idx`` parameter is passed to ``train``, it is remembered and then is used to extract only the necessary components from the input sample in the method ``predict``.
|
The method is used to predict the response for a new sample. In case of a classification, the method returns the class label. In case of a regression, the method returns the output function value. The input sample must have as many components as the ``train_data`` passed to ``train`` contains. If the ``var_idx`` parameter is passed to ``train``, it is remembered and then is used to extract only the necessary components from the input sample in the method ``predict``.
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ Brute-force descriptor matcher. For each descriptor in the first set, this match
|
|||||||
|
|
||||||
The class ``BruteForceMatcher_OCL_base`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory. ``BruteForceMatcher_OCL_base`` supports only the ``L1<float>``, ``L2<float>``, and ``Hamming`` distance types.
|
The class ``BruteForceMatcher_OCL_base`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory. ``BruteForceMatcher_OCL_base`` supports only the ``L1<float>``, ``L2<float>``, and ``Hamming`` distance types.
|
||||||
|
|
||||||
.. seealso:: :ocv:class:`DescriptorMatcher`, :ocv:class:`BruteForceMatcher`
|
.. seealso:: :ocv:class:`DescriptorMatcher`, :ocv:class:`BFMatcher`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus
|
|||||||
You can use field `user_block_size` to set specific block size for :ocv:func:`ocl::matchTemplate` function. If you leave its default value `Size(0,0)` then automatic estimation of block size will be used (which is optimized for speed). By varying `user_block_size` you can reduce memory requirements at the cost of speed.
|
You can use field `user_block_size` to set specific block size for :ocv:func:`ocl::matchTemplate` function. If you leave its default value `Size(0,0)` then automatic estimation of block size will be used (which is optimized for speed). By varying `user_block_size` you can reduce memory requirements at the cost of speed.
|
||||||
|
|
||||||
ocl::matchTemplate
|
ocl::matchTemplate
|
||||||
----------------------
|
------------------
|
||||||
Computes a proximity map for a raster template and an image where the template is searched for.
|
Computes a proximity map for a raster template and an image where the template is searched for.
|
||||||
|
|
||||||
.. ocv:function:: void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method)
|
.. ocv:function:: void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method)
|
||||||
@ -71,7 +71,7 @@ Computes a proximity map for a raster template and an image where the template i
|
|||||||
|
|
||||||
:param method: Specifies the way to compare the template with the image.
|
:param method: Specifies the way to compare the template with the image.
|
||||||
|
|
||||||
:param buf: Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:class:`ocl::MatchTemplateBuf`.
|
:param buf: Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:struct:`ocl::MatchTemplateBuf`.
|
||||||
|
|
||||||
The following methods are supported for the ``CV_8U`` depth images for now:
|
The following methods are supported for the ``CV_8U`` depth images for now:
|
||||||
|
|
||||||
|
@ -221,6 +221,7 @@ Implementation of the camera parameters refinement algorithm which minimizes sum
|
|||||||
|
|
||||||
detail::WaveCorrectKind
|
detail::WaveCorrectKind
|
||||||
-----------------------
|
-----------------------
|
||||||
|
.. ocv:class:: detail::WaveCorrectKind
|
||||||
|
|
||||||
Wave correction kind. ::
|
Wave correction kind. ::
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ The function finds all of the motion segments and marks them in ``segmask`` with
|
|||||||
|
|
||||||
|
|
||||||
CamShift
|
CamShift
|
||||||
------------
|
--------
|
||||||
Finds an object center, size, and orientation.
|
Finds an object center, size, and orientation.
|
||||||
|
|
||||||
.. ocv:function:: RotatedRect CamShift( InputArray probImage, Rect& window, TermCriteria criteria )
|
.. ocv:function:: RotatedRect CamShift( InputArray probImage, Rect& window, TermCriteria criteria )
|
||||||
@ -316,7 +316,7 @@ See the OpenCV sample ``camshiftdemo.c`` that tracks colored objects.
|
|||||||
|
|
||||||
|
|
||||||
meanShift
|
meanShift
|
||||||
-------------
|
---------
|
||||||
Finds an object on a back projection image.
|
Finds an object on a back projection image.
|
||||||
|
|
||||||
.. ocv:function:: int meanShift( InputArray probImage, Rect& window, TermCriteria criteria )
|
.. ocv:function:: int meanShift( InputArray probImage, Rect& window, TermCriteria criteria )
|
||||||
|
Loading…
Reference in New Issue
Block a user