That is, ``Ptr<T> ptr`` incapsulates a pointer to a ``T`` instance and a reference counter associated with the pointer. See the
:ref:`Ptr`
:ocv:class:`Ptr`
description for details.
.. _AutomaticAllocation:
...
...
@@ -175,7 +175,8 @@ Multi-channel (``n``-channel) types can be specified using the following options
* ``CV_8UC(n)`` ... ``CV_64FC(n)`` or ``CV_MAKETYPE(CV_8U, n)`` ... ``CV_MAKETYPE(CV_64F, n)`` macros when the number of channels is more than 4 or unknown at the compilation time.
.. note:: ``CV_32FC1 == CV_32F``, ``CV_32FC2 == CV_32FC(2) == CV_MAKETYPE(CV_32F, 2)``, and ``CV_MAKETYPE(depth, n) == ((x&7)<<3) + (n-1)``. This means that the constant type is formed from the ``depth``, taking the lowest 3 bits, and the number of channels minus 1, taking the next ``log2(CV_CN_MAX)`` bits.
Examples::
Examples: ::
Mat mtx(3, 3, CV_32F); // make a 3x3 floating-point matrix
Mat cmtx(10, 1, CV_64FC2); // make a 10x1 2-channel floating-point
@@ -18,7 +18,7 @@ Computes an absolute value of each matrix element.
* ``C = abs(A)`` is equivalent to ``absdiff(A, Scalar::all(0), C)``
* ``C = Mat_<Vec<uchar,n> >(abs(A*alpha + beta))`` is equivalent to :ocv:funcx:`convertScaleAbs`(A, C, alpha, beta)`
* ``C = Mat_<Vec<uchar,n> >(abs(A*alpha + beta))`` is equivalent to :ocv:funcx:`convertScaleAbs` (A, C, alpha, beta)
The output matrix has the same size and the same type as the input one except for the last case, where ``C`` is ``depth=CV_8U`` .
...
...
@@ -2172,7 +2172,7 @@ PCA constructors
:param maxComponents: Maximum number of components that PCA should retain. By default, all the components are retained.
The default constructor initializes an empty PCA structure. The second constructor initializes the structure and calls
:ocv:func:`PCA::operator()` .
:ocv:func:`PCA::operator()` .
...
...
@@ -3114,7 +3114,7 @@ The constructors.
* **SVD::FULL_UV** When the matrix is not square, by default the algorithm produces ``u`` and ``vt`` matrices of sufficiently large size for the further ``A`` reconstruction. If, however, ``FULL_UV`` flag is specified, ``u`` and ``vt`` will be full-size square orthogonal matrices.
The first constructor initializes an empty ``SVD`` structure. The second constructor initializes an empty ``SVD`` structure and then calls
:ocv:func:`SVD::operator()` .
:ocv:func:`SVD::operator()` .
SVD::operator ()
...
...
@@ -3163,7 +3163,7 @@ Performs SVD of a matrix
:param flags: Opertion flags - see :ocv:func:`SVD::SVD`.
The methods/functions perform SVD of matrix. Unlike ``SVD::SVD`` constructor and ``SVD::operator()``, they store the results to the user-provided matrices. ::
The methods/functions perform SVD of matrix. Unlike ``SVD::SVD`` constructor and ``SVD::operator()``, they store the results to the user-provided matrices. ::
Mat A, w, u, vt;
SVD::compute(A, w, u, vt);
...
...
@@ -3231,7 +3231,7 @@ Calculates the sum of array elements.
:param xyzw: Output 4-channel floating-point image of the same size as ``disp`` . Each element of ``xyzw(x,y)`` contains 3D coordinates ``(x,y,z,1)`` of the point ``(x,y)`` , computed from the disparity map.
:param Q: :math:`4 \times 4` perspective transformation matrix that can be obtained via :ref:`StereoRectify` .
:param Q: :math:`4 \times 4` perspective transformation matrix that can be obtained via :ocv:func:`stereoRectify` .
:param stream: Stream for the asynchronous version.
@@ -115,17 +115,18 @@ By using ``FilterEngine_GPU`` instead of functions you can avoid unnecessary mem
.. note:: The GPU filters do not support the in-place mode.
.. seealso::
:ocv:class:`gpu::BaseRowFilter_GPU`,
:ocv:class:`gpu::BaseColumnFilter_GPU`,
:ocv:class:`gpu::BaseFilter_GPU`,
:ocv:func:`gpu::createFilter2D_GPU`,
:ocv:func:`gpu::createSeparableFilter_GPU`,
:ocv:func:`gpu::createBoxFilter_GPU`,
:ocv:func:`gpu::createMorphologyFilter_GPU`,
:ocv:func:`gpu::createLinearFilter_GPU`,
:ocv:func:`gpu::createSeparableLinearFilter_GPU`,
:ocv:func:`gpu::createDerivFilter_GPU`,
:ocv:func:`gpu::createGaussianFilter_GPU`
:ocv:class:`gpu::BaseRowFilter_GPU`,
:ocv:class:`gpu::BaseColumnFilter_GPU`,
:ocv:class:`gpu::BaseFilter_GPU`,
:ocv:func:`gpu::createFilter2D_GPU`,
:ocv:func:`gpu::createSeparableFilter_GPU`,
:ocv:func:`gpu::createBoxFilter_GPU`,
:ocv:func:`gpu::createMorphologyFilter_GPU`,
:ocv:func:`gpu::createLinearFilter_GPU`,
:ocv:func:`gpu::createSeparableLinearFilter_GPU`,
:ocv:func:`gpu::createDerivFilter_GPU`,
:ocv:func:`gpu::createGaussianFilter_GPU`
.. index:: gpu::createFilter2D_GPU
...
...
@@ -455,10 +456,12 @@ gpu::getLinearRowFilter_GPU
:param borderType: Pixel extrapolation method. For details, see :ocv:func:`borderInterpolate`. For details on limitations, see below.
There are two versions of the algorithm: NPP and OpenCV.
* NPP version is called when ``srcType == CV_8UC1`` or ``srcType == CV_8UC4`` and ``bufType == srcType`` . Otherwise, the OpenCV version is called. NPP supports only ``BORDER_CONSTANT`` border type and does not check indices outside the image.
* OpenCV version supports only ``CV_32F`` buffer depth and ``BORDER_REFLECT101``,``BORDER_REPLICATE``, and ``BORDER_CONSTANT`` border types. It checks indices outside the image.
See Also:,:ocv:func:`createSeparableLinearFilter` .
:param anchor: Anchor position within the kernel. Negative values mean that anchor is positioned at the aperture center.
:param rowBorderType, columnBorderType: Pixel extrapolation method in the horizontal and vertical directions For details, see :ocv:func:`borderInterpolate`. For details on limitations, see :ocv:func:`gpu::getLinearRowFilter_GPU`, cpp:ocv:func:`gpu::getLinearColumnFilter_GPU`.
:param rowBorderType: Pixel extrapolation method in the vertical direction For details, see :ocv:func:`borderInterpolate`. For details on limitations, see :ocv:func:`gpu::getLinearRowFilter_GPU`, cpp:ocv:func:`gpu::getLinearColumnFilter_GPU`.
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. For details, see :ocv:func:`getDerivKernels` .
:param rowBorderType, columnBorderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
:param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details.
:param rowBorderType, columnBorderType: Pixel extrapolation method. For details, see :ocv:func:`borderInterpolate` and :ocv:func:`Scharr` .
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
:param ksize: Gaussian kernel size. ``ksize.width`` and ``ksize.height`` can differ but they both must be positive and odd. If they are zeros, they are computed from ``sigmaX`` and ``sigmaY`` .
:param sigmaX, sigmaY: Gaussian kernel standard deviations in X and Y direction. If ``sigmaY`` is zero, it is set to be equal to ``sigmaX`` . If they are both 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 modification of all this semantics, you are recommended to specify all of ``ksize``, ``sigmaX``, and ``sigmaY`` .
: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 they are both 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 modification of all this semantics, you are recommended to specify all of ``ksize``, ``sigmaX``, and ``sigmaY`` .
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
:param rowBorderType, columnBorderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details.
:param columnBorderType: Pixel extrapolation method in the horizontal direction.
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
.. index:: gpu::meanShiftProc
gpu::meanShiftProc
----------------------
...
...
@@ -41,10 +41,9 @@ gpu::meanShiftProc
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
.. seealso::
:ocv:func:`gpu::meanShiftFiltering`
.. seealso:: :ocv:func:`gpu::meanShiftFiltering`
.. index:: gpu::meanShiftSegmentation
gpu::meanShiftSegmentation
------------------------------
...
...
@@ -64,7 +63,7 @@ gpu::meanShiftSegmentation
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
.. index:: gpu::integral
gpu::integral
-----------------
...
...
@@ -80,10 +79,9 @@ gpu::integral
:param sqsum: Squared integral image of the ``CV_32FC1`` type.
.. seealso::
:ocv:func:`integral`
.. seealso:: :ocv:func:`integral`
.. index:: gpu::sqrIntegral
gpu::sqrIntegral
--------------------
...
...
@@ -95,7 +93,7 @@ gpu::sqrIntegral
:param sqsum: Squared integral image containing 64-bit unsigned integer values packed into ``CV_64FC1`` .
.. index:: gpu::columnSum
gpu::columnSum
------------------
...
...
@@ -107,7 +105,7 @@ gpu::columnSum
:param sum: Destination image of the ``CV_32FC1`` type.
.. index:: gpu::cornerHarris
gpu::cornerHarris
---------------------
...
...
@@ -127,10 +125,9 @@ gpu::cornerHarris
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
.. seealso::
:ocv:func:`cornerHarris`
.. seealso:: :ocv:func:`cornerHarris`
.. index:: gpu::cornerMinEigenVal
gpu::cornerMinEigenVal
--------------------------
...
...
@@ -152,7 +149,7 @@ gpu::cornerMinEigenVal
.. seealso:: :ocv:func:`cornerMinEigenVal`
.. index:: gpu::mulSpectrums
gpu::mulSpectrums
---------------------
...
...
@@ -172,10 +169,9 @@ gpu::mulSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
.. seealso::
:ocv:func:`mulSpectrums`
.. seealso:: :ocv:func:`mulSpectrums`
.. index:: gpu::mulAndScaleSpectrums
gpu::mulAndScaleSpectrums
-----------------------------
...
...
@@ -197,10 +193,9 @@ gpu::mulAndScaleSpectrums
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
.. seealso::
:ocv:func:`mulSpectrums`
.. seealso:: :ocv:func:`mulSpectrums`
.. index:: gpu::dft
gpu::dft
------------
...
...
@@ -236,10 +231,9 @@ gpu::dft
*
If the source matrix is real (its type is ``CV_32FC1`` ), forward DFT is performed. The result of the DFT is packed into complex ( ``CV_32FC2`` ) matrix. So, the width of the destination matrix is ``dft_size.width / 2 + 1`` . But if the source is a single column, the height is reduced instead of the width.
.. seealso::
:ocv:func:`dft`
.. seealso:: :ocv:func:`dft`
.. index:: gpu::convolve
gpu::convolve
-----------------
...
...
@@ -259,7 +253,7 @@ gpu::convolve
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
.. index:: gpu::ConvolveBuf
gpu::ConvolveBuf
----------------
...
...
@@ -280,7 +274,7 @@ Class providing a memory buffer for the :ocv:func:`gpu::convolve` function.
};
.. index:: gpu::ConvolveBuf::ConvolveBuf
gpu::ConvolveBuf::ConvolveBuf
---------------------------------
...
...
@@ -294,7 +288,7 @@ gpu::ConvolveBuf::ConvolveBuf
Constructs a buffer for the
:ocv:func:`convolve` function with respective arguments.
.. index:: gpu::matchTemplate
gpu::matchTemplate
----------------------
...
...
@@ -324,10 +318,9 @@ gpu::matchTemplate
* ``CV_TM_SQDIFF``
* ``CV_TM_CCORR``
.. seealso::
:ocv:func:`matchTemplate`
.. seealso:: :ocv:func:`matchTemplate`
.. index:: gpu::remap
gpu::remap
--------------
...
...
@@ -351,10 +344,9 @@ The function transforms the source image using the specified map:
Values of pixels with non-integer coordinates are computed using the bilinear interpolation.
.. seealso::
:ocv:func:`remap`
.. seealso:: :ocv:func:`remap`
.. index:: gpu::cvtColor
gpu::cvtColor
-----------------
...
...
@@ -376,10 +368,9 @@ gpu::cvtColor
3-channel color spaces (like ``HSV``, ``XYZ``, and so on) can be stored in a 4-channel image for better perfomance.
.. seealso::
:ocv:func:`cvtColor`
.. seealso:: :ocv:func:`cvtColor`
.. index:: gpu::threshold
gpu::threshold
------------------
...
...
@@ -401,10 +392,9 @@ gpu::threshold
:param stream: Stream for the asynchronous version.
.. seealso::
:ocv:func:`threshold`
.. seealso:: :ocv:func:`threshold`
.. index:: gpu::resize
gpu::resize
---------------
...
...
@@ -439,7 +429,7 @@ gpu::resize
.. seealso:: :ocv:func:`resize`
.. index:: gpu::warpAffine
gpu::warpAffine
-------------------
...
...
@@ -457,10 +447,9 @@ gpu::warpAffine
:param flags: Combination of interpolation methods (see :ocv:func:`resize`) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is an inverse transformation (``dst=>src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
.. seealso::
:ocv:func:`warpAffine`
.. seealso:: :ocv:func:`warpAffine`
.. index:: gpu::warpPerspective
gpu::warpPerspective
------------------------
...
...
@@ -478,10 +467,9 @@ gpu::warpPerspective
:param flags: Combination of interpolation methods (see :ocv:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is the inverse transformation (``dst => src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
.. seealso::
:ocv:func:`warpPerspective`
.. seealso:: :ocv:func:`warpPerspective`
.. index:: gpu::rotate
gpu::rotate
---------------
...
...
@@ -503,10 +491,9 @@ gpu::rotate
:param interpolation: Interpolation method. Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` are supported.
.. seealso::
:ocv:func:`gpu::warpAffine`
.. seealso:: :ocv:func:`gpu::warpAffine`
.. index:: gpu::copyMakeBorder
gpu::copyMakeBorder
-----------------------
...
...
@@ -518,14 +505,19 @@ gpu::copyMakeBorder
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
:param top, bottom, left, right: Number of pixels in each direction from the source image rectangle to extrapolate. For example: ``top=1, bottom=1, left=1, right=1`` mean that 1 pixel-wide border needs to be built.
:param top:
:param bottom:
:param left:
:param right: Number of pixels in each direction from the source image rectangle to extrapolate. For example: ``top=1, bottom=1, left=1, right=1`` mean that 1 pixel-wide border needs to be built.
:param value: Border value.
.. seealso::
:ocv:func:`copyMakeBorder`
.. seealso:: :ocv:func:`copyMakeBorder`
.. index:: gpu::rectStdDev
gpu::rectStdDev
-------------------
...
...
@@ -541,7 +533,7 @@ gpu::rectStdDev
:param rect: Rectangular window.
.. index:: gpu::evenLevels
gpu::evenLevels
-------------------
...
...
@@ -557,13 +549,11 @@ gpu::evenLevels
:param upperLevel: Upper boundary value of the greatest level.
.. index:: gpu::histEven
gpu::histEven
-----------------
.. ocv:function:: void gpu::histEven(const GpuMat& src, GpuMat& hist, int histSize, int lowerLevel, int upperLevel)
.. ocv:function:: void gpu::histEven(const GpuMat& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4])
:param image: Input 8-bit or floating-point 32-bit, single-channel image.
...
...
@@ -266,12 +268,14 @@ The function can be used to initialize a point-based tracker of an object.
**Note**: If the function is called with different values ``A`` and ``B`` of the parameter ``qualityLevel`` , and ``A`` > {B}, the vector of returned corners with ``qualityLevel=A`` will be the prefix of the output vector with ``qualityLevel=B`` .
See Also: :ocv:func:`cornerMinEigenVal`,
:ocv:func:`cornerHarris`,
:ocv:func:`calcOpticalFlowPyrLK`,
:ocv:func:`estimateRigidMotion`,
:ocv:func:`PlanarObjectDetector`,
:ocv:func:`OneWayDescriptor`
.. seealso::
:ocv:func:`cornerMinEigenVal`,
:ocv:func:`cornerHarris`,
:ocv:func:`calcOpticalFlowPyrLK`,
:ocv:func:`estimateRigidMotion`,
:ocv:func:`PlanarObjectDetector`,
:ocv:func:`OneWayDescriptor`
...
...
@@ -336,10 +340,10 @@ The function finds circles in a grayscale image using a modification of the Houg
**Note**: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( ``minRadius`` and ``maxRadius`` ) if you know it. Or, you may ignore the returned radius, use only the center, and find the correct radius using an additional procedure.
@@ -145,9 +145,7 @@ The functions ``calcBackProject`` calculate the back project of the histogram. T
This is an approximate algorithm of the
:ocv:func:`CAMShift` color object tracker.
See Also:
:ocv:func:`calcHist`
.. seealso:: :ocv:func:`calcHist`
compareHist
...
...
@@ -312,7 +310,7 @@ Locates a template within an image by using a histogram comparison.
:param hist: Histogram
:param method: Comparison method, passed to :ref:`CompareHist` (see description of that function)
:param method: Comparison method, passed to :ocv:cfunc:`CompareHist` (see description of that function)
:param factor: Normalization factor for histograms, will affect the normalization scale of the destination image, pass 1 if unsure
...
...
@@ -419,7 +417,11 @@ Returns a pointer to the histogram bin.
:param hist: Histogram
:param idx0, idx1, idx2, idx3: Indices of the bin
:param idx0: 0-th index
:param idx1: 1-st index
:param idx2: 2-nd index
:param idx: Array of indices
...
...
@@ -474,9 +476,9 @@ Makes a histogram out of an array.
:param data: Array that will be used to store histogram bins
:param ranges: Histogram bin ranges, see :ref:`CreateHist`
:param ranges: Histogram bin ranges, see :ocv:cfunc:`CreateHist`
:param uniform: Uniformity flag, see :ref:`CreateHist`
:param uniform: Uniformity flag, see :ocv:cfunc:`CreateHist`
The function initializes the histogram, whose header and bins are allocated by the user. :ocv:cfunc:`ReleaseHist` does not need to be called afterwards. Only dense histograms can be initialized this way. The function returns ``hist``.
...
...
@@ -510,7 +512,11 @@ Queries the value of the histogram bin.
:param hist: Histogram
:param idx0, idx1, idx2, idx3: Indices of the bin
:param idx0: 0-th index
:param idx1: 1-st index
:param idx2: 2-nd index
:param idx: Array of indices
...
...
@@ -535,9 +541,9 @@ Sets the bounds of the histogram bins.
:param hist: Histogram
:param ranges: Array of bin ranges arrays, see :ref:`CreateHist`
:param ranges: Array of bin ranges arrays, see :ocv:cfunc:`CreateHist`
:param uniform: Uniformity flag, see :ref:`CreateHist`
:param uniform: Uniformity flag, see :ocv:cfunc:`CreateHist`
The function is a stand-alone function for setting bin ranges in the histogram. For a more detailed description of the parameters ``ranges`` and ``uniform`` see the :ocv:cfunc:`CalcHist` function, that can initialize the ranges as well. Ranges for the histogram bins must be set before the histogram is calculated or the backproject of the histogram is calculated.
...
...
@@ -580,5 +586,4 @@ between the calculated minimum and maximum distances are incremented
.. [RubnerSept98] Y. Rubner. C. Tomasi, L.J. Guibas. The Earth Mover’s Distance as a Metric for Image Retrieval. Technical Report STAN-CS-TN-98-86, Department of Computer Science, Stanford University, September 1998.
.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. Comparison of Combined Shape Descriptors for Irregular Objects, 8th British Machine Vision Conference, BMVC'97.
.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. Comparison of Combined Shape Descriptors for Irregular Objects, 8th British Machine Vision Conference, BMVC'97. http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html
Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on. Various modes of the function are demonstrated in the ``floodfill.cpp`` sample.
See Also:
:ocv:func:`findContours`
.. seealso:: :ocv:func:`findContours`
...
...
@@ -743,13 +741,13 @@ Currently, Otsu's method is implemented only for 8-bit images.
.. image:: pics/threshold.png
See Also:
:ocv:func:`adaptiveThreshold`,
:ocv:func:`findContours`,
:ocv:func:`compare`,
:ocv:func:`min`,
:ocv:func:`max`
.. seealso::
:ocv:func:`adaptiveThreshold`,
:ocv:func:`findContours`,
:ocv:func:`compare`,
:ocv:func:`min`,
:ocv:func:`max`
watershed
...
...
@@ -787,9 +785,7 @@ example, when such tangent components exist in the initial
marker image. Visual demonstration and usage example of the function
can be found in the OpenCV samples directory (see the ``watershed.cpp`` demo).
See Also:
:ocv:func:`findContours`
.. seealso:: :ocv:func:`findContours`
grabCut
...
...
@@ -814,7 +810,9 @@ Runs the GrabCut algorithm.
:param rect: ROI containing a segmented object. The pixels outside of the ROI are marked as "obvious background". The parameter is only used when ``mode==GC_INIT_WITH_RECT`` .
:param bgdModel, fgdModel: Temporary arrays used for segmentation. Do not modify them while you are processing the same image.
:param bgdModel: Temporary array for the background model. Do not modify it while you are processing the same image.
:param fgdModel: Temporary arrays for the foreground model. Do not modify it while you are processing the same image.
:param iterCount: Number of iterations the algorithm should make before returning the result. Note that the result can be refined with further calls with ``mode==GC_INIT_WITH_MASK`` or ``mode==GC_EVAL`` .
@@ -77,9 +77,10 @@ The moments of a contour are defined in the same way but computed using Green's
http://en.wikipedia.org/wiki/Green_theorem
). So, due to a limited raster resolution, the moments computed for a contour are slightly different from the moments computed for the same rasterized contour.
These values are proved to be invariants to the image scale, rotation, and reflection except the seventh one, whose sign is changed by reflection. This invariance is proved with the assumption of infinite image resolution. In case of raster images, the computed Hu invariants for the original and transformed images are a bit different.
See Also:
:ocv:func:`matchShapes`
.. seealso:: :ocv:func:`matchShapes`
findContours
...
...
@@ -286,7 +286,7 @@ Approximates Freeman chain(s) with a polygonal curve.
:param storage: Storage location for the resulting polylines
:param method: Approximation method (see the description of the function :ref:`FindContours` )
:param method: Approximation method (see the description of the function :ocv:cfunc:`FindContours` )
:param parameter: Method parameter (not used now)
...
...
@@ -469,7 +469,9 @@ Fits a line to a 2D or 3D point set.
:param param: Numerical parameter ( ``C`` ) for some types of distances. If it is 0, an optimal value is chosen.
:param reps, aeps: Sufficient accuracy for the radius (distance between the coordinate origin and the line) and angle, respectively. 0.01 would be a good default value for both.
:param reps: Sufficient accuracy for the radius (distance between the coordinate origin and the line).
:param aeps: Sufficient accuracy for the angle. 0.01 would be a good default value for ``reps`` and ``aeps``.
The function ``fitLine`` fits a line to a 2D or 3D point set by minimizing
@@ -78,7 +78,7 @@ The structure represents a possible decision tree node split. It has public memb
Pointer to the next split in the node list of splits.
.. ocv:member:: int subset[2]
.. ocv:member:: int[] subset
Bit array indicating the value subset in case of split on a categorical variable. The rule is:
...
...
@@ -90,9 +90,7 @@ The structure represents a possible decision tree node split. It has public memb
.. ocv:member:: float ord.c
The threshold value in case of split on an ordered variable. The rule is:
::
The threshold value in case of split on an ordered variable. The rule is: ::
if var_value < c
then next_node<-left
...
...
@@ -125,7 +123,7 @@ The structure represents a node in a decision tree. It has public members:
Pointer to the parent node.
.. ocv:mebmer:: CvDTreeNode* left
.. ocv:member:: CvDTreeNode* left
Pointer to the left child node.
...
...
@@ -137,7 +135,7 @@ The structure represents a node in a decision tree. It has public members:
Pointer to the first (primary) split in the node list of splits.
.. ocv:mebmer:: int sample_count
.. ocv:member:: int sample_count
The number of samples that fall into the node at the training stage. It is used to resolve the difficult cases - when the variable for the primary split is missing and all the variables for other surrogate splits are missing too. In this case the sample is directed to the left if ``left->sample_count > right->sample_count`` and to the right otherwise.
@@ -205,10 +205,10 @@ In case of point sets, the problem is formulated as follows: you need to find a
when ``fullAffine=false`` .
.. seealso::
:ocv:func:`getAffineTransform`,
:ocv:func:`getPerspectiveTransform`,
:ocv:func:`findHomography`
:ocv:func:`getAffineTransform`,
:ocv:func:`getPerspectiveTransform`,
:ocv:func:`findHomography`
...
...
@@ -242,14 +242,10 @@ That is, MHI pixels where the motion occurs are set to the current ``timestamp``
The function, together with
:ocv:func:`calcMotionGradient` and
:ocv:func:`calcGlobalOrientation` , implements a motion templates technique described in
[Davis97]_
and
[Bradski00]_
.
[Davis97]_ and [Bradski00]_.
See also the OpenCV sample ``motempl.c`` that demonstrates the use of all the motion template functions.
calcMotionGradient
----------------------
Calculates a gradient orientation of a motion history image.
...
...
@@ -267,7 +263,9 @@ Calculates a gradient orientation of a motion history image.
:param orientation: Output motion gradient orientation image that has the same type and the same size as ``mhi`` . Each pixel of the image is a motion orientation, from 0 to 360 degrees.
:param delta1, delta2: Minimum and maximum allowed difference between ``mhi`` values within a pixel neighorhood. That is, the function finds the minimum ( :math:`m(x,y)` ) and maximum ( :math:`M(x,y)` ) ``mhi`` values over :math:`3 \times 3` neighborhood of each pixel and marks the motion orientation at :math:`(x, y)` as valid only if
:param delta1: Minimal (or maximal) allowed difference between ``mhi`` values within a pixel neighorhood.
:param delta2: Maximal (or minimal) allowed difference between ``mhi`` values within a pixel neighorhood. That is, the function finds the minimum ( :math:`m(x,y)` ) and maximum ( :math:`M(x,y)` ) ``mhi`` values over :math:`3 \times 3` neighborhood of each pixel and marks the motion orientation at :math:`(x, y)` as valid only if
.. math::
...
...
@@ -354,6 +352,7 @@ Finds an object center, size, and orientation.