Commit c7a42e96 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

started work on API & doc synchronization (in particular, Mat& =>…

started work on API & doc synchronization (in particular, Mat& => Input/OutputArray in the descriptions)
parent 927b5c88
......@@ -16,13 +16,13 @@ opencv_hdr_list = [
]
opencv_module_list = [
"core",
"imgproc",
"calib3d",
"features2d",
"video",
"objdetect",
"highgui",
#"core",
#"imgproc",
#"calib3d",
#"features2d",
#"video",
#"objdetect",
#"highgui",
"ml"
]
......@@ -33,7 +33,7 @@ class RSTParser(object):
fdecl = ""
balance = 0
lineno = 0
for l in df.readlines():
lineno += 1
ll = l.strip()
......@@ -48,6 +48,7 @@ class RSTParser(object):
if balance > 0:
continue
rst_decl = self.parser.parse_func_decl_no_wrap(fdecl)
hdr_decls = self.fmap.get(rst_decl[0], [])
if not hdr_decls:
print "Documented function %s (%s) in %s:%d is not in the headers" % (fdecl, rst_decl[0], docname, lineno)
......@@ -68,6 +69,7 @@ class RSTParser(object):
self.fmap[rst_decl[0]] = hdr_decls[:decl_idx] + hdr_decls[decl_idx+1:]
continue
print "Documented function %s in %s:%d does not have a match" % (fdecl, docname, lineno)
df.close()
def check_module_docs(self, name):
self.parser = hp.CppHeaderParser()
......@@ -94,11 +96,14 @@ class RSTParser(object):
self.process_rst(d)
print "\n\n########## The list of undocumented functions: ###########\n\n"
misscount = 0
fkeys = sorted(self.fmap.keys())
for f in fkeys:
decls = self.fmap[f]
for d in decls:
misscount += 1
print "%s %s(%s)" % (d[1], d[0], ", ".join([a[0] + " " + a[1] for a in d[3]]))
print "\n\n\nundocumented functions in %s: %d" % (name, misscount)
p = RSTParser()
for m in opencv_module_list:
......
......@@ -308,7 +308,7 @@ The algorithm does the following:
The function returns the final re-projection error.
Note: if you're using a non-square (=non-NxN) grid and
:func:`findChessboardCorners`
:cpp:func:`findChessboardCorners`
for calibration, and
``calibrateCamera``
returns
......@@ -333,7 +333,7 @@ See also:
,
:ref:`FindExtrinsicCameraParams2`
,
:func:`initCameraMatrix2D`
:cpp:func:`initCameraMatrix2D`
,
:ref:`StereoCalibrate`
,
......@@ -2303,7 +2303,7 @@ StereoRectify
:param P1, P2: The output :math:`3 \times 4` projection matrices in the new (rectified) coordinate systems.
:param Q: The output :math:`4 \times 4` disparity-to-depth mapping matrix, see :func:`reprojectImageTo3D` .
:param Q: The output :math:`4 \times 4` disparity-to-depth mapping matrix, see :cpp:func:`reprojectImageTo3D` .
:param flags: The operation flags; may be 0 or ``CV_CALIB_ZERO_DISPARITY`` . If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. And if the flag is not set, the function may still shift the images in horizontal or vertical direction (depending on the orientation of epipolar lines) in order to maximize the useful image area.
......@@ -2320,7 +2320,7 @@ StereoRectify
The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, that makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. On input the function takes the matrices computed by
:func:`stereoCalibrate`
:cpp:func:`stereoCalibrate`
and on output it gives 2 rotation matrices and also 2 projection matrices in the new coordinates. The 2 cases are distinguished by the function are:
......@@ -2562,10 +2562,10 @@ UndistortPoints
:param distCoeffs: The input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5 or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param R: The rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :func:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used
:param R: The rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :cpp:func:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used
:param P: The new camera matrix (3x3) or the new projection matrix (3x4). ``P1`` or ``P2`` , computed by :func:`StereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used
:param P: The new camera matrix (3x3) or the new projection matrix (3x4). ``P1`` or ``P2`` , computed by :cpp:func:`StereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used
......
......@@ -9,20 +9,20 @@ The boundaries of the shapes can be rendered with antialiasing (implemented only
All the functions include the parameter color that uses a rgb value (that may be constructed
with
``CV_RGB``
macro or the :func:`cvScalar` function
macro or the :cpp:func:`cvScalar` function
) for color
images and brightness for grayscale images. For color images the order channel
is normally
*Blue, Green, Red*
, this is what
:func:`imshow`
:cpp:func:`imshow`
,
:func:`imread`
:cpp:func:`imread`
and
:func:`imwrite`
:cpp:func:`imwrite`
expect
, so if you form a color using
:func:`cvScalar`
:cpp:func:`cvScalar`
, it should look like:
......@@ -32,7 +32,7 @@ expect
If you are using your own image rendering and I/O functions, you can use any channel ordering, the drawing functions process each channel independently and do not depend on the channel order or even on the color space used. The whole image can be converted from BGR to RGB or to a different color space using
:func:`cvtColor`
:cpp:func:`cvtColor`
.
If a drawn figure is partially or completely outside the image, the drawing functions clip it. Also, many drawing functions can handle pixel coordinates specified with sub-pixel accuracy, that is, the coordinates can be passed as fixed-point numbers, encoded as integers. The number of fractional bits is specified by the
......
......@@ -5,7 +5,7 @@ Image Filtering
Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as
:func:`Mat`
:cpp:func:`Mat`
's), that is, for each pixel location
:math:`(x,y)`
in the source image some its (normally rectangular) neighborhood is considered and used to compute the response. In case of a linear filter it is a weighted sum of pixel values, in case of morphological operations it is the minimum or maximum etc. The computed response is stored to the destination image at the same location
......
......@@ -278,7 +278,7 @@ The algorithm does the following:
Note: if you're using a non-square (=non-NxN) grid and
:func:`findChessboardCorners`
:cpp:func:`findChessboardCorners`
for calibration, and
``calibrateCamera``
returns
......@@ -303,7 +303,7 @@ See also:
,
:ref:`FindExtrinsicCameraParams2`
,
:func:`initCameraMatrix2D`
:cpp:func:`initCameraMatrix2D`
,
:ref:`StereoCalibrate`
,
......@@ -2312,7 +2312,7 @@ StereoRectify
:param P1, P2: The output :math:`3 \times 4` projection matrices in the new (rectified) coordinate systems.
:param Q: The output :math:`4 \times 4` disparity-to-depth mapping matrix, see :func:`reprojectImageTo3D` .
:param Q: The output :math:`4 \times 4` disparity-to-depth mapping matrix, see :cpp:func:`reprojectImageTo3D` .
:type Q: :class:`CvMat`
......@@ -2337,7 +2337,7 @@ StereoRectify
The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, that makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. On input the function takes the matrices computed by
:func:`stereoCalibrate`
:cpp:func:`stereoCalibrate`
and on output it gives 2 rotation matrices and also 2 projection matrices in the new coordinates. The 2 cases are distinguished by the function are:
......@@ -2595,12 +2595,12 @@ UndistortPoints
:type distCoeffs: :class:`CvMat`
:param R: The rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :func:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used
:param R: The rectification transformation in object space (3x3 matrix). ``R1`` or ``R2`` , computed by :cpp:func:`StereoRectify` can be passed here. If the matrix is empty, the identity transformation is used
:type R: :class:`CvMat`
:param P: The new camera matrix (3x3) or the new projection matrix (3x4). ``P1`` or ``P2`` , computed by :func:`StereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used
:param P: The new camera matrix (3x3) or the new projection matrix (3x4). ``P1`` or ``P2`` , computed by :cpp:func:`StereoRectify` can be passed here. If the matrix is empty, the identity new camera matrix is used
:type P: :class:`CvMat`
......
......@@ -14,14 +14,14 @@ images and brightness for grayscale images. For color images the order channel
is normally
*Blue, Green, Red*
, this is what
:func:`imshow`
:cpp:func:`imshow`
,
:func:`imread`
:cpp:func:`imread`
and
:func:`imwrite`
:cpp:func:`imwrite`
expect
If you are using your own image rendering and I/O functions, you can use any channel ordering, the drawing functions process each channel independently and do not depend on the channel order or even on the color space used. The whole image can be converted from BGR to RGB or to a different color space using
:func:`cvtColor`
:cpp:func:`cvtColor`
.
If a drawn figure is partially or completely outside the image, the drawing functions clip it. Also, many drawing functions can handle pixel coordinates specified with sub-pixel accuracy, that is, the coordinates can be passed as fixed-point numbers, encoded as integers. The number of fractional bits is specified by the
......
......@@ -5,7 +5,7 @@ Image Filtering
Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as
:func:`Mat`
:cpp:func:`Mat`
's), that is, for each pixel location
:math:`(x,y)`
in the source image some its (normally rectangular) neighborhood is considered and used to compute the response. In case of a linear filter it is a weighted sum of pixel values, in case of morphological operations it is the minimum or maximum etc. The computed response is stored to the destination image at the same location
......
This diff is collapsed.
......@@ -10,7 +10,7 @@ Clustering
kmeans
------
.. c:function:: double kmeans( const Mat& samples, int clusterCount, Mat& labels, TermCriteria termcrit, int attempts, int flags, Mat* centers )
.. cpp:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=None() )
Finds centers of clusters and groups input samples around the clusters.
......@@ -57,9 +57,9 @@ attempts to 1, initialize labels each time using a custom algorithm, pass them w
partition
-------------
.. c:function:: template<typename _Tp, class _EqPredicate> int
.. cpp:function:: template<typename _Tp, class _EqPredicate> int
.. c:function:: partition( const vector<_Tp>& vec, vector<int>& labels, _EqPredicate predicate=_EqPredicate())
.. cpp:function:: partition( const vector<_Tp>& vec, vector<int>& labels, _EqPredicate predicate=_EqPredicate())
Splits an element set into equivalency classes.
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,7 +7,7 @@ Utility and System Functions and Macros
alignPtr
------------
.. c:function:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
.. cpp:function:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
Aligns a pointer to the specified number of bytes.
......@@ -25,7 +25,7 @@ The function returns the aligned pointer of the same type as the input pointer:
alignSize
-------------
.. c:function:: size_t alignSize(size_t sz, int n)
.. cpp:function:: size_t alignSize(size_t sz, int n)
Aligns a buffer size to the specified number of bytes.
......@@ -43,7 +43,7 @@ The function returns the minimum number that is greater or equal to ``sz`` and i
allocate
------------
.. c:function:: template<typename _Tp> _Tp* allocate(size_t n)
.. cpp:function:: template<typename _Tp> _Tp* allocate(size_t n)
Allocates an array of elements.
......@@ -55,7 +55,7 @@ The generic function ``allocate`` allocates a buffer for the specified number of
deallocate
--------------
.. c:function:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
.. cpp:function:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
Deallocates an array of elements.
......@@ -64,8 +64,8 @@ deallocate
:param n: Number of elements in the buffer.
The generic function ``deallocate`` deallocates the buffer allocated with
:func:`allocate` . The number of elements must match the number passed to
:func:`allocate` .
:cpp:func:`allocate` . The number of elements must match the number passed to
:cpp:func:`allocate` .
.. index:: CV_Assert
......@@ -73,7 +73,7 @@ The generic function ``deallocate`` deallocates the buffer allocated with
CV_Assert
---------
.. c:function:: CV_Assert(expr)
.. cpp:function:: CV_Assert(expr)
Checks a condition at runtime. ::
......@@ -84,17 +84,17 @@ CV_Assert
:param expr: Expression to check.
The macros ``CV_Assert`` and ``CV_DbgAssert`` evaluate the specified expression. If it is 0, the macros raise an error (see
:func:`error` ). The macro ``CV_Assert`` checks the condition in both Debug and Release configurations, while ``CV_DbgAssert`` is only retained in the Debug configuration.
:cpp:func:`error` ). The macro ``CV_Assert`` checks the condition in both Debug and Release configurations, while ``CV_DbgAssert`` is only retained in the Debug configuration.
.. index:: error
error
---------
.. c:function:: void error( const Exception\& exc )
.. cpp:function:: void error( const Exception\& exc )
.. c:function:: \#define CV_Error( code, msg ) <...>
.. cpp:function:: \#define CV_Error( code, msg ) <...>
.. c:function:: \#define CV_Error_( code, args ) <...>
.. cpp:function:: \#define CV_Error_( code, args ) <...>
Signals an error and raises an exception.
......@@ -148,13 +148,13 @@ Exception class passed to error ::
};
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` .
:cpp:func:`error` .
.. index:: fastMalloc
fastMalloc
--------------
.. c:function:: void* fastMalloc(size_t size)
.. cpp:function:: void* fastMalloc(size_t size)
Allocates an aligned memory buffer.
......@@ -166,74 +166,74 @@ The function allocates the buffer of the specified size and returns it. When the
fastFree
------------
.. c:function:: void fastFree(void* ptr)
.. cpp:function:: void fastFree(void* ptr)
Deallocates a memory buffer.
:param ptr: Pointer to the allocated buffer.
The function deallocates the buffer allocated with
:func:`fastMalloc` .
:cpp:func:`fastMalloc` .
If NULL pointer is passed, the function does nothing.
.. index:: format
format
----------
.. c:function:: string format( const char* fmt, ... )
.. cpp:function:: string format( const char* fmt, ... )
Returns a text string formatted using the ``printf`` -like expression.
:param fmt: ``printf`` -compatible formatting specifiers.
The function acts like ``sprintf`` but forms and returns an STL string. It can be used to form an error message in the
:func:`Exception` constructor.
:cpp:func:`Exception` constructor.
.. index:: getNumThreads
getNumThreads
-----------------
.. c:function:: int getNumThreads()
.. cpp:function:: int getNumThreads()
Returns the number of threads used by OpenCV.
The function returns the number of threads that is used by OpenCV.
See Also:
:func:`setNumThreads`,
:func:`getThreadNum`
:cpp:func:`setNumThreads`,
:cpp:func:`getThreadNum`
.. index:: getThreadNum
getThreadNum
----------------
.. c:function:: int getThreadNum()
.. cpp:function:: int getThreadNum()
Returns the index of the currently executed thread.
The function returns a 0-based index of the currently executed thread. The function is only valid inside a parallel OpenMP region. When OpenCV is built without OpenMP support, the function always returns 0.
See Also:
:func:`setNumThreads`,
:func:`getNumThreads` .
:cpp:func:`setNumThreads`,
:cpp:func:`getNumThreads` .
.. index:: getTickCount
getTickCount
----------------
.. c:function:: int64 getTickCount()
.. cpp:function:: int64 getTickCount()
Returns the number of ticks.
The function returns the number of ticks after the certain event (for example, when the machine was turned on).
It can be used to initialize
:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
:cpp:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
.. index:: getTickFrequency
getTickFrequency
--------------------
.. c:function:: double getTickFrequency()
.. cpp:function:: double getTickFrequency()
Returns the number of ticks per second.
......@@ -248,7 +248,7 @@ That is, the following code computes the execution time in seconds: ::
setNumThreads
-----------------
.. c:function:: void setNumThreads(int nthreads)
.. cpp:function:: void setNumThreads(int nthreads)
Sets the number of threads used by OpenCV.
......@@ -257,5 +257,5 @@ setNumThreads
The function sets the number of threads used by OpenCV in parallel OpenMP regions. If ``nthreads=0`` , the function uses the default number of threads that is usually equal to the number of the processing cores.
See Also:
:func:`getNumThreads`,
:func:`getThreadNum`
\ No newline at end of file
:cpp:func:`getNumThreads`,
:cpp:func:`getThreadNum`
\ No newline at end of file
......@@ -2340,10 +2340,10 @@ CV_EXPORTS RNG& theRNG();
template<typename _Tp> static inline _Tp randu() { return (_Tp)theRNG(); }
//! fills array with uniformly-distributed random numbers from the range [low, high)
CV_EXPORTS_W void randu(CV_IN_OUT OutputArray dst, InputArray low, InputArray high);
CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high);
//! fills array with normally-distributed random numbers with the specified mean and the standard deviation
CV_EXPORTS_W void randn(CV_IN_OUT OutputArray dst, InputArray mean, InputArray stddev);
CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev);
//! shuffles the input array elements
CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor=1., RNG* rng=0);
......
......@@ -51,7 +51,7 @@ descriptors is represented as
DescriptorExtractor::compute
--------------------------------
.. c:function:: void DescriptorExtractor::compute( const Mat\& image, vector<KeyPoint>\& keypoints, Mat\& descriptors ) const
.. cpp:function:: void DescriptorExtractor::compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const
Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
......@@ -61,7 +61,7 @@ DescriptorExtractor::compute
:param descriptors: Descriptors. Row i is the descriptor for keypoint i.
.. c:function:: void DescriptorExtractor::compute( const vector<Mat>\& images, vector<vector<KeyPoint> >\& keypoints, vector<Mat>\& descriptors ) const
.. cpp:function:: void DescriptorExtractor::compute( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints, vector<Mat>& descriptors ) const
:param images: Image set.
......@@ -75,7 +75,7 @@ DescriptorExtractor::compute
DescriptorExtractor::read
-----------------------------
.. c:function:: void DescriptorExtractor::read( const FileNode\& fn )
.. cpp:function:: void DescriptorExtractor::read( const FileNode& fn )
Reads the object of a descriptor extractor from a file node.
......@@ -85,7 +85,7 @@ DescriptorExtractor::read
DescriptorExtractor::write
------------------------------
.. c:function:: void DescriptorExtractor::write( FileStorage\& fs ) const
.. cpp:function:: void DescriptorExtractor::write( FileStorage& fs ) const
Writes the object of a descriptor extractor to a file storage.
......@@ -95,7 +95,7 @@ DescriptorExtractor::write
DescriptorExtractor::create
-------------------------------
.. c:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string& descriptorExtractorType )
.. cpp:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string& descriptorExtractorType )
Creates a descriptor extractor by name.
......
......@@ -7,7 +7,7 @@ Feature Detection and Description
FAST
--------
.. c:function:: void FAST( const Mat& image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression=true )
.. cpp:function:: void FAST( const Mat& image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression=true )
Detects corners using the FAST algorithm by E. Rosten (*Machine learning for high-speed corner detection*, 2006).
......@@ -355,11 +355,11 @@ Class containing a base structure for ``RTreeClassifier`` ::
RandomizedTree::train
-------------------------
.. c:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. cpp:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
Trains a randomized tree using an input set of keypoints.
.. c:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
.. cpp:function:: void train(std::vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits)
:param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training.
......@@ -379,9 +379,9 @@ RandomizedTree::train
RandomizedTree::read
------------------------
.. c:function:: read(const char* file_name, int num_quant_bits)
.. cpp:function:: read(const char* file_name, int num_quant_bits)
.. c:function:: read(std::istream &is, int num_quant_bits)
.. cpp:function:: read(std::istream &is, int num_quant_bits)
Reads a pre-saved randomized tree from a file or stream.
......@@ -395,11 +395,11 @@ RandomizedTree::read
RandomizedTree::write
-------------------------
.. c:function:: void write(const char* file_name) const
.. cpp:function:: void write(const char* file_name) const
Writes the current randomized tree to a file or stream.
.. c:function:: void write(std::ostream \&os) const
.. cpp:function:: void write(std::ostream \&os) const
:param file_name: Name of the file where randomized tree data is stored.
......@@ -409,7 +409,7 @@ RandomizedTree::write
RandomizedTree::applyQuantization
-------------------------------------
.. c:function:: void applyQuantization(int num_quant_bits)
.. cpp:function:: void applyQuantization(int num_quant_bits)
Applies quantization to the current randomized tree.
......@@ -519,11 +519,11 @@ Class containing ``RTreeClassifier``. It represents the Calonder descriptor that
RTreeClassifier::train
--------------------------
.. c:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. cpp:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
Trains a randomized tree classifier using an input set of keypoints.
.. c:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
.. cpp:function:: void train(vector<BaseKeypoint> const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true)
:param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training.
......@@ -547,11 +547,11 @@ RTreeClassifier::train
RTreeClassifier::getSignature
---------------------------------
.. c:function:: void getSignature(IplImage *patch, uchar *sig)
.. cpp:function:: void getSignature(IplImage *patch, uchar *sig)
Returns a signature for an image patch.
.. c:function:: void getSignature(IplImage *patch, float *sig)
.. cpp:function:: void getSignature(IplImage *patch, float *sig)
:param patch: Image patch to calculate the signature for.
:param sig: Output signature (array dimension is ``reduced_num_dim)`` .
......@@ -561,7 +561,7 @@ RTreeClassifier::getSignature
RTreeClassifier::getSparseSignature
---------------------------------------
.. c:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
.. cpp:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh)
Returns a signature for an image patch similarly to ``getSignature`` but uses a threshold for removing all signature elements below the threshold so that the signature is compressed.
......@@ -575,7 +575,7 @@ RTreeClassifier::getSparseSignature
RTreeClassifier::countNonZeroElements
-----------------------------------------
.. c:function:: static int countNonZeroElements(float *vec, int n, double tol=1e-10)
.. cpp:function:: static int countNonZeroElements(float *vec, int n, double tol=1e-10)
Returns the number of non-zero elements in an input array.
......@@ -589,11 +589,11 @@ RTreeClassifier::countNonZeroElements
RTreeClassifier::read
-------------------------
.. c:function:: read(const char* file_name)
.. cpp:function:: read(const char* file_name)
Reads a pre-saved ``RTreeClassifier`` from a file or stream.
.. c:function:: read(std::istream& is)
.. cpp:function:: read(std::istream& is)
:param file_name: Name of the file that contains randomized tree data.
......@@ -603,11 +603,11 @@ RTreeClassifier::read
RTreeClassifier::write
--------------------------
.. c:function:: void write(const char* file_name) const
.. cpp:function:: void write(const char* file_name) const
Writes the current ``RTreeClassifier`` to a file or stream.
.. c:function:: void write(std::ostream &os) const
.. cpp:function:: void write(std::ostream &os) const
:param file_name: Name of the file where randomized tree data is stored.
......@@ -617,7 +617,7 @@ RTreeClassifier::write
RTreeClassifier::setQuantization
------------------------------------
.. c:function:: void setQuantization(int num_quant_bits)
.. cpp:function:: void setQuantization(int num_quant_bits)
Applies quantization to the current randomized tree.
......
......@@ -41,7 +41,7 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
BOWTrainer::add
-------------------
.. c:function:: void BOWTrainer::add( const Mat& descriptors )
.. cpp:function:: void BOWTrainer::add( const Mat& descriptors )
Adds descriptors to a training set. The training set is clustered using ``clustermethod`` to construct the vocabulary.
......@@ -51,7 +51,7 @@ BOWTrainer::add
BOWTrainer::getDescriptors
------------------------------
.. c:function:: const vector<Mat>& BOWTrainer::getDescriptors() const
.. cpp:function:: const vector<Mat>& BOWTrainer::getDescriptors() const
Returns a training set of descriptors.
......@@ -59,7 +59,7 @@ BOWTrainer::getDescriptors
BOWTrainer::descripotorsCount
---------------------------------
.. c:function:: const vector<Mat>& BOWTrainer::descripotorsCount() const
.. cpp:function:: const vector<Mat>& BOWTrainer::descripotorsCount() const
Returns the count of all descriptors stored in the training set.
......@@ -67,11 +67,11 @@ BOWTrainer::descripotorsCount
BOWTrainer::cluster
-----------------------
.. c:function:: Mat BOWTrainer::cluster() const
.. cpp:function:: Mat BOWTrainer::cluster() const
Clusters train descriptors. The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first variant of the method, train descriptors stored in the object are clustered. In the second variant, input descriptors are clustered.
.. c:function:: Mat BOWTrainer::cluster( const Mat& descriptors ) const
.. cpp:function:: Mat BOWTrainer::cluster( const Mat& descriptors ) const
:param descriptors: Descriptors to cluster. Each row of the ``descriptors`` matrix is a descriptor. Descriptors are not added to the inner train descriptor set.
......@@ -146,7 +146,7 @@ Here is the class declaration ::
BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
--------------------------------------------------------
.. c:function:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor, const Ptr<DescriptorMatcher>& dmatcher )
.. cpp:function:: BOWImgDescriptorExtractor::BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor, const Ptr<DescriptorMatcher>& dmatcher )
The class constructor.
......@@ -158,7 +158,7 @@ BOWImgDescriptorExtractor::BOWImgDescriptorExtractor
BOWImgDescriptorExtractor::setVocabulary
--------------------------------------------
.. c:function:: void BOWImgDescriptorExtractor::setVocabulary( const Mat& vocabulary )
.. cpp:function:: void BOWImgDescriptorExtractor::setVocabulary( const Mat& vocabulary )
Sets a visual vocabulary.
......@@ -168,7 +168,7 @@ BOWImgDescriptorExtractor::setVocabulary
BOWImgDescriptorExtractor::getVocabulary
--------------------------------------------
.. c:function:: const Mat& BOWImgDescriptorExtractor::getVocabulary() const
.. cpp:function:: const Mat& BOWImgDescriptorExtractor::getVocabulary() const
Returns the set vocabulary.
......@@ -176,7 +176,7 @@ BOWImgDescriptorExtractor::getVocabulary
BOWImgDescriptorExtractor::compute
--------------------------------------
.. c:function:: void BOWImgDescriptorExtractor::compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& imgDescriptor, vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 )
.. cpp:function:: void BOWImgDescriptorExtractor::compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& imgDescriptor, vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 )
Computes an image descriptor using the set visual vocabulary.
......@@ -194,7 +194,7 @@ BOWImgDescriptorExtractor::compute
BOWImgDescriptorExtractor::descriptorSize
---------------------------------------------
.. c:function:: int BOWImgDescriptorExtractor::descriptorSize() const
.. cpp:function:: int BOWImgDescriptorExtractor::descriptorSize() const
Returns an image discriptor size if the vocabulary is set. Otherwise, it returns 0.
......@@ -202,7 +202,7 @@ BOWImgDescriptorExtractor::descriptorSize
BOWImgDescriptorExtractor::descriptorType
---------------------------------------------
.. c:function:: int BOWImgDescriptorExtractor::descriptorType() const
.. cpp:function:: int BOWImgDescriptorExtractor::descriptorType() const
Returns an image descriptor type.
......@@ -490,7 +490,7 @@ gpu::reprojectImageTo3D
:param stream: Stream for the asynchronous version.
See Also: :c:func:`reprojectImageTo3D` .
See Also: :c:cpp:func:`reprojectImageTo3D` .
.. index:: gpu::solvePnPRansac
......@@ -507,7 +507,7 @@ gpu::solvePnPRansac
:param camera_mat: 3x3 matrix of intrinsic camera parameters.
:param dist_coef: Distortion coefficients. See :c:func:`undistortPoints` for details.
:param dist_coef: Distortion coefficients. See :c:cpp:func:`undistortPoints` for details.
:param rvec: Output 3D rotation vector.
......@@ -523,5 +523,5 @@ gpu::solvePnPRansac
:param inliers: Output vector of inlier indices.
See Also :c:func:`solvePnPRansac`.
See Also :c:cpp:func:`solvePnPRansac`.
\ No newline at end of file
......@@ -148,7 +148,7 @@ In contrast with :c:type:`Mat`, in most cases ``GpuMat::isContinuous() == false`
You are not recommended to leave static or global ``GpuMat`` variables allocated, that is to rely on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory release function returns error if the CUDA context has been destroyed before.
See Also:
:func:`Mat`
:cpp:func:`Mat`
.. index:: gpu::CudaMem
......@@ -157,7 +157,7 @@ gpu::CudaMem
.. cpp:class:: gpu::CudaMem
This class with reference counting wraps special memory type allocation functions from CUDA. Its interface is also
:func:`Mat`-like but with additional memory type parameters.
:cpp:func:`Mat`-like but with additional memory type parameters.
*
``ALLOC_PAGE_LOCKED``: Sets a page locked memory type, used commonly for fast and asynchronous uploading/downloading data from/to GPU.
......
......@@ -195,7 +195,7 @@ gpu::BruteForceMatcher_GPU::match
Finds the best match for each descriptor from a query set with train descriptors.
See Also:
:c:func:`DescriptorMatcher::match`
:c:cpp:func:`DescriptorMatcher::match`
.. index:: gpu::BruteForceMatcher_GPU::matchSingle
......@@ -264,10 +264,10 @@ gpu::BruteForceMatcher_GPU::knnMatch
Finds the k best matches for each descriptor from a query set with train descriptors. The function returns detected k (or less if not possible) matches in the increasing order by distance.
.. c:function:: void knnMatch(const GpuMat& queryDescs, std::vector< std::vector<DMatch> >&matches, int k, const std::vector<GpuMat>&masks = std::vector<GpuMat>(), bool compactResult = false )
.. cpp:function:: void knnMatch(const GpuMat& queryDescs, std::vector< std::vector<DMatch> >&matches, int k, const std::vector<GpuMat>&masks = std::vector<GpuMat>(), bool compactResult = false )
See Also:
:func:`DescriptorMatcher::knnMatch`
:cpp:func:`DescriptorMatcher::knnMatch`
.. index:: gpu::BruteForceMatcher_GPU::knnMatch
......@@ -308,7 +308,7 @@ gpu::BruteForceMatcher_GPU::radiusMatch
This function works only on devices with the compute capability :math:`>=` 1.1.
See Also:
:func:`DescriptorMatcher::radiusMatch`
:cpp:func:`DescriptorMatcher::radiusMatch`
.. index:: gpu::BruteForceMatcher_GPU::radiusMatch
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ gpu::meanShiftProc
:param criteria: Termination criteria. See :cpp:class:`TermCriteria`.
See Also:
:c:func:`gpu::meanShiftFiltering`
:c:cpp:func:`gpu::meanShiftFiltering`
.. index:: gpu::meanShiftSegmentation
......@@ -81,7 +81,7 @@ gpu::integral
:param sqsum: Squared integral image of the ``CV_32FC1`` type.
See Also:
:c:func:`integral`
:c:cpp:func:`integral`
.. index:: gpu::sqrIntegral
......@@ -128,7 +128,7 @@ gpu::cornerHarris
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
See Also:
:c:func:`cornerHarris`
:c:cpp:func:`cornerHarris`
.. index:: gpu::cornerMinEigenVal
......@@ -150,7 +150,7 @@ gpu::cornerMinEigenVal
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
See also: :c:func:`cornerMinEigenVal`
See also: :c:cpp:func:`cornerMinEigenVal`
.. index:: gpu::mulSpectrums
......@@ -173,7 +173,7 @@ gpu::mulSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
See Also:
:c:func:`mulSpectrums`
:c:cpp:func:`mulSpectrums`
.. index:: gpu::mulAndScaleSpectrums
......@@ -198,7 +198,7 @@ gpu::mulAndScaleSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
See Also:
:c:func:`mulSpectrums`
:c:cpp:func:`mulSpectrums`
.. index:: gpu::dft
......@@ -237,7 +237,7 @@ gpu::dft
If the source matrix is real (its type is ``CV_32FC1`` ), forward DFT is performed. The result of the DFT is packed into complex ( ``CV_32FC2`` ) matrix. So, the width of the destination matrix is ``dft_size.width / 2 + 1`` . But if the source is a single column, the height is reduced instead of the width.
See Also:
:c:func:`dft`
:c:cpp:func:`dft`
.. index:: gpu::convolve
......@@ -268,7 +268,7 @@ gpu::ConvolveBuf
.. cpp:class:: gpu::ConvolveBuf
This class provides a memory buffer for the
:c:func:`gpu::convolve` function.
:c:cpp:func:`gpu::convolve` function.
::
struct CV_EXPORTS ConvolveBuf
......@@ -290,12 +290,12 @@ gpu::ConvolveBuf::ConvolveBuf
.. cpp:function:: ConvolveBuf::ConvolveBuf()
Constructs an empty buffer that is properly resized after the first call of the
:c:func:`convolve` function.
:c:cpp:func:`convolve` function.
.. cpp:function:: ConvolveBuf::ConvolveBuf(Size image_size, Size templ_size)
Constructs a buffer for the
:c:func:`convolve` function with respective arguments.
:c:cpp:func:`convolve` function with respective arguments.
.. index:: gpu::matchTemplate
......@@ -328,7 +328,7 @@ gpu::matchTemplate
* ``CV_TM_CCORR``
See Also:
:c:func:`matchTemplate`
:c:cpp:func:`matchTemplate`
.. index:: gpu::remap
......@@ -354,7 +354,7 @@ gpu::remap
Values of pixels with non-integer coordinates are computed using bilinear the interpolation.
See Also: :c:func:`remap`
See Also: :c:cpp:func:`remap`
.. index:: gpu::cvtColor
......@@ -370,7 +370,7 @@ gpu::cvtColor
:param dst: Destination image with the same size and depth as ``src`` .
:param code: Color space conversion code. For details, see :func:`cvtColor` . Conversion to/from Luv and Bayer color spaces is not supported.
:param code: Color space conversion code. For details, see :cpp:func:`cvtColor` . Conversion to/from Luv and Bayer color spaces is not supported.
:param dcn: Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from ``src`` and the ``code`` .
......@@ -379,7 +379,7 @@ gpu::cvtColor
3-channel color spaces (like ``HSV``, ``XYZ``, and so on) can be stored in a 4-channel image for better perfomance.
See Also:
:func:`cvtColor`
:cpp:func:`cvtColor`
.. index:: gpu::threshold
......@@ -399,12 +399,12 @@ gpu::threshold
:param maxVal: Maximum value to use with ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` threshold types.
:param thresholdType: Threshold type. For details, see :func:`threshold` . The ``THRESH_OTSU`` threshold type is not supported.
:param thresholdType: Threshold type. For details, see :cpp:func:`threshold` . The ``THRESH_OTSU`` threshold type is not supported.
:param stream: Stream for the asynchronous version.
See Also:
:func:`threshold`
:cpp:func:`threshold`
.. index:: gpu::resize
......@@ -439,7 +439,7 @@ gpu::resize
:param interpolation: Interpolation method. Only ``INTER_NEAREST`` and ``INTER_LINEAR`` are supported.
See Also: :func:`resize`
See Also: :cpp:func:`resize`
.. index:: gpu::warpAffine
......@@ -457,10 +457,10 @@ gpu::warpAffine
:param dsize: Size of the destination image.
:param flags: Combination of interpolation methods (see :func:`resize`) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is an inverse transformation (``dst=>src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
:param flags: Combination of interpolation methods (see :cpp:func:`resize`) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is an inverse transformation (``dst=>src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
See Also:
:func:`warpAffine`
:cpp:func:`warpAffine`
.. index:: gpu::warpPerspective
......@@ -478,10 +478,10 @@ gpu::warpPerspective
:param dsize: Size of the destination image.
:param flags: Combination of interpolation methods (see :func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is the inverse transformation (``dst => src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
:param flags: Combination of interpolation methods (see :cpp:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is the inverse transformation (``dst => src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
See Also:
:func:`warpPerspective`
:cpp:func:`warpPerspective`
.. index:: gpu::rotate
......@@ -506,7 +506,7 @@ gpu::rotate
:param interpolation: Interpolation method. Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` are supported.
See Also:
:func:`gpu::warpAffine`
:cpp:func:`gpu::warpAffine`
.. index:: gpu::copyMakeBorder
......@@ -525,7 +525,7 @@ gpu::copyMakeBorder
:param value: Border value.
See Also:
:func:`copyMakeBorder`
:cpp:func:`copyMakeBorder`
.. index:: gpu::rectStdDev
......
......@@ -15,9 +15,9 @@ The GPU module depends on the CUDA Toolkit and NVIDIA Performance Primitives lib
The OpenCV GPU module is designed for ease of use and does not require any knowledge of CUDA. Though, such a knowledge will certainly be useful to handle non-trivial cases or achieve the highest performance. It is helpful to understand the cost of various operations, what the GPU does, what the preferred data formats are, and so on. The GPU module is an effective instrument for quick implementation of GPU-accelerated computer vision algorithms. However, if your algorithm involves many simple operations, then, for the best possible performance, you may still need to write your own kernels to avoid extra write and read operations on the intermediate results.
To enable CUDA support, configure OpenCV using ``CMake`` with ``WITH_CUDA=ON`` . When the flag is set and if CUDA is installed, the full-featured OpenCV GPU module is built. Otherwise, the module is still built, but at runtime all functions from the module throw
:func:`Exception` with ``CV_GpuNotSupported`` error code, except for
:func:`gpu::getCudaEnabledDeviceCount()`. The latter function returns zero GPU count in this case. Building OpenCV without CUDA support does not perform device code compilation, so it does not require the CUDA Toolkit installed. Therefore, using the
:func:`gpu::getCudaEnabledDeviceCount()` function, you can implement a high-level algorithm that will detect GPU presence at runtime and choose an appropriate implementation (CPU or GPU) accordingly.
:cpp:func:`Exception` with ``CV_GpuNotSupported`` error code, except for
:cpp:func:`gpu::getCudaEnabledDeviceCount()`. The latter function returns zero GPU count in this case. Building OpenCV without CUDA support does not perform device code compilation, so it does not require the CUDA Toolkit installed. Therefore, using the
:cpp:func:`gpu::getCudaEnabledDeviceCount()` function, you can implement a high-level algorithm that will detect GPU presence at runtime and choose an appropriate implementation (CPU or GPU) accordingly.
Compilation for Different NVIDIA* Platforms
-------------------------------------------
......@@ -34,12 +34,12 @@ By default, the OpenCV GPU module includes:
PTX code for compute capabilities 1.1 and 1.3 (controlled by ``CUDA_ARCH_PTX`` in ``CMake``)
This means that for devices with CC 1.3 and 2.0 binary images are ready to run. For all newer platforms, the PTX code for 1.3 is JIT'ed to a binary image. For devices with CC 1.1 and 1.2, the PTX for 1.1 is JIT'ed. For devices with CC 1.0, no code is available and the functions throw
:func:`Exception`. For platforms where JIT compilation is performed first, the run is slow.
:cpp:func:`Exception`. For platforms where JIT compilation is performed first, the run is slow.
On a GPU with CC 1.0, you can still compile the GPU module and most of the functions will run flawlessly. To achieve this, add "1.0" to the list of binaries, for example, ``CUDA_ARCH_BIN="1.0 1.3 2.0"`` . The functions that cannot be run on CC 1.0 GPUs throw an exception.
You can always determine at runtime whether the OpenCV GPU-built binaries (or PTX code) are compatible with your GPU. The function
:func:`gpu::DeviceInfo::isCompatible` returns the compatibility status (true/false).
:cpp:func:`gpu::DeviceInfo::isCompatible` returns the compatibility status (true/false).
Threading and Multi-threading
------------------------------
......@@ -57,7 +57,7 @@ In the current version, each of the OpenCV GPU algorithms can use only a single
*
If you use only synchronous functions, create several CPU threads (one per each GPU) and from within each thread create a CUDA context for the corresponding GPU using
:func:`gpu::setDevice()` or Driver API. Each of the threads will use the associated GPU.
:cpp:func:`gpu::setDevice()` or Driver API. Each of the threads will use the associated GPU.
*
If you use asynchronous functions, you can use the Driver API to create several CUDA contexts associated with different GPUs but attached to one CPU thread. Within the thread you can switch from one GPU to another by making the corresponding context "current". With non-blocking GPU calls, managing algorithm is clear.
......
......@@ -17,7 +17,7 @@ gpu::meanStdDev
:param stddev: Standard deviation value.
See Also: :c:func:`meanStdDev`
See Also: :c:cpp:func:`meanStdDev`
.. index:: gpu::norm
......@@ -37,7 +37,7 @@ gpu::norm
:param buf: Optional buffer to avoid extra memory allocations. It is resized automatically.
See Also: :c:func:`norm`
See Also: :c:cpp:func:`norm`
.. index:: gpu::sum
......@@ -53,7 +53,7 @@ gpu::sum
:param buf: Optional buffer to avoid extra memory allocations. It is resized automatically.
See Also: :c:func:`sum`
See Also: :c:cpp:func:`sum`
.. index:: gpu::absSum
......@@ -105,7 +105,7 @@ gpu::minMax
The function does not work with ``CV_64F`` images on GPUs with the compute capability < 1.3.
See Also: :c:func:`minMaxLoc`
See Also: :c:cpp:func:`minMaxLoc`
.. index:: gpu::minMaxLoc
......@@ -135,7 +135,7 @@ gpu::minMaxLoc
The function does not work with ``CV_64F`` images on GPU with the compute capability < 1.3.
See Also: :c:func:`minMaxLoc`
See Also: :c:cpp:func:`minMaxLoc`
.. index:: gpu::countNonZero
......@@ -153,4 +153,4 @@ gpu::countNonZero
The function does not work with ``CV_64F`` images on GPUs with the compute capability < 1.3.
See Also: :c:func:`countNonZero`
See Also: :c:cpp:func:`countNonZero`
......@@ -173,11 +173,11 @@ gpu::HOGDescriptor::detectMultiScale
Performs object detection with a multi-scale window.
:param img: Source image. See :func:`gpu::HOGDescriptor::detect` for type limitations.
:param img: Source image. See :cpp:func:`gpu::HOGDescriptor::detect` for type limitations.
:param found_locations: Detected objects boundaries.
:param hit_threshold: Threshold for the distance between features and SVM classifying plane. See :func:`gpu::HOGDescriptor::detect` for details.
:param hit_threshold: Threshold for the distance between features and SVM classifying plane. See :cpp:func:`gpu::HOGDescriptor::detect` for details.
:param win_stride: Window stride. It must be a multiple of block stride.
......@@ -185,7 +185,7 @@ gpu::HOGDescriptor::detectMultiScale
:param scale0: Coefficient of the detection window increase.
:param group_threshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See :func:`groupRectangles` .
:param group_threshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See :cpp:func:`groupRectangles` .
.. index:: gpu::HOGDescriptor::getDescriptors
......@@ -197,7 +197,7 @@ gpu::HOGDescriptor::getDescriptors
Returns block descriptors computed for the whole image. The function is mainly used to learn the classifier.
:param img: Source image. See :func:`gpu::HOGDescriptor::detect` for type limitations.
:param img: Source image. See :cpp:func:`gpu::HOGDescriptor::detect` for type limitations.
:param win_stride: Window stride. It must be a multiple of block stride.
......@@ -324,5 +324,5 @@ gpu::CascadeClassifier_GPU::detectMultiScale
imshow("Faces", image_cpu);
See Also: :c:func:`CascadeClassifier::detectMultiScale`
See Also: :c:cpp:func:`CascadeClassifier::detectMultiScale`
......@@ -16,7 +16,7 @@ gpu::transpose
:param dst: Destination matrix.
See Also:
:c:func:`transpose`
:c:cpp:func:`transpose`
.. index:: gpu::flip
......@@ -40,7 +40,7 @@ gpu::flip
See Also:
:c:func:`flip`
:c:cpp:func:`flip`
.. index:: gpu::LUT
......@@ -57,7 +57,7 @@ gpu::LUT
:param dst: Destination matrix with the same depth as ``lut`` and the same number of channels as ``src``.
See Also: :c:func:`LUT`
See Also: :c:cpp:func:`LUT`
.. index:: gpu::merge
......@@ -81,7 +81,7 @@ gpu::merge
:param stream: Stream for the asynchronous version.
See Also: :c:func:`merge`
See Also: :c:cpp:func:`merge`
.. index:: gpu::split
......@@ -103,7 +103,7 @@ gpu::split
:param stream: Stream for the asynchronous version.
See Also: :c:func:`split`
See Also: :c:cpp:func:`split`
.. index:: gpu::magnitude
......@@ -128,7 +128,7 @@ gpu::magnitude
:param stream: Stream for the asynchronous version.
See Also:
:c:func:`magnitude`
:c:cpp:func:`magnitude`
.. index:: gpu::magnitudeSqr
......@@ -173,7 +173,7 @@ gpu::phase
:param stream: Stream for the asynchronous version.
See Also:
:c:func:`phase`
:c:cpp:func:`phase`
.. index:: gpu::cartToPolar
......@@ -198,7 +198,7 @@ gpu::cartToPolar
:param stream: Stream for the asynchronous version.
See Also:
:c:func:`cartToPolar`
:c:cpp:func:`cartToPolar`
.. index:: gpu::polarToCart
......@@ -223,4 +223,4 @@ gpu::polarToCart
:param stream: Stream for the asynchronous version.
See Also:
:c:func:`polarToCart`
:c:cpp:func:`polarToCart`
......@@ -21,7 +21,7 @@ gpu::add
:param dst: Destination matrix with the same size and type as ``src1``.
See Also: :c:func:`add`
See Also: :c:cpp:func:`add`
.. index:: gpu::subtract
......@@ -39,7 +39,7 @@ gpu::subtract
:param dst: Destination matrix with the same size and type as ``src1``.
See Also: :c:func:`subtract`
See Also: :c:cpp:func:`subtract`
......@@ -59,7 +59,7 @@ gpu::multiply
:param dst: Destination matrix with the same size and type as ``src1``.
See Also: :c:func:`multiply`
See Also: :c:cpp:func:`multiply`
.. index:: gpu::divide
......@@ -78,9 +78,9 @@ gpu::divide
:param dst: Destination matrix with the same size and type as ``src1``.
This function, in contrast to :c:func:`divide`, uses a round-down rounding mode.
This function, in contrast to :c:cpp:func:`divide`, uses a round-down rounding mode.
See Also: :c:func:`divide`
See Also: :c:cpp:func:`divide`
......@@ -96,7 +96,7 @@ gpu::exp
:param dst: Destination matrix with the same size and type as ``src``.
See Also: :c:func:`exp`
See Also: :c:cpp:func:`exp`
......@@ -112,7 +112,7 @@ gpu::log
:param dst: Destination matrix with the same size and type as ``src``.
See Also: :c:func:`log`
See Also: :c:cpp:func:`log`
......@@ -132,7 +132,7 @@ gpu::absdiff
:param dst: Destination matrix with the same size and type as ``src1``.
See Also: :c:func:`absdiff`
See Also: :c:cpp:func:`absdiff`
.. index:: gpu::compare
......@@ -157,7 +157,7 @@ gpu::compare
* **CMP_LE:** ``src1(.) <= src2(.)``
* **CMP_NE:** ``src1(.) != src2(.)``
See Also: :c:func:`compare`
See Also: :c:cpp:func:`compare`
.. index:: gpu::bitwise_not
......@@ -268,7 +268,7 @@ gpu::min
:param stream: Stream for the asynchronous version.
See Also: :c:func:`min`
See Also: :c:cpp:func:`min`
......@@ -294,4 +294,4 @@ gpu::max
:param stream: Stream for the asynchronous version.
See Also: :c:func:`max`
See Also: :c:cpp:func:`max`
......@@ -62,7 +62,7 @@ The following code is an example used to generate the figure. ::
setWindowProperty
---------------------
.. c:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
.. cpp:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
Changes parameters of a window dynamically.
......@@ -96,7 +96,7 @@ The function ``setWindowProperty`` enables changing properties of a window.
getWindowProperty
---------------------
.. c:function:: void getWindowProperty(const char* name, int prop_id)
.. cpp:function:: void getWindowProperty(const string& name, int prop_id)
Provides parameters of a window.
......@@ -122,7 +122,7 @@ The function ``getWindowProperty`` returns properties of a window.
fontQt
----------
.. c:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
.. cpp:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
Creates the font to draw a text on an image.
......@@ -167,7 +167,7 @@ A basic usage of this function is the following: ::
addText
-----------
.. c:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font)
.. cpp:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font)
Creates the font to draw a text on an image.
......@@ -192,7 +192,7 @@ using a specific font
displayOverlay
------------------
.. c:function:: void displayOverlay(const string& name, const string& text, int delay)
.. cpp:function:: void displayOverlay(const string& name, const string& text, int delay)
Displays a text on a window image as an overlay for a specified duration.
......@@ -208,7 +208,7 @@ The function ``displayOverlay`` displays useful information/tips on top of the w
displayStatusBar
--------------------
.. c:function:: void displayStatusBar(const string& name, const string& text, int delay)
.. cpp:function:: void displayStatusBar(const string& name, const string& text, int delay)
Displays a text on the window statusbar during the specified period of time.
......@@ -227,7 +227,7 @@ The function ``displayOverlay`` displays useful information/tips on top of the w
createOpenGLCallback
------------------------
.. c:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1)
.. cpp:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1)
Creates a callback function called to draw OpenGL on top the the image display by ``windowname``.
......@@ -279,7 +279,7 @@ The function ``createOpenGLCallback`` can be used to draw 3D data on the window.
saveWindowParameters
------------------------
.. c:function:: void saveWindowParameters(const string& name)
.. cpp:function:: void saveWindowParameters(const string& name)
Saves parameters of the window ``windowname`` .
......@@ -293,7 +293,7 @@ The function ``saveWindowParameters`` saves size, location, flags, trackbars va
loadWindowParameters
------------------------
.. c:function:: void loadWindowParameters(const string& name)
.. cpp:function:: void loadWindowParameters(const string& name)
Loads parameters of the window ``windowname`` .
......@@ -307,7 +307,7 @@ The function ``loadWindowParameters`` loads size, location, flags, trackbars val
createButton
----------------
.. c:function:: createButton( const string& button_name CV_DEFAULT(NULL),ButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL), int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0))
.. cpp:function:: createButton( const string& button_name CV_DEFAULT(NULL),ButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL), int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0))
Creates a callback function called to draw OpenGL on top of the image display by ``windowname`` .
......
......@@ -9,7 +9,7 @@ Reading and Writing Images and Video
imdecode
------------
.. c:function:: Mat imdecode( const Mat\& buf, int flags )
.. cpp:function:: Mat imdecode( InputArray buf, int flags )
Reads an image from a buffer in memory.
......@@ -29,7 +29,7 @@ See
imencode
------------
.. c:function:: bool imencode( const string\& ext, const Mat\& img, vector<uchar>\& buf, const vector<int>\& params=vector<int>())
.. cpp:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
Encode an image into a memory buffer.
......@@ -51,7 +51,7 @@ See
imread
----------
.. c:function:: Mat imread( const string\& filename, int flags=1 )
.. cpp:function:: Mat imread( const string& filename, int flags=1 )
Loads an image from a file.
......@@ -95,7 +95,7 @@ The function ``imread`` loads an image from the specified file and returns it. I
imwrite
-----------
.. c:function:: bool imwrite( const string\& filename, const Mat\& img, const vector<int>\& params=vector<int>())
.. cpp:function:: bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>())
Saves an image to a specified file.
......@@ -208,11 +208,11 @@ The class provides C++ video capturing API. Here is how the class can be used: :
VideoCapture::VideoCapture
------------------------------
.. c:function:: VideoCapture::VideoCapture()
.. cpp:function:: VideoCapture::VideoCapture()
.. c:function:: VideoCapture::VideoCapture(const string& filename)
.. cpp:function:: VideoCapture::VideoCapture(const string& filename)
.. c:function:: VideoCapture::VideoCapture(int device)
.. cpp:function:: VideoCapture::VideoCapture(int device)
VideoCapture constructors.
......@@ -226,7 +226,7 @@ VideoCapture constructors.
VideoCapture::get
---------------------
.. c:function:: double VideoCapture::get(int property_id)
.. cpp:function:: double VideoCapture::get(int property_id)
:param property_id: Property identifier. It can be one of the following:
......@@ -277,7 +277,7 @@ VideoCapture::get
VideoCapture::set
---------------------
.. c:function:: bool VideoCapture::set(int property_id, double value)
.. cpp:function:: bool VideoCapture::set(int property_id, double value)
Sets a property in the VideoCapture backend.
......
......@@ -9,7 +9,7 @@ User Interface
createTrackbar
------------------
.. c:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange CV_DEFAULT(0), void* userdata CV_DEFAULT(0))
.. cpp:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
Creates a trackbar and attaches it to the specified window.
......@@ -45,7 +45,7 @@ Clicking the label of each trackbar enables editing the trackbar values manually
getTrackbarPos
------------------
.. c:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
.. cpp:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
Returns the trackbar position.
......@@ -67,7 +67,7 @@ Qt-specific details:
imshow
----------
.. c:function:: void imshow( const string& winname, const Mat& image )
.. cpp:function:: void imshow( const string& winname, InputArray image )
Displays an image in the specified window.
......@@ -92,7 +92,7 @@ The function ``imshow`` displays an image in the specified window. If the window
namedWindow
---------------
.. c:function:: void namedWindow( const string& winname, int flags )
.. cpp:function:: void namedWindow( const string& winname, int flags )
Creates a window.
......@@ -132,7 +132,7 @@ Qt-specific details:
setTrackbarPos
------------------
.. c:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
.. cpp:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
Sets the trackbar position.
......@@ -156,7 +156,7 @@ Qt-specific details:
waitKey
-----------
.. c:function:: int waitKey(int delay=0)
.. cpp:function:: int waitKey(int delay=0)
Waits for a pressed key.
......
......@@ -56,7 +56,7 @@ namespace cv
enum { WINDOW_AUTOSIZE=1 };
CV_EXPORTS_W void namedWindow( const string& winname, int flags CV_DEFAULT(WINDOW_AUTOSIZE) );
CV_EXPORTS_W void namedWindow( const string& winname, int flags=WINDOW_AUTOSIZE );
CV_EXPORTS_W void destroyWindow( const string& winname );
CV_EXPORTS_W int startWindowThread();
......@@ -66,16 +66,16 @@ CV_EXPORTS_W double getWindowProperty(const string& winname, int prop_id);//YV
//Only for Qt
//------------------------
CV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize CV_DEFAULT(-1),
Scalar color CV_DEFAULT(Scalar::all(0)), int weight CV_DEFAULT(CV_FONT_NORMAL),
int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
CV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize=-1,
Scalar color=Scalar::all(0), int weight=CV_FONT_NORMAL,
int style=CV_STYLE_NORMAL, int spacing=0);
CV_EXPORTS void addText( const Mat& img, const string& text, Point org, CvFont font);
CV_EXPORTS void displayOverlay(const string& winname, const string& text, int delayms);
CV_EXPORTS void displayStatusBar(const string& winname, const string& text, int delayms);
typedef void (CV_CDECL *OpenGLCallback)(void* userdata);
CV_EXPORTS void createOpenGLCallback(const string& winname, CvOpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(0));
CV_EXPORTS void createOpenGLCallback(const string& winname, CvOpenGLCallback callbackOpenGL, void* userdata=0);
CV_EXPORTS void saveWindowParameters(const string& windowName);
CV_EXPORTS void loadWindowParameters(const string& windowName);
......@@ -84,8 +84,8 @@ CV_EXPORTS void stopLoop();
typedef void (CV_CDECL *ButtonCallback)(int state, void* userdata);
CV_EXPORTS int createButton( const string& bar_name, ButtonCallback on_change,
void* userdata CV_DEFAULT(NULL), int type CV_DEFAULT(CV_PUSH_BUTTON),
bool initial_button_state CV_DEFAULT(0));
void* userdata=NULL, int type=CV_PUSH_BUTTON,
bool initial_button_state=0);
//-------------------------
CV_EXPORTS_W void imshow( const string& winname, InputArray mat );
......@@ -94,8 +94,8 @@ typedef void (CV_CDECL *TrackbarCallback)(int pos, void* userdata);
CV_EXPORTS int createTrackbar( const string& trackbarname, const string& winname,
int* value, int count,
TrackbarCallback onChange CV_DEFAULT(0),
void* userdata CV_DEFAULT(0));
TrackbarCallback onChange=0,
void* userdata=0);
CV_EXPORTS_W int getTrackbarPos( const string& trackbarname, const string& winname );
CV_EXPORTS_W void setTrackbarPos( const string& trackbarname, const string& winname, int pos );
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,13 +5,11 @@ Histograms
.. index:: calcHist
.. _calcHist:
calcHist
------------
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, MatND\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. cpp:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, OutputArray hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. c:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, const Mat\& mask, SparseMat\& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. cpp:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
Calculates a histogram of a set of arrays.
......@@ -99,13 +97,11 @@ input arrays at the same location. The sample below shows how to compute a 2D Hu
.. index:: calcBackProject
.. _calcBackProject:
calcBackProject
-------------------
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const MatND\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. cpp:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, InputArray hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
.. c:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat\& hist, Mat\& backProject, const float** ranges, double scale=1, bool uniform=true )
.. cpp:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
Calculates the back projection of a histogram.
......@@ -119,7 +115,7 @@ calcBackProject
:param backProject: Destination back projection aray that is a single-channel array of the same size and depth as ``arrays[0]`` .
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :func:`calcHist` .
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :cpp:func:`calcHist` .
:param scale: Optional scale factor for the output back projection.
......@@ -137,21 +133,19 @@ The functions ``calcBackProject`` calculate the back project of the histogram. T
Find connected components in the resulting picture and choose, for example, the largest component.
This is an approximate algorithm of the
:func:`CAMShift` color object tracker.
:cpp:func:`CAMShift` color object tracker.
See Also:
:func:`calcHist`
:cpp:func:`calcHist`
.. index:: compareHist
.. _compareHist:
compareHist
-----------
.. c:function:: double compareHist( const MatND\& H1, const MatND\& H2, int method )
.. cpp:function:: double compareHist( InputArray H1, InputArray H2, int method )
.. c:function:: double compareHist( const SparseMat\& H1, const SparseMat\& H2, int method )
.. cpp:function:: double compareHist( const SparseMat& H1, const SparseMat& H2, int method )
Compares two histograms.
......@@ -207,15 +201,13 @@ The function returns
:math:`d(H_1, H_2)` .
While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms or more general sparse configurations of weighted points, consider using the
:func:`calcEMD` function.
:cpp:func:`calcEMD` function.
.. index:: equalizeHist
.. _equalizeHist:
equalizeHist
----------------
.. c:function:: void equalizeHist( const Mat\& src, Mat\& dst )
.. cpp:function:: void equalizeHist( InputArray src, OutputArray dst )
Equalizes the histogram of a grayscale image.
......
......@@ -9,7 +9,7 @@ Miscellaneous Image Transformations
adaptiveThreshold
---------------------
.. c:function:: void adaptiveThreshold( const Mat& src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
.. cpp:function:: void adaptiveThreshold( InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
Applies an adaptive threshold to an array.
......@@ -54,14 +54,14 @@ where
:math:`T(x, y)` is a weighted sum (cross-correlation with a Gaussian window) of the
:math:`\texttt{blockSize} \times \texttt{blockSize}` neighborhood of
:math:`(x, y)` minus ``C`` . The default sigma (standard deviation) is used for the specified ``blockSize`` . See
:func:`getGaussianKernel` .
:cpp:func:`getGaussianKernel` .
The function can process the image in-place.
See Also:
:func:`threshold`,
:func:`blur`,
:func:`GaussianBlur`
:cpp:func:`threshold`,
:cpp:func:`blur`,
:cpp:func:`GaussianBlur`
.. index:: cvtColor
......@@ -70,7 +70,7 @@ See Also:
cvtColor
------------
.. c:function:: void cvtColor( const Mat& src, Mat& dst, int code, int dstCn=0 )
.. cpp:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 )
Converts an image from one color space to another.
......@@ -127,7 +127,7 @@ The function can do the following transformations:
..
More advanced channel reordering can also be done with
:func:`mixChannels` .
:cpp:func:`mixChannels` .
*
RGB
......@@ -404,9 +404,9 @@ The function can do the following transformations:
distanceTransform
---------------------
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, int distanceType, int maskSize )
.. cpp:function:: void distanceTransform( InputArray src, OutputArray dst, int distanceType, int maskSize )
.. c:function:: void distanceTransform( const Mat& src, Mat& dst, Mat& labels, int distanceType, int maskSize )
.. cpp:function:: void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize )
Calculates the distance to the closest zero pixel for each pixel of the source image.
......@@ -472,9 +472,9 @@ Currently, the second variant can use only the approximate distance transform al
floodFill
-------------
.. c:function:: int floodFill( Mat& image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. cpp:function:: int floodFill( InputOutputArray image, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. c:function:: int floodFill( Mat& image, Mat& mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. cpp:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
Fills a connected component with the given color.
......@@ -566,7 +566,7 @@ where
Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on. Various modes of the function are demonstrated in the ``floodfill.cpp`` sample.
See Also:
:func:`findContours`
:cpp:func:`findContours`
.. index:: inpaint
......@@ -574,7 +574,7 @@ See Also:
inpaint
-----------
.. c:function:: void inpaint( const Mat& src, const Mat& inpaintMask, Mat& dst, double inpaintRadius, int flags )
.. cpp:function:: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags )
Restores the selected region in an image using the region neighborhood.
......@@ -598,15 +598,13 @@ for more details.
.. index:: integral
.. _integral:
integral
------------
.. c:function:: void integral( const Mat& image, Mat& sum, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, int sdepth=-1 )
.. c:function:: void integral( const Mat& image, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth=-1 )
.. cpp:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )
Calculates the integral of an image.
......@@ -656,7 +654,7 @@ As a practical example, the next figure shows the calculation of the integral of
threshold
-------------
.. c:function:: double threshold( const Mat& src, Mat& dst, double thresh, double maxVal, int thresholdType )
.. cpp:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxVal, int thresholdType )
Applies a fixed-level threshold to each array element.
......@@ -673,7 +671,7 @@ threshold
The function applies fixed-level thresholding
to a single-channel array. The function is typically used to get a
bi-level (binary) image out of a grayscale image (
:func:`compare` could
:cpp:func:`compare` could
be also used for this purpose) or for removing a noise, that is, filtering
out pixels with too small or too large values. There are several
types of thresholding supported by the function. They are determined by ``thresholdType`` :
......@@ -717,19 +715,17 @@ Currently, Otsu's method is implemented only for 8-bit images.
.. image:: pics/threshold.png
See Also:
:func:`adaptiveThreshold`,
:func:`findContours`,
:func:`compare`,
:func:`min`,
:func:`max`
:cpp:func:`adaptiveThreshold`,
:cpp:func:`findContours`,
:cpp:func:`compare`,
:cpp:func:`min`,
:cpp:func:`max`
.. index:: watershed
.. _watershed:
watershed
-------------
.. c:function:: void watershed( const Mat& image, Mat& markers )
.. cpp:function:: void watershed( InputArray image, InputOutputArray markers )
Performs a marker-based image segmentation using the watershed algrorithm.
......@@ -745,8 +741,8 @@ function, you have to roughly outline the desired regions in the image ``markers
represented as one or more connected components with the pixel values
1, 2, 3, and so on. Such markers can be retrieved from a binary mask
using
:func:`findContours` and
:func:`drawContours` (see the ``watershed.cpp`` demo).
:cpp:func:`findContours` and
:cpp:func:`drawContours` (see the ``watershed.cpp`` demo).
The markers are "seeds" of the future image
regions. All the other pixels in ``markers`` , whose relation to the
outlined regions is not known and should be defined by the algorithm,
......@@ -761,16 +757,14 @@ marker image. Visual demonstration and usage example of the function
can be found in the OpenCV samples directory (see the ``watershed.cpp`` demo).
See Also:
:func:`findContours`
:cpp:func:`findContours`
.. index:: grabCut
.. _grabCut:
grabCut
-------
.. c:function:: void grabCut(const Mat& image, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode )
.. cpp:function:: void grabCut(InputArray image, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode )
Runs the GrabCut algorithm.
......
......@@ -7,7 +7,7 @@ Object Detection
matchTemplate
-----------------
.. c:function:: void matchTemplate( const Mat& image, const Mat& temp, Mat& result, int method )
.. cpp:function:: void matchTemplate( InputArray image, InputArray temp, OutputArray result, int method )
Compares a template against overlapped image regions.
......@@ -69,5 +69,5 @@ image patch:
R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} }
After the function finishes the comparison, the best matches can be found as global minimums (when ``CV_TM_SQDIFF`` was used) or maximums (when ``CV_TM_CCORR`` or ``CV_TM_CCOEFF`` was used) using the
:func:`minMaxLoc` function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
:cpp:func:`minMaxLoc` function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
......@@ -221,7 +221,7 @@ Boosted tree classifier ::
CvBoost::train
--------------
.. c:function:: bool CvBoost::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvBoostParams params=CvBoostParams(), bool update=false )
.. cpp:function:: bool CvBoost::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvBoostParams params=CvBoostParams(), bool update=false )
Trains a boosted tree classifier.
......@@ -233,7 +233,7 @@ The train method follows the common template. The last parameter ``update`` spec
CvBoost::predict
----------------
.. c:function:: float CvBoost::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weak_responses=0, CvSlice slice=CV_WHOLE_SEQ, bool raw_mode=false ) const
.. cpp:function:: float CvBoost::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weak_responses=0, CvSlice slice=CV_WHOLE_SEQ, bool raw_mode=false ) const
Predicts a response for an input sample.
......@@ -245,7 +245,7 @@ The method ``CvBoost::predict`` runs the sample through the trees in the ensembl
CvBoost::prune
--------------
.. c:function:: void CvBoost::prune( CvSlice slice )
.. cpp:function:: void CvBoost::prune( CvSlice slice )
Removes the specified weak classifiers.
......@@ -261,7 +261,7 @@ Do not confuse this method with the pruning of individual decision trees, which
CvBoost::get_weak_predictors
----------------------------
.. c:function:: CvSeq* CvBoost::get_weak_predictors()
.. cpp:function:: CvSeq* CvBoost::get_weak_predictors()
Returns the sequence of weak tree classifiers.
......
......@@ -371,9 +371,9 @@ Decision tree ::
CvDTree::train
--------------
.. c:function:: bool CvDTree::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvDTreeParams params=CvDTreeParams() )
.. cpp:function:: bool CvDTree::train( const CvMat* _train_data, int _tflag, const CvMat* _responses, const CvMat* _var_idx=0, const CvMat* _sample_idx=0, const CvMat* _var_type=0, const CvMat* _missing_mask=0, CvDTreeParams params=CvDTreeParams() )
.. c:function:: bool CvDTree::train( CvDTreeTrainData* _train_data, const CvMat* _subsample_idx )
.. cpp:function:: bool CvDTree::train( CvDTreeTrainData* _train_data, const CvMat* _subsample_idx )
Trains a decision tree.
......@@ -391,7 +391,7 @@ There are two ``train`` methods in ``CvDTree`` :
CvDTree::predict
----------------
.. c:function:: CvDTreeNode* CvDTree::predict( const CvMat* _sample, const CvMat* _missing_data_mask=0, bool raw_mode=false ) const
.. cpp:function:: CvDTreeNode* CvDTree::predict( const CvMat* _sample, const CvMat* _missing_data_mask=0, bool raw_mode=false ) const
Returns the leaf node of a decision tree corresponding to the input vector.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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