Improved the public 'non-optimized' duplicates of 'Tegra-optimized' functions.
This commit is contained in:
parent
2e685dcf0a
commit
fc307c87dc
@ -502,27 +502,27 @@ Sample usage of detecting and drawing chessboard corners: ::
|
||||
|
||||
findCirclesGrid
|
||||
-------------------
|
||||
Finds the centers in the grid of circles.
|
||||
Finds centers in the grid of circles.
|
||||
|
||||
.. ocv:function:: bool findCirclesGrid( InputArray image, Size patternSize, OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID, const Ptr<FeatureDetector> &blobDetector = new SimpleBlobDetector() )
|
||||
|
||||
.. ocv:pyfunction:: cv2.findCirclesGridDefault(image, patternSize[, centers[, flags]]) -> retval, centers
|
||||
|
||||
:param image: Grid view of source circles. It must be an 8-bit grayscale or color image.
|
||||
:param image: grid view of input circles; it must be an 8-bit grayscale or color image.
|
||||
|
||||
:param patternSize: Number of circles per a grid row and column ``( patternSize = Size(points_per_row, points_per_colum) )`` .
|
||||
:param patternSize: number of circles per row and column ``( patternSize = Size(points_per_row, points_per_colum) )``.
|
||||
|
||||
:param centers: Output array of detected centers.
|
||||
:param centers: output array of detected centers.
|
||||
|
||||
:param flags: Various operation flags that can be one of the following values:
|
||||
:param flags: various operation flags that can be one of the following values:
|
||||
|
||||
* **CALIB_CB_SYMMETRIC_GRID** Use symmetric pattern of circles.
|
||||
* **CALIB_CB_SYMMETRIC_GRID** uses symmetric pattern of circles.
|
||||
|
||||
* **CALIB_CB_ASYMMETRIC_GRID** Use asymmetric pattern of circles.
|
||||
* **CALIB_CB_ASYMMETRIC_GRID** uses asymmetric pattern of circles.
|
||||
|
||||
* **CALIB_CB_CLUSTERING** Use a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter.
|
||||
* **CALIB_CB_CLUSTERING** uses a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter.
|
||||
|
||||
:param blobDetector: FeatureDetector that finds blobs like dark circles on light background
|
||||
:param blobDetector: feature detector that finds blobs like dark circles on light background.
|
||||
|
||||
|
||||
The function attempts to determine
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
@ -778,7 +778,7 @@ Here are examples of matrix expressions:
|
||||
Below is the formal description of the ``Mat`` methods.
|
||||
|
||||
Mat::Mat
|
||||
------------
|
||||
--------
|
||||
Various Mat constructors
|
||||
|
||||
.. ocv:function:: Mat::Mat()
|
||||
@ -861,7 +861,7 @@ often the default constructor is enough, and the proper matrix will be allocated
|
||||
|
||||
|
||||
Mat::~Mat
|
||||
------------
|
||||
---------
|
||||
The Mat destructor.
|
||||
|
||||
.. ocv:function:: Mat::~Mat()
|
||||
@ -870,7 +870,7 @@ The matrix destructor calls :ocv:func:`Mat::release` .
|
||||
|
||||
|
||||
Mat::operator =
|
||||
-------------------
|
||||
---------------
|
||||
Provides matrix assignment operators.
|
||||
|
||||
.. ocv:function:: Mat& Mat::operator = (const Mat& m)
|
||||
@ -888,7 +888,7 @@ Provides matrix assignment operators.
|
||||
These are available assignment operators. Since they all are very different, make sure to read the operator parameters description.
|
||||
|
||||
Mat::row
|
||||
------------
|
||||
--------
|
||||
Creates a matrix header for the specified matrix row.
|
||||
|
||||
.. ocv:function:: Mat Mat::row(int y) const
|
||||
@ -923,7 +923,7 @@ The method makes a new header for the specified matrix row and returns it. This
|
||||
A.row(j).copyTo(A.row(i));
|
||||
|
||||
Mat::col
|
||||
------------
|
||||
--------
|
||||
Creates a matrix header for the specified matrix column.
|
||||
|
||||
.. ocv:function:: Mat Mat::col(int x) const
|
||||
@ -935,7 +935,7 @@ The method makes a new header for the specified matrix column and returns it. Th
|
||||
|
||||
|
||||
Mat::rowRange
|
||||
-----------------
|
||||
-------------
|
||||
Creates a matrix header for the specified row span.
|
||||
|
||||
.. ocv:function:: Mat Mat::rowRange(int startrow, int endrow) const
|
||||
@ -953,7 +953,7 @@ The method makes a new header for the specified row span of the matrix. Similarl
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::colRange
|
||||
-----------------
|
||||
-------------
|
||||
Creates a matrix header for the specified row span.
|
||||
|
||||
.. ocv:function:: Mat Mat::colRange(int startcol, int endcol) const
|
||||
@ -971,7 +971,7 @@ The method makes a new header for the specified column span of the matrix. Simil
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::diag
|
||||
-------------
|
||||
---------
|
||||
Extracts a diagonal from a matrix, or creates a diagonal matrix.
|
||||
|
||||
.. ocv:function:: Mat Mat::diag( int d=0 ) const
|
||||
@ -991,7 +991,7 @@ The method makes a new header for the specified matrix diagonal. The new matrix
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::clone
|
||||
--------------
|
||||
----------
|
||||
Creates a full copy of the array and the underlying data.
|
||||
|
||||
.. ocv:function:: Mat Mat::clone() const
|
||||
@ -1000,7 +1000,7 @@ The method creates a full copy of the array. The original ``step[]`` is not take
|
||||
|
||||
|
||||
Mat::copyTo
|
||||
---------------
|
||||
-----------
|
||||
Copies the matrix to another one.
|
||||
|
||||
.. ocv:function:: void Mat::copyTo( OutputArray m ) const
|
||||
@ -1022,18 +1022,18 @@ When the operation mask is specified, and the ``Mat::create`` call shown above r
|
||||
.. _Mat::convertTo:
|
||||
|
||||
Mat::convertTo
|
||||
------------------
|
||||
--------------
|
||||
Converts an array to another data type with optional scaling.
|
||||
|
||||
.. ocv:function:: void Mat::convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const
|
||||
|
||||
:param m: Destination matrix. If it does not have a proper size or type before the operation, it is reallocated.
|
||||
:param m: output matrix; if it does not have a proper size or type before the operation, it is reallocated.
|
||||
|
||||
:param rtype: Desired destination matrix type or, rather, the depth since the number of channels are the same as the source has. If ``rtype`` is negative, the destination matrix will have the same type as the source.
|
||||
:param rtype: desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if ``rtype`` is negative, the output matrix will have the same type as the input.
|
||||
|
||||
:param alpha: Optional scale factor.
|
||||
:param alpha: optional scale factor.
|
||||
|
||||
:param beta: Optional delta added to the scaled values.
|
||||
:param beta: optional delta added to the scaled values.
|
||||
|
||||
The method converts source pixel values to the target data type. ``saturate_cast<>`` is applied at the end to avoid possible overflows:
|
||||
|
||||
@ -1043,7 +1043,7 @@ The method converts source pixel values to the target data type. ``saturate_cast
|
||||
|
||||
|
||||
Mat::assignTo
|
||||
-----------------
|
||||
-------------
|
||||
Provides a functional form of ``convertTo``.
|
||||
|
||||
.. ocv:function:: void Mat::assignTo( Mat& m, int type=-1 ) const
|
||||
@ -1056,7 +1056,7 @@ This is an internally used method called by the
|
||||
:ref:`MatrixExpressions` engine.
|
||||
|
||||
Mat::setTo
|
||||
--------------
|
||||
----------
|
||||
Sets all or some of the array elements to the specified value.
|
||||
|
||||
.. ocv:function:: Mat& Mat::setTo( InputArray value, InputArray mask=noArray() )
|
||||
@ -1067,7 +1067,7 @@ Sets all or some of the array elements to the specified value.
|
||||
|
||||
|
||||
Mat::reshape
|
||||
----------------
|
||||
------------
|
||||
Changes the shape and/or the number of channels of a 2D matrix without copying the data.
|
||||
|
||||
.. ocv:function:: Mat Mat::reshape(int cn, int rows=0) const
|
||||
@ -1100,7 +1100,7 @@ For example, if there is a set of 3D points stored as an STL vector, and you wan
|
||||
|
||||
|
||||
Mat::t
|
||||
----------
|
||||
------
|
||||
Transposes a matrix.
|
||||
|
||||
.. ocv:function:: MatExpr Mat::t() const
|
||||
@ -1112,7 +1112,7 @@ The method performs matrix transposition by means of matrix expressions. It does
|
||||
|
||||
|
||||
Mat::inv
|
||||
------------
|
||||
--------
|
||||
Inverses a matrix.
|
||||
|
||||
.. ocv:function:: MatExpr Mat::inv(int method=DECOMP_LU) const
|
||||
@ -1129,7 +1129,7 @@ The method performs a matrix inversion by means of matrix expressions. This mean
|
||||
|
||||
|
||||
Mat::mul
|
||||
------------
|
||||
--------
|
||||
Performs an element-wise multiplication or division of the two matrices.
|
||||
|
||||
.. ocv:function:: MatExpr Mat::mul(InputArray m, double scale=1) const
|
||||
@ -1146,7 +1146,7 @@ Example: ::
|
||||
|
||||
|
||||
Mat::cross
|
||||
--------------
|
||||
----------
|
||||
Computes a cross-product of two 3-element vectors.
|
||||
|
||||
.. ocv:function:: Mat Mat::cross(InputArray m) const
|
||||
@ -1157,18 +1157,18 @@ The method computes a cross-product of two 3-element vectors. The vectors must b
|
||||
|
||||
|
||||
Mat::dot
|
||||
------------
|
||||
--------
|
||||
Computes a dot-product of two vectors.
|
||||
|
||||
.. ocv:function:: double Mat::dot(InputArray m) const
|
||||
|
||||
:param m: Another dot-product operand.
|
||||
:param m: another dot-product operand.
|
||||
|
||||
The method computes a dot-product of two matrices. If the matrices are not single-column or single-row vectors, the top-to-bottom left-to-right scan ordering is used to treat them as 1D vectors. The vectors must have the same size and type. If the matrices have more than one channel, the dot products from all the channels are summed together.
|
||||
|
||||
|
||||
Mat::zeros
|
||||
--------------
|
||||
----------
|
||||
Returns a zero array of the specified size and type.
|
||||
|
||||
.. ocv:function:: static MatExpr Mat::zeros(int rows, int cols, int type)
|
||||
@ -1443,7 +1443,7 @@ The operators make a new header for the specified sub-array of ``*this`` . They
|
||||
|
||||
|
||||
Mat::operator CvMat
|
||||
-----------------------
|
||||
-------------------
|
||||
Creates the ``CvMat`` header for the matrix.
|
||||
|
||||
.. ocv:function:: Mat::operator CvMat() const
|
||||
@ -1462,7 +1462,7 @@ where ``mycvOldFunc`` is a function written to work with OpenCV 1.x data structu
|
||||
|
||||
|
||||
Mat::operator IplImage
|
||||
--------------------------
|
||||
----------------------
|
||||
Creates the ``IplImage`` header for the matrix.
|
||||
|
||||
.. ocv:function:: Mat::operator IplImage() const
|
||||
@ -1470,7 +1470,7 @@ Creates the ``IplImage`` header for the matrix.
|
||||
The operator creates the ``IplImage`` header for the matrix without copying the underlying data. You should make sure than the original matrix is not deallocated while the ``IplImage`` header is used. Similarly to ``Mat::operator CvMat`` , the operator is useful for intermixing the new and the old OpenCV API's.
|
||||
|
||||
Mat::total
|
||||
--------------
|
||||
----------
|
||||
Returns the total number of array elements.
|
||||
|
||||
.. ocv:function:: size_t Mat::total() const
|
||||
@ -1478,7 +1478,7 @@ Returns the total number of array elements.
|
||||
The method returns the number of array elements (a number of pixels if the array represents an image).
|
||||
|
||||
Mat::isContinuous
|
||||
---------------------
|
||||
-----------------
|
||||
Reports whether the matrix is continuous or not.
|
||||
|
||||
.. ocv:function:: bool Mat::isContinuous() const
|
||||
@ -1576,7 +1576,7 @@ The method returns a matrix element type. This is an identifier compatible with
|
||||
|
||||
|
||||
Mat::depth
|
||||
--------------
|
||||
----------
|
||||
Returns the depth of a matrix element.
|
||||
|
||||
.. ocv:function:: int Mat::depth() const
|
||||
@ -1599,7 +1599,7 @@ The method returns the identifier of the matrix element depth (the type of each
|
||||
|
||||
|
||||
Mat::channels
|
||||
-----------------
|
||||
-------------
|
||||
Returns the number of matrix channels.
|
||||
|
||||
.. ocv:function:: int Mat::channels() const
|
||||
@ -1608,7 +1608,7 @@ The method returns the number of matrix channels.
|
||||
|
||||
|
||||
Mat::step1
|
||||
--------------
|
||||
----------
|
||||
Returns a normalized step.
|
||||
|
||||
.. ocv:function:: size_t Mat::step1( int i=0 ) const
|
||||
@ -1618,7 +1618,7 @@ The method returns a matrix step divided by
|
||||
|
||||
|
||||
Mat::size
|
||||
-------------
|
||||
---------
|
||||
Returns a matrix size.
|
||||
|
||||
.. ocv:function:: Size Mat::size() const
|
||||
@ -1627,7 +1627,7 @@ The method returns a matrix size: ``Size(cols, rows)`` . When the matrix is more
|
||||
|
||||
|
||||
Mat::empty
|
||||
--------------
|
||||
----------
|
||||
Returns ``true`` if the array has no elements.
|
||||
|
||||
.. ocv:function:: bool Mat::empty() const
|
||||
@ -1636,7 +1636,7 @@ The method returns ``true`` if ``Mat::total()`` is 0 or if ``Mat::data`` is NULL
|
||||
|
||||
|
||||
Mat::ptr
|
||||
------------
|
||||
--------
|
||||
Returns a pointer to the specified matrix row.
|
||||
|
||||
.. ocv:function:: uchar* Mat::ptr(int i0=0)
|
||||
@ -1654,7 +1654,7 @@ The methods return ``uchar*`` or typed pointer to the specified matrix row. See
|
||||
|
||||
|
||||
Mat::at
|
||||
-----------
|
||||
-------
|
||||
Returns a reference to the specified array element.
|
||||
|
||||
.. ocv:function:: template<typename T> T& Mat::at(int i) const
|
||||
|
@ -5,7 +5,7 @@ Operations on Arrays
|
||||
|
||||
abs
|
||||
---
|
||||
Computes an absolute value of each matrix element.
|
||||
Calculates an absolute value of each matrix element.
|
||||
|
||||
.. ocv:function:: MatExpr abs( const Mat& m )
|
||||
.. ocv:function:: MatExpr abs( const MatExpr& e )
|
||||
@ -27,8 +27,8 @@ The output matrix has the same size and the same type as the input one except fo
|
||||
|
||||
|
||||
absdiff
|
||||
-----------
|
||||
Computes the per-element absolute difference between two arrays or between an array and a scalar.
|
||||
-------
|
||||
Calculates the per-element absolute difference between two arrays or between an array and a scalar.
|
||||
|
||||
.. ocv:function:: void absdiff(InputArray src1, InputArray src2, OutputArray dst)
|
||||
|
||||
@ -39,13 +39,13 @@ Computes the per-element absolute difference between two arrays or between an ar
|
||||
.. ocv:pyoldfunction:: cv.AbsDiff(src1, src2, dst)-> None
|
||||
.. ocv:pyoldfunction:: cv.AbsDiffS(src, dst, value)-> None
|
||||
|
||||
:param src1: First input array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second input array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array that has the same size and type as ``src1`` (or ``src2``).
|
||||
:param dst: output array that has the same size and type as input arrays.
|
||||
|
||||
The function ``absdiff`` computes:
|
||||
The function ``absdiff`` calculates:
|
||||
|
||||
*
|
||||
Absolute difference between two arrays when they have the same size and type:
|
||||
@ -76,9 +76,9 @@ The function ``absdiff`` computes:
|
||||
|
||||
|
||||
add
|
||||
-------
|
||||
---
|
||||
|
||||
Computes the per-element sum of two arrays or an array and a scalar.
|
||||
Calculates the per-element sum of two arrays or an array and a scalar.
|
||||
|
||||
.. ocv:function:: void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
|
||||
|
||||
@ -89,17 +89,17 @@ Computes the per-element sum of two arrays or an array and a scalar.
|
||||
.. ocv:pyoldfunction:: cv.Add(src1, src2, dst, mask=None)-> None
|
||||
.. ocv:pyoldfunction:: cv.AddS(src, value, dst, mask=None)-> None
|
||||
|
||||
:param src1: First source array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second source array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1``/``src2``.
|
||||
:param dst: output array that has the same size and number of channels as the input array(s); the depth is defined by ``dtype`` or ``src1``/``src2``.
|
||||
|
||||
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask – 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
|
||||
:param dtype: Optional depth of the output array. See the discussion below.
|
||||
:param dtype: optional depth of the output array (see the discussion below).
|
||||
|
||||
The function ``add`` computes:
|
||||
The function ``add`` calculates:
|
||||
|
||||
*
|
||||
Sum of two arrays when both input arrays have the same size and the same number of channels:
|
||||
@ -129,7 +129,7 @@ The first function in the list above can be replaced with matrix expressions: ::
|
||||
dst = src1 + src2;
|
||||
dst += src1; // equivalent to add(dst, src1, dst);
|
||||
|
||||
The input arrays and the destination array can all have the same or different depths. For example, you can add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit floating-point array. Depth of the output array is determined by the ``dtype`` parameter. In the second and third cases above, as well as in the first case, when ``src1.depth() == src2.depth()``, ``dtype`` can be set to the default ``-1``. In this case, the output array will have the same depth as the input array, be it ``src1``, ``src2`` or both.
|
||||
The input arrays and the output array can all have the same or different depths. For example, you can add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit floating-point array. Depth of the output array is determined by the ``dtype`` parameter. In the second and third cases above, as well as in the first case, when ``src1.depth() == src2.depth()``, ``dtype`` can be set to the default ``-1``. In this case, the output array will have the same depth as the input array, be it ``src1``, ``src2`` or both.
|
||||
|
||||
.. note:: Saturation is not applied when the output array has the depth ``CV_32S``. You may even get result of an incorrect sign in the case of overflow.
|
||||
|
||||
@ -144,8 +144,8 @@ The input arrays and the destination array can all have the same or different de
|
||||
|
||||
|
||||
addWeighted
|
||||
---------------
|
||||
Computes the weighted sum of two arrays.
|
||||
-----------
|
||||
Calculates the weighted sum of two arrays.
|
||||
|
||||
.. ocv:function:: void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1)
|
||||
|
||||
@ -154,19 +154,19 @@ Computes the weighted sum of two arrays.
|
||||
.. ocv:cfunction:: void cvAddWeighted(const CvArr* src1, double alpha, const CvArr* src2, double beta, double gamma, CvArr* dst)
|
||||
.. ocv:pyoldfunction:: cv.AddWeighted(src1, alpha, src2, beta, gamma, dst)-> None
|
||||
|
||||
:param src1: First source array.
|
||||
:param src1: first source array.
|
||||
|
||||
:param alpha: Weight for the first array elements.
|
||||
:param alpha: weight of the first array elements.
|
||||
|
||||
:param src2: Second source array of the same size and channel number as ``src1`` .
|
||||
:param src2: second source array of the same size and channel number as ``src1``.
|
||||
|
||||
:param beta: Weight for the second array elements.
|
||||
:param beta: weight of the second array elements.
|
||||
|
||||
:param dst: Destination array that has the same size and number of channels as the input arrays.
|
||||
:param dst: output array that has the same size and number of channels as the input arrays.
|
||||
|
||||
:param gamma: Scalar added to each sum.
|
||||
:param gamma: scalar added to each sum.
|
||||
|
||||
:param dtype: Optional depth of the destination array. When both input arrays have the same depth, ``dtype`` can be set to ``-1``, which will be equivalent to ``src1.depth()``.
|
||||
:param dtype: optional depth of the destination array; when both input arrays have the same depth, ``dtype`` can be set to ``-1``, which will be equivalent to ``src1.depth()``.
|
||||
|
||||
The function ``addWeighted`` calculates the weighted sum of two arrays as follows:
|
||||
|
||||
@ -205,15 +205,15 @@ Calculates the per-element bit-wise conjunction of two arrays or an array and a
|
||||
.. ocv:pyoldfunction:: cv.And(src1, src2, dst, mask=None)-> None
|
||||
.. ocv:pyoldfunction:: cv.AndS(src, value, dst, mask=None)-> None
|
||||
|
||||
:param src1: First source array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second source array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array that has the same size and type as the input array(s).
|
||||
:param dst: output array that has the same size and type as the input arrays.
|
||||
|
||||
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
|
||||
The function computes the per-element bit-wise logical conjunction for:
|
||||
The function calculates the per-element bit-wise logical conjunction for:
|
||||
|
||||
*
|
||||
Two arrays when ``src1`` and ``src2`` have the same size:
|
||||
@ -252,13 +252,13 @@ Inverts every bit of an array.
|
||||
.. ocv:cfunction:: void cvNot(const CvArr* src, CvArr* dst)
|
||||
.. ocv:pyoldfunction:: cv.Not(src, dst)-> None
|
||||
|
||||
:param src: Source array.
|
||||
:param src: input array.
|
||||
|
||||
:param dst: Destination array that has the same size and type as the input array.
|
||||
:param dst: output array that has the same size and type as the input array.
|
||||
|
||||
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask, 8-bit single channel array, that specifies elements of the output array to be changed.
|
||||
|
||||
The function computes per-element bit-wise inversion of the source array:
|
||||
The function calculates per-element bit-wise inversion of the source array:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -281,15 +281,15 @@ Calculates the per-element bit-wise disjunction of two arrays or an array and a
|
||||
.. ocv:pyoldfunction:: cv.Or(src1, src2, dst, mask=None)-> None
|
||||
.. ocv:pyoldfunction:: cv.OrS(src, value, dst, mask=None)-> None
|
||||
|
||||
:param src1: First source array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second source array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array that has the same size and type as the input array(s).
|
||||
:param dst: output array that has the same size and type as the input arrays.
|
||||
|
||||
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask, 8-bit single channel array, that specifies elements of the output array to be changed.
|
||||
|
||||
The function computes the per-element bit-wise logical disjunction for:
|
||||
The function calculates the per-element bit-wise logical disjunction for:
|
||||
|
||||
*
|
||||
Two arrays when ``src1`` and ``src2`` have the same size:
|
||||
@ -329,15 +329,15 @@ Calculates the per-element bit-wise "exclusive or" operation on two arrays or an
|
||||
.. ocv:pyoldfunction:: cv.Xor(src1, src2, dst, mask=None)-> None
|
||||
.. ocv:pyoldfunction:: cv.XorS(src, value, dst, mask=None)-> None
|
||||
|
||||
:param src1: First source array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second source array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array that has the same size and type as the input array(s).
|
||||
:param dst: output array that has the same size and type as the input arrays.
|
||||
|
||||
:param mask: Optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask, 8-bit single channel array, that specifies elements of the destination array to be changed.
|
||||
|
||||
The function computes the per-element bit-wise logical "exclusive-or" operation for:
|
||||
The function calculates the per-element bit-wise logical "exclusive-or" operation for:
|
||||
|
||||
*
|
||||
Two arrays when ``src1`` and ``src2`` have the same size:
|
||||
@ -404,7 +404,7 @@ Calculates the covariance matrix of a set of vectors.
|
||||
|
||||
``covar`` will be a square matrix of the same size as the total number of elements in each input vector. One and only one of ``CV_COVAR_SCRAMBLED`` and ``CV_COVAR_NORMAL`` must be specified.
|
||||
|
||||
* **CV_COVAR_USE_AVG** If the flag is specified, the function does not calculate ``mean`` from the input vectors but, instead, uses the passed ``mean`` vector. This is useful if ``mean`` has been pre-computed or known in advance, or if the covariance matrix is calculated by parts. In this case, ``mean`` is not a mean vector of the input sub-set of vectors but rather the mean vector of the whole set.
|
||||
* **CV_COVAR_USE_AVG** If the flag is specified, the function does not calculate ``mean`` from the input vectors but, instead, uses the passed ``mean`` vector. This is useful if ``mean`` has been pre-calculated or known in advance, or if the covariance matrix is calculated by parts. In this case, ``mean`` is not a mean vector of the input sub-set of vectors but rather the mean vector of the whole set.
|
||||
|
||||
* **CV_COVAR_SCALE** If the flag is specified, the covariance matrix is scaled. In the "normal" mode, ``scale`` is ``1./nsamples`` . In the "scrambled" mode, ``scale`` is the reciprocal of the total number of elements in each input vector. By default (if the flag is not specified), the covariance matrix is not scaled ( ``scale=1`` ).
|
||||
|
||||
@ -498,20 +498,20 @@ Performs the per-element comparison of two arrays or an array and scalar value.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.CmpS(src, value, dst, cmpOp)-> None
|
||||
|
||||
:param src1: First source array or a scalar (in the case of ``cvCmp``, ``cv.Cmp``, ``cvCmpS``, ``cv.CmpS`` it is always an array). When it is array, it must have a single channel.
|
||||
:param src1: first input array or a scalar (in the case of ``cvCmp``, ``cv.Cmp``, ``cvCmpS``, ``cv.CmpS`` it is always an array); when it is an array, it must have a single channel.
|
||||
|
||||
:param src2: Second source array or a scalar (in the case of ``cvCmp`` and ``cv.Cmp`` it is always an array; in the case of ``cvCmpS``, ``cv.CmpS`` it is always a scalar). When it is array, it must have a single channel.
|
||||
:param src2: second input array or a scalar (in the case of ``cvCmp`` and ``cv.Cmp`` it is always an array; in the case of ``cvCmpS``, ``cv.CmpS`` it is always a scalar); when it is an array, it must have a single channel.
|
||||
|
||||
:param dst: Destination array that has the same size as the input array(s) and type= ``CV_8UC1`` .
|
||||
:param dst: output array that has the same size as the input arrays and type= ``CV_8UC1`` .
|
||||
|
||||
:param cmpop: Flag specifying the relation between the elements to be checked.
|
||||
:param cmpop: a flag, that specifies correspondence between the arrays:
|
||||
|
||||
* **CMP_EQ** ``src1`` equal to ``src2``.
|
||||
* **CMP_GT** ``src1`` greater than ``src2``.
|
||||
* **CMP_GE** ``src1`` greater than or equal to ``src2``.
|
||||
* **CMP_LT** ``src1`` less than ``src2``.
|
||||
* **CMP_LE** ``src1`` less than or equal to ``src2``.
|
||||
* **CMP_NE** ``src1`` not equal to ``src2``.
|
||||
* **CMP_EQ** ``src1`` is equal to ``src2``.
|
||||
* **CMP_GT** ``src1`` is greater than ``src2``.
|
||||
* **CMP_GE** ``src1`` is greater than or equal to ``src2``.
|
||||
* **CMP_LT** ``src1`` is less than ``src2``.
|
||||
* **CMP_LE** ``src1`` is less than or equal to ``src2``.
|
||||
* **CMP_NE** ``src1`` is unequal to ``src2``.
|
||||
|
||||
The function compares:
|
||||
|
||||
@ -587,7 +587,7 @@ The function ``completeSymm`` copies the lower half of a square matrix to its an
|
||||
|
||||
convertScaleAbs
|
||||
---------------
|
||||
Scales, computes absolute values, and converts the result to 8-bit.
|
||||
Scales, calculates absolute values, and converts the result to 8-bit.
|
||||
|
||||
.. ocv:function:: void convertScaleAbs(InputArray src, OutputArray dst, double alpha=1, double beta=0)
|
||||
|
||||
@ -611,7 +611,7 @@ On each element of the input array, the function ``convertScaleAbs`` performs th
|
||||
|
||||
\texttt{dst} (I)= \texttt{saturate\_cast<uchar>} (| \texttt{src} (I)* \texttt{alpha} + \texttt{beta} |)
|
||||
|
||||
In case of multi-channel arrays, the function processes each channel independently. When the output is not 8-bit, the operation can be emulated by calling the ``Mat::convertTo`` method (or by using matrix expressions) and then by computing an absolute value of the result. For example: ::
|
||||
In case of multi-channel arrays, the function processes each channel independently. When the output is not 8-bit, the operation can be emulated by calling the ``Mat::convertTo`` method (or by using matrix expressions) and then by calculating an absolute value of the result. For example: ::
|
||||
|
||||
Mat_<float> A(30,30);
|
||||
randu(A, Scalar(-100), Scalar(100));
|
||||
@ -640,7 +640,7 @@ Counts non-zero array elements.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.CountNonZero(arr)-> int
|
||||
|
||||
:param src: Single-channel array.
|
||||
:param src: single-channel array.
|
||||
|
||||
The function returns the number of non-zero elements in ``src`` :
|
||||
|
||||
@ -664,13 +664,13 @@ Converts ``CvMat``, ``IplImage`` , or ``CvMatND`` to ``Mat``.
|
||||
|
||||
.. ocv:function:: Mat cvarrToMat( const CvArr* arr, bool copyData=false, bool allowND=true, int coiMode=0 )
|
||||
|
||||
:param arr: Source ``CvMat``, ``IplImage`` , or ``CvMatND`` .
|
||||
:param arr: input ``CvMat``, ``IplImage`` , or ``CvMatND``.
|
||||
|
||||
:param copyData: When it is false (default value), no data is copied and only the new header is created. In this case, the original array should not be deallocated while the new matrix header is used. If the parameter is true, all the data is copied and you may deallocate the original array right after the conversion.
|
||||
:param copyData: when false (default value), no data is copied and only the new header is created, in this case, the original array should not be deallocated while the new matrix header is used; if the parameter is true, all the data is copied and you may deallocate the original array right after the conversion.
|
||||
|
||||
:param allowND: When it is true (default value), ``CvMatND`` is converted to 2-dimensional ``Mat``, if it is possible (see the discussion below). If it is not possible, or when the parameter is false, the function will report an error.
|
||||
:param allowND: when true (default value), ``CvMatND`` is converted to 2-dimensional ``Mat``, if it is possible (see the discussion below); if it is not possible, or when the parameter is false, the function will report an error.
|
||||
|
||||
:param coiMode: Parameter specifying how the IplImage COI (when set) is handled.
|
||||
:param coiMode: parameter specifying how the IplImage COI (when set) is handled.
|
||||
|
||||
* If ``coiMode=0`` and COI is set, the function reports an error.
|
||||
|
||||
@ -722,7 +722,7 @@ The last parameter, ``coiMode`` , specifies how to deal with an image with COI s
|
||||
:ocv:func:`mixChannels`
|
||||
|
||||
dct
|
||||
-------
|
||||
---
|
||||
Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
|
||||
|
||||
.. ocv:function:: void dct(InputArray src, OutputArray dst, int flags=0)
|
||||
@ -806,7 +806,7 @@ The function chooses the mode of operation by looking at the flags and size of t
|
||||
Currently ``dct`` supports even-size arrays (2, 4, 6 ...). For data analysis and approximation, you can pad the array when necessary.
|
||||
|
||||
Also, the function performance depends very much, and not monotonically, on the array size (see
|
||||
:ocv:func:`getOptimalDFTSize` ). In the current implementation DCT of a vector of size ``N`` is computed via DFT of a vector of size ``N/2`` . Thus, the optimal DCT size ``N1 >= N`` can be computed as: ::
|
||||
:ocv:func:`getOptimalDFTSize` ). In the current implementation DCT of a vector of size ``N`` is calculated via DFT of a vector of size ``N/2`` . Thus, the optimal DCT size ``N1 >= N`` can be calculated as: ::
|
||||
|
||||
size_t getOptimalDCTSize(size_t N) { return 2*getOptimalDFTSize((N+1)/2); }
|
||||
N1 = getOptimalDCTSize(N);
|
||||
@ -842,7 +842,7 @@ Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-
|
||||
|
||||
* **DFT_REAL_OUTPUT** performs an inverse transformation of a 1D or 2D complex array. The result is normally a complex array of the same size. However, if the source array has conjugate-complex symmetry (for example, it is a result of forward transformation with ``DFT_COMPLEX_OUTPUT`` flag), the output is a real array. While the function itself does not check whether the input is symmetrical or not, you can pass the flag and then the function will assume the symmetry and produce the real output array. Note that when the input is packed into a real array and inverse transformation is executed, the function treats the input as a packed complex-conjugate symmetrical array. So, the output will also be a real array.
|
||||
|
||||
:param nonzeroRows: When the parameter is not zero, the function assumes that only the first ``nonzeroRows`` rows of the input array ( ``DFT_INVERSE`` is not set) or only the first ``nonzeroRows`` of the output array ( ``DFT_INVERSE`` is set) contain non-zeros. Thus, the function can handle the rest of the rows more efficiently and save some time. This technique is very useful for computing array cross-correlation or convolution using DFT.
|
||||
:param nonzeroRows: When the parameter is not zero, the function assumes that only the first ``nonzeroRows`` rows of the input array ( ``DFT_INVERSE`` is not set) or only the first ``nonzeroRows`` of the output array ( ``DFT_INVERSE`` is set) contain non-zeros. Thus, the function can handle the rest of the rows more efficiently and save some time. This technique is very useful for calculating array cross-correlation or convolution using DFT.
|
||||
|
||||
|
||||
The function performs one of the following:
|
||||
@ -907,16 +907,16 @@ So, the function chooses an operation mode depending on the flags and size of th
|
||||
|
||||
If ``DFT_SCALE`` is set, the scaling is done after the transformation.
|
||||
|
||||
Unlike :ocv:func:`dct` , the function supports arrays of arbitrary size. But only those arrays are processed efficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the current implementation). Such an efficient DFT size can be computed using the :ocv:func:`getOptimalDFTSize` method.
|
||||
Unlike :ocv:func:`dct` , the function supports arrays of arbitrary size. But only those arrays are processed efficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the current implementation). Such an efficient DFT size can be calculated using the :ocv:func:`getOptimalDFTSize` method.
|
||||
|
||||
The sample below illustrates how to compute a DFT-based convolution of two 2D real arrays: ::
|
||||
The sample below illustrates how to calculate a DFT-based convolution of two 2D real arrays: ::
|
||||
|
||||
void convolveDFT(InputArray A, InputArray B, OutputArray C)
|
||||
{
|
||||
// reallocate the output array if needed
|
||||
C.create(abs(A.rows - B.rows)+1, abs(A.cols - B.cols)+1, A.type());
|
||||
Size dftSize;
|
||||
// compute the size of DFT transform
|
||||
// calculate the size of DFT transform
|
||||
dftSize.width = getOptimalDFTSize(A.cols + B.cols - 1);
|
||||
dftSize.height = getOptimalDFTSize(A.rows + B.rows - 1);
|
||||
|
||||
@ -958,12 +958,12 @@ To optimize this sample, consider the following approaches:
|
||||
Since ``nonzeroRows != 0`` is passed to the forward transform calls and since ``A`` and ``B`` are copied to the top-left corners of ``tempA`` and ``tempB``, respectively, it is not necessary to clear the whole ``tempA`` and ``tempB``. It is only necessary to clear the ``tempA.cols - A.cols`` ( ``tempB.cols - B.cols``) rightmost columns of the matrices.
|
||||
|
||||
*
|
||||
This DFT-based convolution does not have to be applied to the whole big arrays, especially if ``B`` is significantly smaller than ``A`` or vice versa. Instead, you can compute convolution by parts. To do this, you need to split the destination array ``C`` into multiple tiles. For each tile, estimate which parts of ``A`` and ``B`` are required to compute convolution in this tile. If the tiles in ``C`` are too small, the speed will decrease a lot because of repeated work. In the ultimate case, when each tile in ``C`` is a single pixel, the algorithm becomes equivalent to the naive convolution algorithm. If the tiles are too big, the temporary arrays ``tempA`` and ``tempB`` become too big and there is also a slowdown because of bad cache locality. So, there is an optimal tile size somewhere in the middle.
|
||||
This DFT-based convolution does not have to be applied to the whole big arrays, especially if ``B`` is significantly smaller than ``A`` or vice versa. Instead, you can calculate convolution by parts. To do this, you need to split the destination array ``C`` into multiple tiles. For each tile, estimate which parts of ``A`` and ``B`` are required to calculate convolution in this tile. If the tiles in ``C`` are too small, the speed will decrease a lot because of repeated work. In the ultimate case, when each tile in ``C`` is a single pixel, the algorithm becomes equivalent to the naive convolution algorithm. If the tiles are too big, the temporary arrays ``tempA`` and ``tempB`` become too big and there is also a slowdown because of bad cache locality. So, there is an optimal tile size somewhere in the middle.
|
||||
|
||||
*
|
||||
If different tiles in ``C`` can be computed in parallel and, thus, the convolution is done by parts, the loop can be threaded.
|
||||
If different tiles in ``C`` can be calculated in parallel and, thus, the convolution is done by parts, the loop can be threaded.
|
||||
|
||||
All of the above improvements have been implemented in :ocv:func:`matchTemplate` and :ocv:func:`filter2D` . Therefore, by using them, you can get the performance even better than with the above theoretically optimal implementation. Though, those two functions actually compute cross-correlation, not convolution, so you need to "flip" the second convolution operand ``B`` vertically and horizontally using :ocv:func:`flip` .
|
||||
All of the above improvements have been implemented in :ocv:func:`matchTemplate` and :ocv:func:`filter2D` . Therefore, by using them, you can get the performance even better than with the above theoretically optimal implementation. Though, those two functions actually calculate cross-correlation, not convolution, so you need to "flip" the second convolution operand ``B`` vertically and horizontally using :ocv:func:`flip` .
|
||||
|
||||
.. seealso:: :ocv:func:`dct` , :ocv:func:`getOptimalDFTSize` , :ocv:func:`mulSpectrums`, :ocv:func:`filter2D` , :ocv:func:`matchTemplate` , :ocv:func:`flip` , :ocv:func:`cartToPolar` , :ocv:func:`magnitude` , :ocv:func:`phase`
|
||||
|
||||
@ -1032,10 +1032,10 @@ Returns the determinant of a square floating-point matrix.
|
||||
|
||||
:param mtx: Input matrix that must have ``CV_32FC1`` or ``CV_64FC1`` type and square size.
|
||||
|
||||
The function ``determinant`` computes and returns the determinant of the specified matrix. For small matrices ( ``mtx.cols=mtx.rows<=3`` ),
|
||||
The function ``determinant`` calculates and returns the determinant of the specified matrix. For small matrices ( ``mtx.cols=mtx.rows<=3`` ),
|
||||
the direct method is used. For larger matrices, the function uses LU factorization with partial pivoting.
|
||||
|
||||
For symmetric positively-determined matrices, it is also possible to use :ocv:func:`eigen` decomposition to compute the determinant.
|
||||
For symmetric positively-determined matrices, it is also possible to use :ocv:func:`eigen` decomposition to calculate the determinant.
|
||||
|
||||
.. seealso::
|
||||
|
||||
@ -1049,13 +1049,13 @@ For symmetric positively-determined matrices, it is also possible to use :ocv:fu
|
||||
|
||||
eigen
|
||||
-----
|
||||
Computes eigenvalues and eigenvectors of a symmetric matrix.
|
||||
Calculates eigenvalues and eigenvectors of a symmetric matrix.
|
||||
|
||||
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1, int highindex=-1)
|
||||
|
||||
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors, int lowindex=-1,int highindex=-1)
|
||||
|
||||
.. ocv:pyfunction:: cv2.eigen(src, computeEigenvectors[, eigenvalues[, eigenvectors]]) -> retval, eigenvalues, eigenvectors
|
||||
.. ocv:pyfunction:: cv2.eigen(src, calculateEigenvectors[, eigenvalues[, eigenvectors]]) -> retval, eigenvalues, eigenvectors
|
||||
|
||||
.. ocv:cfunction:: void cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, double eps=0, int lowindex=-1, int highindex=-1 )
|
||||
|
||||
@ -1071,7 +1071,7 @@ Computes eigenvalues and eigenvectors of a symmetric matrix.
|
||||
|
||||
:param highindex: Optional index of smallest eigenvalue/-vector to calculate. The parameter is ignored in the current implementation.
|
||||
|
||||
The functions ``eigen`` compute just eigenvalues, or eigenvalues and eigenvectors of the symmetric matrix ``src`` : ::
|
||||
The functions ``eigen`` calculate just eigenvalues, or eigenvalues and eigenvectors of the symmetric matrix ``src`` : ::
|
||||
|
||||
src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()
|
||||
|
||||
@ -1301,14 +1301,14 @@ Returns the optimal DFT size for a given vector size.
|
||||
|
||||
:param vecsize: Vector size.
|
||||
|
||||
DFT performance is not a monotonic function of a vector size. Therefore, when you compute convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to pad the input data with zeros to get a bit larger array that can be transformed much faster than the original one.
|
||||
DFT performance is not a monotonic function of a vector size. Therefore, when you calculate convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to pad the input data with zeros to get a bit larger array that can be transformed much faster than the original one.
|
||||
Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process. Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5*5*3*2*2) are also processed quite efficiently.
|
||||
|
||||
The function ``getOptimalDFTSize`` returns the minimum number ``N`` that is greater than or equal to ``vecsize`` so that the DFT of a vector of size ``N`` can be computed efficiently. In the current implementation ``N`` = 2 :sup:`p` * 3 :sup:`q` * 5 :sup:`r` for some integer ``p``, ``q``, ``r``.
|
||||
The function ``getOptimalDFTSize`` returns the minimum number ``N`` that is greater than or equal to ``vecsize`` so that the DFT of a vector of size ``N`` can be processed efficiently. In the current implementation ``N`` = 2 :sup:`p` * 3 :sup:`q` * 5 :sup:`r` for some integer ``p``, ``q``, ``r``.
|
||||
|
||||
The function returns a negative number if ``vecsize`` is too large (very close to ``INT_MAX`` ).
|
||||
|
||||
While the function cannot be used directly to estimate the optimal vector size for DCT transform (since the current DCT implementation supports only even-size vectors), it can be easily computed as ``getOptimalDFTSize((vecsize+1)/2)*2``.
|
||||
While the function cannot be used directly to estimate the optimal vector size for DCT transform (since the current DCT implementation supports only even-size vectors), it can be easily processed as ``getOptimalDFTSize((vecsize+1)/2)*2``.
|
||||
|
||||
.. seealso:: :ocv:func:`dft` , :ocv:func:`dct` , :ocv:func:`idft` , :ocv:func:`idct` , :ocv:func:`mulSpectrums`
|
||||
|
||||
@ -1316,7 +1316,7 @@ While the function cannot be used directly to estimate the optimal vector size f
|
||||
|
||||
idct
|
||||
----
|
||||
Computes the inverse Discrete Cosine Transform of a 1D or 2D array.
|
||||
Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
|
||||
|
||||
.. ocv:function:: void idct(InputArray src, OutputArray dst, int flags=0)
|
||||
|
||||
@ -1341,19 +1341,19 @@ Computes the inverse Discrete Cosine Transform of a 1D or 2D array.
|
||||
|
||||
idft
|
||||
----
|
||||
Computes the inverse Discrete Fourier Transform of a 1D or 2D array.
|
||||
Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
|
||||
|
||||
.. ocv:function:: void idft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
|
||||
|
||||
.. ocv:pyfunction:: cv2.idft(src[, dst[, flags[, nonzeroRows]]]) -> dst
|
||||
|
||||
:param src: Source floating-point real or complex array.
|
||||
:param src: input floating-point real or complex array.
|
||||
|
||||
:param dst: Destination array whose size and type depend on the ``flags`` .
|
||||
:param dst: output array whose size and type depend on the ``flags`` .
|
||||
|
||||
:param flags: Operation flags. See :ocv:func:`dft` .
|
||||
:param flags: operation flags (see :ocv:func:`dft`).
|
||||
|
||||
:param nonzeroRows: Number of ``dst`` rows to compute. The rest of the rows have undefined content. See the convolution sample in :ocv:func:`dft` description.
|
||||
:param nonzeroRows: number of ``dst`` rows to process; the rest of the rows have undefined content (see the convolution sample in :ocv:func:`dft` description.
|
||||
|
||||
``idft(src, dst, flags)`` is equivalent to ``dft(src, dst, flags | DFT_INVERSE)`` .
|
||||
|
||||
@ -1384,13 +1384,13 @@ Checks if array elements lie between the elements of two other arrays.
|
||||
.. ocv:pyoldfunction:: cv.InRange(src, lower, upper, dst)-> None
|
||||
.. ocv:pyoldfunction:: cv.InRangeS(src, lower, upper, dst)-> None
|
||||
|
||||
:param src: First source array.
|
||||
:param src: first input array.
|
||||
|
||||
:param lowerb: Inclusive lower boundary array or a scalar.
|
||||
:param lowerb: inclusive lower boundary array or a scalar.
|
||||
|
||||
:param upperb: Inclusive upper boundary array or a scalar.
|
||||
:param upperb: inclusive upper boundary array or a scalar.
|
||||
|
||||
:param dst: Destination array of the same size as ``src`` and ``CV_8U`` type.
|
||||
:param dst: output array of the same size as ``src`` and ``CV_8U`` type.
|
||||
|
||||
The function checks the range as follows:
|
||||
|
||||
@ -1438,9 +1438,9 @@ Finds the inverse or pseudo-inverse of a matrix.
|
||||
* **DECOMP_CHOLESKY** Cholesky decomposition. The matrix must be symmetrical and positively defined.
|
||||
|
||||
The function ``invert`` inverts the matrix ``src`` and stores the result in ``dst`` .
|
||||
When the matrix ``src`` is singular or non-square, the function computes the pseudo-inverse matrix (the ``dst`` matrix) so that ``norm(src*dst - I)`` is minimal, where I is an identity matrix.
|
||||
When the matrix ``src`` is singular or non-square, the function calculates the pseudo-inverse matrix (the ``dst`` matrix) so that ``norm(src*dst - I)`` is minimal, where I is an identity matrix.
|
||||
|
||||
In case of the ``DECOMP_LU`` method, the function returns non-zero value if the inverse has been successfully computed and 0 if ``src`` is singular.
|
||||
In case of the ``DECOMP_LU`` method, the function returns non-zero value if the inverse has been successfully calculated and 0 if ``src`` is singular.
|
||||
|
||||
In case of the ``DECOMP_SVD`` method, the function returns the inverse condition number of ``src`` (the ratio of the smallest singular value to the largest singular value) and 0 if ``src`` is singular. The SVD method calculates a pseudo-inverse matrix if ``src`` is singular.
|
||||
|
||||
@ -1607,15 +1607,15 @@ Calculates per-element maximum of two arrays or an array and a scalar.
|
||||
.. ocv:pyoldfunction:: cv.Max(src1, src2, dst)-> None
|
||||
.. ocv:pyoldfunction:: cv.MaxS(src, value, dst)-> None
|
||||
|
||||
:param src1: First source array.
|
||||
:param src1: first input array.
|
||||
|
||||
:param src2: Second source array of the same size and type as ``src1`` .
|
||||
:param src2: second input array of the same size and type as ``src1`` .
|
||||
|
||||
:param value: Real scalar value.
|
||||
:param value: real scalar value.
|
||||
|
||||
:param dst: Destination array of the same size and type as ``src1`` .
|
||||
:param dst: output array of the same size and type as ``src1`` .
|
||||
|
||||
The functions ``max`` compute the per-element maximum of two arrays:
|
||||
The functions ``max`` calculate the per-element maximum of two arrays:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -1653,11 +1653,11 @@ Calculates an average (mean) of array elements.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Avg(arr, mask=None) -> scalar
|
||||
|
||||
:param src: Source array that should have from 1 to 4 channels so that the result can be stored in :ocv:class:`Scalar_` .
|
||||
:param src: input array that should have from 1 to 4 channels so that the result can be stored in :ocv:class:`Scalar_` .
|
||||
|
||||
:param mask: Optional operation mask.
|
||||
:param mask: optional operation mask.
|
||||
|
||||
The function ``mean`` computes the mean value ``M`` of array elements, independently for each channel, and return it:
|
||||
The function ``mean`` calculates the mean value ``M`` of array elements, independently for each channel, and return it:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -1686,15 +1686,15 @@ Calculates a mean and standard deviation of array elements.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.AvgSdv(arr, mask=None) -> (mean, stdDev)
|
||||
|
||||
:param src: Source array that should have from 1 to 4 channels so that the results can be stored in :ocv:class:`Scalar_` 's.
|
||||
:param src: input array that should have from 1 to 4 channels so that the results can be stored in :ocv:class:`Scalar_` 's.
|
||||
|
||||
:param mean: Output parameter: computed mean value.
|
||||
:param mean: output parameter: calculated mean value.
|
||||
|
||||
:param stddev: Output parameter: computed standard deviation.
|
||||
:param stddev: output parameter: calculateded standard deviation.
|
||||
|
||||
:param mask: Optional operation mask.
|
||||
:param mask: optional operation mask.
|
||||
|
||||
The function ``meanStdDev`` computes the mean and the standard deviation ``M`` of array elements independently for each channel and returns it via the output parameters:
|
||||
The function ``meanStdDev`` calculates the mean and the standard deviation ``M`` of array elements independently for each channel and returns it via the output parameters:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -1702,7 +1702,7 @@ The function ``meanStdDev`` computes the mean and the standard deviation ``M`` o
|
||||
|
||||
When all the mask elements are 0's, the functions return ``mean=stddev=Scalar::all(0)`` .
|
||||
|
||||
.. note:: The computed standard deviation is only the diagonal of the complete normalized covariance matrix. If the full matrix is needed, you can reshape the multi-channel array ``M x N`` to the single-channel array ``M*N x mtx.channels()`` (only possible when the matrix is continuous) and then pass the matrix to :ocv:func:`calcCovarMatrix` .
|
||||
.. note:: The calculated standard deviation is only the diagonal of the complete normalized covariance matrix. If the full matrix is needed, you can reshape the multi-channel array ``M x N`` to the single-channel array ``M*N x mtx.channels()`` (only possible when the matrix is continuous) and then pass the matrix to :ocv:func:`calcCovarMatrix` .
|
||||
|
||||
.. seealso::
|
||||
|
||||
@ -1716,7 +1716,7 @@ When all the mask elements are 0's, the functions return ``mean=stddev=Scalar::a
|
||||
|
||||
merge
|
||||
-----
|
||||
Composes a multi-channel array from several single-channel arrays.
|
||||
Creates one multichannel array out of several single-channel ones.
|
||||
|
||||
.. ocv:function:: void merge(const Mat* mv, size_t count, OutputArray dst)
|
||||
|
||||
@ -1727,11 +1727,11 @@ Composes a multi-channel array from several single-channel arrays.
|
||||
.. ocv:cfunction:: void cvMerge(const CvArr* src0, const CvArr* src1, const CvArr* src2, const CvArr* src3, CvArr* dst)
|
||||
.. ocv:pyoldfunction:: cv.Merge(src0, src1, src2, src3, dst)-> None
|
||||
|
||||
:param mv: Source array or vector of matrices to be merged. All the matrices in ``mv`` must have the same size and the same depth.
|
||||
:param mv: input array or vector of matrices to be merged; all the matrices in ``mv`` must have the same size and the same depth.
|
||||
|
||||
:param count: Number of source matrices when ``mv`` is a plain C array. It must be greater than zero.
|
||||
:param count: number of source matrices when ``mv`` is a plain C array; it must be greater than zero.
|
||||
|
||||
:param dst: Destination array of the same size and the same depth as ``mv[0]`` . The number of channels will be the total number of channels in the matrix array.
|
||||
:param dst: output array of the same size and the same depth as ``mv[0]``; The number of channels will be the total number of channels in the matrix array.
|
||||
|
||||
The functions ``merge`` merge several arrays to make a single multi-channel array. That is, each element of the output array will be a concatenation of the elements of the input arrays, where elements of i-th input array are treated as ``mv[i].channels()``-element vectors.
|
||||
|
||||
@ -1749,7 +1749,7 @@ The function
|
||||
|
||||
min
|
||||
---
|
||||
Calculates per-element minimum of two arrays or array and a scalar.
|
||||
Calculates per-element minimum of two arrays or an array and a scalar.
|
||||
|
||||
.. ocv:function:: MatExpr min( const Mat& a, const Mat& b )
|
||||
|
||||
@ -1770,15 +1770,15 @@ Calculates per-element minimum of two arrays or array and a scalar.
|
||||
.. ocv:pyoldfunction:: cv.Min(src1, src2, dst)-> None
|
||||
.. ocv:pyoldfunction:: cv.MinS(src, value, dst)-> None
|
||||
|
||||
:param src1: First source array.
|
||||
:param src1: first input array.
|
||||
|
||||
:param src2: Second source array of the same size and type as ``src1`` .
|
||||
:param src2: second input array of the same size and type as ``src1`` .
|
||||
|
||||
:param value: Real scalar value.
|
||||
:param value: real scalar value.
|
||||
|
||||
:param dst: Destination array of the same size and type as ``src1`` .
|
||||
:param dst: output array of the same size and type as ``src1`` .
|
||||
|
||||
The functions ``min`` compute the per-element minimum of two arrays:
|
||||
The functions ``min`` calculate the per-element minimum of two arrays:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -1850,17 +1850,17 @@ Finds the global minimum and maximum in an array.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.MinMaxLoc(arr, mask=None)-> (minVal, maxVal, minLoc, maxLoc)
|
||||
|
||||
:param src: Source single-channel array.
|
||||
:param src: input single-channel array.
|
||||
|
||||
:param minVal: Pointer to the returned minimum value. ``NULL`` is used if not required.
|
||||
:param minVal: pointer to the returned minimum value; ``NULL`` is used if not required.
|
||||
|
||||
:param maxVal: Pointer to the returned maximum value. ``NULL`` is used if not required.
|
||||
:param maxVal: pointer to the returned maximum value; ``NULL`` is used if not required.
|
||||
|
||||
:param minLoc: Pointer to the returned minimum location (in 2D case). ``NULL`` is used if not required.
|
||||
:param minLoc: pointer to the returned minimum location (in 2D case); ``NULL`` is used if not required.
|
||||
|
||||
:param maxLoc: Pointer to the returned maximum location (in 2D case). ``NULL`` is used if not required.
|
||||
:param maxLoc: pointer to the returned maximum location (in 2D case); ``NULL`` is used if not required.
|
||||
|
||||
:param mask: Optional mask used to select a sub-array.
|
||||
:param mask: optional mask used to select a sub-array.
|
||||
|
||||
The functions ``minMaxLoc`` find the minimum and maximum element values and their positions. The extremums are searched across the whole array or,
|
||||
if ``mask`` is not an empty array, in the specified array region.
|
||||
@ -2056,7 +2056,7 @@ if ``aTa=true`` , and
|
||||
|
||||
\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T
|
||||
|
||||
otherwise. The function is used to compute the covariance matrix. With zero delta, it can be used as a faster substitute for general matrix product ``A*B`` when ``B=A'``
|
||||
otherwise. The function is used to calculate the covariance matrix. With zero delta, it can be used as a faster substitute for general matrix product ``A*B`` when ``B=A'``
|
||||
|
||||
.. seealso::
|
||||
|
||||
@ -2084,13 +2084,13 @@ Calculates an absolute array norm, an absolute difference norm, or a relative di
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Norm(arr1, arr2, normType=CV_L2, mask=None) -> float
|
||||
|
||||
:param src1: First source array.
|
||||
:param src1: first input array.
|
||||
|
||||
:param src2: Second source array of the same size and the same type as ``src1`` .
|
||||
:param src2: second input array of the same size and the same type as ``src1``.
|
||||
|
||||
:param normType: Type of the norm. See the details below.
|
||||
:param normType: type of the norm (see the details below).
|
||||
|
||||
:param mask: Optional operation mask. It must have the same size as ``src1`` and ``CV_8UC1`` type.
|
||||
:param mask: optional operation mask; it must have the same size as ``src1`` and ``CV_8UC1`` type.
|
||||
|
||||
The functions ``norm`` calculate an absolute norm of ``src1`` (when there is no ``src2`` ):
|
||||
|
||||
@ -2118,7 +2118,7 @@ or
|
||||
|
||||
The functions ``norm`` return the calculated norm.
|
||||
|
||||
When the ``mask`` parameter is specified and it is not empty, the norm is computed only over the region specified by the mask.
|
||||
When the ``mask`` parameter is specified and it is not empty, the norm is calculated only over the region specified by the mask.
|
||||
|
||||
A multi-channel source arrays are treated as a single-channel, that is, the results for all channels are combined.
|
||||
|
||||
@ -2162,7 +2162,7 @@ The functions ``normalize`` scale and shift the source array elements so that
|
||||
\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}
|
||||
|
||||
when ``normType=NORM_MINMAX`` (for dense arrays only).
|
||||
The optional mask specifies a sub-array to be normalized. This means that the norm or min-n-max are computed over the sub-array, and then this sub-array is modified to be normalized. If you want to only use the mask to compute the norm or min-max but modify the whole array, you can use
|
||||
The optional mask specifies a sub-array to be normalized. This means that the norm or min-n-max are calculated over the sub-array, and then this sub-array is modified to be normalized. If you want to only use the mask to calculate the norm or min-max but modify the whole array, you can use
|
||||
:ocv:func:`norm` and
|
||||
:ocv:func:`Mat::convertTo`.
|
||||
|
||||
@ -2182,10 +2182,10 @@ PCA
|
||||
|
||||
Principal Component Analysis class.
|
||||
|
||||
The class is used to compute a special basis for a set of vectors. The basis will consist of eigenvectors of the covariance matrix computed from the input set of vectors. The class ``PCA`` can also transform vectors to/from the new coordinate space defined by the basis. Usually, in this new coordinate system, each vector from the original set (and any linear combination of such vectors) can be quite accurately approximated by taking its first few components, corresponding to the eigenvectors of the largest eigenvalues of the covariance matrix. Geometrically it means that you compute a projection of the vector to a subspace formed by a few eigenvectors corresponding to the dominant eigenvalues of the covariance matrix. And usually such a projection is very close to the original vector. So, you can represent the original vector from a high-dimensional space with a much shorter vector consisting of the projected vector's coordinates in the subspace. Such a transformation is also known as Karhunen-Loeve Transform, or KLT. See
|
||||
The class is used to calculate a special basis for a set of vectors. The basis will consist of eigenvectors of the covariance matrix calculated from the input set of vectors. The class ``PCA`` can also transform vectors to/from the new coordinate space defined by the basis. Usually, in this new coordinate system, each vector from the original set (and any linear combination of such vectors) can be quite accurately approximated by taking its first few components, corresponding to the eigenvectors of the largest eigenvalues of the covariance matrix. Geometrically it means that you calculate a projection of the vector to a subspace formed by a few eigenvectors corresponding to the dominant eigenvalues of the covariance matrix. And usually such a projection is very close to the original vector. So, you can represent the original vector from a high-dimensional space with a much shorter vector consisting of the projected vector's coordinates in the subspace. Such a transformation is also known as Karhunen-Loeve Transform, or KLT. See
|
||||
http://en.wikipedia.org/wiki/Principal\_component\_analysis .
|
||||
|
||||
The sample below is the function that takes two matrices. The first function stores a set of vectors (a row per vector) that is used to compute PCA. The second function stores another "test" set of vectors (a row per vector). First, these vectors are compressed with PCA, then reconstructed back, and then the reconstruction error norm is computed and printed for each vector. ::
|
||||
The sample below is the function that takes two matrices. The first function stores a set of vectors (a row per vector) that is used to calculate PCA. The second function stores another "test" set of vectors (a row per vector). First, these vectors are compressed with PCA, then reconstructed back, and then the reconstruction error norm is computed and printed for each vector. ::
|
||||
|
||||
PCA compressPCA(InputArray pcaset, int maxComponents,
|
||||
const Mat& testset, OutputArray compressed)
|
||||
@ -2376,15 +2376,15 @@ Calculates the rotation angle of 2D vectors.
|
||||
|
||||
.. ocv:pyfunction:: cv2.phase(x, y[, angle[, angleInDegrees]]) -> angle
|
||||
|
||||
:param x: Source floating-point array of x-coordinates of 2D vectors.
|
||||
:param x: input floating-point array of x-coordinates of 2D vectors.
|
||||
|
||||
:param y: Source array of y-coordinates of 2D vectors. It must have the same size and the same type as ``x`` .
|
||||
:param y: input array of y-coordinates of 2D vectors; it must have the same size and the same type as ``x``.
|
||||
|
||||
:param angle: Destination array of vector angles. It has the same size and same type as ``x`` .
|
||||
:param angle: output array of vector angles; it has the same size and same type as ``x`` .
|
||||
|
||||
:param angleInDegrees: When it is true, the function computes the angle in degrees. Otherwise, they are measured in radians.
|
||||
:param angleInDegrees: when true, the function calculates the angle in degrees, otherwise, they are measured in radians.
|
||||
|
||||
The function ``phase`` computes the rotation angle of each 2D vector that is formed from the corresponding elements of ``x`` and ``y`` :
|
||||
The function ``phase`` calculates the rotation angle of each 2D vector that is formed from the corresponding elements of ``x`` and ``y`` :
|
||||
|
||||
.. math::
|
||||
|
||||
@ -2395,7 +2395,7 @@ The angle estimation accuracy is about 0.3 degrees. When ``x(I)=y(I)=0`` , the c
|
||||
|
||||
polarToCart
|
||||
-----------
|
||||
Computes x and y coordinates of 2D vectors from their magnitude and angle.
|
||||
Calculates x and y coordinates of 2D vectors from their magnitude and angle.
|
||||
|
||||
.. ocv:function:: void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees=false)
|
||||
|
||||
@ -2415,7 +2415,7 @@ Computes x and y coordinates of 2D vectors from their magnitude and angle.
|
||||
|
||||
:param angleInDegrees: When it is true, the input angles are measured in degrees. Otherwise. they are measured in radians.
|
||||
|
||||
The function ``polarToCart`` computes the Cartesian coordinates of each 2D vector represented by the corresponding elements of ``magnitude`` and ``angle`` :
|
||||
The function ``polarToCart`` calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of ``magnitude`` and ``angle`` :
|
||||
|
||||
.. math::
|
||||
|
||||
@ -2714,23 +2714,23 @@ Reduces a matrix to a vector.
|
||||
.. ocv:cfunction:: void cvReduce(const CvArr* src, CvArr* dst, int dim=-1, int op=CV_REDUCE_SUM)
|
||||
.. ocv:pyoldfunction:: cv.Reduce(src, dst, dim=-1, op=CV_REDUCE_SUM)-> None
|
||||
|
||||
:param src: Source 2D matrix.
|
||||
:param src: input 2D matrix.
|
||||
|
||||
:param dst: Destination vector. Its size and type is defined by ``dim`` and ``dtype`` parameters.
|
||||
:param dst: output vector. Its size and type is defined by ``dim`` and ``dtype`` parameters.
|
||||
|
||||
:param dim: Dimension index along which the matrix is reduced. 0 means that the matrix is reduced to a single row. 1 means that the matrix is reduced to a single column.
|
||||
:param dim: dimension index along which the matrix is reduced. 0 means that the matrix is reduced to a single row. 1 means that the matrix is reduced to a single column.
|
||||
|
||||
:param rtype: Reduction operation that could be one of the following:
|
||||
:param rtype: reduction operation that could be one of the following:
|
||||
|
||||
* **CV_REDUCE_SUM** The output is the sum of all rows/columns of the matrix.
|
||||
* **CV_REDUCE_SUM**: the output is the sum of all rows/columns of the matrix.
|
||||
|
||||
* **CV_REDUCE_AVG** The output is the mean vector of all rows/columns of the matrix.
|
||||
* **CV_REDUCE_AVG**: the output is the mean vector of all rows/columns of the matrix.
|
||||
|
||||
* **CV_REDUCE_MAX** The output is the maximum (column/row-wise) of all rows/columns of the matrix.
|
||||
* **CV_REDUCE_MAX**: the output is the maximum (column/row-wise) of all rows/columns of the matrix.
|
||||
|
||||
* **CV_REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the matrix.
|
||||
* **CV_REDUCE_MIN**: the output is the minimum (column/row-wise) of all rows/columns of the matrix.
|
||||
|
||||
:param dtype: When it is negative, the destination vector will have the same type as the source matrix. Otherwise, its type will be ``CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels())`` .
|
||||
:param dtype: when negative, the destination vector will have the same type as the source matrix, otherwise, its type will be ``CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels())``.
|
||||
|
||||
The function ``reduce`` reduces the matrix to a vector by treating the matrix rows/columns as a set of 1D vectors and performing the specified operation on the vectors until a single row/column is obtained. For example, the function can be used to compute horizontal and vertical projections of a raster image. In case of ``CV_REDUCE_SUM`` and ``CV_REDUCE_AVG`` , the output may have a larger element bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction modes.
|
||||
|
||||
@ -3048,9 +3048,9 @@ Divides a multi-channel array into several single-channel arrays.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Split(src, dst0, dst1, dst2, dst3)-> None
|
||||
|
||||
:param src: Source multi-channel array.
|
||||
:param src: input multi-channel array.
|
||||
|
||||
:param mv: Destination array or vector of arrays. In the first variant of the function the number of arrays must match ``src.channels()`` . The arrays themselves are reallocated, if needed.
|
||||
:param mv: output array or vector of arrays; in the first variant of the function the number of arrays must match ``src.channels()``; the arrays themselves are reallocated, if needed.
|
||||
|
||||
The functions ``split`` split a multi-channel array into separate single-channel arrays:
|
||||
|
||||
@ -3109,17 +3109,17 @@ Calculates the per-element difference between two arrays or array and a scalar.
|
||||
.. ocv:pyoldfunction:: cv.SubRS(src, value, dst, mask=None) -> None
|
||||
.. ocv:pyoldfunction:: cv.SubS(src, value, dst, mask=None) -> None
|
||||
|
||||
:param src1: First source array or a scalar.
|
||||
:param src1: first input array or a scalar.
|
||||
|
||||
:param src2: Second source array or a scalar.
|
||||
:param src2: second input array or a scalar.
|
||||
|
||||
:param dst: Destination array of the same size and the same number of channels as the input array.
|
||||
:param dst: output array of the same size and the same number of channels as the input array.
|
||||
|
||||
:param mask: Optional operation mask. This is an 8-bit single channel array that specifies elements of the destination array to be changed.
|
||||
:param mask: optional operation mask; this is an 8-bit single channel array that specifies elements of the destination array to be changed.
|
||||
|
||||
:param dtype: Optional depth of the output array. See the details below.
|
||||
:param dtype: optional depth of the output array (see the details below).
|
||||
|
||||
The function ``subtract`` computes:
|
||||
The function ``subtract`` calculates:
|
||||
|
||||
*
|
||||
Difference between two arrays, when both input arrays have the same size and the same number of channels:
|
||||
@ -3156,7 +3156,7 @@ The first function in the list above can be replaced with matrix expressions: ::
|
||||
dst = src1 - src2;
|
||||
dst -= src1; // equivalent to subtract(dst, src1, dst);
|
||||
|
||||
The input arrays and the destination array can all have the same or different depths. For example, you can subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of the output array is determined by ``dtype`` parameter. In the second and third cases above, as well as in the first case, when ``src1.depth() == src2.depth()``, ``dtype`` can be set to the default ``-1``. In this case the output array will have the same depth as the input array, be it ``src1``, ``src2`` or both.
|
||||
The input arrays and the output array can all have the same or different depths. For example, you can subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of the output array is determined by ``dtype`` parameter. In the second and third cases above, as well as in the first case, when ``src1.depth() == src2.depth()``, ``dtype`` can be set to the default ``-1``. In this case the output array will have the same depth as the input array, be it ``src1``, ``src2`` or both.
|
||||
|
||||
.. note:: Saturation is not applied when the output array has the depth ``CV_32S``. You may even get result of an incorrect sign in the case of overflow.
|
||||
|
||||
@ -3245,11 +3245,11 @@ Performs SVD of a matrix
|
||||
|
||||
:param src: Decomposed matrix
|
||||
|
||||
:param w: Computed singular values
|
||||
:param w: calculated singular values
|
||||
|
||||
:param u: Computed left singular vectors
|
||||
:param u: calculated left singular vectors
|
||||
|
||||
:param V: Computed right singular vectors
|
||||
:param V: calculated right singular vectors
|
||||
|
||||
:param vt: Transposed matrix of right singular values
|
||||
|
||||
@ -3305,7 +3305,7 @@ Performs a singular value back substitution.
|
||||
|
||||
:param dst: Found solution of the system.
|
||||
|
||||
The method computes a back substitution for the specified right-hand side:
|
||||
The method calculates a back substitution for the specified right-hand side:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -3329,7 +3329,7 @@ Calculates the sum of array elements.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Sum(arr) -> scalar
|
||||
|
||||
:param arr: Source array that must have from 1 to 4 channels.
|
||||
:param arr: input array that must have from 1 to 4 channels.
|
||||
|
||||
The functions ``sum`` calculate and return the sum of array elements, independently for each channel.
|
||||
|
||||
|
@ -4,18 +4,18 @@ Feature Detection and Description
|
||||
.. highlight:: cpp
|
||||
|
||||
FAST
|
||||
--------
|
||||
----
|
||||
Detects corners using the FAST algorithm
|
||||
|
||||
.. ocv:function:: void FAST( InputArray image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression=true, type=FastFeatureDetector::TYPE_9_16 )
|
||||
|
||||
:param image: Image where keypoints (corners) are detected.
|
||||
:param image: grayscale image where keypoints (corners) are detected.
|
||||
|
||||
:param keypoints: Keypoints detected on the image.
|
||||
:param keypoints: keypoints detected on the image.
|
||||
|
||||
:param threshold: Threshold on difference between intensity of the central pixel and pixels on a circle around this pixel. See the algorithm description below.
|
||||
:param threshold: threshold on difference between intensity of the central pixel and pixels of a circle around this pixel.
|
||||
|
||||
:param nonmaxSupression: If it is true, non-maximum suppression is applied to detected corners (keypoints).
|
||||
:param nonmaxSupression: if true, non-maximum suppression is applied to detected corners (keypoints).
|
||||
|
||||
:param type: one of the three neighborhoods as defined in the paper: ``FastFeatureDetector::TYPE_9_16``, ``FastFeatureDetector::TYPE_7_12``, ``FastFeatureDetector::TYPE_5_8``
|
||||
|
||||
|
@ -17,17 +17,17 @@ Finds edges in an image using the [Canny86]_ algorithm.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Canny(image, edges, threshold1, threshold2, aperture_size=3) -> None
|
||||
|
||||
:param image: Single-channel 8-bit input image.
|
||||
:param image: single-channel 8-bit input image.
|
||||
|
||||
:param edges: Output edge map. It has the same size and type as ``image`` .
|
||||
:param edges: output edge map; it has the same size and type as ``image`` .
|
||||
|
||||
:param threshold1: First threshold for the hysteresis procedure.
|
||||
:param threshold1: first threshold for the hysteresis procedure.
|
||||
|
||||
:param threshold2: Second threshold for the hysteresis procedure.
|
||||
:param threshold2: second threshold for the hysteresis procedure.
|
||||
|
||||
:param apertureSize: Aperture size for the :ocv:func:`Sobel` operator.
|
||||
:param apertureSize: aperture size for the :ocv:func:`Sobel` operator.
|
||||
|
||||
:param L2gradient: Flag indicating whether a more accurate :math:`L_2` norm :math:`=\sqrt{(dI/dx)^2 + (dI/dy)^2}` should be used to compute the image gradient magnitude ( ``L2gradient=true`` ), or a faster default :math:`L_1` norm :math:`=|dI/dx|+|dI/dy|` is enough ( ``L2gradient=false`` ).
|
||||
:param L2gradient: a flag, indicating whether a more accurate :math:`L_2` norm :math:`=\sqrt{(dI/dx)^2 + (dI/dy)^2}` should be used to calculate the image gradient magnitude ( ``L2gradient=true`` ), or whether the default :math:`L_1` norm :math:`=|dI/dx|+|dI/dy|` is enough ( ``L2gradient=false`` ).
|
||||
|
||||
The function finds edges in the input image ``image`` and marks them in the output map ``edges`` using the Canny algorithm. The smallest value between ``threshold1`` and ``threshold2`` is used for edge linking. The largest value is used to find initial segments of strong edges. See
|
||||
http://en.wikipedia.org/wiki/Canny_edge_detector
|
||||
|
@ -411,22 +411,22 @@ This filter does not work inplace.
|
||||
|
||||
|
||||
blur
|
||||
--------
|
||||
Smoothes an image using the normalized box filter.
|
||||
----
|
||||
Blurs an image using the normalized box filter.
|
||||
|
||||
.. ocv:function:: void blur( InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
|
||||
|
||||
.. ocv:pyfunction:: cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) -> dst
|
||||
|
||||
:param src: Source image. The image can have any number of channels, which are processed independently. The depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``.
|
||||
:param src: input image; it can have any number of channels, which are processed independently, but the depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``.
|
||||
|
||||
:param dst: Destination image of the same size and type as ``src`` .
|
||||
:param dst: output image of the same size and type as ``src``.
|
||||
|
||||
:param ksize: Smoothing kernel size.
|
||||
:param ksize: blurring kernel size.
|
||||
|
||||
:param anchor: Anchor point. The default value ``Point(-1,-1)`` means that the anchor is at the kernel center.
|
||||
:param anchor: anchor point; default value ``Point(-1,-1)`` means that the anchor is at the kernel center.
|
||||
|
||||
:param borderType: Border mode used to extrapolate pixels outside of the image.
|
||||
:param borderType: border mode used to extrapolate pixels outside of the image.
|
||||
|
||||
The function smoothes an image using the kernel:
|
||||
|
||||
@ -445,7 +445,7 @@ The call ``blur(src, dst, ksize, anchor, borderType)`` is equivalent to ``boxFil
|
||||
|
||||
|
||||
borderInterpolate
|
||||
---------------------
|
||||
-----------------
|
||||
Computes the source location of an extrapolated pixel.
|
||||
|
||||
.. ocv:function:: int borderInterpolate( int p, int len, int borderType )
|
||||
@ -476,24 +476,24 @@ Normally, the function is not called directly. It is used inside
|
||||
|
||||
|
||||
boxFilter
|
||||
-------------
|
||||
Smoothes an image using the box filter.
|
||||
---------
|
||||
Blurs an image using the box filter.
|
||||
|
||||
.. ocv:function:: void boxFilter( InputArray src, OutputArray dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT )
|
||||
|
||||
.. ocv:pyfunction:: cv2.boxFilter(src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]) -> dst
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image of the same size and type as ``src`` .
|
||||
:param dst: output image of the same size and type as ``src``.
|
||||
|
||||
:param ksize: Smoothing kernel size.
|
||||
:param ksize: blurring kernel size.
|
||||
|
||||
:param anchor: Anchor point. The default value ``Point(-1,-1)`` means that the anchor is at the kernel center.
|
||||
:param anchor: anchor point; default value ``Point(-1,-1)`` means that the anchor is at the kernel center.
|
||||
|
||||
:param normalize: Flag specifying whether the kernel is normalized by its area or not.
|
||||
:param normalize: flag, specifying whether the kernel is normalized by its area or not.
|
||||
|
||||
:param borderType: Border mode used to extrapolate pixels outside of the image.
|
||||
:param borderType: border mode used to extrapolate pixels outside of the image.
|
||||
|
||||
The function smoothes an image using the kernel:
|
||||
|
||||
@ -520,7 +520,7 @@ Unnormalized box filter is useful for computing various integral characteristics
|
||||
|
||||
|
||||
buildPyramid
|
||||
----------------
|
||||
------------
|
||||
Constructs the Gaussian pyramid for an image.
|
||||
|
||||
.. ocv:function:: void buildPyramid( InputArray src, OutputArrayOfArrays dst, int maxlevel, int borderType=BORDER_DEFAULT )
|
||||
@ -537,7 +537,7 @@ The function constructs a vector of images and builds the Gaussian pyramid by re
|
||||
|
||||
|
||||
copyMakeBorder
|
||||
------------------
|
||||
--------------
|
||||
Forms a border around an image.
|
||||
|
||||
.. ocv:function:: void copyMakeBorder( InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() )
|
||||
@ -828,7 +828,7 @@ The functions construct primitive separable linear filtering operations or a fil
|
||||
|
||||
|
||||
dilate
|
||||
----------
|
||||
------
|
||||
Dilates an image by using a specific structuring element.
|
||||
|
||||
.. ocv:function:: void dilate( InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
|
||||
@ -838,19 +838,19 @@ Dilates an image by using a specific structuring element.
|
||||
.. ocv:cfunction:: void cvDilate( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1 )
|
||||
.. ocv:pyoldfunction:: cv.Dilate(src, dst, element=None, iterations=1)-> None
|
||||
|
||||
:param src: Source image. The number of channels can be arbitrary. The depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``.
|
||||
:param src: input image; the number of channels can be arbitrary, but the depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``.
|
||||
|
||||
:param dst: Destination image of the same size and type as ``src`` .
|
||||
:param dst: output image of the same size and type as ``src``.
|
||||
|
||||
:param element: Structuring element used for dilation. If ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
|
||||
:param element: structuring element used for dilation; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
|
||||
|
||||
:param anchor: Position of the anchor within the element. The default value ``(-1, -1)`` means that the anchor is at the element center.
|
||||
:param anchor: position of the anchor within the element; default value ``(-1, -1)`` means that the anchor is at the element center.
|
||||
|
||||
:param iterations: Number of times dilation is applied.
|
||||
:param iterations: number of times dilation is applied.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :ocv:func:`createMorphologyFilter` for details.
|
||||
:param borderValue: border value in case of a constant border (see :ocv:func:`createMorphologyFilter` for details).
|
||||
|
||||
The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken:
|
||||
|
||||
@ -868,7 +868,7 @@ The function supports the in-place mode. Dilation can be applied several ( ``ite
|
||||
|
||||
|
||||
erode
|
||||
---------
|
||||
-----
|
||||
Erodes an image by using a specific structuring element.
|
||||
|
||||
.. ocv:function:: void erode( InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
|
||||
@ -878,19 +878,19 @@ Erodes an image by using a specific structuring element.
|
||||
.. ocv:cfunction:: void cvErode( const CvArr* src, CvArr* dst, IplConvKernel* element=NULL, int iterations=1)
|
||||
.. ocv:pyoldfunction:: cv.Erode(src, dst, element=None, iterations=1)-> None
|
||||
|
||||
:param src: Source image. The number of channels can be arbitrary. The depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``.
|
||||
:param src: input image; the number of channels can be arbitrary, but the depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``.
|
||||
|
||||
:param dst: Destination image of the same size and type as ``src``.
|
||||
:param dst: output image of the same size and type as ``src``.
|
||||
|
||||
:param element: Structuring element used for erosion. If ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
|
||||
:param element: structuring element used for erosion; if ``element=Mat()`` , a ``3 x 3`` rectangular structuring element is used.
|
||||
|
||||
:param anchor: Position of the anchor within the element. The default value ``(-1, -1)`` means that the anchor is at the element center.
|
||||
:param anchor: position of the anchor within the element; default value ``(-1, -1)`` means that the anchor is at the element center.
|
||||
|
||||
:param iterations: Number of times erosion is applied.
|
||||
:param iterations: number of times erosion is applied.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
:param borderValue: Border value in case of a constant border. The default value has a special meaning. See :ocv:func:`createMorphologyFilter` for details.
|
||||
:param borderValue: border value in case of a constant border (see :ocv:func:`createMorphologyFilter` for details).
|
||||
|
||||
The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken:
|
||||
|
||||
@ -909,7 +909,7 @@ The function supports the in-place mode. Erosion can be applied several ( ``iter
|
||||
|
||||
|
||||
filter2D
|
||||
------------
|
||||
--------
|
||||
Convolves an image with the kernel.
|
||||
|
||||
.. ocv:function:: void filter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
|
||||
@ -920,25 +920,26 @@ Convolves an image with the kernel.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Filter2D(src, dst, kernel, anchor=(-1, -1))-> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image of the same size and the same number of channels as ``src`` .
|
||||
:param dst: output image of the same size and the same number of channels as ``src``.
|
||||
|
||||
:param ddepth: Desired depth of the destination image. If it is negative, it will be the same as ``src.depth()`` . The following combination of ``src.depth()`` and ``ddepth`` are supported:
|
||||
|
||||
:param ddepth: desired depth of the destination image; if it is negative, it will be the same as ``src.depth()``; the following combinations of ``src.depth()`` and ``ddepth`` are supported:
|
||||
* ``src.depth()`` = ``CV_8U``, ``ddepth`` = -1/``CV_16S``/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_16U``/``CV_16S``, ``ddepth`` = -1/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_32F``, ``ddepth`` = -1/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_64F``, ``ddepth`` = -1/``CV_64F``
|
||||
|
||||
when ``ddepth=-1``, the destination image will have the same depth as the source.
|
||||
when ``ddepth=-1``, the output image will have the same depth as the source.
|
||||
|
||||
:param kernel: Convolution kernel (or rather a correlation kernel), a single-channel floating point matrix. If you want to apply different kernels to different channels, split the image into separate color planes using :ocv:func:`split` and process them individually.
|
||||
:param kernel: convolution kernel (or rather a correlation kernel), a single-channel floating point matrix; if you want to apply different kernels to different channels, split the image into separate color planes using :ocv:func:`split` and process them individually.
|
||||
|
||||
:param anchor: Anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor should lie within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center.
|
||||
:param anchor: anchor of the kernel that indicates the relative position of a filtered point within the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is at the kernel center.
|
||||
|
||||
:param delta: Optional value added to the filtered pixels before storing them in ``dst`` .
|
||||
:param delta: optional value added to the filtered pixels before storing them in ``dst``.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode.
|
||||
|
||||
@ -963,24 +964,24 @@ The function uses the DFT-based algorithm in case of sufficiently large kernels
|
||||
|
||||
|
||||
GaussianBlur
|
||||
----------------
|
||||
Smoothes an image using a Gaussian filter.
|
||||
------------
|
||||
Blurs an image using a Gaussian filter.
|
||||
|
||||
.. ocv:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
|
||||
|
||||
.. ocv:pyfunction:: cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) -> dst
|
||||
|
||||
:param src: Source image. The image can have any number of channels, which are processed independently. The depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``.
|
||||
:param src: input image; the image can have any number of channels, which are processed independently, but the depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``.
|
||||
|
||||
:param dst: Destination image of the same size and type as ``src`` .
|
||||
:param dst: output image of the same size and type as ``src``.
|
||||
|
||||
:param ksize: Gaussian kernel size. ``ksize.width`` and ``ksize.height`` can differ but they both must be positive and odd. Or, they can be zero's and then they are computed from ``sigma*`` .
|
||||
|
||||
:param sigmaX: Gaussian kernel standard deviation in X direction.
|
||||
|
||||
:param sigmaY: Gaussian kernel standard deviation in Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If both sigmas are zeros, they are computed from ``ksize.width`` and ``ksize.height`` , respectively. See :ocv:func:`getGaussianKernel` for details. To fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ``ksize`` , ``sigmaX`` , and ``sigmaY`` .
|
||||
:param sigmaY: Gaussian kernel standard deviation in Y direction; if ``sigmaY`` is zero, it is set to be equal to ``sigmaX``, if both sigmas are zeros, they are computed from ``ksize.width`` and ``ksize.height`` , respectively (see :ocv:func:`getGaussianKernel` for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ``ksize``, ``sigmaX``, and ``sigmaY``.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
|
||||
|
||||
@ -995,7 +996,7 @@ The function convolves the source image with the specified Gaussian kernel. In-p
|
||||
|
||||
|
||||
getDerivKernels
|
||||
-------------------
|
||||
---------------
|
||||
Returns filter coefficients for computing spatial image derivatives.
|
||||
|
||||
.. ocv:function:: void getDerivKernels( OutputArray kx, OutputArray ky, int dx, int dy, int ksize, bool normalize=false, int ktype=CV_32F )
|
||||
@ -1026,7 +1027,7 @@ The function computes and returns the filter coefficients for spatial image deri
|
||||
|
||||
|
||||
getGaussianKernel
|
||||
---------------------
|
||||
-----------------
|
||||
Returns Gaussian filter coefficients.
|
||||
|
||||
.. ocv:function:: Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F )
|
||||
@ -1066,7 +1067,7 @@ Two of such generated kernels can be passed to
|
||||
|
||||
|
||||
getKernelType
|
||||
-----------------
|
||||
-------------
|
||||
Returns the kernel type.
|
||||
|
||||
.. ocv:function:: int getKernelType(InputArray kernel, Point anchor)
|
||||
@ -1089,7 +1090,7 @@ The function analyzes the kernel coefficients and returns the corresponding kern
|
||||
|
||||
|
||||
getStructuringElement
|
||||
-------------------------
|
||||
---------------------
|
||||
Returns a structuring element of the specified size and shape for morphological operations.
|
||||
|
||||
.. ocv:function:: Mat getStructuringElement(int shape, Size ksize, Point anchor=Point(-1,-1))
|
||||
@ -1142,18 +1143,18 @@ The function constructs and returns the structuring element that can be further
|
||||
|
||||
|
||||
medianBlur
|
||||
--------------
|
||||
Smoothes an image using the median filter.
|
||||
----------
|
||||
Blurs an image using the median filter.
|
||||
|
||||
.. ocv:function:: void medianBlur( InputArray src, OutputArray dst, int ksize )
|
||||
|
||||
.. ocv:pyfunction:: cv2.medianBlur(src, ksize[, dst]) -> dst
|
||||
|
||||
:param src: Source 1-, 3-, or 4-channel image. When ``ksize`` is 3 or 5, the image depth should be ``CV_8U`` , ``CV_16U`` , or ``CV_32F`` . For larger aperture sizes, it can only be ``CV_8U`` .
|
||||
:param src: input 1-, 3-, or 4-channel image; when ``ksize`` is 3 or 5, the image depth should be ``CV_8U``, ``CV_16U``, or ``CV_32F``, for larger aperture sizes, it can only be ``CV_8U``.
|
||||
|
||||
:param dst: Destination array of the same size and type as ``src`` .
|
||||
:param dst: destination array of the same size and type as ``src``.
|
||||
|
||||
:param ksize: Aperture linear size. It must be odd and greater than 1, for example: 3, 5, 7 ...
|
||||
:param ksize: aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
|
||||
|
||||
The function smoothes an image using the median filter with the
|
||||
:math:`\texttt{ksize} \times \texttt{ksize}` aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported.
|
||||
@ -1168,7 +1169,7 @@ The function smoothes an image using the median filter with the
|
||||
|
||||
|
||||
morphologyEx
|
||||
----------------
|
||||
------------
|
||||
Performs advanced morphological transformations.
|
||||
|
||||
.. ocv:function:: void morphologyEx( InputArray src, OutputArray dst, int op, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
|
||||
@ -1244,7 +1245,7 @@ Any of the operations can be done in-place. In case of multi-channel images, eac
|
||||
|
||||
|
||||
Laplacian
|
||||
-------------
|
||||
---------
|
||||
Calculates the Laplacian of an image.
|
||||
|
||||
.. ocv:function:: void Laplacian( InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
|
||||
@ -1290,8 +1291,8 @@ This is done when ``ksize > 1`` . When ``ksize == 1`` , the Laplacian is compute
|
||||
|
||||
|
||||
pyrDown
|
||||
-----------
|
||||
Smoothes an image and downsamples it.
|
||||
-------
|
||||
Blurs an image and downsamples it.
|
||||
|
||||
.. ocv:function:: void pyrDown( InputArray src, OutputArray dst, const Size& dstsize=Size(), int borderType=BORDER_DEFAULT )
|
||||
|
||||
@ -1301,11 +1302,11 @@ Smoothes an image and downsamples it.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.PyrDown(src, dst, filter=CV_GAUSSIAN_5X5) -> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image. It has the specified size and the same type as ``src`` .
|
||||
:param dst: output image; it has the specified size and the same type as ``src``.
|
||||
|
||||
:param dstsize: Size of the destination image. By default, it is computed as ``Size((src.cols+1)/2, (src.rows+1)/2)`` . But in any case, the following conditions should be satisfied:
|
||||
:param dstsize: size of the output image; by default, it is computed as ``Size((src.cols+1)/2, (src.rows+1)/2)``, but in any case, the following conditions should be satisfied:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -1323,8 +1324,8 @@ Then, it downsamples the image by rejecting even rows and columns.
|
||||
|
||||
|
||||
pyrUp
|
||||
---------
|
||||
Upsamples an image and then smoothes it.
|
||||
-----
|
||||
Upsamples an image and then blurs it.
|
||||
|
||||
.. ocv:function:: void pyrUp( InputArray src, OutputArray dst, const Size& dstsize=Size(), int borderType=BORDER_DEFAULT )
|
||||
|
||||
@ -1334,18 +1335,18 @@ Upsamples an image and then smoothes it.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.PyrUp(src, dst, filter=CV_GAUSSIAN_5X5) -> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image. It has the specified size and the same type as ``src`` .
|
||||
:param dst: output image. It has the specified size and the same type as ``src`` .
|
||||
|
||||
:param dstsize: Size of the destination image. By default, it is computed as ``Size(src.cols*2, (src.rows*2)`` . But in any case, the following conditions should be satisfied:
|
||||
:param dstsize: size of the output image; by default, it is computed as ``Size(src.cols*2, (src.rows*2)``, but in any case, the following conditions should be satisfied:
|
||||
|
||||
.. math::
|
||||
|
||||
\begin{array}{l}
|
||||
| \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}
|
||||
|
||||
The function performs the upsampling step of the Gaussian pyramid construction though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in
|
||||
The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in
|
||||
:ocv:func:`pyrDown` multiplied by 4.
|
||||
|
||||
|
||||
@ -1399,7 +1400,7 @@ When ``maxLevel > 0``, the gaussian pyramid of ``maxLevel+1`` levels is built, a
|
||||
|
||||
|
||||
sepFilter2D
|
||||
---------------
|
||||
-----------
|
||||
Applies a separable linear filter to an image.
|
||||
|
||||
.. ocv:function:: void sepFilter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernelX, InputArray kernelY, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT )
|
||||
@ -1493,7 +1494,7 @@ The function smooths an image using one of several methods. Every of the methods
|
||||
|
||||
|
||||
Sobel
|
||||
---------
|
||||
-----
|
||||
Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
|
||||
|
||||
.. ocv:function:: void Sobel( InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
|
||||
@ -1504,29 +1505,29 @@ Calculates the first, second, third, or mixed image derivatives using an extende
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Sobel(src, dst, xorder, yorder, apertureSize=3)-> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image of the same size and the same number of channels as ``src`` .
|
||||
:param dst: output image of the same size and the same number of channels as ``src`` .
|
||||
|
||||
:param ddepth: Destination image depth. The following combination of ``src.depth()`` and ``ddepth`` are supported:
|
||||
:param ddepth: output image depth; the following combinations of ``src.depth()`` and ``ddepth`` are supported:
|
||||
* ``src.depth()`` = ``CV_8U``, ``ddepth`` = -1/``CV_16S``/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_16U``/``CV_16S``, ``ddepth`` = -1/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_32F``, ``ddepth`` = -1/``CV_32F``/``CV_64F``
|
||||
* ``src.depth()`` = ``CV_64F``, ``ddepth`` = -1/``CV_64F``
|
||||
|
||||
when ``ddepth=-1``, the destination image will have the same depth as the source. In the case of 8-bit input images it will result in truncated derivatives.
|
||||
when ``ddepth=-1``, the destination image will have the same depth as the source; in the case of 8-bit input images it will result in truncated derivatives.
|
||||
|
||||
:param xorder: Order of the derivative x.
|
||||
:param xorder: order of the derivative x.
|
||||
|
||||
:param yorder: Order of the derivative y.
|
||||
:param yorder: order of the derivative y.
|
||||
|
||||
:param ksize: Size of the extended Sobel kernel. It must be 1, 3, 5, or 7.
|
||||
:param ksize: size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
|
||||
|
||||
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details.
|
||||
:param scale: optional scale factor for the computed derivative values; by default, no scaling is applied (see :ocv:func:`getDerivKernels` for details).
|
||||
|
||||
:param delta: Optional delta value that is added to the results prior to storing them in ``dst`` .
|
||||
:param delta: optional delta value that is added to the results prior to storing them in ``dst``.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
In all cases except one, the
|
||||
:math:`\texttt{ksize} \times
|
||||
@ -1580,28 +1581,28 @@ The second case corresponds to a kernel of:
|
||||
|
||||
|
||||
Scharr
|
||||
----------
|
||||
------
|
||||
Calculates the first x- or y- image derivative using Scharr operator.
|
||||
|
||||
.. ocv:function:: void Scharr( InputArray src, OutputArray dst, int ddepth, int dx, int dy, double scale=1, double delta=0, int borderType=BORDER_DEFAULT )
|
||||
|
||||
.. ocv:pyfunction:: cv2.Scharr(src, ddepth, dx, dy[, dst[, scale[, delta[, borderType]]]]) -> dst
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image of the same size and the same number of channels as ``src``.
|
||||
:param dst: output image of the same size and the same number of channels as ``src``.
|
||||
|
||||
:param ddepth: Destination image depth. See :ocv:func:`Sobel` for the list of supported combination of ``src.depth()`` and ``ddepth``.
|
||||
:param ddepth: output image depth (see :ocv:func:`Sobel` for the list of supported combination of ``src.depth()`` and ``ddepth``).
|
||||
|
||||
:param dx: Order of the derivative x.
|
||||
:param dx: order of the derivative x.
|
||||
|
||||
:param dy: Order of the derivative y.
|
||||
:param dy: order of the derivative y.
|
||||
|
||||
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details.
|
||||
:param scale: optional scale factor for the computed derivative values; by default, no scaling is applied (see :ocv:func:`getDerivKernels` for details).
|
||||
|
||||
:param delta: Optional delta value that is added to the results prior to storing them in ``dst``.
|
||||
:param delta: optional delta value that is added to the results prior to storing them in ``dst``.
|
||||
|
||||
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
|
||||
:param borderType: pixel extrapolation method (see :ocv:func:`borderInterpolate` for details).
|
||||
|
||||
The function computes the first x- or y- spatial image derivative using the Scharr operator. The call
|
||||
|
||||
|
@ -356,7 +356,7 @@ This function cannot operate in-place.
|
||||
|
||||
|
||||
resize
|
||||
----------
|
||||
------
|
||||
Resizes an image.
|
||||
|
||||
.. ocv:function:: void resize( InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
|
||||
@ -366,11 +366,11 @@ Resizes an image.
|
||||
.. ocv:cfunction:: void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR )
|
||||
.. ocv:pyoldfunction:: cv.Resize(src, dst, interpolation=CV_INTER_LINEAR)-> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image. It has the size ``dsize`` (when it is non-zero) or the size computed from ``src.size()`` , ``fx`` , and ``fy`` . The type of ``dst`` is the same as of ``src`` .
|
||||
:param dst: output image; it has the size ``dsize`` (when it is non-zero) or the size computed from ``src.size()``, ``fx``, and ``fy``; the type of ``dst`` is the same as of ``src``.
|
||||
|
||||
:param dsize: Destination image size. If it is zero, it is computed as:
|
||||
:param dsize: output image size; if it equals zero, it is computed as:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -379,19 +379,19 @@ Resizes an image.
|
||||
|
||||
Either ``dsize`` or both ``fx`` and ``fy`` must be non-zero.
|
||||
|
||||
:param fx: Scale factor along the horizontal axis. When it is 0, it is computed as
|
||||
:param fx: scale factor along the horizontal axis; when it equals 0, it is computed as
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{(double)dsize.width/src.cols}
|
||||
|
||||
:param fy: Scale factor along the vertical axis. When it is 0, it is computed as
|
||||
:param fy: scale factor along the vertical axis; when it equals 0, it is computed as
|
||||
|
||||
.. math::
|
||||
|
||||
\texttt{(double)dsize.height/src.rows}
|
||||
|
||||
:param interpolation: Interpolation method:
|
||||
:param interpolation: interpolation method:
|
||||
|
||||
* **INTER_NEAREST** - a nearest-neighbor interpolation
|
||||
|
||||
@ -425,7 +425,7 @@ To shrink an image, it will generally look best with CV_INTER_AREA interpolation
|
||||
|
||||
|
||||
warpAffine
|
||||
--------------
|
||||
----------
|
||||
Applies an affine transformation to an image.
|
||||
|
||||
.. ocv:function:: void warpAffine( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
|
||||
@ -440,19 +440,19 @@ Applies an affine transformation to an image.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.GetQuadrangleSubPix(src, dst, mapMatrix)-> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image that has the size ``dsize`` and the same type as ``src`` .
|
||||
:param dst: output image that has the size ``dsize`` and the same type as ``src`` .
|
||||
|
||||
:param M: :math:`2\times 3` transformation matrix.
|
||||
:param M: :math:`2\times 3` transformation matrix.
|
||||
|
||||
:param dsize: Size of the destination image.
|
||||
:param dsize: size of the output image.
|
||||
|
||||
:param flags: Combination of interpolation methods (see :ocv:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
|
||||
:param flags: combination of interpolation methods (see :ocv:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
|
||||
|
||||
:param borderMode: Pixel extrapolation method (see :ocv:func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image corresponding to the "outliers" in the source image are not modified by the function.
|
||||
:param borderMode: pixel extrapolation method (see :ocv:func:`borderInterpolate`); when \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image corresponding to the "outliers" in the source image are not modified by the function.
|
||||
|
||||
:param borderValue: Value used in case of a constant border. By default, it is 0.
|
||||
:param borderValue: value used in case of a constant border; by default, it is 0.
|
||||
|
||||
The function ``warpAffine`` transforms the source image using the specified matrix:
|
||||
|
||||
@ -476,7 +476,7 @@ The function cannot operate in-place.
|
||||
.. note:: ``cvGetQuadrangleSubPix`` is similar to ``cvWarpAffine``, but the outliers are extrapolated using replication border mode.
|
||||
|
||||
warpPerspective
|
||||
-------------------
|
||||
---------------
|
||||
Applies a perspective transformation to an image.
|
||||
|
||||
.. ocv:function:: void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
|
||||
@ -487,19 +487,19 @@ Applies a perspective transformation to an image.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.WarpPerspective(src, dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
|
||||
|
||||
:param src: Source image.
|
||||
:param src: input image.
|
||||
|
||||
:param dst: Destination image that has the size ``dsize`` and the same type as ``src`` .
|
||||
:param dst: output image that has the size ``dsize`` and the same type as ``src`` .
|
||||
|
||||
:param M: :math:`3\times 3` transformation matrix.
|
||||
|
||||
:param dsize: Size of the destination image.
|
||||
:param dsize: size of the output image.
|
||||
|
||||
:param flags: Combination of interpolation methods (see :ocv:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` that means that ``M`` is the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
|
||||
:param flags: combination of interpolation methods (``INTER_LINEAR`` or ``INTER_NEAREST``) and the optional flag ``WARP_INVERSE_MAP``, that sets ``M`` as the inverse transformation ( :math:`\texttt{dst}\rightarrow\texttt{src}` ).
|
||||
|
||||
:param borderMode: Pixel extrapolation method (see :ocv:func:`borderInterpolate` ). When \ ``borderMode=BORDER_TRANSPARENT`` , it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function.
|
||||
:param borderMode: pixel extrapolation method (``BORDER_CONSTANT`` or ``BORDER_REPLICATE``).
|
||||
|
||||
:param borderValue: Value used in case of a constant border. By default, it is 0.
|
||||
:param borderValue: value used in case of a constant border; by default, it equals 0.
|
||||
|
||||
The function ``warpPerspective`` transforms the source image using the specified matrix:
|
||||
|
||||
@ -524,7 +524,7 @@ The function cannot operate in-place.
|
||||
|
||||
|
||||
initUndistortRectifyMap
|
||||
---------------------------
|
||||
-----------------------
|
||||
Computes the undistortion and rectification transformation map.
|
||||
|
||||
.. ocv:function:: void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2 )
|
||||
|
@ -71,7 +71,7 @@ The function can process the image in-place.
|
||||
|
||||
|
||||
cvtColor
|
||||
------------
|
||||
--------
|
||||
Converts an image from one color space to another.
|
||||
|
||||
.. ocv:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 )
|
||||
@ -81,13 +81,13 @@ Converts an image from one color space to another.
|
||||
.. ocv:cfunction:: void cvCvtColor( const CvArr* src, CvArr* dst, int code )
|
||||
.. ocv:pyoldfunction:: cv.CvtColor(src, dst, code)-> None
|
||||
|
||||
:param src: Source image: 8-bit unsigned, 16-bit unsigned ( ``CV_16UC...`` ), or single-precision floating-point.
|
||||
:param src: input image: 8-bit unsigned, 16-bit unsigned ( ``CV_16UC...`` ), or single-precision floating-point.
|
||||
|
||||
:param dst: Destination image of the same size and depth as ``src`` .
|
||||
:param dst: output image of the same size and depth as ``src``.
|
||||
|
||||
:param code: Color space conversion code. See the description below.
|
||||
:param code: color space conversion code (see the description below).
|
||||
|
||||
:param dstCn: Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from ``src`` and ``code`` .
|
||||
:param dstCn: number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from ``src`` and ``code`` .
|
||||
|
||||
The function converts an input image from one color
|
||||
space to another. In case of a transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR).
|
||||
@ -408,7 +408,7 @@ The function can do the following transformations:
|
||||
|
||||
|
||||
distanceTransform
|
||||
---------------------
|
||||
-----------------
|
||||
Calculates the distance to the closest zero pixel for each pixel of the source image.
|
||||
|
||||
.. ocv:function:: void distanceTransform( InputArray src, OutputArray dst, int distanceType, int maskSize )
|
||||
@ -481,7 +481,7 @@ That is, the function provides a very fast way to compute the Voronoi diagram fo
|
||||
Currently, the second variant can use only the approximate distance transform algorithm, i.e. ``maskSize=CV_DIST_MASK_PRECISE`` is not supported yet.
|
||||
|
||||
floodFill
|
||||
-------------
|
||||
---------
|
||||
Fills a connected component with the given color.
|
||||
|
||||
.. ocv:function:: int floodFill( InputOutputArray image, Point seedPoint, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
|
||||
@ -586,7 +586,7 @@ Use these functions to either mark a connected component with the specified colo
|
||||
|
||||
|
||||
integral
|
||||
------------
|
||||
--------
|
||||
Calculates the integral of an image.
|
||||
|
||||
.. ocv:function:: void integral( InputArray src, OutputArray sum, int sdepth=-1 )
|
||||
@ -605,15 +605,15 @@ Calculates the integral of an image.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Integral(image, sum, sqsum=None, tiltedSum=None)-> None
|
||||
|
||||
:param image: Source image as :math:`W \times H` , 8-bit or floating-point (32f or 64f).
|
||||
:param image: input image as :math:`W \times H`, 8-bit or floating-point (32f or 64f).
|
||||
|
||||
:param sum: Integral image as :math:`(W+1)\times (H+1)` , 32-bit integer or floating-point (32f or 64f).
|
||||
:param sum: integral image as :math:`(W+1)\times (H+1)` , 32-bit integer or floating-point (32f or 64f).
|
||||
|
||||
:param sqsum: Integral image for squared pixel values. It is :math:`(W+1)\times (H+1)`, double-precision floating-point (64f) array.
|
||||
:param sqsum: integral image for squared pixel values; it is :math:`(W+1)\times (H+1)`, double-precision floating-point (64f) array.
|
||||
|
||||
:param tilted: Integral for the image rotated by 45 degrees. It is :math:`(W+1)\times (H+1)` array with the same data type as ``sum``.
|
||||
:param tilted: integral for the image rotated by 45 degrees; it is :math:`(W+1)\times (H+1)` array with the same data type as ``sum``.
|
||||
|
||||
:param sdepth: Desired depth of the integral and the tilted integral images, ``CV_32S``, ``CV_32F``, or ``CV_64F``.
|
||||
:param sdepth: desired depth of the integral and the tilted integral images, ``CV_32S``, ``CV_32F``, or ``CV_64F``.
|
||||
|
||||
The functions calculate one or more integral images for the source image as follows:
|
||||
|
||||
@ -646,7 +646,7 @@ As a practical example, the next figure shows the calculation of the integral of
|
||||
|
||||
|
||||
threshold
|
||||
-------------
|
||||
---------
|
||||
Applies a fixed-level threshold to each array element.
|
||||
|
||||
.. ocv:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxval, int type )
|
||||
@ -657,15 +657,15 @@ Applies a fixed-level threshold to each array element.
|
||||
|
||||
.. ocv:pyoldfunction:: cv.Threshold(src, dst, threshold, maxValue, thresholdType)-> None
|
||||
|
||||
:param src: Source array (single-channel, 8-bit or 32-bit floating point).
|
||||
:param src: input array (single-channel, 8-bit or 32-bit floating point).
|
||||
|
||||
:param dst: Destination array of the same size and type as ``src`` .
|
||||
:param dst: output array of the same size and type as ``src``.
|
||||
|
||||
:param thresh: Threshold value.
|
||||
:param thresh: treshold value.
|
||||
|
||||
:param maxval: Maximum value to use with the ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` thresholding types.
|
||||
:param maxval: maximum value to use with the ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` thresholding types.
|
||||
|
||||
:param type: Thresholding type (see the details below).
|
||||
:param type: thresholding type (see the details below).
|
||||
|
||||
The function applies fixed-level thresholding
|
||||
to a single-channel array. The function is typically used to get a
|
||||
@ -724,7 +724,7 @@ Currently, the Otsu's method is implemented only for 8-bit images.
|
||||
|
||||
|
||||
watershed
|
||||
-------------
|
||||
---------
|
||||
Performs a marker-based image segmentation using the watershed algorithm.
|
||||
|
||||
.. ocv:function:: void watershed( InputArray image, InputOutputArray markers )
|
||||
|
@ -204,11 +204,11 @@ This method must implement matching logic in order to make the wrappers `detail:
|
||||
|
||||
.. ocv:function:: void detail::FeaturesMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info)
|
||||
|
||||
:param features1: First image features
|
||||
:param features1: first image features
|
||||
|
||||
:param features2: Second image features
|
||||
:param features2: second image features
|
||||
|
||||
:param matches_info: Found matches
|
||||
:param matches_info: found matches
|
||||
|
||||
detail::BestOf2NearestMatcher
|
||||
-----------------------------
|
||||
|
@ -15,30 +15,30 @@ Calculates an optical flow for a sparse feature set using the iterative Lucas-Ka
|
||||
.. ocv:cfunction:: void cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, CvArr* prev_pyr, CvArr* curr_pyr, const CvPoint2D32f* prev_features, CvPoint2D32f* curr_features, int count, CvSize win_size, int level, char* status, float* track_error, CvTermCriteria criteria, int flags )
|
||||
.. ocv:pyoldfunction:: cv.CalcOpticalFlowPyrLK(prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses=None) -> (currFeatures, status, track_error)
|
||||
|
||||
:param prevImg: First 8-bit input image or pyramid constructed by :ocv:func:`buildOpticalFlowPyramid`.
|
||||
:param prevImg: first 8-bit input image or pyramid constructed by :ocv:func:`buildOpticalFlowPyramid`.
|
||||
|
||||
:param nextImg: Second input image or pyramid of the same size and the same type as ``prevImg``.
|
||||
:param nextImg: second input image or pyramid of the same size and the same type as ``prevImg``.
|
||||
|
||||
:param prevPts: Vector of 2D points for which the flow needs to be found. The point coordinates must be single-precision floating-point numbers.
|
||||
:param prevPts: vector of 2D points for which the flow needs to be found; point coordinates must be single-precision floating-point numbers.
|
||||
|
||||
:param nextPts: Output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image. When ``OPTFLOW_USE_INITIAL_FLOW`` flag is passed, the vector must have the same size as in the input.
|
||||
:param nextPts: output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image; when ``OPTFLOW_USE_INITIAL_FLOW`` flag is passed, the vector must have the same size as in the input.
|
||||
|
||||
:param status: Output status vector. Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
|
||||
:param status: output status vector; each element of the vector is set to 1 if the flow for the corresponding features has been found, otherwise, it is set to 0.
|
||||
|
||||
:param err: Output vector of errors. Each element of the vector is set to a error for the corresponding feature. A type of the error measure can be set in ``flags`` parameter. If the flow wasn't found then the error is not defined (use the ``status`` parameter to find such cases).
|
||||
:param err: output vector of errors; each element of the vector is set to an error for the corresponding feature, type of the error measure can be set in ``flags`` parameter; if the flow wasn't found then the error is not defined (use the ``status`` parameter to find such cases).
|
||||
|
||||
:param winSize: Size of the search window at each pyramid level.
|
||||
:param winSize: size of the search window at each pyramid level.
|
||||
|
||||
:param maxLevel: 0-based maximal pyramid level number. If set to 0, pyramids are not used (single level). If set to 1, two levels are used, and so on. If pyramids are passed to input then algorithm will use as many levels as pyramids have but no more than ``maxLevel``.
|
||||
:param maxLevel: 0-based maximal pyramid level number; if set to 0, pyramids are not used (single level), if set to 1, two levels are used, and so on; if pyramids are passed to input then algorithm will use as many levels as pyramids have but no more than ``maxLevel``.
|
||||
|
||||
:param criteria: Parameter specifying the termination criteria of the iterative search algorithm (after the specified maximum number of iterations ``criteria.maxCount`` or when the search window moves by less than ``criteria.epsilon`` .
|
||||
:param criteria: parameter, specifying the termination criteria of the iterative search algorithm (after the specified maximum number of iterations ``criteria.maxCount`` or when the search window moves by less than ``criteria.epsilon``.
|
||||
|
||||
:param flags: Operation flags:
|
||||
:param flags: operation flags:
|
||||
|
||||
* **OPTFLOW_USE_INITIAL_FLOW** Use initial estimations stored in ``nextPts`` . If the flag is not set, then ``prevPts`` is copied to ``nextPts`` and is considered as the initial estimate.
|
||||
* **OPTFLOW_LK_GET_MIN_EIGENVALS** Use minimum eigen values as a error measure (see ``minEigThreshold`` description). If the flag is not set, then L1 distance between patches around the original and a moved point divided by number of pixels in a window is used as a error measure.
|
||||
* **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in ``nextPts``; if the flag is not set, then ``prevPts`` is copied to ``nextPts`` and is considered the initial estimate.
|
||||
* **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see ``minEigThreshold`` description); if the flag is not set, then L1 distance between patches around the original and a moved point, divided by number of pixels in a window, is used as a error measure.
|
||||
|
||||
:param minEigThreshold: The algorithm computes a minimum eigen value of a 2x2 normal matrix of optical flow equations (this matrix is called a spatial gradient matrix in [Bouguet00]_) divided by number of pixels in a window. If this value is less then ``minEigThreshold`` then a corresponding feature is filtered out and its flow is not computed. So it allows to remove bad points earlier and speed up the computation.
|
||||
:param minEigThreshold: the algorithm calculates the minimum eigen value of a 2x2 normal matrix of optical flow equations (this matrix is called a spatial gradient matrix in [Bouguet00]_), divided by number of pixels in a window; if this value is less than ``minEigThreshold``, then a corresponding feature is filtered out and its flow is not processed, so it allows to remove bad points and get a performance boost.
|
||||
|
||||
The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See [Bouguet00]_. The function is parallelized with the TBB library.
|
||||
|
||||
@ -79,29 +79,29 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
|
||||
|
||||
.. ocv:pyfunction:: cv2.calcOpticalFlowFarneback(prev, next, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags[, flow]) -> flow
|
||||
|
||||
:param prev: First 8-bit single-channel input image.
|
||||
:param prev: first 8-bit single-channel input image.
|
||||
|
||||
:param next: Second input image of the same size and the same type as ``prev`` .
|
||||
:param next: second input image of the same size and the same type as ``prev``.
|
||||
|
||||
:param flow: Computed flow image that has the same size as ``prev`` and type ``CV_32FC2`` .
|
||||
:param flow: computed flow image that has the same size as ``prev`` and type ``CV_32FC2``.
|
||||
|
||||
:param pyr_scale: Parameter specifying the image scale (<1) to build pyramids for each image. ``pyr_scale=0.5`` means a classical pyramid, where each next layer is twice smaller than the previous one.
|
||||
:param pyr_scale: parameter, specifying the image scale (<1) to build pyramids for each image; ``pyr_scale=0.5`` means a classical pyramid, where each next layer is twice smaller than the previous one.
|
||||
|
||||
:param levels: Number of pyramid layers including the initial image. ``levels=1`` means that no extra layers are created and only the original images are used.
|
||||
:param levels: number of pyramid layers including the initial image; ``levels=1`` means that no extra layers are created and only the original images are used.
|
||||
|
||||
:param winsize: Averaging window size. Larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field.
|
||||
:param winsize: averaging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field.
|
||||
|
||||
:param iterations: Number of iterations the algorithm does at each pyramid level.
|
||||
:param iterations: number of iterations the algorithm does at each pyramid level.
|
||||
|
||||
:param poly_n: Size of the pixel neighborhood used to find polynomial expansion in each pixel. Larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field. Typically, ``poly_n`` =5 or 7.
|
||||
:param poly_n: size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically ``poly_n`` =5 or 7.
|
||||
|
||||
:param poly_sigma: Standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion. For ``poly_n=5`` , you can set ``poly_sigma=1.1`` . For ``poly_n=7`` , a good value would be ``poly_sigma=1.5`` .
|
||||
:param poly_sigma: standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for ``poly_n=5``, you can set ``poly_sigma=1.1``, for ``poly_n=7``, a good value would be ``poly_sigma=1.5``.
|
||||
|
||||
:param flags: Operation flags that can be a combination of the following:
|
||||
:param flags: operation flags that can be a combination of the following:
|
||||
|
||||
* **OPTFLOW_USE_INITIAL_FLOW** Use the input ``flow`` as an initial flow approximation.
|
||||
* **OPTFLOW_USE_INITIAL_FLOW** uses the input ``flow`` as an initial flow approximation.
|
||||
|
||||
* **OPTFLOW_FARNEBACK_GAUSSIAN** Use the Gaussian :math:`\texttt{winsize}\times\texttt{winsize}` filter instead of a box filter of the same size for optical flow estimation. Usually, this option gives z more accurate flow than with a box filter, at the cost of lower speed. Normally, ``winsize`` for a Gaussian window should be set to a larger value to achieve the same level of robustness.
|
||||
* **OPTFLOW_FARNEBACK_GAUSSIAN** uses the Gaussian :math:`\texttt{winsize}\times\texttt{winsize}` filter instead of a box filter of the same size for optical flow estimation; usually, this option gives z more accurate flow than with a box filter, at the cost of lower speed; normally, ``winsize`` for a Gaussian window should be set to a larger value to achieve the same level of robustness.
|
||||
|
||||
The function finds an optical flow for each ``prev`` pixel using the [Farneback2003]_ algorithm so that
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user