Commit f025e473 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

some more doc cleanup

parent 4e6572ac
......@@ -15,7 +15,19 @@ or
.. 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
:math:`(X, Y, Z)` are the coordinates of a 3D point in the world
......@@ -45,7 +57,13 @@ to the following (when
.. 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
radial distortion and slight tangential distortion. So, the above model
......@@ -207,7 +225,7 @@ cv::composeRT
: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:
......@@ -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.
.. image:: ../../pics/stereo_undistort.jpg
.. image:: pics/stereo_undistort.jpg
.. index:: stereoRectifyUncalibrated
......
......@@ -455,16 +455,14 @@ Template class for short numerical vectors ::
typedef Vec<double, 3> Vec3d;
typedef Vec<double, 4> Vec4d;
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
:ref:`Scalar` . The elements of ``Vec`` are accessed using ``operator[]`` . All the expected vector operations are implemented too:
``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:
*
: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)
* ``v1 == v2, v1 != v2`` * ``norm(v1)`` (
:math:`L_2` -norm)
* ``v1 == v2, v1 != v2`` * ``norm(v1)`` (:math:`L_2`-norm)
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
..
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()`` :
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()``:
::
......@@ -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
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.
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.
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.
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.
::
......@@ -915,11 +902,11 @@ for a scalar ( ``Scalar`` ),
:math:`A.t() \sim A^t` *
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:
: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.
: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.
*
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`` ),
:func:`determinant`, :func:`repeat` etc.
*
matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers,
matrix constructors and operators that extract sub-matrices (see
:ref:`Mat` description).
matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers, 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
verb
"Mat_<T>()" constuctor calls to resolve possible ambiguity.
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.
Below is the formal description of the ``Mat`` methods.
......@@ -2410,8 +2392,8 @@ Template sparse n-dimensional array class derived from
SparseMatIterator_<_Tp> end();
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. ::
int sz[] = {10, 20, 30};
......
......@@ -116,7 +116,7 @@ explains the meaning of the parameters.
Parameters of Elliptic Arc
.. image:: ../../pics/ellipse.png
.. image:: pics/ellipse.png
.. index:: ellipse2Poly
......
......@@ -133,7 +133,6 @@ Here is the example: ::
}
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).
......
This diff is collapsed.
......@@ -112,7 +112,6 @@ The macro ``CV_Error_`` can be used to construct the error message on-fly to inc
CV_Error_(CV_StsOutOfRange,
("the matrix element (
i, j, mtx.at<float>(i,j)))
..
.. index:: Exception
......@@ -145,7 +144,6 @@ The exception class passed to error ::
// the source file line where the error happened
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
:func:`error` .
......@@ -241,7 +239,6 @@ That is, the following code computes the execution time in seconds. ::
double t = (double)getTickCount();
// do something ...
t = ((double)getTickCount() - t)/getTickFrequency();
..
.. index:: setNumThreads
......
......@@ -65,7 +65,6 @@ The XML/YAML file storage class ::
vector<char> structs;
int state;
};
..
.. index:: FileNode
......@@ -116,7 +115,6 @@ The XML/YAML file node class ::
const CvFileStorage* fs;
const CvFileNode* node;
};
..
.. index:: FileNodeIterator
......@@ -153,5 +151,6 @@ The XML/YAML file node iterator class ::
CvSeqReader reader;
size_t remaining;
};
..
......@@ -11,8 +11,6 @@ descriptor extractors inherit
.. index:: DescriptorExtractor
.. _DescriptorExtractor:
DescriptorExtractor
-------------------
.. c:type:: DescriptorExtractor
......@@ -40,7 +38,7 @@ Abstract base class for computing descriptors for image keypoints. ::
protected:
...
};
..
In this interface we assume a keypoint descriptor can be represented as a
dense, fixed-dimensional vector of some basic type. Most descriptors used
......@@ -55,8 +53,7 @@ DescriptorExtractor::compute
--------------------------------
.. 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)
or image set (second variant).
Compute the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
:param image: The image.
......@@ -102,25 +99,22 @@ DescriptorExtractor::create
:func:`DescriptorExtractor`
.. c:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string\& descriptorExtractorType )
Descriptor extractor factory that creates of given type with
default parameters (rather using default constructor).
Descriptor extractor factory that creates of given type with default parameters (rather using default constructor).
:param descriptorExtractorType: Descriptor extractor type.
Now the following descriptor extractor types are supported:
\ ``"SIFT"`` --
:func:`SiftFeatureDetector`,\ ``"SURF"`` --
:func:`SurfFeatureDetector`,\ ``"BRIEF"`` --
:func:`BriefFeatureDetector` .
\
* ``"SIFT"`` -- :func:`SiftFeatureDetector`,
* ``"SURF"`` -- :func:`SurfFeatureDetector`,
* ``"BRIEF"`` -- :func:`BriefFeatureDetector` .
Also combined format is supported: descriptor extractor adapter name ( ``"Opponent"`` --
:func:`OpponentColorDescriptorExtractor` ) + descriptor extractor name (see above),
e.g. ``"OpponentSIFT"`` , etc.
.. index:: SiftDescriptorExtractor
.. _SiftDescriptorExtractor:
SiftDescriptorExtractor
-----------------------
.. c:type:: SiftDescriptorExtractor
......@@ -147,11 +141,9 @@ Wrapping class for descriptors computing using
protected:
...
}
..
.. index:: SurfDescriptorExtractor
.. _SurfDescriptorExtractor:
.. index:: SurfDescriptorExtractor
SurfDescriptorExtractor
-----------------------
......@@ -173,11 +165,9 @@ Wrapping class for descriptors computing using
protected:
...
}
..
.. index:: CalonderDescriptorExtractor
.. _CalonderDescriptorExtractor:
.. index:: CalonderDescriptorExtractor
CalonderDescriptorExtractor
---------------------------
......@@ -199,7 +189,7 @@ Wrapping class for descriptors computing using
protected:
...
}
..
.. index:: OpponentColorDescriptorExtractor
......@@ -227,7 +217,7 @@ them into a single color descriptor. ::
protected:
...
};
..
.. index:: BriefDescriptorExtractor
......@@ -257,5 +247,5 @@ Strecha C., Fua P.: ''BRIEF: Binary Robust Independent Elementary Features.''
protected:
...
};
..
......@@ -40,7 +40,7 @@ train descriptor index, train image index and distance between descriptors. ::
// less is better
bool operator<( const DMatch &m ) const;
};
..
.. index:: DescriptorMatcher
......@@ -102,16 +102,15 @@ with image set. ::
vector<Mat> trainDescCollection;
...
};
..
.. index:: DescriptorMatcher::add
DescriptorMatcher::add
-------------------------- ````
--------------------------
.. c:function:: void add( const vector<Mat>\& descriptors )
Add descriptors to train descriptor collection. If collection trainDescCollectionis not empty
the new descriptors are added to existing train descriptors.
Add descriptors to train descriptor collection. If collection trainDescCollectionis not empty the new descriptors are added to existing train descriptors.
:param descriptors: Descriptors to add. Each ``descriptors[i]`` is a set of descriptors
from the same (one) train image.
......@@ -119,7 +118,7 @@ the new descriptors are added to existing train descriptors.
.. index:: DescriptorMatcher::getTrainDescriptors
DescriptorMatcher::getTrainDescriptors
------------------------------------------ ````
------------------------------------------
.. c:function:: const vector<Mat>\& getTrainDescriptors() const
Returns constant link to the train descriptor collection (i.e. trainDescCollection).
......@@ -154,23 +153,15 @@ DescriptorMatcher::train
----------------------------
.. c:function:: void DescriptorMatcher::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)
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)
.. index:: DescriptorMatcher::match
DescriptorMatcher::match
---------------------------- ```` ```` ```` ````
----------------------------
.. 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.
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.
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.
.. c:function:: void DescriptorMatcher::match( const Mat\& queryDescriptors, vector<DMatch>\& matches, const vector<Mat>\& masks=vector<Mat>() )
......@@ -194,9 +185,7 @@ DescriptorMatcher::knnMatch
: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
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 .
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 .
.. 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
: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
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 .
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.
.. 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
:func:`DescriptorMatcher`
.. c:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string\& descriptorMatcherType )
Descriptor matcher factory that creates of
given type with default parameters (rather using default constructor).
Descriptor matcher factory that creates of given type with default parameters (rather using default constructor).
:param descriptorMatcherType: Descriptor matcher type.
......@@ -261,9 +247,7 @@ BruteForceMatcher
-----------------
.. c:type:: BruteForceMatcher
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest
descriptor in the second set by trying each one. This descriptor matcher supports masking
permissible matches between descriptor sets. ::
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. ::
template<class Distance>
class BruteForceMatcher : public DescriptorMatcher
......@@ -277,10 +261,9 @@ permissible matches between descriptor sets. ::
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>
struct Accumulator
......@@ -340,7 +323,7 @@ For float descriptors, a common choice would be ``L2<float>`` . Class of support
int size ) const;
...
};
..
.. index:: FlannBasedMatcher
......@@ -350,14 +333,7 @@ FlannBasedMatcher
-----------------
.. c:type:: FlannBasedMatcher
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. ::
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. ::
class FlannBasedMatcher : public DescriptorMatcher
{
......@@ -376,5 +352,6 @@ support this. ::
protected:
...
};
..
......@@ -25,7 +25,7 @@ There is
:func:`DescriptorExtractor` and
: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.
As
:func:`DescriptorMatcher`,``GenericDescriptorMatcher`` has two groups
of match methods: for matching keypoints of one image with other image or
with image set. ::
......@@ -88,7 +88,7 @@ with image set. ::
protected:
...
};
..
.. index:: GenericDescriptorMatcher::add
......@@ -96,9 +96,7 @@ GenericDescriptorMatcher::add
---------------------------------
.. 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).
If train collection is not empty new image and keypoints from them will be added to
existing data.
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.
:param images: Image collection.
......@@ -135,8 +133,7 @@ GenericDescriptorMatcher::train
-----------------------------------
.. c:function:: void GenericDescriptorMatcher::train()
Train the object, e.g. tree-based structure to extract descriptors or
to optimize descriptors matching.
Train the object, e.g. tree-based structure to extract descriptors or to optimize descriptors matching.
.. index:: GenericDescriptorMatcher::isMaskSupported
......@@ -153,8 +150,7 @@ GenericDescriptorMatcher::classify
:func:`GenericDescriptorMatcher::add`
.. 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
(first version of the method) or train image collection that set using (second version).
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).
.. c:function:: void GenericDescriptorMatcher::classify( const Mat\& queryImage, vector<KeyPoint>\& queryKeypoints )
......@@ -173,9 +169,7 @@ GenericDescriptorMatcher::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
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.
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.
.. 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
: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
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 .
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.
.. 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
: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
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 .
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 .
.. 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
protected:
...
};
..
.. index:: FernDescriptorMatcher
.. _FernDescriptorMatcher:
.. index:: FernDescriptorMatcher
FernDescriptorMatcher
---------------------
......@@ -368,7 +357,7 @@ Wrapping class for computing, matching and classification of descriptors using
protected:
...
};
..
.. index:: VectorDescriptorMatcher
......@@ -400,11 +389,11 @@ Class used for matching descriptors that can be described as vectors in a finite
protected:
...
};
..
Example of creating: ::
VectorDescriptorMatcher matcher( new SurfDescriptorExtractor,
new BruteForceMatcher<L2<float> > );
..
......@@ -7,12 +7,11 @@ Drawing Function of Keypoints and Matches
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.
Match is a line connecting two keypoints (circles).
This function draws matches of keypints from two images on output image. 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.
......@@ -24,19 +23,15 @@ 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 outImg: Output image. Its content depends on ``flags`` value
what is drawn in output image. See below possible ``flags`` bit values.
:param outImg: Output image. Its content depends on ``flags`` value what is drawn in output image. See below possible ``flags`` bit values.
:param matchColor: Color of matches (lines and connected keypoints).
If ``matchColor==Scalar::all(-1)`` color will be generated randomly.
:param matchColor: Color of matches (lines and connected keypoints). If ``matchColor==Scalar::all(-1)`` color will be generated randomly.
:param singlePointColor: Color of single keypoints (circles), i.e. keypoints not having the matches.
If ``singlePointColor==Scalar::all(-1)`` color will be generated randomly.
:param singlePointColor: Color of single keypoints (circles), i.e. keypoints not having the matches. 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 flags: Each bit of ``flags`` sets some feature of drawing.
Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` , see below. ::
:param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` ::
struct DrawMatchesFlags
{
......@@ -56,13 +51,15 @@ Match is a line connecting two keypoints (circles).
// be drawn.
};
};
..
..
.. index:: 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.
......@@ -70,14 +67,9 @@ drawKeypoints
:param keypoints: Keypoints from source image.
:param outImg: Output image. Its content depends on ``flags`` value
what is drawn in output image. See possible ``flags`` bit values.
:param color: Color of keypoints
:param outImg: Output image. Its content depends on ``flags`` value what is drawn in output image. See possible ``flags`` bit values.
.
:param color: Color of keypoints.
:param flags: Each bit of ``flags`` sets some feature of drawing.
Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` ,
see above in :func:`drawMatches` .
:param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags``, see above in :func:`drawMatches` .
......@@ -36,12 +36,12 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
protected:
...
};
..
.. index:: BOWTrainer::add
BOWTrainer::add
------------------- ````
-------------------
.. c:function:: void BOWTrainer::add( const Mat\& descriptors )
Add descriptors to training set. The training set will be clustered using clustermethod to construct vocabulary.
......@@ -70,14 +70,11 @@ BOWTrainer::cluster
-----------------------
.. c:function:: Mat BOWTrainer::cluster() const
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.
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.
.. 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
to the inner train descriptor set.
: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.
.. index:: BOWKMeansTrainer
......@@ -103,7 +100,7 @@ BOWKMeansTrainer
protected:
...
};
..
To gain an understanding of constructor parameters see
:func:`kmeans` function
......@@ -117,14 +114,11 @@ BOWImgDescriptorExtractor
-------------------------
.. c:type:: BOWImgDescriptorExtractor
Class to compute image descriptor using ''bad of visual words''. In few,
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 to compute image descriptor using ''bad of visual words''. In few, such computing consists from the following steps:
#. Compute descriptors for given image and it's keypoints set
#. Find nearest visual words from vocabulary for each keypoint descriptor,
#. 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
{
......@@ -145,7 +139,7 @@ Class to compute image descriptor using ''bad of visual words''. In few,
protected:
...
};
..
.. index:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
......@@ -155,11 +149,9 @@ BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
Constructor.
:param dextractor: Descriptor extractor that will be used to compute descriptors
for input image and it's keypoints.
:param dextractor: Descriptor extractor that will be used to compute descriptors for input image and it's keypoints.
:param dmatcher: Descriptor matcher that will be used to find nearest word of trained vocabulary to
each keupoints descriptor of the image.
:param dmatcher: Descriptor matcher that will be used to find nearest word of trained vocabulary to each keupoints descriptor of the image.
.. index:: BOWImgDescriptorExtractor::setVocabulary
......@@ -169,8 +161,7 @@ BOWImgDescriptorExtractor::setVocabulary
Method to set visual vocabulary.
:param vocabulary: Vocabulary (can be trained using inheritor of :func:`BOWTrainer` ).
Each row of vocabulary is a one visual word (cluster center).
:param vocabulary: Vocabulary (can be trained using inheritor of :func:`BOWTrainer` ). Each row of vocabulary is a one visual word (cluster center).
.. index:: BOWImgDescriptorExtractor::getVocabulary
......@@ -194,8 +185,7 @@ BOWImgDescriptorExtractor::compute
: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
to the ``i-`` cluster (word of vocabulary) (returned if it is not 0.)
: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.)
: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
: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.
.. 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()
......@@ -67,11 +67,11 @@ cv::gpu::StereoBM_GPU::StereoBM_GPU
: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)
......@@ -87,11 +87,11 @@ cv::gpu::StereoBM_GPU::operator ()
: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()
......@@ -169,7 +169,7 @@ for data cost storage. ``width_step`` is the number of bytes in a line including
.. 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)
......@@ -191,8 +191,9 @@ cv::gpu::StereoBeliefPropagation::StereoBeliefPropagation
:param disc_single_jump: Discontinuity single jump.
:param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1`` .
``StereoBeliefPropagation`` uses truncated linear model for the data cost and discontinuity term:
:param msg_type: Type for messages. Supports ``CV_16SC1`` and ``CV_32FC1``.
``StereoBeliefPropagation`` uses truncated linear model for the data cost and discontinuity term:
.. math::
......@@ -214,15 +215,16 @@ By default ``StereoBeliefPropagation`` uses floating-point arithmetics and ``CV_
.. 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)
Some heuristics that tries to compute recommended parameters (ndisp, itersand levels) for specified image size (widthand height).
.. index:: gpu::StereoBeliefPropagation::operator ()
cv::gpu::StereoBeliefPropagation::operator ()
gpu::StereoBeliefPropagation::operator ()
---------------------------------------------
.. c:function:: void StereoBeliefPropagation::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
......@@ -313,7 +315,7 @@ qx_csbp
.. 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)
......@@ -340,7 +342,8 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP
:param min_disp_th: Minimal disparity threshold.
: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::
......@@ -362,15 +365,16 @@ By default ``StereoConstantSpaceBP`` uses floating-point arithmetics and ``CV_32
.. 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)
Some heuristics that tries to compute parameters (ndisp, iters, levelsand nrplane) for specified image size (widthand height).
.. index:: gpu::StereoConstantSpaceBP::operator ()
cv::gpu::StereoConstantSpaceBP::operator ()
gpu::StereoConstantSpaceBP::operator ()
-------------------------------------------
.. c:function:: void StereoConstantSpaceBP::operator()( const GpuMat\& left, const GpuMat\& right, GpuMat\& disparity)
......@@ -425,7 +429,7 @@ qx_csbp
.. 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)
......@@ -447,7 +451,7 @@ cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter
.. index:: gpu::DisparityBilateralFilter::operator ()
cv::gpu::DisparityBilateralFilter::operator ()
gpu::DisparityBilateralFilter::operator ()
----------------------------------------------
.. c:function:: void DisparityBilateralFilter::operator()( const GpuMat\& disparity, const GpuMat\& image, GpuMat\& dst)
......@@ -465,11 +469,11 @@ cv::gpu::DisparityBilateralFilter::operator ()
.. 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.
......@@ -487,11 +491,11 @@ This function converts
.. 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.
......
......@@ -3,13 +3,13 @@ Data Structures
.. highlight:: cpp
.. index:: gpu::DevMem2D_
.. index:: gpu::DevMem2D\_
.. _gpu::DevMem2D_:
gpu::DevMem2D_
--------------
.. c:type:: gpu::DevMem2D_
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. ::
......@@ -21,7 +21,7 @@ This is a simple lightweight class that encapsulate pitched memory on GPU. It is
size_t step;
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>
explicit DevMem2D_(const DevMem2D_<U>& d);
......@@ -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_
-------------
.. c:type:: gpu::PtrStep_
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_
{
......@@ -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_
-----------------
.. c:type:: gpu::PtrElemStrp_
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. ::
......@@ -84,7 +84,7 @@ This is structure is similar to DevMem2D_but contains only pointer and row step
.. index:: 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.
See also:
:func:`Mat`
.. index:: gpu::CudaMem
.. _gpu::CudaMem:
.. index:: gpu::CudaMem
gpu::CudaMem
------------
......@@ -187,18 +186,18 @@ Please note that allocation size of such memory types is usually limited. For mo
.. 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.
.. index:: gpu::CudaMem::createGpuMatHeader
cv::gpu::CudaMem::createGpuMatHeader
gpu::CudaMem::createGpuMatHeader
------------------------------------
:func:`gpu::GpuMat` ``_``
.. c:function:: GpuMat CudaMem::createGpuMatHeader() const
......@@ -209,8 +208,8 @@ cv::gpu::CudaMem::createGpuMatHeader
.. index:: gpu::CudaMem::canMapHostMemory
cv::gpu::CudaMem::canMapHostMemory
---------------------------------- ``_``
gpu::CudaMem::canMapHostMemory
----------------------------------
.. c:function:: static bool CudaMem::canMapHostMemory()
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
.. index:: gpu::Stream::queryIfComplete
cv::gpu::Stream::queryIfComplete
gpu::Stream::queryIfComplete
--------------------------------
.. c:function:: bool Stream::queryIfComplete()
......@@ -278,7 +277,7 @@ cv::gpu::Stream::queryIfComplete
.. index:: gpu::Stream::waitForCompletion
cv::gpu::Stream::waitForCompletion
gpu::Stream::waitForCompletion
----------------------------------
.. c:function:: void Stream::waitForCompletion()
......@@ -303,7 +302,7 @@ This class provides possibility to get ``cudaStream_t`` from
.. index:: gpu::createContinuous
cv::gpu::createContinuous
gpu::createContinuous
-------------------------
.. 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
.. index:: gpu::ensureSizeIsEnough
cv::gpu::ensureSizeIsEnough
gpu::ensureSizeIsEnough
---------------------------
.. 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
.. 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.
......@@ -22,9 +22,9 @@ See also:
.. 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).
......@@ -45,8 +45,7 @@ cv::gpu::norm
* **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.
......@@ -55,11 +54,11 @@ See also:
.. 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.
......@@ -72,11 +71,11 @@ See also:
.. 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.
......@@ -86,11 +85,11 @@ cv::gpu::absSum
.. 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.
......@@ -100,13 +99,11 @@ cv::gpu::sqrSum
.. index:: gpu::minMax
cv::gpu::minMax
gpu::minMax
---------------
.. c:function:: void minMax(const GpuMat\& src, double* minVal,
double* maxVal=0, const GpuMat\& mask=GpuMat())
.. c:function:: void gpu::minMax(const GpuMat\& src, double* minVal, double* maxVal=0, const GpuMat\& mask=GpuMat())
.. c:function:: void minMax(const GpuMat\& src, double* minVal, double* maxVal,
const GpuMat\& mask, GpuMat\& buf)
.. c:function:: void gpu::minMax(const GpuMat\& src, double* minVal, double* maxVal, const GpuMat\& mask, GpuMat\& buf)
Finds global minimum and maximum matrix elements and returns their values.
......@@ -127,13 +124,13 @@ See also:
.. 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,
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,
GpuMat\& valbuf, GpuMat\& locbuf)
......@@ -162,11 +159,11 @@ See also:
.. 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.
......
......@@ -5,9 +5,9 @@ Operations on Matrices
.. 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.
......@@ -20,9 +20,9 @@ See also:
.. 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.
......@@ -44,13 +44,13 @@ See also:
.. index:: gpu::LUT
cv::gpu::LUT
gpu::LUT
------------
.. math::
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:
......@@ -65,11 +65,11 @@ See also:
.. 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)
Makes a multi-channel matrix out of several single-channel matrices.
......@@ -98,11 +98,11 @@ See also:
.. 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.
......@@ -112,9 +112,9 @@ cv::gpu::split
: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)
* **src** Source matrix.
......@@ -128,9 +128,9 @@ See also:
.. 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.
......@@ -156,9 +156,9 @@ See also:
.. 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.
......@@ -181,9 +181,9 @@ cv::gpu::magnitudeSqr
.. 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)
.. c:function:: void phase(const GpuMat\& x, const GpuMat\& y, GpuMat\& angle,
......@@ -206,9 +206,9 @@ See also:
.. 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)
.. c:function:: void cartToPolar(const GpuMat\& x, const GpuMat\& y, GpuMat\& magnitude,
......@@ -233,12 +233,12 @@ See also:
.. 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)
.. 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,
const Stream\& stream)
......
......@@ -5,9 +5,9 @@ Per-element Operations.
.. 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.
......@@ -17,7 +17,7 @@ cv::gpu::add
: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.
......@@ -30,9 +30,9 @@ See also:
.. 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).
......@@ -55,9 +55,9 @@ See also:
.. 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).
......@@ -80,9 +80,9 @@ See also:
.. 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).
......@@ -108,9 +108,9 @@ See also:
.. 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.
......@@ -123,9 +123,9 @@ See also:
.. 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.
......@@ -138,9 +138,9 @@ See also:
.. 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).
......@@ -163,9 +163,9 @@ See also:
.. 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.
......@@ -188,16 +188,16 @@ cv::gpu::compare
See also:
: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())
.. 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)
Performs per-element bitwise inversion.
......@@ -213,16 +213,16 @@ cv::gpu::bitwise_not
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())
.. 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)
Performs per-element bitwise disjunction of two matrices.
......@@ -240,16 +240,16 @@ cv::gpu::bitwise_or
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())
.. 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)
Performs per-element bitwise conjunction of two matrices.
......@@ -267,16 +267,16 @@ cv::gpu::bitwise_and
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())
.. 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)
Performs per-element bitwise "exclusive or" of two matrices.
......@@ -296,11 +296,11 @@ See also:
.. 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)
Computes per-element minimum of two matrices (or of matrix and scalar).
......@@ -313,9 +313,9 @@ cv::gpu::min
: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)
* **src1** Source matrix.
......@@ -331,11 +331,11 @@ See also:
.. 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)
Computes per-element maximum of two matrices (or of matrix and scalar).
......
......@@ -14,6 +14,7 @@ imdecode
:param buf: The input array of vector of bytes
:param flags: The same flags as in :ref:`imread`
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.
......@@ -35,6 +36,7 @@ imencode
:param buf: The output buffer; resized to fit the compressed image
: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.
See
: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 ::
protected:
...
};
..
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
return 0;
}
..
.. index:: VideoCapture::VideoCapture
......@@ -361,5 +363,6 @@ Video writer class ::
protected:
...
};
..
This diff is collapsed.
......@@ -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 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``
The function ``getRectSubPix`` extracts pixels from ``src`` :
.. math::
......
......@@ -210,6 +210,7 @@ equalizeHist
: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``
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
transform the image using
:math:`H'` as a look-up table:
: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. ::
CvBoostParams( int boost_type, int weak_count, double weight_trim_rate,
int max_depth, bool use_surrogates, const float* priors );
};
..
The structure is derived from
: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. ::
...
CvBoost* ensemble;
};
..
The weak classifier, a component of the boosted tree classifier
:ref:`CvBoost` , is a derivative of
......@@ -204,7 +204,7 @@ Boosted tree classifier. ::
CvSeq* weak;
...
};
..
.. index:: CvBoost::train
......
......@@ -89,7 +89,7 @@ Decision tree node split. ::
ord;
};
};
..
.. index:: CvDTreeNode
......@@ -117,7 +117,7 @@ Decision tree node. ::
int depth;
...
};
..
Other numerous fields of ``CvDTreeNode`` are used internally at the training stage.
......@@ -154,7 +154,7 @@ Decision tree training parameters. ::
bool _use_1se_rule, bool _truncate_pruned_tree,
const float* _priors );
};
..
The structure contains all the decision tree training parameters. There is a default constructor that initializes all the parameters with the default values tuned for standalone classification tree. Any of the parameters can be overridden then, or the structure may be fully initialized using the advanced variant of the constructor.
......@@ -260,7 +260,7 @@ Decision tree training data and shared data for tree ensembles. ::
CvRNG rng;
};
..
This structure is mostly used internally for storing both standalone trees and tree ensembles efficiently. Basically, it contains 3 types of information:
......@@ -368,7 +368,7 @@ Decision tree. ::
CvDTreeTrainData* data;
};
..
.. index:: CvDTree::train
......
......@@ -124,7 +124,7 @@ Parameters of the EM algorithm. ::
const CvMat** covs;
CvTermCriteria term_crit;
};
..
The structure has 2 constructors, the default one represents a rough rule-of-thumb, with another one it is possible to override a variety of parameters, from a single number of mixtures (the only essential problem-dependent parameter), to the initial values for the mixture parameters.
......@@ -186,7 +186,7 @@ EM model. ::
CvMat* inv_eigen_values;
CvMat** cov_rotate_mats;
};
..
.. index:: CvEM::train
......@@ -311,5 +311,5 @@ Example: Clustering random samples of multi-Gaussian distribution using EM ::
cvReleaseMat( &labels );
return 0;
}
..
......@@ -43,7 +43,7 @@ K Nearest Neighbors model. ::
protected:
...
};
..
.. index:: CvKNearest::train
......@@ -164,5 +164,5 @@ If only a single input vector is passed, all output matrices are optional and th
cvReleaseMat( &trainData );
return 0;
}
..
......@@ -121,7 +121,7 @@ Parameters of the MLP training algorithm. ::
double rp_dw0, rp_dw_plus, rp_dw_minus, rp_dw_min, rp_dw_max;
};
..
The structure has default constructor that initializes parameters for ``RPROP`` algorithm. There is also more advanced constructor to customize the parameters and/or choose backpropagation algorithm. Finally, the individual parameters can be adjusted after the structure is created.
......@@ -212,7 +212,7 @@ MLP model. ::
CvRNG rng;
};
..
Unlike many other models in ML that are constructed and trained at once, in the MLP model these steps are separated. First, a network with the specified topology is created using the non-default constructor or the method ``create`` . All the weights are set to zeros. Then the network is trained using the set of input and output vectors. The training procedure can be repeated more than once, i.e. the weights can be adjusted based on the new training data.
......
This diff is collapsed.
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