:param pptr: Double pointer to the allocated buffer
The function deallocates the buffer allocated with :ocv:func:`fastMalloc` . If NULL pointer is passed, the function does nothing. C version of the function clears the pointer *pptr to avoid problems with double memory deallocation.
The function deallocates the buffer allocated with :ocv:func:`fastMalloc` . If NULL pointer is passed, the function does nothing. C version of the function clears the pointer ``*pptr`` to avoid problems with double memory deallocation.
.. ocv:function:: BOWKMeansTrainer::BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(), int attempts=3, int flags=KMEANS_PP_CENTERS );
.. ocv:function:: BOWKMeansTrainer::BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(), int attempts=3, int flags=KMEANS_PP_CENTERS )
@@ -24,6 +24,7 @@ Applies an adaptive threshold to an array.
:param adaptiveMethod: Adaptive thresholding algorithm to use, ``ADAPTIVE_THRESH_MEAN_C`` or ``ADAPTIVE_THRESH_GAUSSIAN_C`` . See the details below.
:param thresholdType: Thresholding type that must be either ``THRESH_BINARY`` or ``THRESH_BINARY_INV`` .
:param blockSize: Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.
:param C: Constant subtracted from the mean or weighted mean (see the details below). Normally, it is positive but may be zero or negative as well.
...
...
@@ -88,8 +89,8 @@ Converts an image from one color space to another.
: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 transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR).
Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green and the third byte will be Red. The fourth, fifth and sixth bytes would then be the 2nd pixel (Blue then Green then Red) and so on.
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).
Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.
The conventional ranges for R, G, and B channel values are:
...
...
@@ -104,12 +105,12 @@ The conventional ranges for R, G, and B channel values are:
In case of linear transformations, the range does not matter.
But in case of a non-linear transformation, an input RGB image should be normalized to the proper value range to get the correct results, for example, for RGB
:math:`\rightarrow` L*u*v* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range, instead of 0..1 assumed by the function. So, before calling ``cvtColor`` , you need first to scale the image down: ::
:math:`\rightarrow` L*u*v* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range instead of 0..1 assumed by the function. So, before calling ``cvtColor`` , you need first to scale the image down: ::
img *= 1./255;
cvtColor(img, img, CV_BGR2Luv);
If you use ``cvtColor`` with 8-bit images then conversion will have lost some information. For many applications this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back.
If you use ``cvtColor`` with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back.
The function can do the following transformations:
...
...
@@ -522,7 +523,7 @@ The functions ``floodFill`` fill a connected component starting from the seed po
:math:`src(x',y')` is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
*
Color/brightness of one of its neighbors that already belong to the connected component in case of floating range.
Color/brightness of one of its neighbors that already belong to the connected component in case of a floating range.
*
Color/brightness of the seed point in case of fixed range.
Color/brightness of the seed point in case of a fixed range.
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.
...
...
@@ -638,13 +639,13 @@ Calculates the integral of an image.
: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 will be :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 will be :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``.
The functions calculate one or more integral images for the source image as following:
The functions calculate one or more integral images for the source image as follows:
.. math::
...
...
@@ -658,7 +659,7 @@ The functions calculate one or more integral images for the source image as foll
Using these integral images, you can calculate sum, mean and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:
Using these integral images, you can calculate sa um, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:
.. math::
...
...
@@ -685,7 +686,7 @@ Applies a fixed-level threshold to each array element.
:param src: Source array (single-channel, 8-bit of 32-bit floating point)
:param src: Source array (single-channel, 8-bit of 32-bit floating point).
:param dst: Destination array of the same size and type as ``src`` .
...
...
@@ -735,9 +736,9 @@ types of thresholding supported by the function. They are determined by ``thresh
Also, the special value ``THRESH_OTSU`` may be combined with
one of the above values. In this case, the function determines the optimal threshold
value using Otsu's algorithm and uses it instead of the specified ``thresh`` .
value using the Otsu's algorithm and uses it instead of the specified ``thresh`` .
The function returns the computed threshold value.
Currently, Otsu's method is implemented only for 8-bit images.
Currently, the Otsu's method is implemented only for 8-bit images.
.. image:: pics/threshold.png
...
...
@@ -822,15 +823,15 @@ Runs the GrabCut algorithm.
* **GC_INIT_WITH_MASK** The function initializes the state using the provided mask. Note that ``GC_INIT_WITH_RECT`` and ``GC_INIT_WITH_MASK`` can be combined. Then, all the pixels outside of the ROI are automatically initialized with ``GC_BGD`` .
* **GC_EVAL** The value means that algorithm should just resume.
* **GC_EVAL** The value means that the algorithm should just resume.
The function implements the `GrabCut image segmentation algorithm <http://en.wikipedia.org/wiki/GrabCut>`_.
See the sample grabcut.cpp to learn how to use the function.
See the sample ``grabcut.cpp`` to learn how to use the function.
.. [Borgefors86] Borgefors, Gunilla, “Distance transformations in digital images”. Comput. Vision Graph. Image Process. 34 3, pp 344–371 (1986)
.. [Borgefors86] Borgefors, Gunilla, *Distance transformations in digital images*. Comput. Vision Graph. Image Process. 34 3, pp 344–371 (1986)
.. [Felzenszwalb04] Felzenszwalb, Pedro F. and Huttenlocher, Daniel P. “Distance Transforms of Sampled Functions”, TR2004-1963, TR2004-1963 (2004)
.. [Felzenszwalb04] Felzenszwalb, Pedro F. and Huttenlocher, Daniel P. *Distance Transforms of Sampled Functions*, TR2004-1963, TR2004-1963 (2004)
.. [Meyer92] Meyer, F. “Color image segmentation”, ICIP92, 1992
.. [Meyer92] Meyer, F. *Color Image Segmentation*, ICIP92, 1992
.. [Telea04] Alexandru Telea, “An Image Inpainting Technique Based on the Fast Marching Method”. Journal of Graphics, GPU, and Game Tools 9 1, pp 23-34 (2004)
.. [Telea04] Alexandru Telea, *An Image Inpainting Technique Based on the Fast Marching Method*. Journal of Graphics, GPU, and Game Tools 9 1, pp 23-34 (2004)
:param rect: Rectangle that includes all of the 2d points that are to be added to the subdivision
:param rect: Rectangle that includes all of the 2D points that are to be added to the subdivision.
:param storage: Container for subdivision
:param storage: Container for the subdivision.
The function creates an empty Delaunay
subdivision, where 2d points can be added using the function
subdivision where 2D points can be added using the function
:ocv:cfunc:`SubdivDelaunay2DInsert`
. All of the points to be added must be within
the specified rectangle, otherwise a runtime error will be raised.
the specified rectangle, otherwise a runtime error is raised.
Note that the triangulation is a single large triangle that covers the given rectangle. Hence the three vertices of this triangle are outside the rectangle
``rect``
...
...
@@ -164,14 +163,14 @@ Note that the triangulation is a single large triangle that covers the given rec
FindNearestPoint2D
------------------
Finds the closest subdivision vertex to the given point.
Finds the subdivision vertex closest to the given point.
.. ocv:pyoldfunction:: cv.SubdivDelaunay2DInsert(subdiv, pt)-> point
:param subdiv: Delaunay subdivision created by the function :ocv:cfunc:`CreateSubdivDelaunay2D`
:param subdiv: Delaunay subdivision created by the function :ocv:cfunc:`CreateSubdivDelaunay2D`.
:param pt: Inserted point
:param pt: Inserted point.
The function inserts a single point into a subdivision and modifies the subdivision topology appropriately. If a point with the same coordinates exists already, no new point is added. The function returns a pointer to the allocated point. No virtual point coordinates are calculated at this stage.
@@ -18,9 +18,9 @@ Calculates all of the moments up to the third order of a polygon or rasterized s
:param binaryImage: If it is true, all non-zero image pixels are treated as 1's. The parameter is used for images only.
:param moments: The output moments
:param moments: Output moments.
The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The results are returned in a structure ``Moments``, defined as: ::
The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The results are returned in the structure ``Moments`` defined as: ::
class Moments
{
...
...
@@ -31,16 +31,13 @@ The function computes moments, up to the 3rd order, of a vector shape or a raste
Moments( const CvMoments& moments );
operator CvMoments() const;
..
In case of a raster image, the spatial moments :math:`\texttt{Moments::m}_{ji}` are computed as:
:math:`\texttt{Moments::nu}_{ij}` are computed as:
.. math::
...
...
@@ -66,7 +63,7 @@ and the normalized central moments
:math:`\texttt{nu}_{00}=1`
:math:`\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0` , hence the values are not stored.
The moments of a contour are defined in the same way but computed using Green's formula
The moments of a contour are defined in the same way but computed using the Green's formula
(see
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.
.. ocv:function:: void HuMoments( const Moments& moments, double* hu )
...
...
@@ -93,7 +90,7 @@ Calculates the seven Hu invariants.
:param moments: Input moments computed with :ocv:func:`moments` .
:param hu: Output Hu invariants.
The function calculates the seven Hu invariants (introduced in [Hu62]_; see also
The function calculates seven Hu invariants (introduced in [Hu62]_; see also
http://en.wikipedia.org/wiki/Image_moment) defined as:
.. math::
...
...
@@ -187,7 +184,7 @@ Draws contours outlines or filled contours.
The function draws contour outlines in the image if
:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if
:math:`\texttt{thickness}<0` . Here is the example on how to retrieve connected components from the binary image and label them: ::
:math:`\texttt{thickness}<0` . The example below shows how to retrieve connected components from the binary image and label them: ::
#include "cv.h"
#include "highgui.h"
...
...
@@ -240,15 +237,15 @@ Approximates a polygonal curve(s) with the specified precision.
.. ocv:cfunction:: CvSeq* cvApproxPoly( const void* curve, int headerSize, CvMemStorage* storage, int method, double epsilon, int recursive=0 )
:param curve: Input vector of 2d point, stored in:
:param curve: Input vector of a 2D point stored in:
* ``std::vector`` or ``Mat`` (C++ interface)
* ``Nx2`` numpy array (Python interface).
* ``Nx2`` numpy array (Python interface)
* ``CvSeq`` or `` ``CvMat`` (C interface)
:param approxCurve: Result of the approximation. The type should match the type of the input curve. In the case of C interface the approximated curve is stored in the memory storage and pointer to it is returned.
:param approxCurve: Result of the approximation. The type should match the type of the input curve. In case of C interface the approximated curve is stored in the memory storage and pointer to it is returned.
:param epsilon: Parameter specifying the approximation accuracy. This is the maximum distance between the original curve and its approximation.
...
...
@@ -256,16 +253,16 @@ Approximates a polygonal curve(s) with the specified precision.
:param headerSize: Header size of the approximated curve. Normally, ``sizeof(CvContour)`` is used.
:param storage: Memory storage where the approximated curve will be stored.
:param storage: Memory storage where the approximated curve is stored.
:param method: The contour approximation algorithm. Only ``CV_POLY_APPROX_DP`` is supported.
:param method: Contour approximation algorithm. Only ``CV_POLY_APPROX_DP`` is supported.
:param recursive: The recursion flag. If it is non-zero and ``curve`` is ``CvSeq*``, the function ``cvApproxPoly`` will approximate all the contours accessible from ``curve`` by ``h_next`` and ``v_next`` links.
:param recursive: Recursion flag. If it is non-zero and ``curve`` is ``CvSeq*``, the function ``cvApproxPoly`` approximates all the contours accessible from ``curve`` by ``h_next`` and ``v_next`` links.
The functions ``approxPolyDP`` approximate a curve or a polygon with another curve/polygon with less vertices, so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm
The functions ``approxPolyDP`` approximate a curve or a polygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm
:param chain: Pointer to the approximated Freeman chain that can refer to other chains
:param chain: Pointer to the approximated Freeman chain that can refer to other chains.
:param storage: Storage location for the resulting polylines
:param storage: Storage location for the resulting polylines.
:param method: Approximation method (see the description of the function :ocv:cfunc:`FindContours` )
:param method: Approximation method (see the description of the function :ocv:cfunc:`FindContours` ).
:param parameter: Method parameter (not used now)
:param parameter: Method parameter (not used now).
:param minimalPerimeter: Approximates only those contours whose perimeters are not less than ``minimal_perimeter`` . Other chains are removed from the resulting structure
:param minimalPerimeter: Approximates only those contours whose perimeters are not less than ``minimal_perimeter`` . Other chains are removed from the resulting structure.
:param recursive: Recursion flag. If it is non-zero, the function approximates all chains that can be obtained to from ``chain`` by using the ``h_next`` or ``v_next`` links. Otherwise, the single input chain is approximated.
:param recursive: Recursion flag. If it is non-zero, the function approximates all chains that can be obtained from ``chain`` by using the ``h_next`` or ``v_next`` links. Otherwise, the single input chain is approximated.
This is a stand-alone contour approximation routine, not represented in the new interface. When :ocv:cfunc:`FindContours` retrieves contours as Freeman chains, it calls to the function to get approximated contours, represented as polygons.
This is a standalone contour approximation routine, not represented in the new interface. When :ocv:cfunc:`FindContours` retrieves contours as Freeman chains, it calls the function to get approximated contours, represented as polygons.
:param contour: Input vector of 2d points (contour vertices), stored in ``std::vector`` or ``Mat``.
:param orientation: Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking sign of the area. By default the parameter is ``false``, which means that the absolute value is returned.
:param contour: Input vector of 2D points (contour vertices), stored in ``std::vector`` or ``Mat``.
:param orientation: Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking the sign of an area. By default, the parameter is ``false``, which means that the absolute value is returned.
The function computes a contour area. Similarly to
:ocv:func:`moments` , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
:ocv:func:`drawContours` or
:ocv:func:`fillPoly` , can be different.
Here is a short example: ::
Example: ::
vector<Point> contour;
contour.push_back(Point2f(0, 0));
...
...
@@ -379,15 +377,15 @@ Finds the convex hull of a point set.
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
:param hull: Output convex hull. It is either an integer vector of indices or vector of points. In the first case the ``hull`` elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case ``hull`` elements will be the convex hull points themselves.
:param hull: Output convex hull. It is either an integer vector of indices or vector of points. In the first case, the ``hull`` elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case, ``hull`` elements aree the convex hull points themselves.
:param storage: The output memory storage in the old API (``cvConvexHull2`` returns a sequence containing the convex hull points or their indices).
:param storage: Output memory storage in the old API (``cvConvexHull2`` returns a sequence containing the convex hull points or their indices).
:param clockwise: Orientation flag. If true, the output convex hull will be oriented clockwise. Otherwise, it will be oriented counter-clockwise. The usual screen coordinate system is assumed where the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.
:param clockwise: Orientation flag. If it is true, the output convex hull is oriented clockwise. Otherwise, it is oriented counter-clockwise. The usual screen coordinate system is assumed so that the origin is at the top-left corner, x axis is oriented to the right, and y axis is oriented downwards.
:param orientation: Convex hull orientation parameter in the old API, ``CV_CLOCKWISE`` or ``CV_COUNTERCLOCKWISE``.
:param returnPoints: Operation flag. In the case of matrix, when the flag is true, the function will return convex hull points, otherwise it will return indices of the convex hull points. When the output array is ``std::vector``, the flag is ignored, and the output depends on the type of the vector - ``std::vector<int>`` implies ``returnPoints=true``, ``std::vector<Point>`` implies ``returnPoints=false``.
:param returnPoints: Operation flag. In case of a matrix, when the flag is true, the function returns convex hull points. Otherwise, it returns indices of the convex hull points. When the output array is ``std::vector``, the flag is ignored, and the output depends on the type of the vector: ``std::vector<int>`` implies ``returnPoints=true``, ``std::vector<Point>`` implies ``returnPoints=false``.
The functions find the convex hull of a 2D point set using the Sklansky's algorithm
[Sklansky82]_
...
...
@@ -403,11 +401,11 @@ Finds the convexity defects of a contour.
:param convexhull: Convex hull obtained using :ocv:cfunc:`ConvexHull2` that should contain pointers or indices to the contour points, not the hull points themselves (the ``returnPoints`` parameter in :ocv:cfunc:`ConvexHull2` should be 0)
:param convexhull: Convex hull obtained using :ocv:cfunc:`ConvexHull2` that should contain pointers or indices to the contour points, not the hull points themselves (the ``returnPoints`` parameter in :ocv:cfunc:`ConvexHull2` should be zero).
:param storage: Container for the output sequence of convexity defects. If it is NULL, the contour or hull (in that order) storage is used
:param storage: Container for the output sequence of convexity defects. If it is NULL, the contour or hull (in that order) storage is used.
The function finds all convexity defects of the input contour and returns a sequence of the ``CvConvexityDefect`` structures, where ``CvConvexityDetect`` is defined as: ::
...
...
@@ -419,7 +417,7 @@ The function finds all convexity defects of the input contour and returns a sequ
float depth; // distance between the farthest point and the convex hull
};
Here is the picture displaying convexity defects of a hand contour:
The figure below displays convexity defects of a hand contour:
.. image:: pics/defects.png
...
...
@@ -434,15 +432,15 @@ Fits an ellipse around a set of 2D points.
The function calculates the ellipse that fits (in least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The algorithm [Fitzgibbon95]_ is used.
The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The algorithm [Fitzgibbon95]_ is used.
fitLine
-----------
...
...
@@ -457,9 +455,9 @@ Fits a line to a 2D or 3D point set.
:param points: Input vector of 2D or 3D points, stored in ``std::vector<>`` or ``Mat``.
:param line: Output line parameters. In case of 2D fitting it should be a vector of 4 elements (like ``Vec4f``) - ``(vx, vy, x0, y0)``, where ``(vx, vy)`` is a normalized vector collinear to the line and ``(x0, y0)`` is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like ``Vec6f``) - ``(vx, vy, vz, x0, y0, z0)``, where ``(vx, vy, vz)`` is a normalized vector collinear to the line and ``(x0, y0, z0)`` is a point on the line.
:param line: Output line parameters. In case of 2D fitting, it should be a vector of 4 elements (like ``Vec4f``) - ``(vx, vy, x0, y0)``, where ``(vx, vy)`` is a normalized vector collinear to the line and ``(x0, y0)`` is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like ``Vec6f``) - ``(vx, vy, vz, x0, y0, z0)``, where ``(vx, vy, vz)`` is a normalized vector collinear to the line and ``(x0, y0, z0)`` is a point on the line.
:param distType: Distance used by the M-estimator (see the discussion).
:param distType: Distance used by the M-estimator (see the discussion below).
:param param: Numerical parameter ( ``C`` ) for some types of distances. If it is 0, an optimal value is chosen.
...
...
@@ -471,7 +469,7 @@ The function ``fitLine`` fits a line to a 2D or 3D point set by minimizing
:math:`\sum_i \rho(r_i)` where
:math:`r_i` is a distance between the
:math:`i^{th}` point, the line and
:math:`\rho(r)` is a distance function, one of:
:math:`\rho(r)` is a distance function, one of the following:
* distType=CV\_DIST\_L2
...
...
@@ -528,9 +526,9 @@ Tests a contour convexity.
.. ocv:cfunction:: int cvCheckContourConvexity( const CvArr* contour )
.. ocv:pyoldfunction:: cv.CheckContourConvexity(contour)-> int
:param contour: The input vector of 2D points, stored in:
:param contour: Input vector of 2D points, stored in:
* ``std::vector<>`` or ``Mat`` (C++ interface).
* ``std::vector<>`` or ``Mat`` (C++ interface)
* ``CvSeq*`` or ``CvMat*`` (C interface)
...
...
@@ -552,9 +550,9 @@ Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
or ``CV_CONTOURS_MATCH_I3`` (see the details below).
...
...
@@ -672,16 +670,16 @@ is +1, -1, and 0, respectively. Otherwise, the return value
is a signed distance between the point and the nearest contour
edge.
Here is a sample output of the function where each image pixel is tested against the contour.
See below a sample output of the function where each image pixel is tested against the contour.
.. image:: pics/pointpolygon.png
.. [Fitzgibbon95] Andrew W. Fitzgibbon, R.B.Fisher. A Buyers Guide to Conic Fitting. Proc.5th British Machine Vision Conference, Birmingham, pp. 513-522, 1995.
.. [Fitzgibbon95] Andrew W. Fitzgibbon, R.B.Fisher. *A Buyers Guide to Conic Fitting*. Proc.5th British Machine Vision Conference, Birmingham, pp. 513-522, 1995.
.. [Hu62] M. Hu. Visual Pattern Recognition by Moment Invariants, IRE Transactions on Information Theory, 8:2, pp. 179-187, 1962.
.. [Hu62] M. Hu. *Visual Pattern Recognition by Moment Invariants*, IRE Transactions on Information Theory, 8:2, pp. 179-187, 1962.
.. [Sklansky82] Sklansky, J., Finding the Convex Hull of a Simple Polygon. PRL 1 $number, pp 79-83 (1982)
.. [Sklansky82] Sklansky, J., *Finding the Convex Hull of a Simple Polygon*. PRL 1 $number, pp 79-83 (1982)
.. [Suzuki85] Suzuki, S. and Abe, K., Topological Structural Analysis of Digitized Binary Images by Border Following. CVGIP 30 1, pp 32-46 (1985)
.. [Suzuki85] Suzuki, S. and Abe, K., *Topological Structural Analysis of Digitized Binary Images by Border Following*. CVGIP 30 1, pp 32-46 (1985)
.. [TehChin89] Teh, C.H. and Chin, R.T., On the Detection of Dominant Points on Digital Curve. PAMI 11 8, pp 859-872 (1989)
.. [TehChin89] Teh, C.H. and Chin, R.T., *On the Detection of Dominant Points on Digital Curve*. PAMI 11 8, pp 859-872 (1989)
The method returns a pointer to the matrix of response values or throws an exception if the data has not been loaded from the file yet.
...
...
@@ -100,7 +100,7 @@ CvMLData::set_response_idx
--------------------------
Specifies index of response column in the data matrix
.. ocv:function:: void CvMLData::set_response_idx( int idx );
.. ocv:function:: void CvMLData::set_response_idx( int idx )
The method sets the index of a response column in the ``values`` matrix (see :ocv:func:`CvMLData::get_values`) or throws an exception if the data has not been loaded from the file yet.
This method sets parameters for such a split using ``spl`` (see :ocv:class:`CvTrainTestSplit`) or throws an exception if the data has not been loaded from the file yet.
The method shuffles the indices of training and test samples preserving sizes of training and test subsets if the data split is set by :ocv:func:`CvMLData::get_values`. If the data has not been loaded from the file yet, an exception is thrown.
...
...
@@ -152,7 +152,7 @@ CvMLData::get_var_idx
---------------------
Returns the indices of the active variables in the data matrix
The method returns the indices of variables (columns) used in the ``values`` matrix (see :ocv:func:`CvMLData::get_values`).
...
...
@@ -162,7 +162,7 @@ CvMLData::chahge_var_idx
------------------------
Enables or disables particular variable in the loaded data
.. ocv:function:: void CvMLData::chahge_var_idx( int vi, bool state );
.. ocv:function:: void CvMLData::chahge_var_idx( int vi, bool state )
By default, after reading the data set all variables in the ``values`` matrix (see :ocv:func:`CvMLData::get_values`) are used. But you may want to use only a subset of variables and include/exclude (depending on ``state`` value) a variable with the ``vi`` index from the used subset. If the data has not been loaded from the file yet, an exception is thrown.
The function returns a single-row matrix of the type ``CV_8UC1``, where each element is set to either ``CV_VAR_ORDERED`` or ``CV_VAR_CATEGORICAL``. The number of columns is equal to the number of variables. If data has not been loaded from file yet an exception is thrown.
In the string, a variable type is followed by a list of variables indices. For example: ``"ord[0-17],cat[18]"``, ``"ord[0,2,4,10-12], cat[1,3,5-9,13,14]"``, ``"cat"`` (all variables are categorical), ``"ord"`` (all variables are ordered).
...
...
@@ -194,7 +194,7 @@ CvMLData::change_var_type
-------------------------
Changes type of the specified variable
.. ocv:function:: void CvMLData::change_var_type( int var_idx, int type);
.. ocv:function:: void CvMLData::change_var_type( int var_idx, int type)
The method changes type of variable with index ``var_idx`` from existing type to ``type`` ( ``CV_VAR_ORDERED`` or ``CV_VAR_CATEGORICAL``).
...
...
@@ -202,7 +202,7 @@ CvMLData::set_delimiter
-----------------------
Sets the delimiter in the file used to separate input numbers
The method sets the delimiter for variables in a file. For example: ``','`` (default), ``';'``, ``' '`` (space), or other characters. The floating-point separator ``'.'`` is not allowed.
The method sets the character used to specify missing values. For example: ``'?'`` (default), ``'-'``. The floating-point separator ``'.'`` is not allowed.