Commit f025e473 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

some more doc cleanup

parent 4e6572ac
...@@ -15,7 +15,19 @@ or ...@@ -15,7 +15,19 @@ or
.. math:: .. math::
s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} \begin{bmatrix} r_{11} & r_{12} & r_{13} & t_1 \\ r_{21} & r_{22} & r_{23} & t_2 \\ r_{31} & r_{32} & r_{33} & t_3 \end{bmatrix} \begin{bmatrix} X \\ Y \\ Z \\ 1 \end{bmatrix} s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}
\begin{bmatrix}
r_{11} & r_{12} & r_{13} & t_1 \\
r_{21} & r_{22} & r_{23} & t_2 \\
r_{31} & r_{32} & r_{33} & t_3
\end{bmatrix}
\begin{bmatrix}
X \\
Y \\
Z \\
1
\end{bmatrix}
Where Where
:math:`(X, Y, Z)` are the coordinates of a 3D point in the world :math:`(X, Y, Z)` are the coordinates of a 3D point in the world
...@@ -45,7 +57,13 @@ to the following (when ...@@ -45,7 +57,13 @@ to the following (when
.. math:: .. math::
\begin{array}{l} \vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ x' = x/z \\ y' = y/z \\ u = f_x*x' + c_x \\ v = f_y*y' + c_y \end{array} \begin{array}{l}
\vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\
x' = x/z \\
y' = y/z \\
u = f_x*x' + c_x \\
v = f_y*y' + c_y
\end{array}
Real lenses usually have some distortion, mostly Real lenses usually have some distortion, mostly
radial distortion and slight tangential distortion. So, the above model radial distortion and slight tangential distortion. So, the above model
...@@ -207,7 +225,7 @@ cv::composeRT ...@@ -207,7 +225,7 @@ cv::composeRT
:param tvec3: The output translation vector of the superposition :param tvec3: The output translation vector of the superposition
:param d??d??: The optional output derivatives of ``rvec3`` or ``tvec3`` w.r.t. ``rvec?`` or ``tvec?`` :param d*d*: The optional output derivatives of ``rvec3`` or ``tvec3`` w.r.t. ``rvec?`` or ``tvec?``
The functions compute: The functions compute:
...@@ -1192,7 +1210,7 @@ The matrices, together with ``R1`` and ``R2`` , can then be passed to ...@@ -1192,7 +1210,7 @@ The matrices, together with ``R1`` and ``R2`` , can then be passed to
Below is the screenshot from ``stereo_calib.cpp`` sample. Some red horizontal lines, as you can see, pass through the corresponding image regions, i.e. the images are well rectified (which is what most stereo correspondence algorithms rely on). The green rectangles are ``roi1`` and ``roi2`` - indeed, their interior are all valid pixels. Below is the screenshot from ``stereo_calib.cpp`` sample. Some red horizontal lines, as you can see, pass through the corresponding image regions, i.e. the images are well rectified (which is what most stereo correspondence algorithms rely on). The green rectangles are ``roi1`` and ``roi2`` - indeed, their interior are all valid pixels.
.. image:: ../../pics/stereo_undistort.jpg .. image:: pics/stereo_undistort.jpg
.. index:: stereoRectifyUncalibrated .. index:: stereoRectifyUncalibrated
......
...@@ -455,16 +455,14 @@ Template class for short numerical vectors :: ...@@ -455,16 +455,14 @@ Template class for short numerical vectors ::
typedef Vec<double, 3> Vec3d; typedef Vec<double, 3> Vec3d;
typedef Vec<double, 4> Vec4d; typedef Vec<double, 4> Vec4d;
typedef Vec<double, 6> Vec6d; typedef Vec<double, 6> Vec6d;
.. ``Vec`` is a partial case of ``Matx`` . It is possible to convert ``Vec<T,2>`` to/from ``Point_``,``Vec<T,3>`` to/from ``Point3_`` , and ``Vec<T,4>`` to
:ref:`CvScalar` or ``Vec`` is a partial case of ``Matx`` . It is possible to convert ``Vec<T,2>`` to/from ``Point_``,``Vec<T,3>`` to/from ``Point3_`` , and ``Vec<T,4>`` to :ref:`CvScalar` or :ref:`Scalar`. The elements of ``Vec`` are accessed using ``operator[]``. All the expected vector operations are implemented too:
:ref:`Scalar` . The elements of ``Vec`` are accessed using ``operator[]`` . All the expected vector operations are implemented too:
* *
:math:`\texttt{v1} = \texttt{v2} \pm \texttt{v3}`, :math:`\texttt{v1} = \texttt{v2} * \alpha`, :math:`\texttt{v1} = \alpha * \texttt{v2}` (plus the corresponding augmenting operations; note that these operations apply :math:`\texttt{v1} = \texttt{v2} \pm \texttt{v3}`, :math:`\texttt{v1} = \texttt{v2} * \alpha`, :math:`\texttt{v1} = \alpha * \texttt{v2}` (plus the corresponding augmenting operations; note that these operations apply
to the each computed vector component) to the each computed vector component)
* ``v1 == v2, v1 != v2`` * ``norm(v1)`` ( * ``v1 == v2, v1 != v2`` * ``norm(v1)`` (:math:`L_2`-norm)
:math:`L_2` -norm)
The class ``Vec`` is commonly used to describe pixel types of multi-channel arrays, see ``Mat_`` description. The class ``Vec`` is commonly used to describe pixel types of multi-channel arrays, see ``Mat_`` description.
...@@ -742,10 +740,7 @@ There are many different ways to create ``Mat`` object. Here are the some popula ...@@ -742,10 +740,7 @@ There are many different ways to create ``Mat`` object. Here are the some popula
.. ..
Thanks to the additional ``datastart`` and ``dataend`` members, it is possible to Thanks to the additional ``datastart`` and ``dataend`` members, it is possible to compute the relative sub-array position in the main *"container"* array using ``locateROI()``:
compute the relative sub-array position in the main
*"container"*
array using ``locateROI()`` :
:: ::
...@@ -792,17 +787,9 @@ There are many different ways to create ``Mat`` object. Here are the some popula ...@@ -792,17 +787,9 @@ There are many different ways to create ``Mat`` object. Here are the some popula
.. ..
partial yet very common cases of this "user-allocated data" case are conversions partial yet very common cases of this "user-allocated data" case are conversions from :ref:`CvMat` and :ref:`IplImage` to ``Mat``. For this purpose there are special constructors taking pointers to ``CvMat`` or ``IplImage`` and the optional flag indicating whether to copy the data or not.
from
:ref:`CvMat` and
:ref:`IplImage` to ``Mat`` . For this purpose there are special constructors
taking pointers to ``CvMat`` or ``IplImage`` and the optional
flag indicating whether to copy the data or not.
Backward conversion from ``Mat`` to ``CvMat`` or ``IplImage`` is provided via cast operators ``Mat::operator CvMat() const`` an ``Mat::operator IplImage()`` . Backward conversion from ``Mat`` to ``CvMat`` or ``IplImage`` is provided via cast operators ``Mat::operator CvMat() const`` an ``Mat::operator IplImage()``. The operators do *not* copy the data.
The operators do
*not*
copy the data.
:: ::
...@@ -915,11 +902,11 @@ for a scalar ( ``Scalar`` ), ...@@ -915,11 +902,11 @@ for a scalar ( ``Scalar`` ),
:math:`A.t() \sim A^t` * :math:`A.t() \sim A^t` *
matrix inversion and pseudo-inversion, solving linear systems and least-squares problems: matrix inversion and pseudo-inversion, solving linear systems and least-squares problems:
:math:`A.inv([method]) \sim A^{-1}, A.inv([method])*B \sim X:\,AX=B` * :math:`A.inv([method]) \sim A^{-1}, A.inv([method])*B \sim X:\,AX=B`
*
comparison: comparison:
:math:`A\gtreqqless B,\;A \ne B,\;A \gtreqqless \alpha,\;A \ne \alpha` . :math:`A\gtreqqless B,\;A \ne B,\;A \gtreqqless \alpha,\;A \ne \alpha`. The result of comparison is 8-bit single channel mask, which elements are set to 255 (if the particular element or pair of elements satisfy the condition) and 0 otherwise.
The result of comparison is 8-bit single channel mask, which elements are set to 255
(if the particular element or pair of elements satisfy the condition) and 0 otherwise.
* *
bitwise logical operations: ``A & B, A & s, A | B, A | s, A textasciicircum B, A textasciicircum s, ~ A`` * bitwise logical operations: ``A & B, A & s, A | B, A | s, A textasciicircum B, A textasciicircum s, ~ A`` *
...@@ -935,17 +922,12 @@ for a scalar ( ``Scalar`` ), ...@@ -935,17 +922,12 @@ for a scalar ( ``Scalar`` ),
:func:`determinant`, :func:`repeat` etc. :func:`determinant`, :func:`repeat` etc.
* *
matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers, matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers, matrix constructors and operators that extract sub-matrices (see :ref:`Mat` description).
matrix constructors and operators that extract sub-matrices (see
:ref:`Mat` description).
* *
verb ``Mat_<destination_type>()`` constructors to cast the result to the proper type.
"Mat_<destination_type>()" constructors to cast the result to the proper type.
Note, however, that comma-separated initializers and probably some other operations may require additional explicit ``Mat()`` or Note, however, that comma-separated initializers and probably some other operations may require additional explicit ``Mat()`` or ``Mat_<T>()`` constuctor calls to resolve possible ambiguity.
verb
"Mat_<T>()" constuctor calls to resolve possible ambiguity.
Below is the formal description of the ``Mat`` methods. Below is the formal description of the ``Mat`` methods.
...@@ -2410,8 +2392,8 @@ Template sparse n-dimensional array class derived from ...@@ -2410,8 +2392,8 @@ Template sparse n-dimensional array class derived from
SparseMatIterator_<_Tp> end(); SparseMatIterator_<_Tp> end();
SparseMatConstIterator_<_Tp> end() const; SparseMatConstIterator_<_Tp> end() const;
}; };
.. ``SparseMat_`` is a thin wrapper on top of
:ref:`SparseMat` , made in the same way as ``Mat_`` . ``SparseMat_`` is a thin wrapper on top of :ref:`SparseMat` , made in the same way as ``Mat_`` .
It simplifies notation of some operations, and that's it. :: It simplifies notation of some operations, and that's it. ::
int sz[] = {10, 20, 30}; int sz[] = {10, 20, 30};
......
...@@ -116,7 +116,7 @@ explains the meaning of the parameters. ...@@ -116,7 +116,7 @@ explains the meaning of the parameters.
Parameters of Elliptic Arc Parameters of Elliptic Arc
.. image:: ../../pics/ellipse.png .. image:: pics/ellipse.png
.. index:: ellipse2Poly .. index:: ellipse2Poly
......
...@@ -133,7 +133,6 @@ Here is the example: :: ...@@ -133,7 +133,6 @@ Here is the example: ::
} }
return 0; return 0;
} }
..
The array ``frame`` is automatically allocated by ``>>`` operator, since the video frame resolution and bit-depth is known to the video capturing module. The array ``edges`` is automatically allocated by ``cvtColor`` function. It will have the same size and the bit-depth as the input array, and the number of channels will be 1, because we passed the color conversion code ``CV_BGR2GRAY`` (that means color to grayscale conversion). Note that ``frame`` and ``edges`` will be allocated only once during the first execution of the loop body, since all the next video frames will have the same resolution (unless user somehow changes the video resolution, in this case the arrays will be automatically reallocated). The array ``frame`` is automatically allocated by ``>>`` operator, since the video frame resolution and bit-depth is known to the video capturing module. The array ``edges`` is automatically allocated by ``cvtColor`` function. It will have the same size and the bit-depth as the input array, and the number of channels will be 1, because we passed the color conversion code ``CV_BGR2GRAY`` (that means color to grayscale conversion). Note that ``frame`` and ``edges`` will be allocated only once during the first execution of the loop body, since all the next video frames will have the same resolution (unless user somehow changes the video resolution, in this case the arrays will be automatically reallocated).
......
This diff is collapsed.
...@@ -112,7 +112,6 @@ The macro ``CV_Error_`` can be used to construct the error message on-fly to inc ...@@ -112,7 +112,6 @@ The macro ``CV_Error_`` can be used to construct the error message on-fly to inc
CV_Error_(CV_StsOutOfRange, CV_Error_(CV_StsOutOfRange,
("the matrix element ( ("the matrix element (
i, j, mtx.at<float>(i,j))) i, j, mtx.at<float>(i,j)))
..
.. index:: Exception .. index:: Exception
...@@ -145,7 +144,6 @@ The exception class passed to error :: ...@@ -145,7 +144,6 @@ The exception class passed to error ::
// the source file line where the error happened // the source file line where the error happened
int line; int line;
}; };
..
The class ``Exception`` encapsulates all or almost all the necessary information about the error happened in the program. The exception is usually constructed and thrown implicitly, via ``CV_Error`` and ``CV_Error_`` macros, see The class ``Exception`` encapsulates all or almost all the necessary information about the error happened in the program. The exception is usually constructed and thrown implicitly, via ``CV_Error`` and ``CV_Error_`` macros, see
:func:`error` . :func:`error` .
...@@ -241,7 +239,6 @@ That is, the following code computes the execution time in seconds. :: ...@@ -241,7 +239,6 @@ That is, the following code computes the execution time in seconds. ::
double t = (double)getTickCount(); double t = (double)getTickCount();
// do something ... // do something ...
t = ((double)getTickCount() - t)/getTickFrequency(); t = ((double)getTickCount() - t)/getTickFrequency();
..
.. index:: setNumThreads .. index:: setNumThreads
......
...@@ -65,7 +65,6 @@ The XML/YAML file storage class :: ...@@ -65,7 +65,6 @@ The XML/YAML file storage class ::
vector<char> structs; vector<char> structs;
int state; int state;
}; };
..
.. index:: FileNode .. index:: FileNode
...@@ -116,7 +115,6 @@ The XML/YAML file node class :: ...@@ -116,7 +115,6 @@ The XML/YAML file node class ::
const CvFileStorage* fs; const CvFileStorage* fs;
const CvFileNode* node; const CvFileNode* node;
}; };
..
.. index:: FileNodeIterator .. index:: FileNodeIterator
...@@ -153,5 +151,6 @@ The XML/YAML file node iterator class :: ...@@ -153,5 +151,6 @@ The XML/YAML file node iterator class ::
CvSeqReader reader; CvSeqReader reader;
size_t remaining; size_t remaining;
}; };
.. ..
...@@ -11,8 +11,6 @@ descriptor extractors inherit ...@@ -11,8 +11,6 @@ descriptor extractors inherit
.. index:: DescriptorExtractor .. index:: DescriptorExtractor
.. _DescriptorExtractor:
DescriptorExtractor DescriptorExtractor
------------------- -------------------
.. c:type:: DescriptorExtractor .. c:type:: DescriptorExtractor
...@@ -40,7 +38,7 @@ Abstract base class for computing descriptors for image keypoints. :: ...@@ -40,7 +38,7 @@ Abstract base class for computing descriptors for image keypoints. ::
protected: protected:
... ...
}; };
..
In this interface we assume a keypoint descriptor can be represented as a In this interface we assume a keypoint descriptor can be represented as a
dense, fixed-dimensional vector of some basic type. Most descriptors used dense, fixed-dimensional vector of some basic type. Most descriptors used
...@@ -55,8 +53,7 @@ DescriptorExtractor::compute ...@@ -55,8 +53,7 @@ DescriptorExtractor::compute
-------------------------------- --------------------------------
.. c:function:: void DescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const .. c:function:: void DescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const
Compute the descriptors for a set of keypoints detected in an image (first variant) Compute the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
or image set (second variant).
:param image: The image. :param image: The image.
...@@ -102,25 +99,22 @@ DescriptorExtractor::create ...@@ -102,25 +99,22 @@ DescriptorExtractor::create
:func:`DescriptorExtractor` :func:`DescriptorExtractor`
.. c:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string\& descriptorExtractorType ) .. c:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string\& descriptorExtractorType )
Descriptor extractor factory that creates of given type with Descriptor extractor factory that creates of given type with default parameters (rather using default constructor).
default parameters (rather using default constructor).
:param descriptorExtractorType: Descriptor extractor type. :param descriptorExtractorType: Descriptor extractor type.
Now the following descriptor extractor types are supported: Now the following descriptor extractor types are supported:
\ ``"SIFT"`` --
:func:`SiftFeatureDetector`,\ ``"SURF"`` -- * ``"SIFT"`` -- :func:`SiftFeatureDetector`,
:func:`SurfFeatureDetector`,\ ``"BRIEF"`` -- * ``"SURF"`` -- :func:`SurfFeatureDetector`,
:func:`BriefFeatureDetector` . * ``"BRIEF"`` -- :func:`BriefFeatureDetector` .
\
Also combined format is supported: descriptor extractor adapter name ( ``"Opponent"`` -- Also combined format is supported: descriptor extractor adapter name ( ``"Opponent"`` --
:func:`OpponentColorDescriptorExtractor` ) + descriptor extractor name (see above), :func:`OpponentColorDescriptorExtractor` ) + descriptor extractor name (see above),
e.g. ``"OpponentSIFT"`` , etc. e.g. ``"OpponentSIFT"`` , etc.
.. index:: SiftDescriptorExtractor .. index:: SiftDescriptorExtractor
.. _SiftDescriptorExtractor:
SiftDescriptorExtractor SiftDescriptorExtractor
----------------------- -----------------------
.. c:type:: SiftDescriptorExtractor .. c:type:: SiftDescriptorExtractor
...@@ -147,11 +141,9 @@ Wrapping class for descriptors computing using ...@@ -147,11 +141,9 @@ Wrapping class for descriptors computing using
protected: protected:
... ...
} }
..
.. index:: SurfDescriptorExtractor
.. _SurfDescriptorExtractor: .. index:: SurfDescriptorExtractor
SurfDescriptorExtractor SurfDescriptorExtractor
----------------------- -----------------------
...@@ -173,11 +165,9 @@ Wrapping class for descriptors computing using ...@@ -173,11 +165,9 @@ Wrapping class for descriptors computing using
protected: protected:
... ...
} }
..
.. index:: CalonderDescriptorExtractor
.. _CalonderDescriptorExtractor: .. index:: CalonderDescriptorExtractor
CalonderDescriptorExtractor CalonderDescriptorExtractor
--------------------------- ---------------------------
...@@ -199,7 +189,7 @@ Wrapping class for descriptors computing using ...@@ -199,7 +189,7 @@ Wrapping class for descriptors computing using
protected: protected:
... ...
} }
..
.. index:: OpponentColorDescriptorExtractor .. index:: OpponentColorDescriptorExtractor
...@@ -227,7 +217,7 @@ them into a single color descriptor. :: ...@@ -227,7 +217,7 @@ them into a single color descriptor. ::
protected: protected:
... ...
}; };
..
.. index:: BriefDescriptorExtractor .. index:: BriefDescriptorExtractor
...@@ -257,5 +247,5 @@ Strecha C., Fua P.: ''BRIEF: Binary Robust Independent Elementary Features.'' ...@@ -257,5 +247,5 @@ Strecha C., Fua P.: ''BRIEF: Binary Robust Independent Elementary Features.''
protected: protected:
... ...
}; };
..
...@@ -40,7 +40,7 @@ train descriptor index, train image index and distance between descriptors. :: ...@@ -40,7 +40,7 @@ train descriptor index, train image index and distance between descriptors. ::
// less is better // less is better
bool operator<( const DMatch &m ) const; bool operator<( const DMatch &m ) const;
}; };
..
.. index:: DescriptorMatcher .. index:: DescriptorMatcher
...@@ -102,16 +102,15 @@ with image set. :: ...@@ -102,16 +102,15 @@ with image set. ::
vector<Mat> trainDescCollection; vector<Mat> trainDescCollection;
... ...
}; };
..
.. index:: DescriptorMatcher::add .. index:: DescriptorMatcher::add
DescriptorMatcher::add DescriptorMatcher::add
-------------------------- ```` --------------------------
.. c:function:: void add( const vector<Mat>\& descriptors ) .. c:function:: void add( const vector<Mat>\& descriptors )
Add descriptors to train descriptor collection. If collection trainDescCollectionis not empty Add descriptors to train descriptor collection. If collection trainDescCollectionis not empty the new descriptors are added to existing train descriptors.
the new descriptors are added to existing train descriptors.
:param descriptors: Descriptors to add. Each ``descriptors[i]`` is a set of descriptors :param descriptors: Descriptors to add. Each ``descriptors[i]`` is a set of descriptors
from the same (one) train image. from the same (one) train image.
...@@ -119,7 +118,7 @@ the new descriptors are added to existing train descriptors. ...@@ -119,7 +118,7 @@ the new descriptors are added to existing train descriptors.
.. index:: DescriptorMatcher::getTrainDescriptors .. index:: DescriptorMatcher::getTrainDescriptors
DescriptorMatcher::getTrainDescriptors DescriptorMatcher::getTrainDescriptors
------------------------------------------ ```` ------------------------------------------
.. c:function:: const vector<Mat>\& getTrainDescriptors() const .. c:function:: const vector<Mat>\& getTrainDescriptors() const
Returns constant link to the train descriptor collection (i.e. trainDescCollection). Returns constant link to the train descriptor collection (i.e. trainDescCollection).
...@@ -154,23 +153,15 @@ DescriptorMatcher::train ...@@ -154,23 +153,15 @@ DescriptorMatcher::train
---------------------------- ----------------------------
.. c:function:: void DescriptorMatcher::train() .. c:function:: void DescriptorMatcher::train()
Train descriptor matcher (e.g. train flann index). In all methods to match the method train() Train descriptor matcher (e.g. train flann index). In all methods to match the method train() is run every time before matching. Some descriptor matchers (e.g. BruteForceMatcher) have empty implementation of this method, other matchers realy train their inner structures (e.g. FlannBasedMatcher trains flann::Index)
is run every time before matching. Some descriptor matchers (e.g. BruteForceMatcher) have empty
implementation of this method, other matchers realy train their inner structures (e.g. FlannBasedMatcher
trains flann::Index)
.. index:: DescriptorMatcher::match .. index:: DescriptorMatcher::match
DescriptorMatcher::match DescriptorMatcher::match
---------------------------- ```` ```` ```` ```` ----------------------------
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const .. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
Find the best match for each descriptor from a query set with train descriptors. Find the best match for each descriptor from a query set with train descriptors. Supposed that the query descriptors are of keypoints detected on the same query image. In first variant of this method train descriptors are set as input argument and supposed that they are of keypoints detected on the same train image. In second variant of the method train descriptors collection that was set using addmethod is used. Optional mask (or masks) can be set to describe which descriptors can be matched. queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j)is non-zero.
Supposed that the query descriptors are of keypoints detected on the same query image.
In first variant of this method train descriptors are set as input argument and
supposed that they are of keypoints detected on the same train image. In second variant
of the method train descriptors collection that was set using addmethod is used.
Optional mask (or masks) can be set to describe which descriptors can be matched. queryDescriptors[i]can be matched with trainDescriptors[j]only if mask.at<uchar>(i,j)is non-zero.
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() ) .. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
...@@ -194,9 +185,7 @@ DescriptorMatcher::knnMatch ...@@ -194,9 +185,7 @@ DescriptorMatcher::knnMatch
:func:`DescriptorMatcher::match` :func:`DescriptorMatcher::match`
.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const .. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the k best matches for each descriptor from a query set with train descriptors. Find the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order. Details about query and train descriptors see in .
Found k (or less if not possible) matches are returned in distance increasing order.
Details about query and train descriptors see in .
.. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false ) .. c:function:: void DescriptorMatcher::knnMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
...@@ -215,9 +204,7 @@ DescriptorMatcher::radiusMatch ...@@ -215,9 +204,7 @@ DescriptorMatcher::radiusMatch
:func:`DescriptorMatcher::match` :func:`DescriptorMatcher::match`
.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const .. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, const Mat\& trainDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the best matches for each query descriptor which have distance less than given threshold. Find the best matches for each query descriptor which have distance less than given threshold. Found matches are returned in distance increasing order. Details about query and train descriptors see in.
Found matches are returned in distance increasing order. Details about query and train
descriptors see in .
.. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false ) .. c:function:: void DescriptorMatcher::radiusMatch( const Mat\& queryDescriptors, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
...@@ -246,8 +233,7 @@ DescriptorMatcher::create ...@@ -246,8 +233,7 @@ DescriptorMatcher::create
:func:`DescriptorMatcher` :func:`DescriptorMatcher`
.. c:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType ) .. c:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType )
Descriptor matcher factory that creates of Descriptor matcher factory that creates of given type with default parameters (rather using default constructor).
given type with default parameters (rather using default constructor).
:param descriptorMatcherType: Descriptor matcher type. :param descriptorMatcherType: Descriptor matcher type.
...@@ -261,9 +247,7 @@ BruteForceMatcher ...@@ -261,9 +247,7 @@ BruteForceMatcher
----------------- -----------------
.. c:type:: BruteForceMatcher .. c:type:: BruteForceMatcher
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. ::
descriptor in the second set by trying each one. This descriptor matcher supports masking
permissible matches between descriptor sets. ::
template<class Distance> template<class Distance>
class BruteForceMatcher : public DescriptorMatcher class BruteForceMatcher : public DescriptorMatcher
...@@ -277,10 +261,9 @@ permissible matches between descriptor sets. :: ...@@ -277,10 +261,9 @@ permissible matches between descriptor sets. ::
protected: protected:
... ...
} }
..
For efficiency, BruteForceMatcher is templated on the distance metric.
For float descriptors, a common choice would be ``L2<float>`` . Class of supported distances are: :: For efficiency, BruteForceMatcher is templated on the distance metric. For float descriptors, a common choice would be ``L2<float>``. Class of supported distances are: ::
template<typename T> template<typename T>
struct Accumulator struct Accumulator
...@@ -340,7 +323,7 @@ For float descriptors, a common choice would be ``L2<float>`` . Class of support ...@@ -340,7 +323,7 @@ For float descriptors, a common choice would be ``L2<float>`` . Class of support
int size ) const; int size ) const;
... ...
}; };
..
.. index:: FlannBasedMatcher .. index:: FlannBasedMatcher
...@@ -350,14 +333,7 @@ FlannBasedMatcher ...@@ -350,14 +333,7 @@ FlannBasedMatcher
----------------- -----------------
.. c:type:: FlannBasedMatcher .. c:type:: FlannBasedMatcher
Flann based descriptor matcher. This matcher trains Flann based descriptor matcher. This matcher trains :func:`flann::Index` on train descriptor collection and calls it's nearest search methods to find best matches. So this matcher may be faster in cases of matching to large train collection than brute force matcher. ``FlannBasedMatcher`` does not support masking permissible matches between descriptor sets, because :func:`flann::Index` does not support this. ::
:func:`flann::Index` on
train descriptor collection and calls it's nearest search methods to find best matches.
So this matcher may be faster in cases of matching to large train collection than
brute force matcher. ``FlannBasedMatcher`` does not support masking permissible
matches between descriptor sets, because
:func:`flann::Index` does not
support this. ::
class FlannBasedMatcher : public DescriptorMatcher class FlannBasedMatcher : public DescriptorMatcher
{ {
...@@ -376,5 +352,6 @@ support this. :: ...@@ -376,5 +352,6 @@ support this. ::
protected: protected:
... ...
}; };
.. ..
...@@ -25,7 +25,7 @@ There is ...@@ -25,7 +25,7 @@ There is
:func:`DescriptorExtractor` and :func:`DescriptorExtractor` and
:func:`DescriptorMatcher` for these purposes too, but their interfaces are intended for descriptors :func:`DescriptorMatcher` for these purposes too, but their interfaces are intended for descriptors
represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors. represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors.
As
:func:`DescriptorMatcher`,``GenericDescriptorMatcher`` has two groups :func:`DescriptorMatcher`,``GenericDescriptorMatcher`` has two groups
of match methods: for matching keypoints of one image with other image or of match methods: for matching keypoints of one image with other image or
with image set. :: with image set. ::
...@@ -88,7 +88,7 @@ with image set. :: ...@@ -88,7 +88,7 @@ with image set. ::
protected: protected:
... ...
}; };
..
.. index:: GenericDescriptorMatcher::add .. index:: GenericDescriptorMatcher::add
...@@ -96,9 +96,7 @@ GenericDescriptorMatcher::add ...@@ -96,9 +96,7 @@ GenericDescriptorMatcher::add
--------------------------------- ---------------------------------
.. c:function:: void GenericDescriptorMatcher::add( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints ) .. c:function:: void GenericDescriptorMatcher::add( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints )
Adds images and keypoints from them to the train collection (descriptors are supposed to be calculated here). Adds images and keypoints from them to the train collection (descriptors are supposed to be calculated here). If train collection is not empty new image and keypoints from them will be added to existing data.
If train collection is not empty new image and keypoints from them will be added to
existing data.
:param images: Image collection. :param images: Image collection.
...@@ -135,8 +133,7 @@ GenericDescriptorMatcher::train ...@@ -135,8 +133,7 @@ GenericDescriptorMatcher::train
----------------------------------- -----------------------------------
.. c:function:: void GenericDescriptorMatcher::train() .. c:function:: void GenericDescriptorMatcher::train()
Train the object, e.g. tree-based structure to extract descriptors or Train the object, e.g. tree-based structure to extract descriptors or to optimize descriptors matching.
to optimize descriptors matching.
.. index:: GenericDescriptorMatcher::isMaskSupported .. index:: GenericDescriptorMatcher::isMaskSupported
...@@ -153,8 +150,7 @@ GenericDescriptorMatcher::classify ...@@ -153,8 +150,7 @@ GenericDescriptorMatcher::classify
:func:`GenericDescriptorMatcher::add` :func:`GenericDescriptorMatcher::add`
.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints ) const .. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints ) const
Classifies query keypoints under keypoints of one train image qiven as input argument Classifies query keypoints under keypoints of one train image qiven as input argument (first version of the method) or train image collection that set using (second version).
(first version of the method) or train image collection that set using (second version).
.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints ) .. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints )
...@@ -173,9 +169,7 @@ GenericDescriptorMatcher::match ...@@ -173,9 +169,7 @@ GenericDescriptorMatcher::match
:func:`GenericDescriptorMatcher::add` :func:`DescriptorMatcher::match` :func:`GenericDescriptorMatcher::add` :func:`DescriptorMatcher::match`
.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const .. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<DMatch>\& matches, const Mat\& mask=Mat() ) const
Find best match for query keypoints to the training set. In first version of method Find best match for query keypoints to the training set. In first version of method one train image and keypoints detected on it - are input arguments. In second version query keypoints are matched to training collectin that set using . As in the mask can be set.
one train image and keypoints detected on it - are input arguments. In second version
query keypoints are matched to training collectin that set using . As in the mask can be set.
.. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() ) .. c:function:: void GenericDescriptorMatcher::match( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
...@@ -204,9 +198,7 @@ GenericDescriptorMatcher::knnMatch ...@@ -204,9 +198,7 @@ GenericDescriptorMatcher::knnMatch
:func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::knnMatch` :func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::knnMatch`
.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const .. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, int k, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the knn best matches for each keypoint from a query set with train keypoints. Find the knn best matches for each keypoint from a query set with train keypoints. Found knn (or less if not possible) matches are returned in distance increasing order. Details see in and.
Found knn (or less if not possible) matches are returned in distance increasing order.
Details see in and .
.. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false ) .. c:function:: void GenericDescriptorMatcher::knnMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, int k, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
...@@ -217,8 +209,7 @@ GenericDescriptorMatcher::radiusMatch ...@@ -217,8 +209,7 @@ GenericDescriptorMatcher::radiusMatch
:func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::radiusMatch` :func:`GenericDescriptorMatcher::match` :func:`DescriptorMatcher::radiusMatch`
.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const .. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, const Mat\& trainImage, vector<KeyPoint>\& trainKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const Mat\& mask=Mat(), bool compactResult=false ) const
Find the best matches for each query keypoint which have distance less than given threshold. Find the best matches for each query keypoint which have distance less than given threshold. Found matches are returned in distance increasing order. Details see in and .
Found matches are returned in distance increasing order. Details see in and .
.. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false ) .. c:function:: void GenericDescriptorMatcher::radiusMatch( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints, vector<vector<DMatch> >\& matches, float maxDistance, const vector<Mat>\& masks=vector<Mat>(), bool compactResult=false )
...@@ -309,11 +300,9 @@ Wrapping class for computing, matching and classification of descriptors using ...@@ -309,11 +300,9 @@ Wrapping class for computing, matching and classification of descriptors using
protected: protected:
... ...
}; };
..
.. index:: FernDescriptorMatcher
.. _FernDescriptorMatcher: .. index:: FernDescriptorMatcher
FernDescriptorMatcher FernDescriptorMatcher
--------------------- ---------------------
...@@ -368,7 +357,7 @@ Wrapping class for computing, matching and classification of descriptors using ...@@ -368,7 +357,7 @@ Wrapping class for computing, matching and classification of descriptors using
protected: protected:
... ...
}; };
..
.. index:: VectorDescriptorMatcher .. index:: VectorDescriptorMatcher
...@@ -400,11 +389,11 @@ Class used for matching descriptors that can be described as vectors in a finite ...@@ -400,11 +389,11 @@ Class used for matching descriptors that can be described as vectors in a finite
protected: protected:
... ...
}; };
..
Example of creating: :: Example of creating: ::
VectorDescriptorMatcher matcher( new SurfDescriptorExtractor, VectorDescriptorMatcher matcher( new SurfDescriptorExtractor,
new BruteForceMatcher<L2<float> > ); new BruteForceMatcher<L2<float> > );
..
...@@ -7,12 +7,11 @@ Drawing Function of Keypoints and Matches ...@@ -7,12 +7,11 @@ Drawing Function of Keypoints and Matches
drawMatches drawMatches
--------------- ---------------
.. c:function:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<DMatch>\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<char>\& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT ) .. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<char>& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
This function draws matches of keypints from two images on output image. This function draws matches of keypints from two images on output image. Match is a line connecting two keypoints (circles).
Match is a line connecting two keypoints (circles).
.. c:function:: void drawMatches( const Mat\& img1, const vector<KeyPoint>\& keypoints1, const Mat\& img2, const vector<KeyPoint>\& keypoints2, const vector<vector<DMatch> >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector<vector<char>>\& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT ) .. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<vector<DMatch> >& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<vector<char>>& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT )
:param img1: First source image. :param img1: First source image.
...@@ -24,45 +23,43 @@ Match is a line connecting two keypoints (circles). ...@@ -24,45 +23,43 @@ Match is a line connecting two keypoints (circles).
:param matches: Matches from first image to second one, i.e. ``keypoints1[i]`` has corresponding point ``keypoints2[matches[i]]`` . :param matches: Matches from first image to second one, i.e. ``keypoints1[i]`` has corresponding point ``keypoints2[matches[i]]`` .
:param outImg: Output image. Its content depends on ``flags`` value :param outImg: Output image. Its content depends on ``flags`` value what is drawn in output image. See below possible ``flags`` bit values.
what is drawn in output image. See below possible ``flags`` bit values.
:param matchColor: Color of matches (lines and connected keypoints). :param matchColor: Color of matches (lines and connected keypoints). If ``matchColor==Scalar::all(-1)`` color will be generated randomly.
If ``matchColor==Scalar::all(-1)`` color will be generated randomly.
:param singlePointColor: Color of single keypoints (circles), i.e. keypoints not having the matches. :param singlePointColor: Color of single keypoints (circles), i.e. keypoints not having the matches. If ``singlePointColor==Scalar::all(-1)`` color will be generated randomly.
If ``singlePointColor==Scalar::all(-1)`` color will be generated randomly.
:param matchesMask: Mask determining which matches will be drawn. If mask is empty all matches will be drawn. :param matchesMask: Mask determining which matches will be drawn. If mask is empty all matches will be drawn.
:param flags: Each bit of ``flags`` sets some feature of drawing. :param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` ::
Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` , see below. ::
struct DrawMatchesFlags
struct DrawMatchesFlags {
{ enum{ DEFAULT = 0, // Output image matrix will be created (Mat::create),
enum{ DEFAULT = 0, // Output image matrix will be created (Mat::create), // i.e. existing memory of output image may be reused.
// i.e. existing memory of output image may be reused. // Two source image, matches and single keypoints
// Two source image, matches and single keypoints // will be drawn.
// will be drawn. // For each keypoint only the center point will be
// For each keypoint only the center point will be // drawn (without the circle around keypoint with
// drawn (without the circle around keypoint with // keypoint size and orientation).
// keypoint size and orientation). DRAW_OVER_OUTIMG = 1, // Output image matrix will not be
DRAW_OVER_OUTIMG = 1, // Output image matrix will not be // created (Mat::create). Matches will be drawn
// created (Mat::create). Matches will be drawn // on existing content of output image.
// on existing content of output image. NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn.
NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn. DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around
DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around // keypoint with keypoint size and orientation will
// keypoint with keypoint size and orientation will // be drawn.
// be drawn. };
}; };
};
.. ..
.. index:: drawKeypoints .. index:: drawKeypoints
drawKeypoints drawKeypoints
----------------- -----------------
.. c:function:: void drawKeypoints( const Mat\& image, const vector<KeyPoint>\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ) .. c:function:: void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, Mat& outImg, const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT )
Draw keypoints. Draw keypoints.
...@@ -70,14 +67,9 @@ drawKeypoints ...@@ -70,14 +67,9 @@ drawKeypoints
:param keypoints: Keypoints from source image. :param keypoints: Keypoints from source image.
:param outImg: Output image. Its content depends on ``flags`` value :param outImg: Output image. Its content depends on ``flags`` value what is drawn in output image. See possible ``flags`` bit values.
what is drawn in output image. See possible ``flags`` bit values.
:param color: Color of keypoints
. :param color: Color of keypoints.
:param flags: Each bit of ``flags`` sets some feature of drawing. :param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags``, see above in :func:`drawMatches` .
Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` ,
see above in :func:`drawMatches` .
...@@ -36,12 +36,12 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :: ...@@ -36,12 +36,12 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
protected: protected:
... ...
}; };
..
.. index:: BOWTrainer::add .. index:: BOWTrainer::add
BOWTrainer::add BOWTrainer::add
------------------- ```` -------------------
.. c:function:: void BOWTrainer::add( const Mat\& descriptors ) .. c:function:: void BOWTrainer::add( const Mat\& descriptors )
Add descriptors to training set. The training set will be clustered using clustermethod to construct vocabulary. Add descriptors to training set. The training set will be clustered using clustermethod to construct vocabulary.
...@@ -70,14 +70,11 @@ BOWTrainer::cluster ...@@ -70,14 +70,11 @@ BOWTrainer::cluster
----------------------- -----------------------
.. c:function:: Mat BOWTrainer::cluster() const .. c:function:: Mat BOWTrainer::cluster() const
Cluster train descriptors. Vocabulary consists from cluster centers. So this method Cluster train descriptors. Vocabulary consists from cluster centers. So this method returns vocabulary. In first method variant the stored in object train descriptors will be clustered, in second variant -- input descriptors will be clustered.
returns vocabulary. In first method variant the stored in object train descriptors will be
clustered, in second variant -- input descriptors will be clustered.
.. c:function:: Mat BOWTrainer::cluster( const Mat\& descriptors ) const .. c:function:: Mat BOWTrainer::cluster( const Mat\& descriptors ) const
:param descriptors: Descriptors to cluster. Each row of ``descriptors`` matrix is a one descriptor. Descriptors will not be added :param descriptors: Descriptors to cluster. Each row of ``descriptors`` matrix is a one descriptor. Descriptors will not be added to the inner train descriptor set.
to the inner train descriptor set.
.. index:: BOWKMeansTrainer .. index:: BOWKMeansTrainer
...@@ -103,7 +100,7 @@ BOWKMeansTrainer ...@@ -103,7 +100,7 @@ BOWKMeansTrainer
protected: protected:
... ...
}; };
..
To gain an understanding of constructor parameters see To gain an understanding of constructor parameters see
:func:`kmeans` function :func:`kmeans` function
...@@ -117,35 +114,32 @@ BOWImgDescriptorExtractor ...@@ -117,35 +114,32 @@ BOWImgDescriptorExtractor
------------------------- -------------------------
.. c:type:: BOWImgDescriptorExtractor .. c:type:: BOWImgDescriptorExtractor
Class to compute image descriptor using ''bad of visual words''. In few, Class to compute image descriptor using ''bad of visual words''. In few, such computing consists from the following steps:
such computing consists from the following steps:
1. Compute descriptors for given image and it's keypoints set,
\
2. Find nearest visual words from vocabulary for each keypoint descriptor,
\
3. Image descriptor is a normalized histogram of vocabulary words encountered in the image. I.e.
``i`` -bin of the histogram is a frequency of ``i`` -word of vocabulary in the given image. ::
class BOWImgDescriptorExtractor #. Compute descriptors for given image and it's keypoints set
{ #. Find nearest visual words from vocabulary for each keypoint descriptor,
public: #. Image descriptor is a normalized histogram of vocabulary words encountered in the image. I.e. ``i`` -bin of the histogram is a frequency of ``i`` -word of vocabulary in the given image. ::
BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor,
const Ptr<DescriptorMatcher>& dmatcher ); class BOWImgDescriptorExtractor
virtual ~BOWImgDescriptorExtractor(){} {
public:
void setVocabulary( const Mat& vocabulary ); BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor,
const Mat& getVocabulary() const; const Ptr<DescriptorMatcher>& dmatcher );
void compute( const Mat& image, vector<KeyPoint>& keypoints, virtual ~BOWImgDescriptorExtractor(){}
Mat& imgDescriptor,
vector<vector<int> >* pointIdxsOfClusters=0, void setVocabulary( const Mat& vocabulary );
Mat* descriptors=0 ); const Mat& getVocabulary() const;
int descriptorSize() const; void compute( const Mat& image, vector<KeyPoint>& keypoints,
int descriptorType() const; Mat& imgDescriptor,
vector<vector<int> >* pointIdxsOfClusters=0,
Mat* descriptors=0 );
int descriptorSize() const;
int descriptorType() const;
protected:
...
};
protected:
...
};
..
.. index:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor .. index:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
...@@ -155,11 +149,9 @@ BOWImgDescriptorExtractor::BOWImgDescriptorExtractor ...@@ -155,11 +149,9 @@ BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
Constructor. Constructor.
:param dextractor: Descriptor extractor that will be used to compute descriptors :param dextractor: Descriptor extractor that will be used to compute descriptors for input image and it's keypoints.
for input image and it's keypoints.
:param dmatcher: Descriptor matcher that will be used to find nearest word of trained vocabulary to :param dmatcher: Descriptor matcher that will be used to find nearest word of trained vocabulary to each keupoints descriptor of the image.
each keupoints descriptor of the image.
.. index:: BOWImgDescriptorExtractor::setVocabulary .. index:: BOWImgDescriptorExtractor::setVocabulary
...@@ -169,8 +161,7 @@ BOWImgDescriptorExtractor::setVocabulary ...@@ -169,8 +161,7 @@ BOWImgDescriptorExtractor::setVocabulary
Method to set visual vocabulary. Method to set visual vocabulary.
:param vocabulary: Vocabulary (can be trained using inheritor of :func:`BOWTrainer` ). :param vocabulary: Vocabulary (can be trained using inheritor of :func:`BOWTrainer` ). Each row of vocabulary is a one visual word (cluster center).
Each row of vocabulary is a one visual word (cluster center).
.. index:: BOWImgDescriptorExtractor::getVocabulary .. index:: BOWImgDescriptorExtractor::getVocabulary
...@@ -194,8 +185,7 @@ BOWImgDescriptorExtractor::compute ...@@ -194,8 +185,7 @@ BOWImgDescriptorExtractor::compute
:param imgDescriptor: This is output, i.e. computed image descriptor. :param imgDescriptor: This is output, i.e. computed image descriptor.
:param pointIdxsOfClusters: Indices of keypoints which belong to the cluster, i.e. ``pointIdxsOfClusters[i]`` is keypoint indices which belong :param pointIdxsOfClusters: Indices of keypoints which belong to the cluster, i.e. ``pointIdxsOfClusters[i]`` is keypoint indices which belong to the ``i-`` cluster (word of vocabulary) (returned if it is not 0.)
to the ``i-`` cluster (word of vocabulary) (returned if it is not 0.)
:param descriptors: Descriptors of the image keypoints (returned if it is not 0.) :param descriptors: Descriptors of the image keypoints (returned if it is not 0.)
......
...@@ -45,11 +45,11 @@ This class computes the disparity map using block matching algorithm. The class ...@@ -45,11 +45,11 @@ This class computes the disparity map using block matching algorithm. The class
:math:`>` 0). If ``avergeTexThreshold = 0`` low textureness filtering is disabled, otherwise disparity is set to 0 in each point ``(x, y)`` where for left image :math:`>` 0). If ``avergeTexThreshold = 0`` low textureness filtering is disabled, otherwise disparity is set to 0 in each point ``(x, y)`` where for left image
:math:`\sum HorizontalGradiensInWindow(x, y, winSize) < (winSize \cdot winSize) \cdot avergeTexThreshold` i.e. input left image is low textured. :math:`\sum HorizontalGradiensInWindow(x, y, winSize) < (winSize \cdot winSize) \cdot avergeTexThreshold` i.e. input left image is low textured.
.. index:: cv::gpu::StereoBM_GPU::StereoBM_GPU .. index:: gpu::StereoBM_GPU::StereoBM_GPU
.. _cv::gpu::StereoBM_GPU::StereoBM_GPU: .. _gpu::StereoBM_GPU::StereoBM_GPU:
cv::gpu::StereoBM_GPU::StereoBM_GPU gpu::StereoBM_GPU::StereoBM_GPU
-----------------------------------_ -----------------------------------_
.. c:function:: StereoBM_GPU::StereoBM_GPU() .. c:function:: StereoBM_GPU::StereoBM_GPU()
...@@ -67,11 +67,11 @@ cv::gpu::StereoBM_GPU::StereoBM_GPU ...@@ -67,11 +67,11 @@ cv::gpu::StereoBM_GPU::StereoBM_GPU
:param winSize: Block size. :param winSize: Block size.
.. index:: cv::gpu::StereoBM_GPU::operator () .. index:: gpu::StereoBM_GPU::operator ()
.. _cv::gpu::StereoBM_GPU::operator (): .. _gpu::StereoBM_GPU::operator ():
cv::gpu::StereoBM_GPU::operator () gpu::StereoBM_GPU::operator ()
---------------------------------- ----------------------------------
.. c:function:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity) .. c:function:: void StereoBM_GPU::operator() (const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
...@@ -87,11 +87,11 @@ cv::gpu::StereoBM_GPU::operator () ...@@ -87,11 +87,11 @@ cv::gpu::StereoBM_GPU::operator ()
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. index:: cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable .. index:: gpu::StereoBM_GPU::checkIfGpuCallReasonable
.. _cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable: .. _gpu::StereoBM_GPU::checkIfGpuCallReasonable:
cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable gpu::StereoBM_GPU::checkIfGpuCallReasonable
----------------------------------------------- -----------------------------------------------
.. c:function:: bool StereoBM_GPU::checkIfGpuCallReasonable() .. c:function:: bool StereoBM_GPU::checkIfGpuCallReasonable()
...@@ -169,7 +169,7 @@ for data cost storage. ``width_step`` is the number of bytes in a line including ...@@ -169,7 +169,7 @@ for data cost storage. ``width_step`` is the number of bytes in a line including
.. index:: gpu::StereoBeliefPropagation::StereoBeliefPropagation .. index:: gpu::StereoBeliefPropagation::StereoBeliefPropagation
cv::gpu::StereoBeliefPropagation::StereoBeliefPropagation gpu::StereoBeliefPropagation::StereoBeliefPropagation
--------------------------------------------------------- ---------------------------------------------------------
.. c:function:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int msg_type = CV_32F) .. c:function:: StereoBeliefPropagation::StereoBeliefPropagation( int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int msg_type = CV_32F)
...@@ -191,8 +191,9 @@ cv::gpu::StereoBeliefPropagation::StereoBeliefPropagation ...@@ -191,8 +191,9 @@ cv::gpu::StereoBeliefPropagation::StereoBeliefPropagation
:param disc_single_jump: Discontinuity single jump. :param disc_single_jump: Discontinuity single jump.
:param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1`` . :param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1``.
``StereoBeliefPropagation`` uses truncated linear model for the data cost and discontinuity term:
``StereoBeliefPropagation`` uses truncated linear model for the data cost and discontinuity term:
.. math:: .. math::
...@@ -214,15 +215,16 @@ By default ``StereoBeliefPropagation`` uses floating-point arithmetics and ``CV_ ...@@ -214,15 +215,16 @@ By default ``StereoBeliefPropagation`` uses floating-point arithmetics and ``CV_
.. index:: gpu::StereoBeliefPropagation::estimateRecommendedParams .. index:: gpu::StereoBeliefPropagation::estimateRecommendedParams
cv::gpu::StereoBeliefPropagation::estimateRecommendedParams gpu::StereoBeliefPropagation::estimateRecommendedParams
----------------------------------------------------------- ```` ```` ```` ```` ```` -----------------------------------------------------------
.. c:function:: void StereoBeliefPropagation::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels) .. c:function:: void StereoBeliefPropagation::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels)
Some heuristics that tries to compute recommended parameters (ndisp, itersand levels) for specified image size (widthand height). Some heuristics that tries to compute recommended parameters (ndisp, itersand levels) for specified image size (widthand height).
.. index:: gpu::StereoBeliefPropagation::operator () .. index:: gpu::StereoBeliefPropagation::operator ()
cv::gpu::StereoBeliefPropagation::operator () gpu::StereoBeliefPropagation::operator ()
--------------------------------------------- ---------------------------------------------
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity) .. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
...@@ -313,7 +315,7 @@ qx_csbp ...@@ -313,7 +315,7 @@ qx_csbp
.. index:: gpu::StereoConstantSpaceBP::StereoConstantSpaceBP .. index:: gpu::StereoConstantSpaceBP::StereoConstantSpaceBP
cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP gpu::StereoConstantSpaceBP::StereoConstantSpaceBP
----------------------------------------------------- -----------------------------------------------------
.. c:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int nr_plane = DEFAULT_NR_PLANE, int msg_type = CV_32F) .. c:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int nr_plane = DEFAULT_NR_PLANE, int msg_type = CV_32F)
...@@ -340,7 +342,8 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP ...@@ -340,7 +342,8 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP
:param min_disp_th: Minimal disparity threshold. :param min_disp_th: Minimal disparity threshold.
:param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1`` . :param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1`` .
``StereoConstantSpaceBP`` uses truncated linear model for the data cost and discontinuity term:
``StereoConstantSpaceBP`` uses truncated linear model for the data cost and discontinuity term:
.. math:: .. math::
...@@ -362,15 +365,16 @@ By default ``StereoConstantSpaceBP`` uses floating-point arithmetics and ``CV_32 ...@@ -362,15 +365,16 @@ By default ``StereoConstantSpaceBP`` uses floating-point arithmetics and ``CV_32
.. index:: gpu::StereoConstantSpaceBP::estimateRecommendedParams .. index:: gpu::StereoConstantSpaceBP::estimateRecommendedParams
cv::gpu::StereoConstantSpaceBP::estimateRecommendedParams gpu::StereoConstantSpaceBP::estimateRecommendedParams
--------------------------------------------------------- ```` ```` ```` ``_`` ```` ```` ---------------------------------------------------------
.. c:function:: void StereoConstantSpaceBP::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels, int\& nr_plane) .. c:function:: void StereoConstantSpaceBP::estimateRecommendedParams( int width, int height, int\& ndisp, int\& iters, int\& levels, int\& nr_plane)
Some heuristics that tries to compute parameters (ndisp, iters, levelsand nrplane) for specified image size (widthand height). Some heuristics that tries to compute parameters (ndisp, iters, levelsand nrplane) for specified image size (widthand height).
.. index:: gpu::StereoConstantSpaceBP::operator () .. index:: gpu::StereoConstantSpaceBP::operator ()
cv::gpu::StereoConstantSpaceBP::operator () gpu::StereoConstantSpaceBP::operator ()
------------------------------------------- -------------------------------------------
.. c:function:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity) .. c:function:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
...@@ -425,7 +429,7 @@ qx_csbp ...@@ -425,7 +429,7 @@ qx_csbp
.. index:: gpu::DisparityBilateralFilter::DisparityBilateralFilter .. index:: gpu::DisparityBilateralFilter::DisparityBilateralFilter
cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter gpu::DisparityBilateralFilter::DisparityBilateralFilter
----------------------------------------------------------- -----------------------------------------------------------
.. c:function:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp = DEFAULT_NDISP, int radius = DEFAULT_RADIUS, int iters = DEFAULT_ITERS) .. c:function:: DisparityBilateralFilter::DisparityBilateralFilter( int ndisp = DEFAULT_NDISP, int radius = DEFAULT_RADIUS, int iters = DEFAULT_ITERS)
...@@ -447,7 +451,7 @@ cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter ...@@ -447,7 +451,7 @@ cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter
.. index:: gpu::DisparityBilateralFilter::operator () .. index:: gpu::DisparityBilateralFilter::operator ()
cv::gpu::DisparityBilateralFilter::operator () gpu::DisparityBilateralFilter::operator ()
---------------------------------------------- ----------------------------------------------
.. c:function:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst) .. c:function:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst)
...@@ -465,11 +469,11 @@ cv::gpu::DisparityBilateralFilter::operator () ...@@ -465,11 +469,11 @@ cv::gpu::DisparityBilateralFilter::operator ()
.. index:: gpu::drawColorDisp .. index:: gpu::drawColorDisp
cv::gpu::drawColorDisp gpu::drawColorDisp
---------------------- ----------------------
.. c:function:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp) .. c:function:: void gpu::drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp)
.. c:function:: void drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp, const Stream\& stream) .. c:function:: void gpu::drawColorDisp(const GpuMat\& src_disp, GpuMat\& dst_disp, int ndisp, const Stream\& stream)
Does coloring of disparity image. Does coloring of disparity image.
...@@ -487,11 +491,11 @@ This function converts ...@@ -487,11 +491,11 @@ This function converts
.. index:: gpu::reprojectImageTo3D .. index:: gpu::reprojectImageTo3D
cv::gpu::reprojectImageTo3D gpu::reprojectImageTo3D
--------------------------- ---------------------------
.. c:function:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q) .. c:function:: void gpu::reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q)
.. c:function:: void reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q, const Stream\& stream) .. c:function:: void gpu::reprojectImageTo3D(const GpuMat\& disp, GpuMat\& xyzw, const Mat\& Q, const Stream\& stream)
Reprojects disparity image to 3D space. Reprojects disparity image to 3D space.
......
...@@ -3,13 +3,13 @@ Data Structures ...@@ -3,13 +3,13 @@ Data Structures
.. highlight:: cpp .. highlight:: cpp
.. index:: gpu::DevMem2D_ .. index:: gpu::DevMem2D\_
.. _gpu::DevMem2D_: .. _gpu::DevMem2D_:
gpu::DevMem2D_ gpu::DevMem2D\_
-------------- ---------------
.. c:type:: gpu::DevMem2D_ .. c:type:: gpu::DevMem2D\_
This is a simple lightweight class that encapsulate pitched memory on GPU. It is intended to pass to nvcc-compiled code, i.e. CUDA kernels. So it is used internally by OpenCV and by users writes own device code. Its members can be called both from host and from device code. :: This is a simple lightweight class that encapsulate pitched memory on GPU. It is intended to pass to nvcc-compiled code, i.e. CUDA kernels. So it is used internally by OpenCV and by users writes own device code. Its members can be called both from host and from device code. ::
...@@ -21,7 +21,7 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is ...@@ -21,7 +21,7 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is
size_t step; size_t step;
DevMem2D_() : cols(0), rows(0), data(0), step(0){}; DevMem2D_() : cols(0), rows(0), data(0), step(0){};
DevMem2D_(int rows_, int cols_, T *data_, size_t step_); DevMem2D_(int rows, int cols, T *data, size_t step);
template <typename U> template <typename U>
explicit DevMem2D_(const DevMem2D_<U>& d); explicit DevMem2D_(const DevMem2D_<U>& d);
...@@ -37,15 +37,15 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is ...@@ -37,15 +37,15 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is
}; };
.. index:: gpu::PtrStep_ .. index:: gpu::PtrStep\_
.. _gpu::PtrStep_: .. gpu::PtrStep\_:
gpu::PtrStep_ gpu::PtrStep\_
------------- --------------
.. c:type:: gpu::PtrStep_ .. c:type:: gpu::PtrStep\_
This is structure is similar to DevMem2D_but contains only pointer and row step. Width and height fields are excluded due to performance reasons. The structure is for internal use or for users who write own device code. :: This is structure is similar to DevMem2D\_ but contains only pointer and row step. Width and height fields are excluded due to performance reasons. The structure is for internal use or for users who write own device code. ::
template<typename T> struct PtrStep_ template<typename T> struct PtrStep_
{ {
...@@ -64,13 +64,13 @@ This is structure is similar to DevMem2D_but contains only pointer and row step. ...@@ -64,13 +64,13 @@ This is structure is similar to DevMem2D_but contains only pointer and row step.
}; };
.. index:: gpu::PtrElemStrp_ .. index:: gpu::PtrElemStrp\_
.. _gpu::PtrElemStrp_: .. gpu::PtrElemStrp\_:
gpu::PtrElemStrp_ gpu::PtrElemStrp\_
----------------- ------------------
.. c:type:: gpu::PtrElemStrp_ .. c:type:: gpu::PtrElemStrp\_
This is structure is similar to DevMem2D_but contains only pointer and row step in elements. Width and height fields are excluded due to performance reasons. This class is can only be constructed if sizeof(T) is a multiple of 256. The structure is for internal use or for users who write own device code. :: This is structure is similar to DevMem2D_but contains only pointer and row step in elements. Width and height fields are excluded due to performance reasons. This class is can only be constructed if sizeof(T) is a multiple of 256. The structure is for internal use or for users who write own device code. ::
...@@ -84,7 +84,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step ...@@ -84,7 +84,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step
.. index:: gpu::GpuMat .. index:: gpu::GpuMat
.. _gpu::GpuMat: .. gpu::GpuMat:
gpu::GpuMat gpu::GpuMat
----------- -----------
...@@ -136,9 +136,8 @@ Is it a bad practice to leave static or global GpuMat variables allocated, i.e. ...@@ -136,9 +136,8 @@ Is it a bad practice to leave static or global GpuMat variables allocated, i.e.
See also: See also:
:func:`Mat` :func:`Mat`
.. index:: gpu::CudaMem
.. _gpu::CudaMem: .. index:: gpu::CudaMem
gpu::CudaMem gpu::CudaMem
------------ ------------
...@@ -187,18 +186,18 @@ Please note that allocation size of such memory types is usually limited. For mo ...@@ -187,18 +186,18 @@ Please note that allocation size of such memory types is usually limited. For mo
.. index:: gpu::CudaMem::createMatHeader .. index:: gpu::CudaMem::createMatHeader
cv::gpu::CudaMem::createMatHeader gpu::CudaMem::createMatHeader
--------------------------------- ---------------------------------
:func:`Mat`
.. c:function:: Mat CudaMem::createMatHeader() const
.. c:function:: CudaMem::operator Mat() const .. cpp:function:: Mat CudaMem::createMatHeader() const
.. cpp:function:: CudaMem::operator Mat() const
Creates header without reference counting to CudaMem data. Creates header without reference counting to CudaMem data.
.. index:: gpu::CudaMem::createGpuMatHeader .. index:: gpu::CudaMem::createGpuMatHeader
cv::gpu::CudaMem::createGpuMatHeader gpu::CudaMem::createGpuMatHeader
------------------------------------ ------------------------------------
:func:`gpu::GpuMat` ``_`` :func:`gpu::GpuMat` ``_``
.. c:function:: GpuMat CudaMem::createGpuMatHeader() const .. c:function:: GpuMat CudaMem::createGpuMatHeader() const
...@@ -209,8 +208,8 @@ cv::gpu::CudaMem::createGpuMatHeader ...@@ -209,8 +208,8 @@ cv::gpu::CudaMem::createGpuMatHeader
.. index:: gpu::CudaMem::canMapHostMemory .. index:: gpu::CudaMem::canMapHostMemory
cv::gpu::CudaMem::canMapHostMemory gpu::CudaMem::canMapHostMemory
---------------------------------- ``_`` ----------------------------------
.. c:function:: static bool CudaMem::canMapHostMemory() .. c:function:: static bool CudaMem::canMapHostMemory()
Returns true if the current hardware supports address space mapping and ALLOCZEROCOPYmemory allocation Returns true if the current hardware supports address space mapping and ALLOCZEROCOPYmemory allocation
...@@ -270,7 +269,7 @@ This class encapsulated queue of the asynchronous calls. Some functions have ove ...@@ -270,7 +269,7 @@ This class encapsulated queue of the asynchronous calls. Some functions have ove
.. index:: gpu::Stream::queryIfComplete .. index:: gpu::Stream::queryIfComplete
cv::gpu::Stream::queryIfComplete gpu::Stream::queryIfComplete
-------------------------------- --------------------------------
.. c:function:: bool Stream::queryIfComplete() .. c:function:: bool Stream::queryIfComplete()
...@@ -278,7 +277,7 @@ cv::gpu::Stream::queryIfComplete ...@@ -278,7 +277,7 @@ cv::gpu::Stream::queryIfComplete
.. index:: gpu::Stream::waitForCompletion .. index:: gpu::Stream::waitForCompletion
cv::gpu::Stream::waitForCompletion gpu::Stream::waitForCompletion
---------------------------------- ----------------------------------
.. c:function:: void Stream::waitForCompletion() .. c:function:: void Stream::waitForCompletion()
...@@ -303,7 +302,7 @@ This class provides possibility to get ``cudaStream_t`` from ...@@ -303,7 +302,7 @@ This class provides possibility to get ``cudaStream_t`` from
.. index:: gpu::createContinuous .. index:: gpu::createContinuous
cv::gpu::createContinuous gpu::createContinuous
------------------------- -------------------------
.. c:function:: void createContinuous(int rows, int cols, int type, GpuMat\& m) .. c:function:: void createContinuous(int rows, int cols, int type, GpuMat\& m)
...@@ -329,7 +328,7 @@ Matrix is called continuous if its elements are stored continuously, i.e. wuthou ...@@ -329,7 +328,7 @@ Matrix is called continuous if its elements are stored continuously, i.e. wuthou
.. index:: gpu::ensureSizeIsEnough .. index:: gpu::ensureSizeIsEnough
cv::gpu::ensureSizeIsEnough gpu::ensureSizeIsEnough
--------------------------- ---------------------------
.. c:function:: void ensureSizeIsEnough(int rows, int cols, int type, GpuMat\& m) .. c:function:: void ensureSizeIsEnough(int rows, int cols, int type, GpuMat\& m)
......
This diff is collapsed.
This diff is collapsed.
...@@ -5,9 +5,9 @@ Matrix Reductions ...@@ -5,9 +5,9 @@ Matrix Reductions
.. index:: gpu::meanStdDev .. index:: gpu::meanStdDev
cv::gpu::meanStdDev gpu::meanStdDev
------------------- -------------------
.. c:function:: void meanStdDev(const GpuMat\& mtx, Scalar\& mean, Scalar\& stddev) .. c:function:: void gpu::meanStdDev(const GpuMat\& mtx, Scalar\& mean, Scalar\& stddev)
Computes mean value and standard deviation of matrix elements. Computes mean value and standard deviation of matrix elements.
...@@ -22,9 +22,9 @@ See also: ...@@ -22,9 +22,9 @@ See also:
.. index:: gpu::norm .. index:: gpu::norm
cv::gpu::norm gpu::norm
------------- -------------
.. c:function:: double norm(const GpuMat\& src, int normType=NORM_L2) .. c:function:: double gpu::norm(const GpuMat\& src, int normType=NORM_L2)
Returns norm of matrix (or of two matrices difference). Returns norm of matrix (or of two matrices difference).
...@@ -45,8 +45,7 @@ cv::gpu::norm ...@@ -45,8 +45,7 @@ cv::gpu::norm
* **src1** First source matrix. ``CV_8UC1`` matrices are supported for now. * **src1** First source matrix. ``CV_8UC1`` matrices are supported for now.
* **src2** Second source matrix. Must have the same size and type as ``src1`` * **src2** Second source matrix. Must have the same size and type as ``src1``.
.
* **normType** Norm type. ``NORM_L1`` , ``NORM_L2`` and ``NORM_INF`` are supported for now. * **normType** Norm type. ``NORM_L1`` , ``NORM_L2`` and ``NORM_INF`` are supported for now.
...@@ -55,11 +54,11 @@ See also: ...@@ -55,11 +54,11 @@ See also:
.. index:: gpu::sum .. index:: gpu::sum
cv::gpu::sum gpu::sum
------------ ------------
.. c:function:: Scalar sum(const GpuMat\& src) .. c:function:: Scalar gpu::sum(const GpuMat\& src)
.. c:function:: Scalar sum(const GpuMat\& src, GpuMat\& buf) .. c:function:: Scalar gpu::sum(const GpuMat\& src, GpuMat\& buf)
Returns sum of matrix elements. Returns sum of matrix elements.
...@@ -72,11 +71,11 @@ See also: ...@@ -72,11 +71,11 @@ See also:
.. index:: gpu::absSum .. index:: gpu::absSum
cv::gpu::absSum gpu::absSum
--------------- ---------------
.. c:function:: Scalar absSum(const GpuMat\& src) .. c:function:: Scalar gpu::absSum(const GpuMat\& src)
.. c:function:: Scalar absSum(const GpuMat\& src, GpuMat\& buf) .. c:function:: Scalar gpu::absSum(const GpuMat\& src, GpuMat\& buf)
Returns sum of matrix elements absolute values. Returns sum of matrix elements absolute values.
...@@ -86,11 +85,11 @@ cv::gpu::absSum ...@@ -86,11 +85,11 @@ cv::gpu::absSum
.. index:: gpu::sqrSum .. index:: gpu::sqrSum
cv::gpu::sqrSum gpu::sqrSum
--------------- ---------------
.. c:function:: Scalar sqrSum(const GpuMat\& src) .. c:function:: Scalar gpu::sqrSum(const GpuMat\& src)
.. c:function:: Scalar sqrSum(const GpuMat\& src, GpuMat\& buf) .. c:function:: Scalar gpu::sqrSum(const GpuMat\& src, GpuMat\& buf)
Returns squared sum of matrix elements. Returns squared sum of matrix elements.
...@@ -100,13 +99,11 @@ cv::gpu::sqrSum ...@@ -100,13 +99,11 @@ cv::gpu::sqrSum
.. index:: gpu::minMax .. index:: gpu::minMax
cv::gpu::minMax gpu::minMax
--------------- ---------------
.. c:function:: void minMax(const GpuMat\& src, double* minVal, .. c:function:: void gpu::minMax(const GpuMat\& src, double* minVal, double* maxVal=0, const GpuMat\& mask=GpuMat())
double* maxVal=0, const GpuMat\& mask=GpuMat())
.. c:function:: void minMax(const GpuMat\& src, double* minVal, double* maxVal, .. c:function:: void gpu::minMax(const GpuMat\& src, double* minVal, double* maxVal, const GpuMat\& mask, GpuMat\& buf)
const GpuMat\& mask, GpuMat\& buf)
Finds global minimum and maximum matrix elements and returns their values. Finds global minimum and maximum matrix elements and returns their values.
...@@ -127,13 +124,13 @@ See also: ...@@ -127,13 +124,13 @@ See also:
.. index:: gpu::minMaxLoc .. index:: gpu::minMaxLoc
cv::gpu::minMaxLoc gpu::minMaxLoc
------------------ ------------------
.. c:function:: void minMaxLoc(const GpuMat\& src, double\* minVal, double* maxVal=0, .. c:function:: void gpu::minMaxLoc(const GpuMat\& src, double\* minVal, double* maxVal=0,
Point* minLoc=0, Point* maxLoc=0, Point* minLoc=0, Point* maxLoc=0,
const GpuMat\& mask=GpuMat()) const GpuMat\& mask=GpuMat())
.. c:function:: void minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal, .. c:function:: void gpu::minMaxLoc(const GpuMat\& src, double* minVal, double* maxVal,
Point* minLoc, Point* maxLoc, const GpuMat\& mask, Point* minLoc, Point* maxLoc, const GpuMat\& mask,
GpuMat\& valbuf, GpuMat\& locbuf) GpuMat\& valbuf, GpuMat\& locbuf)
...@@ -162,11 +159,11 @@ See also: ...@@ -162,11 +159,11 @@ See also:
.. index:: gpu::countNonZero .. index:: gpu::countNonZero
cv::gpu::countNonZero gpu::countNonZero
--------------------- ---------------------
.. c:function:: int countNonZero(const GpuMat\& src) .. c:function:: int gpu::countNonZero(const GpuMat\& src)
.. c:function:: int countNonZero(const GpuMat\& src, GpuMat\& buf) .. c:function:: int gpu::countNonZero(const GpuMat\& src, GpuMat\& buf)
Counts non-zero matrix elements. Counts non-zero matrix elements.
......
...@@ -5,9 +5,9 @@ Operations on Matrices ...@@ -5,9 +5,9 @@ Operations on Matrices
.. index:: gpu::transpose .. index:: gpu::transpose
cv::gpu::transpose gpu::transpose
------------------ ------------------
.. c:function:: void transpose(const GpuMat\& src, GpuMat\& dst) .. c:function:: void gpu::transpose(const GpuMat\& src, GpuMat\& dst)
Transposes a matrix. Transposes a matrix.
...@@ -20,9 +20,9 @@ See also: ...@@ -20,9 +20,9 @@ See also:
.. index:: gpu::flip .. index:: gpu::flip
cv::gpu::flip gpu::flip
------------- -------------
.. c:function:: void flip(const GpuMat\& a, GpuMat\& b, int flipCode) .. c:function:: void gpu::flip(const GpuMat\& a, GpuMat\& b, int flipCode)
Flips a 2D matrix around vertical, horizontal or both axes. Flips a 2D matrix around vertical, horizontal or both axes.
...@@ -44,13 +44,13 @@ See also: ...@@ -44,13 +44,13 @@ See also:
.. index:: gpu::LUT .. index:: gpu::LUT
cv::gpu::LUT gpu::LUT
------------ ------------
.. math:: .. math::
dst(I) = lut(src(I)) dst(I) = lut(src(I))
.. c:function:: void LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst) .. c:function:: void gpu::LUT(const GpuMat\& src, const Mat\& lut, GpuMat\& dst)
Transforms the source matrix into the destination matrix using given look-up table: Transforms the source matrix into the destination matrix using given look-up table:
...@@ -65,11 +65,11 @@ See also: ...@@ -65,11 +65,11 @@ See also:
.. index:: gpu::merge .. index:: gpu::merge
cv::gpu::merge gpu::merge
-------------- --------------
.. c:function:: void merge(const GpuMat* src, size_t n, GpuMat\& dst) .. c:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat\& dst)
.. c:function:: void merge(const GpuMat* src, size_t n, GpuMat\& dst, .. c:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat\& dst,
const Stream\& stream) const Stream\& stream)
Makes a multi-channel matrix out of several single-channel matrices. Makes a multi-channel matrix out of several single-channel matrices.
...@@ -98,11 +98,11 @@ See also: ...@@ -98,11 +98,11 @@ See also:
.. index:: gpu::split .. index:: gpu::split
cv::gpu::split gpu::split
-------------- --------------
.. c:function:: void split(const GpuMat\& src, GpuMat* dst) .. c:function:: void gpu::split(const GpuMat\& src, GpuMat* dst)
.. c:function:: void split(const GpuMat\& src, GpuMat* dst, const Stream\& stream) .. c:function:: void gpu::split(const GpuMat\& src, GpuMat* dst, const Stream\& stream)
Copies each plane of a multi-channel matrix into an array. Copies each plane of a multi-channel matrix into an array.
...@@ -112,9 +112,9 @@ cv::gpu::split ...@@ -112,9 +112,9 @@ cv::gpu::split
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. c:function:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst) .. c:function:: void gpu::split(const GpuMat\& src, vector$<$GpuMat$>$\& dst)
.. c:function:: void split(const GpuMat\& src, vector$<$GpuMat$>$\& dst, .. c:function:: void gpu::split(const GpuMat\& src, vector$<$GpuMat$>$\& dst,
const Stream\& stream) const Stream\& stream)
* **src** Source matrix. * **src** Source matrix.
...@@ -128,9 +128,9 @@ See also: ...@@ -128,9 +128,9 @@ See also:
.. index:: gpu::magnitude .. index:: gpu::magnitude
cv::gpu::magnitude gpu::magnitude
------------------ ------------------
.. c:function:: void magnitude(const GpuMat\& x, GpuMat\& magnitude) .. c:function:: void gpu::magnitude(const GpuMat\& x, GpuMat\& magnitude)
Computes magnitudes of complex matrix elements. Computes magnitudes of complex matrix elements.
...@@ -156,9 +156,9 @@ See also: ...@@ -156,9 +156,9 @@ See also:
.. index:: gpu::magnitudeSqr .. index:: gpu::magnitudeSqr
cv::gpu::magnitudeSqr gpu::magnitudeSqr
--------------------- ---------------------
.. c:function:: void magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude) .. c:function:: void gpu::magnitudeSqr(const GpuMat\& x, GpuMat\& magnitude)
Computes squared magnitudes of complex matrix elements. Computes squared magnitudes of complex matrix elements.
...@@ -181,9 +181,9 @@ cv::gpu::magnitudeSqr ...@@ -181,9 +181,9 @@ cv::gpu::magnitudeSqr
.. index:: gpu::phase .. index:: gpu::phase
cv::gpu::phase gpu::phase
-------------- --------------
.. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, .. c:function:: void gpu::phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,
bool angleInDegrees=false) bool angleInDegrees=false)
.. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle, .. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,
...@@ -206,9 +206,9 @@ See also: ...@@ -206,9 +206,9 @@ See also:
.. index:: gpu::cartToPolar .. index:: gpu::cartToPolar
cv::gpu::cartToPolar gpu::cartToPolar
-------------------- --------------------
.. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, .. c:function:: void gpu::cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
GpuMat\& angle, bool angleInDegrees=false) GpuMat\& angle, bool angleInDegrees=false)
.. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude, .. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
...@@ -233,12 +233,12 @@ See also: ...@@ -233,12 +233,12 @@ See also:
.. index:: gpu::polarToCart .. index:: gpu::polarToCart
cv::gpu::polarToCart gpu::polarToCart
-------------------- --------------------
.. c:function:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, .. c:function:: void gpu::polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,
GpuMat\& x, GpuMat\& y, bool angleInDegrees=false) GpuMat\& x, GpuMat\& y, bool angleInDegrees=false)
.. c:function:: void polarToCart(const GpuMat\& magnitude, const GpuMat\& angle, .. c:function:: void gpu::polarToCart(const GpuMat\& magnitude, const GpuMat\& angle,
GpuMat\& x, GpuMat\& y, bool angleInDegrees, GpuMat\& x, GpuMat\& y, bool angleInDegrees,
const Stream\& stream) const Stream\& stream)
......
...@@ -5,9 +5,9 @@ Per-element Operations. ...@@ -5,9 +5,9 @@ Per-element Operations.
.. index:: gpu::add .. index:: gpu::add
cv::gpu::add gpu::add
------------ ------------
.. c:function:: void add(const GpuMat\& a, const GpuMat\& b, GpuMat\& c) .. c:function:: void gpu::add(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes matrix-matrix or matrix-scalar sum. Computes matrix-matrix or matrix-scalar sum.
...@@ -17,7 +17,7 @@ cv::gpu::add ...@@ -17,7 +17,7 @@ cv::gpu::add
:param c: Destination matrix. Will have the same size and type as ``a`` . :param c: Destination matrix. Will have the same size and type as ``a`` .
.. c:function:: void add(const GpuMat\& a, const Scalar\& sc, GpuMat\& c) .. c:function:: void gpu::add(const GpuMat\& a, const Scalar\& sc, GpuMat\& c)
* **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now. * **a** Source matrix. ``CV_32FC1`` and ``CV_32FC2`` matrixes are supported for now.
...@@ -30,9 +30,9 @@ See also: ...@@ -30,9 +30,9 @@ See also:
.. index:: gpu::subtract .. index:: gpu::subtract
cv::gpu::subtract gpu::subtract
----------------- -----------------
.. c:function:: void subtract(const GpuMat\& a, const GpuMat\& b, GpuMat\& c) .. c:function:: void gpu::subtract(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Subtracts matrix from another matrix (or scalar from matrix). Subtracts matrix from another matrix (or scalar from matrix).
...@@ -55,9 +55,9 @@ See also: ...@@ -55,9 +55,9 @@ See also:
.. index:: gpu::multiply .. index:: gpu::multiply
cv::gpu::multiply gpu::multiply
----------------- -----------------
.. c:function:: void multiply(const GpuMat\& a, const GpuMat\& b, GpuMat\& c) .. c:function:: void gpu::multiply(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes per-element product of two matrices (or of matrix and scalar). Computes per-element product of two matrices (or of matrix and scalar).
...@@ -80,9 +80,9 @@ See also: ...@@ -80,9 +80,9 @@ See also:
.. index:: gpu::divide .. index:: gpu::divide
cv::gpu::divide gpu::divide
--------------- ---------------
.. c:function:: void divide(const GpuMat\& a, const GpuMat\& b, GpuMat\& c) .. c:function:: void gpu::divide(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Performs per-element division of two matrices (or division of matrix by scalar). Performs per-element division of two matrices (or division of matrix by scalar).
...@@ -108,9 +108,9 @@ See also: ...@@ -108,9 +108,9 @@ See also:
.. index:: gpu::exp .. index:: gpu::exp
cv::gpu::exp gpu::exp
------------ ------------
.. c:function:: void exp(const GpuMat\& a, GpuMat\& b) .. c:function:: void gpu::exp(const GpuMat\& a, GpuMat\& b)
Computes exponent of each matrix element. Computes exponent of each matrix element.
...@@ -123,9 +123,9 @@ See also: ...@@ -123,9 +123,9 @@ See also:
.. index:: gpu::log .. index:: gpu::log
cv::gpu::log gpu::log
------------ ------------
.. c:function:: void log(const GpuMat\& a, GpuMat\& b) .. c:function:: void gpu::log(const GpuMat\& a, GpuMat\& b)
Computes natural logarithm of absolute value of each matrix element. Computes natural logarithm of absolute value of each matrix element.
...@@ -138,9 +138,9 @@ See also: ...@@ -138,9 +138,9 @@ See also:
.. index:: gpu::absdiff .. index:: gpu::absdiff
cv::gpu::absdiff gpu::absdiff
---------------- ----------------
.. c:function:: void absdiff(const GpuMat\& a, const GpuMat\& b, GpuMat\& c) .. c:function:: void gpu::absdiff(const GpuMat\& a, const GpuMat\& b, GpuMat\& c)
Computes per-element absolute difference of two matrices (or of matrix and scalar). Computes per-element absolute difference of two matrices (or of matrix and scalar).
...@@ -163,9 +163,9 @@ See also: ...@@ -163,9 +163,9 @@ See also:
.. index:: gpu::compare .. index:: gpu::compare
cv::gpu::compare gpu::compare
---------------- ----------------
.. c:function:: void compare(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int cmpop) .. c:function:: void gpu::compare(const GpuMat\& a, const GpuMat\& b, GpuMat\& c, int cmpop)
Compares elements of two matrices. Compares elements of two matrices.
...@@ -188,16 +188,16 @@ cv::gpu::compare ...@@ -188,16 +188,16 @@ cv::gpu::compare
See also: See also:
:func:`compare` . :func:`compare` .
.. index:: cv::gpu::bitwise_not .. index:: gpu::bitwise_not
.. _cv::gpu::bitwise_not: .. _gpu::bitwise_not:
cv::gpu::bitwise_not gpu::bitwise_not
-------------------- --------------------
.. c:function:: void bitwise_not(const GpuMat\& src, GpuMat\& dst, .. c:function:: void gpu::bitwise_not(const GpuMat\& src, GpuMat\& dst,
const GpuMat\& mask=GpuMat()) const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_not(const GpuMat\& src, GpuMat\& dst, .. c:function:: void gpu::bitwise_not(const GpuMat\& src, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream) const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise inversion. Performs per-element bitwise inversion.
...@@ -213,16 +213,16 @@ cv::gpu::bitwise_not ...@@ -213,16 +213,16 @@ cv::gpu::bitwise_not
See also: See also:
. .
.. index:: cv::gpu::bitwise_or .. index:: gpu::bitwise_or
.. _cv::gpu::bitwise_or: .. _gpu::bitwise_or:
cv::gpu::bitwise_or gpu::bitwise_or
------------------- -------------------
.. c:function:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat()) const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_or(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream) const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise disjunction of two matrices. Performs per-element bitwise disjunction of two matrices.
...@@ -240,16 +240,16 @@ cv::gpu::bitwise_or ...@@ -240,16 +240,16 @@ cv::gpu::bitwise_or
See also: See also:
. .
.. index:: cv::gpu::bitwise_and .. index:: gpu::bitwise_and
.. _cv::gpu::bitwise_and: .. _gpu::bitwise_and:
cv::gpu::bitwise_and gpu::bitwise_and
-------------------- --------------------
.. c:function:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat()) const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_and(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream) const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise conjunction of two matrices. Performs per-element bitwise conjunction of two matrices.
...@@ -267,16 +267,16 @@ cv::gpu::bitwise_and ...@@ -267,16 +267,16 @@ cv::gpu::bitwise_and
See also: See also:
. .
.. index:: cv::gpu::bitwise_xor .. index:: gpu::bitwise_xor
.. _cv::gpu::bitwise_xor: .. _gpu::bitwise_xor:
cv::gpu::bitwise_xor gpu::bitwise_xor
-------------------- --------------------
.. c:function:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask=GpuMat()) const GpuMat\& mask=GpuMat())
.. c:function:: void bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::bitwise_xor(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const GpuMat\& mask, const Stream\& stream) const GpuMat\& mask, const Stream\& stream)
Performs per-element bitwise "exclusive or" of two matrices. Performs per-element bitwise "exclusive or" of two matrices.
...@@ -296,11 +296,11 @@ See also: ...@@ -296,11 +296,11 @@ See also:
.. index:: gpu::min .. index:: gpu::min
cv::gpu::min gpu::min
------------ ------------
.. c:function:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst) .. c:function:: void gpu::min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. c:function:: void min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::min(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const Stream\& stream) const Stream\& stream)
Computes per-element minimum of two matrices (or of matrix and scalar). Computes per-element minimum of two matrices (or of matrix and scalar).
...@@ -313,9 +313,9 @@ cv::gpu::min ...@@ -313,9 +313,9 @@ cv::gpu::min
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. c:function:: void min(const GpuMat\& src1, double src2, GpuMat\& dst) .. c:function:: void gpu::min(const GpuMat\& src1, double src2, GpuMat\& dst)
.. c:function:: void min(const GpuMat\& src1, double src2, GpuMat\& dst, .. c:function:: void gpu::min(const GpuMat\& src1, double src2, GpuMat\& dst,
const Stream\& stream) const Stream\& stream)
* **src1** Source matrix. * **src1** Source matrix.
...@@ -331,11 +331,11 @@ See also: ...@@ -331,11 +331,11 @@ See also:
.. index:: gpu::max .. index:: gpu::max
cv::gpu::max gpu::max
------------ ------------
.. c:function:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst) .. c:function:: void gpu::max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst)
.. c:function:: void max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst, .. c:function:: void gpu::max(const GpuMat\& src1, const GpuMat\& src2, GpuMat\& dst,
const Stream\& stream) const Stream\& stream)
Computes per-element maximum of two matrices (or of matrix and scalar). Computes per-element maximum of two matrices (or of matrix and scalar).
......
...@@ -14,6 +14,7 @@ imdecode ...@@ -14,6 +14,7 @@ imdecode
:param buf: The input array of vector of bytes :param buf: The input array of vector of bytes
:param flags: The same flags as in :ref:`imread` :param flags: The same flags as in :ref:`imread`
The function reads image from the specified buffer in memory. The function reads image from the specified buffer in memory.
If the buffer is too short or contains invalid data, the empty matrix will be returned. If the buffer is too short or contains invalid data, the empty matrix will be returned.
...@@ -35,6 +36,7 @@ imencode ...@@ -35,6 +36,7 @@ imencode
:param buf: The output buffer; resized to fit the compressed image :param buf: The output buffer; resized to fit the compressed image
:param params: The format-specific parameters; see :ref:`imwrite` :param params: The format-specific parameters; see :ref:`imwrite`
The function compresses the image and stores it in the memory buffer, which is resized to fit the result. The function compresses the image and stores it in the memory buffer, which is resized to fit the result.
See See
:ref:`imwrite` for the list of supported formats and the flags description. :ref:`imwrite` for the list of supported formats and the flags description.
...@@ -175,7 +177,7 @@ Class for video capturing from video files or cameras :: ...@@ -175,7 +177,7 @@ Class for video capturing from video files or cameras ::
protected: protected:
... ...
}; };
..
The class provides C++ video capturing API. Here is how the class can be used: :: The class provides C++ video capturing API. Here is how the class can be used: ::
...@@ -205,7 +207,7 @@ The class provides C++ video capturing API. Here is how the class can be used: : ...@@ -205,7 +207,7 @@ The class provides C++ video capturing API. Here is how the class can be used: :
// the camera will be deinitialized automatically in VideoCapture destructor // the camera will be deinitialized automatically in VideoCapture destructor
return 0; return 0;
} }
..
.. index:: VideoCapture::VideoCapture .. index:: VideoCapture::VideoCapture
...@@ -361,5 +363,6 @@ Video writer class :: ...@@ -361,5 +363,6 @@ Video writer class ::
protected: protected:
... ...
}; };
.. ..
This diff is collapsed.
...@@ -139,7 +139,9 @@ getRectSubPix ...@@ -139,7 +139,9 @@ getRectSubPix
:param center: Floating point coordinates of the extracted rectangle center within the source image. The center must be inside the image :param center: Floating point coordinates of the extracted rectangle center within the source image. The center must be inside the image
:param dst: The extracted patch; will have the size ``patchSize`` and the same number of channels as ``src`` :param dst: The extracted patch; will have the size ``patchSize`` and the same number of channels as ``src``
:param patchType: The depth of the extracted pixels. By default they will have the same depth as ``src`` :param patchType: The depth of the extracted pixels. By default they will have the same depth as ``src``
The function ``getRectSubPix`` extracts pixels from ``src`` : The function ``getRectSubPix`` extracts pixels from ``src`` :
.. math:: .. math::
......
...@@ -210,6 +210,7 @@ equalizeHist ...@@ -210,6 +210,7 @@ equalizeHist
:param src: The source 8-bit single channel image :param src: The source 8-bit single channel image
:param dst: The destination image; will have the same size and the same type as ``src`` :param dst: The destination image; will have the same size and the same type as ``src``
The function equalizes the histogram of the input image using the following algorithm: The function equalizes the histogram of the input image using the following algorithm:
#. #.
...@@ -230,5 +231,5 @@ The function equalizes the histogram of the input image using the following algo ...@@ -230,5 +231,5 @@ The function equalizes the histogram of the input image using the following algo
transform the image using transform the image using
:math:`H'` as a look-up table: :math:`H'` as a look-up table:
:math:`\texttt{dst}(x,y) = H'(\texttt{src}(x,y))` :math:`\texttt{dst}(x,y) = H'(\texttt{src}(x,y))`
The algorithm normalizes the brightness and increases the contrast of the image.
The algorithm normalizes the brightness and increases the contrast of the image.
...@@ -98,7 +98,7 @@ Boosting training parameters. :: ...@@ -98,7 +98,7 @@ Boosting training parameters. ::
CvBoostParams( int boost_type, int weak_count, double weight_trim_rate, CvBoostParams( int boost_type, int weak_count, double weight_trim_rate,
int max_depth, bool use_surrogates, const float* priors ); int max_depth, bool use_surrogates, const float* priors );
}; };
..
The structure is derived from The structure is derived from
:ref:`CvDTreeParams` , but not all of the decision tree parameters are supported. In particular, cross-validation is not supported. :ref:`CvDTreeParams` , but not all of the decision tree parameters are supported. In particular, cross-validation is not supported.
...@@ -130,7 +130,7 @@ Weak tree classifier. :: ...@@ -130,7 +130,7 @@ Weak tree classifier. ::
... ...
CvBoost* ensemble; CvBoost* ensemble;
}; };
..
The weak classifier, a component of the boosted tree classifier The weak classifier, a component of the boosted tree classifier
:ref:`CvBoost` , is a derivative of :ref:`CvBoost` , is a derivative of
...@@ -204,7 +204,7 @@ Boosted tree classifier. :: ...@@ -204,7 +204,7 @@ Boosted tree classifier. ::
CvSeq* weak; CvSeq* weak;
... ...
}; };
..
.. index:: CvBoost::train .. index:: CvBoost::train
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -40,7 +40,7 @@ Bayes classifier for normally distributed data. :: ...@@ -40,7 +40,7 @@ Bayes classifier for normally distributed data. ::
protected: protected:
... ...
}; };
..
.. index:: CvNormalBayesClassifier::train .. index:: CvNormalBayesClassifier::train
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment