Commit 05de6302 authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed documentation: corrected parameter names

parent 67b718f1
......@@ -9,6 +9,7 @@ import rst_parser as rp
rp.show_warnings = False
rp.show_errors = False
allmodules = rp.allmodules
DOCUMENTED_MARKER = "verified"
ERROR_001_NOTACLASS = 1
......@@ -33,6 +34,8 @@ doc_signatures_whitelist = [
"gpu::DevMem2D_", "gpu::PtrStep_", "gpu::PtrElemStep_",
# black boxes
"CvArr", "CvFileStorage",
# other
"InputArray", "OutputArray",
]
defines = ["cvGraphEdgeIdx", "cvFree", "CV_Assert", "cvSqrt", "cvGetGraphVtx", "cvGraphVtxIdx",
......@@ -55,6 +58,8 @@ synonims = {
"cvCaptureFromCAM" : ["cvCreateCameraCapture"],
"cvCalcArrBackProjectPatch" : ["cvCalcBackProjectPatch"],
"cvCalcArrBackProject" : ["cvCalcBackProject"],
"InputArray" : ["_InputArray"],
"OutputArray" : ["_OutputArray"],
}
if do_python_crosscheck:
......@@ -143,11 +148,18 @@ def formatSignature(s):
for idx, arg in enumerate(s[3]):
if idx > 0:
_str += ", "
_str += re.sub(r"\bcv::", "", arg[0]) + " "
argtype = re.sub(r"\bcv::", "", arg[0])
bidx = argtype.find('[')
if bidx < 0:
_str += argtype + " "
else:
_srt += argtype[:bidx]
if arg[1]:
_str += arg[1]
else:
_str += "arg" + str(idx)
if bidx >= 0:
_str += argtype[bidx:]
if arg[2]:
_str += "=" + re.sub(r"\bcv::", "", arg[2])
_str += " )"
......@@ -471,7 +483,11 @@ if __name__ == "__main__":
print "Usage:\n", os.path.basename(sys.argv[0]), " <module path>"
exit(0)
for module in sys.argv[1:]:
modules = sys.argv[1:]
if modules[0] == "all":
modules = allmodules
for module in modules:
selfpath = os.path.dirname(os.path.abspath(sys.argv[0]))
module_path = os.path.join(selfpath, "..", "modules", module)
......
......@@ -127,7 +127,7 @@ Finds the camera intrinsic and extrinsic parameters from several views of a cali
In the old interface all the vectors of object points from different views are concatenated together.
:param pointCounts: In the old interface this is a vector of integers, containing as many elements, as the number of views of the calibration pattern. Each element is the number of points in each view. Usually, all the elements are the same and equal to the number of feature points on the calibration pattern.
:param point_counts: In the old interface this is a vector of integers, containing as many elements, as the number of views of the calibration pattern. Each element is the number of points in each view. Usually, all the elements are the same and equal to the number of feature points on the calibration pattern.
:param imageSize: Size of the image used only to initialize the intrinsic camera matrix.
......@@ -715,7 +715,7 @@ Finds a perspective transformation between two planes.
then the point :math:`i` is considered an outlier. If ``srcPoints`` and ``dstPoints`` are measured in pixels, it usually makes sense to set this parameter somewhere in the range of 1 to 10.
:param status: Optional output mask set by a robust method ( ``CV_RANSAC`` or ``CV_LMEDS`` ). Note that the input mask values are ignored.
:param mask: Optional output mask set by a robust method ( ``CV_RANSAC`` or ``CV_LMEDS`` ). Note that the input mask values are ignored.
The functions find and return the perspective transformation :math:`H` between the source and the destination planes:
......@@ -775,9 +775,9 @@ Computes an optimal affine transformation between two 3D point sets.
.. ocv:pyfunction:: cv2.estimateAffine3D(src, dst[, out[, inliers[, ransacThreshold[, confidence]]]]) -> retval, out, inliers
:param srcpt: First input 3D point set.
:param src: First input 3D point set.
:param dstpt: Second input 3D point set.
:param dst: Second input 3D point set.
:param out: Output 3D affine transformation matrix :math:`3 \times 4` .
......@@ -829,9 +829,9 @@ Returns the new camera matrix based on the free scaling parameter.
:param alpha: Free scaling parameter between 0 (when all the pixels in the undistorted image are valid) and 1 (when all the source image pixels are retained in the undistorted image). See :ocv:func:`stereoRectify` for details.
:param newCameraMatrix: Output new camera matrix.
:param new_camera_matrix: Output new camera matrix.
:param newImageSize: Image size after rectification. By default,it is set to ``imageSize`` .
:param new_imag_size: Image size after rectification. By default,it is set to ``imageSize`` .
:param validPixROI: Optional output rectangle that outlines all-good-pixels region in the undistorted image. See ``roi1, roi2`` description in :ocv:func:`stereoRectify` .
......@@ -860,7 +860,7 @@ Finds an initial camera matrix from 3D-2D point correspondences.
:param imagePoints: Vector of vectors of the projections of the calibration pattern points. In the old interface all the per-view vectors are concatenated.
:param pointCounts: The integer vector of point counters for each view.
:param npoints: The integer vector of point counters for each view.
:param imageSize: Image size in pixels used to initialize the principal point.
......@@ -984,11 +984,11 @@ Computes an RQ decomposition of 3x3 matrices.
.. ocv:cfunction:: void cvRQDecomp3x3( const CvMat * matrixM, CvMat * matrixR, CvMat * matrixQ, CvMat * matrixQx=NULL, CvMat * matrixQy=NULL, CvMat * matrixQz=NULL, CvPoint3D64f * eulerAngles=NULL )
.. ocv:pyoldfunction:: cv.RQDecomp3x3(M, R, Q, Qx=None, Qy=None, Qz=None) -> eulerAngles
:param M: 3x3 input matrix.
:param src: 3x3 input matrix.
:param R: Output 3x3 upper-triangular matrix.
:param mtxR: Output 3x3 upper-triangular matrix.
:param Q: Output 3x3 orthogonal matrix.
:param mtxQ: Output 3x3 orthogonal matrix.
:param Qx: Optional output 3x3 rotation matrix around x-axis.
......@@ -1120,7 +1120,7 @@ Computes disparity using the BM algorithm for a rectified stereo pair.
:param right: Right image of the same size and the same type as the left one.
:param disp: Output disparity map. It has the same size as the input images. When ``disptype==CV_16S``, the map is a 16-bit signed single-channel image, containing disparity values scaled by 16. To get the true disparity values from such fixed-point representation, you will need to divide each ``disp`` element by 16. If ``disptype==CV_32F``, the disparity map will already contain the real disparity values on output.
:param disparity: Output disparity map. It has the same size as the input images. When ``disptype==CV_16S``, the map is a 16-bit signed single-channel image, containing disparity values scaled by 16. To get the true disparity values from such fixed-point representation, you will need to divide each ``disp`` element by 16. If ``disptype==CV_32F``, the disparity map will already contain the real disparity values on output.
:param disptype: Type of the output disparity map, ``CV_16S`` (default) or ``CV_32F``.
......@@ -1362,9 +1362,9 @@ Computes rectification transforms for each head of a calibrated stereo camera.
:param newImageSize: New image resolution after rectification. The same size should be passed to :ocv:func:`initUndistortRectifyMap` (see the ``stereo_calib.cpp`` sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original ``imageSize`` . Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion.
:param roi1:
:param validPixROI1: Optional output rectangles inside the rectified images where all the pixels are valid. If ``alpha=0`` , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below).
:param roi2: Optional output rectangles inside the rectified images where all the pixels are valid. If ``alpha=0`` , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below).
:param validPixROI2: Optional output rectangles inside the rectified images where all the pixels are valid. If ``alpha=0`` , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see the picture below).
The function computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. The function takes the matrices computed by
:ocv:func:`stereoCalibrate` as input. As output, it provides two rotation matrices and also two projection matrices in the new coordinates. The function distinguishes the following two cases:
......@@ -1427,7 +1427,7 @@ Computes a rectification transform for an uncalibrated stereo camera.
:param F: Input fundamental matrix. It can be computed from the same set of point pairs using :ocv:func:`findFundamentalMat` .
:param imageSize: Size of the image.
:param imgSize: Size of the image.
:param H1: Output rectification homography matrix for the first image.
......
......@@ -855,8 +855,6 @@ Various Mat constructors
:param ranges: Array of selected ranges of ``m`` along each dimensionality.
:param expr: Matrix expression. See :ref:`MatrixExpressions`.
These are various constructors that form a matrix. As noted in the :ref:`AutomaticAllocation`,
often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with
:ocv:func:`Mat::create` . In the former case, the old content is de-referenced.
......@@ -980,7 +978,7 @@ Extracts a diagonal from a matrix, or creates a diagonal matrix.
.. ocv:function:: static Mat Mat::diag( const Mat& d )
:param d: Index of the diagonal, with the following values:
:param d: Single-column matrix that forms a diagonal matrix or index of the diagonal, with the following values:
* **d=0** is the main diagonal.
......@@ -988,8 +986,6 @@ Extracts a diagonal from a matrix, or creates a diagonal matrix.
* **d<0** is a diagonal from the upper half. For example, ``d=1`` means the diagonal is set immediately above the main one.
:param matD: Single-column matrix that forms a diagonal matrix.
The method makes a new header for the specified matrix diagonal. The new matrix is represented as a single-column matrix. Similarly to
:ocv:func:`Mat::row` and
:ocv:func:`Mat::col` , this is an O(1) operation.
......@@ -1065,7 +1061,7 @@ Sets all or some of the array elements to the specified value.
.. ocv:function:: Mat& Mat::setTo( InputArray value, InputArray mask=noArray() )
:param s: Assigned scalar converted to the actual array type.
:param value: Assigned scalar converted to the actual array type.
:param mask: Operation mask of the same size as ``*this``. This is an advanced variant of the ``Mat::operator=(const Scalar& s)`` operator.
......@@ -1187,7 +1183,7 @@ Returns a zero array of the specified size and type.
:param size: Alternative to the matrix size specification ``Size(cols, rows)`` .
:param sizes: Array of integers specifying the array shape.
:param sz: Array of integers specifying the array shape.
:param type: Created matrix type.
......@@ -1216,7 +1212,7 @@ Returns an array of all 1's of the specified size and type.
:param size: Alternative to the matrix size specification ``Size(cols, rows)`` .
:param sizes: Array of integers specifying the array shape.
:param sz: Array of integers specifying the array shape.
:param type: Created matrix type.
......@@ -1805,6 +1801,7 @@ To use ``Mat_`` for multi-channel images/matrices, pass ``Vec`` as a ``Mat_`` pa
InputArray
----------
.. ocv:class:: InputArray
This is the proxy class for passing read-only input arrays into OpenCV functions. It is defined as ::
......@@ -1869,6 +1866,7 @@ It denotes function arguments that are either vectors of vectors or vectors of m
OutputArray
-----------
.. ocv:class:: OutputArray : public InputArray
This type is very similar to ``InputArray`` except that it is used for input/output and output function parameters. Just like with ``InputArray``, OpenCV users should not care about ``OutputArray``, they just pass ``Mat``, ``vector<T>`` etc. to the functions. The same limitation as for ``InputArray``: **Do not explicitly create OutputArray instances** applies here too.
......@@ -2299,6 +2297,7 @@ It simplifies notation of some operations. ::
Algorithm
---------
.. ocv:class:: Algorithm
This is a base class for all more or less complex algorithms in OpenCV, especially for classes of algorithms, for which there can be multiple implementations. The examples are stereo correspondence (for which there are algorithms like block matching, semi-global block matching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians models, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck etc.).
......
......@@ -17,7 +17,7 @@ Finds centers of clusters and groups input samples around the clusters.
:param samples: Floating-point matrix of input samples, one row per sample.
:param clusterCount: Number of clusters to split the set by.
:param cluster_count: Number of clusters to split the set by.
:param labels: Input/output integer array that stores the cluster indices for every sample.
......@@ -40,7 +40,7 @@ Finds centers of clusters and groups input samples around the clusters.
:param compactness: The returned value that is described below.
The function ``kmeans`` implements a k-means algorithm that finds the
centers of ``clusterCount`` clusters and groups the input samples
centers of ``cluster_count`` clusters and groups the input samples
around the clusters. As an output,
:math:`\texttt{labels}_i` contains a 0-based cluster index for
the sample stored in the
......
......@@ -144,9 +144,9 @@ Approximates an elliptic arc with a polyline.
:param angle: Rotation angle of the ellipse in degrees. See the :ocv:func:`ellipse` for details.
:param startAngle: Starting angle of the elliptic arc in degrees.
:param arcStart: Starting angle of the elliptic arc in degrees.
:param endAngle: Ending angle of the elliptic arc in degrees.
:param arcEnd: Ending angle of the elliptic arc in degrees.
:param delta: Angle between the subsequent polyline vertices. It defines the approximation accuracy.
......@@ -284,7 +284,7 @@ Initializes font structure (OpenCV 1.x API).
:param font: Pointer to the font structure initialized by the function
:param fontFace: Font name identifier. Only a subset of Hershey fonts http://sources.isc.org/utils/misc/hershey-font.txt are supported now:
:param font_face: Font name identifier. Only a subset of Hershey fonts http://sources.isc.org/utils/misc/hershey-font.txt are supported now:
* **CV_FONT_HERSHEY_SIMPLEX** normal size sans-serif font
......@@ -317,7 +317,7 @@ Initializes font structure (OpenCV 1.x API).
:param thickness: Thickness of the text strokes
:param lineType: Type of the strokes, see :ocv:func:`line` description
:param line_type: Type of the strokes, see :ocv:func:`line` description
The function initializes the font structure that can be passed to text rendering functions.
......@@ -426,7 +426,7 @@ Draws a simple, thick, or filled up-right rectangle.
:param pt2: Vertex of the rectangle opposite to ``pt1`` .
:param r: Alternative specification of the drawn rectangle.
:param rec: Alternative specification of the drawn rectangle.
:param color: Rectangle color or brightness (grayscale image).
......@@ -477,7 +477,7 @@ drawContours
----------------
Draws contours outlines or filled contours.
.. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() )
.. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() )
.. ocv:pyfunction:: cv2.drawContours(image, contours, contourIdx, color[, thickness[, lineType[, hierarchy[, maxLevel[, offset]]]]]) -> None
......@@ -507,9 +507,9 @@ Draws contours outlines or filled contours.
:param contour: Pointer to the first contour.
:param externalColor: Color of external contours.
:param external_color: Color of external contours.
:param holeColor: Color of internal contours (holes).
:param hole_color: Color of internal contours (holes).
The function draws contour outlines in the image if
:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if
......
......@@ -230,7 +230,7 @@ Clears a set.
.. ocv:cfunction:: void cvClearSet( CvSet* set_header )
:param setHeader: Cleared set
:param set_header: Cleared set
The function removes all elements from set. It has O(1) time complexity.
......@@ -367,7 +367,7 @@ Creates memory storage.
.. ocv:pyoldfunction:: cv.CreateMemStorage(blockSize=0) -> memstorage
:param blockSize: Size of the storage blocks in bytes. If it is 0, the block size is set to a default value - currently it is about 64K.
:param block_size: Size of the storage blocks in bytes. If it is 0, the block size is set to a default value - currently it is about 64K.
The function creates an empty memory storage. See
:ocv:struct:`CvMemStorage`
......@@ -380,11 +380,11 @@ Creates a sequence.
.. ocv:cfunction:: CvSeq* cvCreateSeq( int seq_flags, size_t header_size, size_t elem_size, CvMemStorage* storage )
:param seqFlags: Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types.
:param seq_flags: Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types.
:param headerSize: Size of the sequence header; must be greater than or equal to ``sizeof(CvSeq)`` . If a specific type or its extension is indicated, this type must fit the base type header.
:param header_size: Size of the sequence header; must be greater than or equal to ``sizeof(CvSeq)`` . If a specific type or its extension is indicated, this type must fit the base type header.
:param elemSize: Size of the sequence elements in bytes. The size must be consistent with the sequence type. For example, for a sequence of points to be created, the element type ``CV_SEQ_ELTYPE_POINT`` should be specified and the parameter ``elemSize`` must be equal to ``sizeof(CvPoint)`` .
:param elem_size: Size of the sequence elements in bytes. The size must be consistent with the sequence type. For example, for a sequence of points to be created, the element type ``CV_SEQ_ELTYPE_POINT`` should be specified and the parameter ``elem_size`` must be equal to ``sizeof(CvPoint)`` .
:param storage: Sequence location
......@@ -485,9 +485,9 @@ Finds an edge in a graph by using its pointer.
:param graph: Graph
:param startVtx: Pointer to the starting vertex of the edge
:param start_vtx: Pointer to the starting vertex of the edge
:param endVtx: Pointer to the ending vertex of the edge. For an unoriented graph, the order of the vertex parameters does not matter.
:param end_vtx: Pointer to the ending vertex of the edge. For an unoriented graph, the order of the vertex parameters does not matter.
::
......@@ -590,7 +590,7 @@ Finds a set element by its index.
.. ocv:cfunction:: CvSetElem* cvGetSetElem( const CvSet* set_header, int index )
:param setHeader: Set
:param set_header: Set
:param index: Index of the set element within a sequence
......@@ -728,7 +728,7 @@ Counts the number of edges incident to the vertex.
:param graph: Graph
:param vtxIdx: Index of the graph vertex
:param vtx_idx: Index of the graph vertex
The function returns the number of edges incident to the specified vertex, both incoming and outgoing. To count the edges, the following code is used:
......@@ -1026,7 +1026,7 @@ Inserts an element in the middle of a sequence.
:param seq: Sequence
:param beforeIndex: Index before which the element is inserted. Inserting before 0 (the minimal allowed value of the parameter) is equal to :ocv:cfunc:`SeqPushFront` and inserting before ``seq->total`` (the maximal allowed value of the parameter) is equal to :ocv:cfunc:`SeqPush` .
:param before_index: Index before which the element is inserted. Inserting before 0 (the minimal allowed value of the parameter) is equal to :ocv:cfunc:`SeqPushFront` and inserting before ``seq->total`` (the maximal allowed value of the parameter) is equal to :ocv:cfunc:`SeqPush` .
:param element: Inserted element
......@@ -1042,9 +1042,9 @@ Inserts an array in the middle of a sequence.
:param seq: Sequence
:param beforeIndex: Index before which the array is inserted
:param before_index: Index before which the array is inserted
:param fromArr: The array to take elements from
:param from_arr: The array to take elements from
The function inserts all
``fromArr``
......@@ -1328,7 +1328,7 @@ Occupies a node in the set.
.. ocv:cfunction:: int cvSetAdd( CvSet* set_header, CvSetElem* elem=NULL, CvSetElem** inserted_elem=NULL )
:param setHeader: Set
:param set_header: Set
:param elem: Optional input argument, an inserted element. If not NULL, the function copies the data to the allocated node (the MSB of the first integer field is cleared after copying).
......@@ -1349,7 +1349,7 @@ Adds an element to a set (fast variant).
.. ocv:cfunction:: CvSetElem* cvSetNew( CvSet* set_header )
:param setHeader: Set
:param set_header: Set
The function is an inline lightweight variant of
:ocv:cfunc:`SetAdd`
......@@ -1361,7 +1361,7 @@ Removes an element from a set.
.. ocv:cfunction:: void cvSetRemove( CvSet* set_header, int index )
:param setHeader: Set
:param set_header: Set
:param index: Index of the removed element
......@@ -1378,7 +1378,7 @@ Removes a set element based on its pointer.
.. ocv:cfunction:: void cvSetRemoveByPtr( CvSet* set_header, void* elem )
:param setHeader: Set
:param set_header: Set
:param elem: Removed element
......@@ -1394,19 +1394,19 @@ Sets up sequence block size.
:param seq: Sequence
:param deltaElems: Desirable sequence block size for elements
:param delta_elems: Desirable sequence block size for elements
The function affects memory allocation
granularity. When the free space in the sequence buffers has run out,
the function allocates the space for
``deltaElems``
``delta_elems``
sequence
elements. If this block immediately follows the one previously allocated,
the two blocks are concatenated; otherwise, a new sequence block is
created. Therefore, the bigger the parameter is, the lower the possible
sequence fragmentation, but the more space in the storage block is wasted. When
the sequence is created, the parameter
``deltaElems``
``delta_elems``
is set to
the default value of about 1K. The function can be called any time after
the sequence is created and affects future allocations. The function
......
......@@ -839,9 +839,9 @@ Returns one of more array columns.
:param col: Zero-based index of the selected column
:param startCol: Zero-based index of the starting column (inclusive) of the span
:param start_col: Zero-based index of the starting column (inclusive) of the span
:param endCol: Zero-based index of the ending column (exclusive) of the span
:param end_col: Zero-based index of the ending column (exclusive) of the span
The functions return the header, corresponding to a specified column span of the input array. That is, no data is copied. Therefore, any modifications of the submatrix will affect the original array. If you need to copy the columns, use :ocv:cfunc:`CloneMat`. ``cvGetCol(arr, submat, col)`` is a shortcut for ``cvGetCols(arr, submat, col, col+1)``.
......@@ -916,9 +916,9 @@ Returns image header for arbitrary array.
:param arr: Input array
:param imageHeader: Pointer to ``IplImage`` structure used as a temporary buffer
:param image_header: Pointer to ``IplImage`` structure used as a temporary buffer
The function returns the image header for the input array that can be a matrix (:ocv:struct:`CvMat`) or image (:ocv:struct:`IplImage`). In the case of an image the function simply returns the input pointer. In the case of ``CvMat`` it initializes an ``imageHeader`` structure with the parameters of the input matrix. Note that if we transform ``IplImage`` to ``CvMat`` using :ocv:cfunc:`GetMat` and then transform ``CvMat`` back to IplImage using this function, we will get different headers if the ROI is set in the original image.
The function returns the image header for the input array that can be a matrix (:ocv:struct:`CvMat`) or image (:ocv:struct:`IplImage`). In the case of an image the function simply returns the input pointer. In the case of ``CvMat`` it initializes an ``image_header`` structure with the parameters of the input matrix. Note that if we transform ``IplImage`` to ``CvMat`` using :ocv:cfunc:`GetMat` and then transform ``CvMat`` back to IplImage using this function, we will get different headers if the ROI is set in the original image.
GetImageCOI
-----------
......@@ -972,7 +972,7 @@ Returns the next sparse matrix element
.. ocv:cfunction:: CvSparseNode* cvGetNextSparseNode( CvSparseMatIterator* mat_iterator )
:param matIterator: Sparse array iterator
:param mat_iterator: Sparse array iterator
The function moves iterator to the next sparse matrix element and returns pointer to it. In the current version there is no any particular order of the elements, because they are stored in the hash table. The sample below demonstrates how to iterate through the sparse matrix: ::
......@@ -1011,7 +1011,7 @@ Retrieves low-level information about the array.
:param step: Output full row length in bytes
:param roiSize: Output ROI size
:param roi_size: Output ROI size
The function fills output variables with low-level information about the array data. All output parameters are optional, so some of the pointers may be set to ``NULL``. If the array is ``IplImage`` with ROI set, the parameters of ROI are returned.
......@@ -1074,11 +1074,11 @@ Returns array row or row span.
:param row: Zero-based index of the selected row
:param startRow: Zero-based index of the starting row (inclusive) of the span
:param start_row: Zero-based index of the starting row (inclusive) of the span
:param endRow: Zero-based index of the ending row (exclusive) of the span
:param end_row: Zero-based index of the ending row (exclusive) of the span
:param deltaRow: Index step in the row span. That is, the function extracts every ``deltaRow`` -th row from ``startRow`` and up to (but not including) ``endRow`` .
:param delta_row: Index step in the row span. That is, the function extracts every ``delta_row`` -th row from ``start_row`` and up to (but not including) ``end_row`` .
The functions return the header, corresponding to a specified row/row span of the input array. ``cvGetRow(arr, submat, row)`` is a shortcut for ``cvGetRows(arr, submat, row, row+1)``.
......@@ -1217,7 +1217,7 @@ Initializes sparse array elements iterator.
:param mat: Input array
:param matIterator: Initialized iterator
:param mat_iterator: Initialized iterator
The function initializes iterator of sparse array elements and returns pointer to the first element, or NULL if the array is empty.
......@@ -1268,9 +1268,9 @@ Return pointer to a particular array element.
:param type: Optional output parameter: type of matrix elements
:param createNode: Optional input parameter for sparse matrices. Non-zero value of the parameter means that the requested element is created if it does not exist already.
:param create_node: Optional input parameter for sparse matrices. Non-zero value of the parameter means that the requested element is created if it does not exist already.
:param precalcHashval: Optional input parameter for sparse matrices. If the pointer is not NULL, the function does not recalculate the node hash value, but takes it from the specified location. It is useful for speeding up pair-wise operations (TODO: provide an example)
:param precalc_hashval: Optional input parameter for sparse matrices. If the pointer is not NULL, the function does not recalculate the node hash value, but takes it from the specified location. It is useful for speeding up pair-wise operations (TODO: provide an example)
The functions return a pointer to a specific array element. Number of array dimension should match to the number of indices passed to the function except for ``cvPtr1D`` function that can be used for sequential access to 1D, 2D or nD dense arrays.
......@@ -1415,9 +1415,9 @@ Changes shape of matrix/image without copying data.
:param header: Output header to be filled
:param newCn: New number of channels. 'newCn = 0' means that the number of channels remains unchanged.
:param new_cn: New number of channels. 'new_cn = 0' means that the number of channels remains unchanged.
:param newRows: New number of rows. 'newRows = 0' means that the number of rows remains unchanged unless it needs to be changed according to ``newCn`` value.
:param new_rows: New number of rows. 'new_rows = 0' means that the number of rows remains unchanged unless it needs to be changed according to ``new_cn`` value.
The function initializes the CvMat header so that it points to the same data as the original array but has a different shape - different number of channels, different number of rows, or both.
......@@ -1451,15 +1451,15 @@ Changes the shape of a multi-dimensional array without copying the data.
:param arr: Input array
:param sizeofHeader: Size of output header to distinguish between IplImage, CvMat and CvMatND output headers
:param sizeof_header: Size of output header to distinguish between IplImage, CvMat and CvMatND output headers
:param header: Output header to be filled
:param newCn: New number of channels. ``newCn = 0`` means that the number of channels remains unchanged.
:param new_cn: New number of channels. ``new_cn = 0`` means that the number of channels remains unchanged.
:param newDims: New number of dimensions. ``newDims = 0`` means that the number of dimensions remains the same.
:param new_dims: New number of dimensions. ``new_dims = 0`` means that the number of dimensions remains the same.
:param newSizes: Array of new dimension sizes. Only ``newDims-1`` values are used, because the total number of elements must remain the same. Thus, if ``newDims = 1``, ``newSizes`` array is not used.
:param new_sizes: Array of new dimension sizes. Only ``new_dims-1`` values are used, because the total number of elements must remain the same. Thus, if ``new_dims = 1``, ``new_sizes`` array is not used.
The function is an advanced version of :ocv:cfunc:`Reshape` that can work with multi-dimensional arrays as well (though it can work with ordinary images and matrices) and change the number of dimensions.
......@@ -1701,7 +1701,7 @@ Fills an array with random numbers and updates the RNG state.
:param arr: The destination array
:param distType: Distribution type
:param dist_type: Distribution type
* **CV_RAND_UNI** uniform distribution
......
......@@ -153,9 +153,9 @@ Makes a clone of an object.
.. ocv:cfunction:: void* cvClone( const void* struct_ptr )
:param structPtr: The object to clone
:param struct_ptr: The object to clone
The function finds the type of a given object and calls ``clone`` with the passed object. Of course, if you know the object type, for example, ``structPtr`` is ``CvMat*``, it is faster to call the specific function, like :ocv:cfunc:`CloneMat`.
The function finds the type of a given object and calls ``clone`` with the passed object. Of course, if you know the object type, for example, ``struct_ptr`` is ``CvMat*``, it is faster to call the specific function, like :ocv:cfunc:`CloneMat`.
EndWriteStruct
--------------
......@@ -173,7 +173,7 @@ Finds a type by its name.
.. ocv:cfunction:: CvTypeInfo* cvFindType( const char* type_name )
:param typeName: Type name
:param type_name: Type name
The function finds a registered type by its name. It returns NULL if there is no type with the specified name.
......@@ -197,7 +197,7 @@ Finds a node in a map or file storage.
:param key: Unique pointer to the node name, retrieved with :ocv:cfunc:`GetHashedKey`
:param createMissing: Flag that specifies whether an absent node should be added to the map
:param create_missing: Flag that specifies whether an absent node should be added to the map
The function finds a file node. It is a faster version of :ocv:cfunc:`GetFileNodeByName`
(see :ocv:cfunc:`GetHashedKey` discussion). Also, the function can insert a new node, if it is not in the map yet.
......@@ -239,7 +239,7 @@ Returns a unique pointer for a given name.
:param len: Length of the name (if it is known apriori), or -1 if it needs to be calculated
:param createMissing: Flag that specifies, whether an absent key should be added into the hash table
:param create_missing: Flag that specifies, whether an absent key should be added into the hash table
The function returns a unique pointer for each particular file node name. This pointer can be then passed to the :ocv:cfunc:`GetFileNode` function that is faster than :ocv:cfunc:`GetFileNodeByName`
because it compares text strings by comparing pointers rather than the strings' content.
......@@ -331,11 +331,11 @@ Loads an object from a file.
:param filename: File name
:param storage: Memory storage for dynamic structures, such as :ocv:struct:`CvSeq` or :ocv:struct:`CvGraph` . It is not used for matrices or images.
:param memstorage: Memory storage for dynamic structures, such as :ocv:struct:`CvSeq` or :ocv:struct:`CvGraph` . It is not used for matrices or images.
:param name: Optional object name. If it is NULL, the first top-level object in the storage will be loaded.
:param realName: Optional output parameter that will contain the name of the loaded object (useful if ``name=NULL`` )
:param real_name: Optional output parameter that will contain the name of the loaded object (useful if ``name=NULL`` )
The function loads an object from a file. It basically reads the specified file, find the first top-level node and calls :ocv:cfunc:`Read` for that node. If the file node does not have type information or the type information can not be found by the type name, the function returns NULL. After the object is loaded, the file storage is closed and all the temporary buffers are deleted. Thus, to load a dynamic structure, such as a sequence, contour, or graph, one should pass a valid memory storage destination to the function.
......@@ -398,10 +398,10 @@ Retrieves an integer value from a file node.
:param node: File node
:param defaultValue: The value that is returned if ``node`` is NULL
:param default_value: The value that is returned if ``node`` is NULL
The function returns an integer that is represented by the file node. If the file node is NULL, the
``defaultValue`` is returned (thus, it is convenient to call the function right after :ocv:cfunc:`GetFileNode` without checking for a NULL pointer). If the file node has type ``CV_NODE_INT``, then ``node->data.i`` is returned. If the file node has type ``CV_NODE_REAL``, then ``node->data.f``
``default_value`` is returned (thus, it is convenient to call the function right after :ocv:cfunc:`GetFileNode` without checking for a NULL pointer). If the file node has type ``CV_NODE_INT``, then ``node->data.i`` is returned. If the file node has type ``CV_NODE_REAL``, then ``node->data.f``
is converted to an integer and returned. Otherwise the error is reported.
ReadIntByName
......@@ -416,7 +416,7 @@ Finds a file node and returns its value.
:param name: The node name
:param defaultValue: The value that is returned if the file node is not found
:param default_value: The value that is returned if the file node is not found
The function is a simple superposition of :ocv:cfunc:`GetFileNodeByName` and :ocv:cfunc:`ReadInt`.
......@@ -464,11 +464,11 @@ Retrieves a floating-point value from a file node.
:param node: File node
:param defaultValue: The value that is returned if ``node`` is NULL
:param default_value: The value that is returned if ``node`` is NULL
The function returns a floating-point value
that is represented by the file node. If the file node is NULL, the
``defaultValue``
``default_value``
is returned (thus, it is convenient to call
the function right after
:ocv:cfunc:`GetFileNode`
......@@ -498,7 +498,7 @@ Finds a file node and returns its value.
:param name: The node name
:param defaultValue: The value that is returned if the file node is not found
:param default_value: The value that is returned if the file node is not found
The function is a simple superposition of
:ocv:cfunc:`GetFileNodeByName`
......@@ -515,11 +515,11 @@ Retrieves a text string from a file node.
:param node: File node
:param defaultValue: The value that is returned if ``node`` is NULL
:param default_value: The value that is returned if ``node`` is NULL
The function returns a text string that is represented
by the file node. If the file node is NULL, the
``defaultValue``
``default_value``
is returned (thus, it is convenient to call the function right after
:ocv:cfunc:`GetFileNode`
without checking for a NULL pointer). If
......@@ -542,7 +542,7 @@ Finds a file node by its name and returns its value.
:param name: The node name
:param defaultValue: The value that is returned if the file node is not found
:param default_value: The value that is returned if the file node is not found
The function is a simple superposition of
:ocv:cfunc:`GetFileNodeByName`
......@@ -572,7 +572,7 @@ Releases an object.
.. ocv:cfunction:: void cvRelease( void** struct_ptr )
:param structPtr: Double pointer to the object
:param struct_ptr: Double pointer to the object
The function finds the type of a given object and calls
``release``
......@@ -600,7 +600,7 @@ Saves an object to a file.
:param filename: File name
:param structPtr: Object to save
:param struct_ptr: Object to save
:param name: Optional object name. If it is NULL, the name will be formed from ``filename`` .
......@@ -677,7 +677,7 @@ Starts writing a new structure.
* **CV_NODE_FLOW** the optional flag that makes sense only for YAML streams. It means that the structure is written as a flow (not as a block), which is more compact. It is recommended to use this flag for structures or arrays whose elements are all scalars.
:param typeName: Optional parameter - the object type name. In
:param type_name: Optional parameter - the object type name. In
case of XML it is written as a ``type_id`` attribute of the
structure opening tag. In the case of YAML it is written after a colon
following the structure name (see the example in :ocv:struct:`CvFileStorage`
......@@ -696,7 +696,7 @@ Returns the type of an object.
.. ocv:cfunction:: CvTypeInfo* cvTypeOf( const void* struct_ptr )
:param structPtr: The object pointer
:param struct_ptr: The object pointer
The function finds the type of a given object. It iterates through the list of registered types and calls the ``is_instance`` function/method for every type info structure with that object until one of them returns non-zero or until the whole list has been traversed. In the latter case, the function returns NULL.
......@@ -707,7 +707,7 @@ Unregisters the type.
.. ocv:cfunction:: void cvUnregisterType( const char* type_name )
:param typeName: Name of an unregistered type
:param type_name: Name of an unregistered type
The function unregisters a type with a specified name. If the name is unknown, it is possible to locate the type info by an instance of the type using :ocv:cfunc:`TypeOf` or by iterating the type list, starting from :ocv:cfunc:`FirstType`, and then calling ``cvUnregisterType(info->typeName)``.
......@@ -782,7 +782,7 @@ Writes a comment.
:param comment: The written comment, single-line or multi-line
:param eolComment: If non-zero, the function tries to put the comment at the end of current line. If the flag is zero, if the comment is multi-line, or if it does not fit at the end of the current line, the comment starts a new line.
:param eol_comment: If non-zero, the function tries to put the comment at the end of current line. If the flag is zero, if the comment is multi-line, or if it does not fit at the end of the current line, the comment starts a new line.
The function writes a comment into file storage. The comments are skipped when the storage is read.
......
This diff is collapsed.
......@@ -426,7 +426,7 @@ Enables or disables the optimized code.
.. ocv:cfunction:: int cvUseOptimized( int on_off )
:param onoff: The boolean flag specifying whether the optimized code should be used (``onoff=true``) or not (``onoff=false``).
:param on_off: The boolean flag specifying whether the optimized code should be used (``on_off=true``) or not (``on_off=false``).
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX, and other instructions on the platforms that support it). It sets a global flag that is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application where you can be sure that no other OpenCV function is currently executed.
......
......@@ -665,7 +665,7 @@ FileNodeIterator::operator +=
-----------------------------
Moves iterator forward by the specified offset.
.. ocv:function:: FileNodeIterator& FileNodeIterator::operator +=( int param )
.. ocv:function:: FileNodeIterator& FileNodeIterator::operator +=( int ofs )
:param ofs: Offset (possibly negative) to move the iterator.
......@@ -674,7 +674,7 @@ FileNodeIterator::operator -=
-----------------------------
Moves iterator backward by the specified offset (possibly negative).
.. ocv:function:: FileNodeIterator& FileNodeIterator::operator -=( int param )
.. ocv:function:: FileNodeIterator& FileNodeIterator::operator -=( int ofs )
:param ofs: Offset (possibly negative) to move the iterator.
......
......@@ -4131,9 +4131,9 @@ public:
//! moves iterator to the previous node
FileNodeIterator operator -- (int);
//! moves iterator forward by the specified offset (possibly negative)
FileNodeIterator& operator += (int);
FileNodeIterator& operator += (int ofs);
//! moves iterator backward by the specified offset (possibly negative)
FileNodeIterator& operator -= (int);
FileNodeIterator& operator -= (int ofs);
//! reads the next maxCount elements (or less, if the sequence/mapping last element occurs earlier) to the buffer with the specified format
FileNodeIterator& readRaw( const string& fmt, uchar* vec,
......
......@@ -269,7 +269,7 @@ Brute-force matcher constructor.
.. ocv:function:: BFMatcher::BFMatcher( int normType, bool crossCheck=false )
:param distanceType: One of ``NORM_L1``, ``NORM_L2``, ``NORM_HAMMING``, ``NORM_HAMMING2``. ``L1`` and ``L2`` norms are preferable choices for SIFT and SURF descriptors, ``NORM_HAMMING`` should be used with ORB and BRIEF, ``NORM_HAMMING2`` should be used with ORB when ``WTA_K==3`` or ``4`` (see ORB::ORB constructor description).
:param normType: One of ``NORM_L1``, ``NORM_L2``, ``NORM_HAMMING``, ``NORM_HAMMING2``. ``L1`` and ``L2`` norms are preferable choices for SIFT and SURF descriptors, ``NORM_HAMMING`` should be used with ORB and BRIEF, ``NORM_HAMMING2`` should be used with ORB when ``WTA_K==3`` or ``4`` (see ORB::ORB constructor description).
:param crossCheck: If it is false, this is will be default BFMatcher behaviour when it finds the k nearest neighbors for each query descriptor. If ``crossCheck==true``, then the ``knnMatch()`` method with ``k=1`` will only return pairs ``(i,j)`` such that for ``i-th`` query descriptor the ``j-th`` descriptor in the matcher's collection is the nearest and vice versa, i.e. the ``BFMathcher`` will only return consistent pairs. Such technique usually produces best results with minimal number of outliers when there are enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper.
......
......@@ -415,7 +415,7 @@ DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector
----------------------------------------------------------------
The constructor
.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjaster, int min_features=400, int max_features=500, int max_iters=5 )
.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 )
:param adjuster: :ocv:class:`AdjusterAdapter` that detects features and adjusts parameters.
......
......@@ -71,7 +71,7 @@ Draws keypoints.
:param keypoints: Keypoints from the source image.
:param outImg: Output image. Its content depends on the ``flags`` value defining what is drawn in the output image. See possible ``flags`` bit values below.
:param outImage: Output image. Its content depends on the ``flags`` value defining what is drawn in the output image. See possible ``flags`` bit values below.
:param color: Color of keypoints.
......
......@@ -644,9 +644,9 @@ Creates a Gaussian filter engine.
:param ksize: Aperture size. See :ocv:func:`getGaussianKernel` for details.
:param sigmaX: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` for details.
:param sigma1: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` for details.
:param sigmaY: Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigmaY}\leftarrow\texttt{sigmaX}` .
:param sigma2: Gaussian sigma in the vertical direction. If 0, then :math:`\texttt{sigma2}\leftarrow\texttt{sigma1}` .
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
......@@ -668,11 +668,11 @@ Smooths an image using the Gaussian filter.
:param dst: Destination image with 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. If they are zeros, they are computed from ``sigmaX`` and ``sigmaY`` .
: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 ``sigma1`` and ``sigma2`` .
:param sigmaX: Gaussian kernel standard deviation in X direction.
:param sigma1: 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 sigma2: Gaussian kernel standard deviation in Y direction. If ``sigma2`` is zero, it is set to be equal to ``sigma1`` . 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`` , ``sigma1`` , and ``sigma2`` .
:param rowBorderType: Pixel extrapolation method in the vertical direction. For details, see :ocv:func:`borderInterpolate`.
......
......@@ -75,7 +75,7 @@ The following method checks whether the module was built with the support of the
.. ocv:function:: static bool gpu::TargetArchs::builtWith( FeatureSet feature_set )
:param feature: Feature to be checked. See :ocv:class:`gpu::FeatureSet`.
:param feature_set: Features to be checked. See :ocv:class:`gpu::FeatureSet`.
There is a set of methods to check whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
......@@ -199,7 +199,7 @@ Provides information on GPU feature support.
.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const
:param feature: Feature to be checked. See :ocv:class:`gpu::FeatureSet`.
:param feature_set: Features to be checked. See :ocv:class:`gpu::FeatureSet`.
This function returns ``true`` if the device has the specified GPU feature. Otherwise, it returns ``false`` .
......
......@@ -49,7 +49,7 @@ Transposes a matrix.
.. ocv:function:: void gpu::transpose( const GpuMat& src1, GpuMat& dst, Stream& stream=Stream::Null() )
:param src: Source matrix. 1-, 4-, 8-byte element sizes are supported for now (CV_8UC1, CV_8UC4, CV_16UC2, CV_32FC1, etc).
:param src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now (CV_8UC1, CV_8UC4, CV_16UC2, CV_32FC1, etc).
:param dst: Destination matrix.
......@@ -65,9 +65,9 @@ Flips a 2D matrix around vertical, horizontal, or both axes.
.. ocv:function:: void gpu::flip( const GpuMat& a, GpuMat& b, int flipCode, Stream& stream=Stream::Null() )
:param src: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
:param a: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
:param dst: Destination matrix.
:param b: Destination matrix.
:param flipCode: Flip mode for the source:
......@@ -143,7 +143,7 @@ gpu::magnitude
------------------
Computes magnitudes of complex matrix elements.
.. ocv:function:: void gpu::magnitude( const GpuMat& x, GpuMat& magnitude, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::magnitude( const GpuMat& xy, GpuMat& magnitude, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::magnitude(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, Stream& stream = Stream::Null())
......@@ -165,7 +165,7 @@ gpu::magnitudeSqr
---------------------
Computes squared magnitudes of complex matrix elements.
.. ocv:function:: void gpu::magnitudeSqr( const GpuMat& x, GpuMat& magnitude, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::magnitudeSqr( const GpuMat& xy, GpuMat& magnitude, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::magnitudeSqr(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, Stream& stream = Stream::Null())
......
......@@ -13,14 +13,16 @@ Computes a matrix-matrix or matrix-scalar sum.
.. ocv:function:: void gpu::add( const GpuMat& a, const Scalar& sc, GpuMat& c, const GpuMat& mask=GpuMat(), int dtype=-1, Stream& stream=Stream::Null() )
:param src1: First source matrix.
:param a: First source matrix.
:param b: Second source matrix to be added to ``a`` . Matrix should have the same size and type as ``a`` .
:param src2: Second source matrix or a scalar to be added to ``src1`` . Matrix should have the same size and type as ``src1`` .
:param sc: A scalar to be added to ``a`` .
:param c: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``a`` depth.
:param dst: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1`` depth.
: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.
:param stream: Stream for the asynchronous version.
......@@ -37,14 +39,16 @@ Computes a matrix-matrix or matrix-scalar difference.
.. ocv:function:: void gpu::subtract( const GpuMat& a, const Scalar& sc, GpuMat& c, const GpuMat& mask=GpuMat(), int dtype=-1, Stream& stream=Stream::Null() )
:param src1: First source matrix.
:param a: First source matrix.
:param b: Second source matrix to be added to ``a`` . Matrix should have the same size and type as ``a`` .
:param sc: A scalar to be added to ``a`` .
:param src2: Second source matrix or a scalar to be added to ``src1`` . Matrix should have the same size and type as ``src1`` .
:param c: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``a`` depth.
:param dst: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1`` depth.
: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.
:param stream: Stream for the asynchronous version.
......@@ -61,14 +65,16 @@ Computes a matrix-matrix or matrix-scalar per-element product.
.. ocv:function:: void gpu::multiply( const GpuMat& a, const Scalar& sc, GpuMat& c, double scale=1, int dtype=-1, Stream& stream=Stream::Null() )
:param src1: First source matrix.
:param a: First source matrix.
:param src2: Second source matrix or a scalar to be multiplied by ``src1`` elements.
:param b: Second source matrix to be multiplied by ``a`` elements.
:param dst: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1`` depth.
:param sc: A scalar to be multiplied by ``a`` elements.
:param c: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``a`` depth.
:param scale: Optional scale factor.
:param dtype: Optional depth of the output array.
:param stream: Stream for the asynchronous version.
......@@ -83,16 +89,20 @@ Computes a matrix-matrix or matrix-scalar division.
.. ocv:function:: void gpu::divide( const GpuMat& a, const GpuMat& b, GpuMat& c, double scale=1, int dtype=-1, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::divide( double scale, const GpuMat& src2, GpuMat& dst, int dtype=-1, Stream& stream=Stream::Null() )
.. ocv:function:: void gpu::divide(const GpuMat& a, const Scalar& sc, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null())
:param src1: First source matrix or a scalar.
.. ocv:function:: void gpu::divide( double scale, const GpuMat& b, GpuMat& c, int dtype=-1, Stream& stream=Stream::Null() )
:param src2: Second source matrix or a scalar. The ``src1`` elements are divided by it.
:param a: First source matrix or a scalar.
:param dst: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``src1`` depth.
:param b: Second source matrix. The ``a`` elements are divided by it.
:param sc: A scalar to be divided by the elements of ``a`` matrix.
:param c: Destination matrix that has the same size and number of channels as the input array(s). The depth is defined by ``dtype`` or ``a`` depth.
:param scale: Optional scale factor.
:param dtype: Optional depth of the output array.
:param stream: Stream for the asynchronous version.
......@@ -113,13 +123,13 @@ Computes the weighted sum of two arrays.
:param alpha: Weight for the first array elements.
:param src2: Second source array of the same size and channel number as ``src1`` .
:param beta: Weight for the second array elements.
:param dst: Destination array that has the same size and number of channels as the input arrays.
: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 stream: Stream for the asynchronous version.
......@@ -188,9 +198,9 @@ Computes an exponent of each matrix element.
.. ocv:function:: void gpu::exp( const GpuMat& a, GpuMat& b, Stream& stream=Stream::Null() )
:param src: Source matrix. Supports ``CV_8U`` , ``CV_16U`` , ``CV_16S`` and ``CV_32F`` depth.
:param a: Source matrix. Supports ``CV_8U`` , ``CV_16U`` , ``CV_16S`` and ``CV_32F`` depth.
:param dst: Destination matrix with the same size and type as ``src`` .
:param b: Destination matrix with the same size and type as ``a`` .
:param stream: Stream for the asynchronous version.
......@@ -204,9 +214,9 @@ Computes a natural logarithm of absolute value of each matrix element.
.. ocv:function:: void gpu::log( const GpuMat& a, GpuMat& b, Stream& stream=Stream::Null() )
:param src: Source matrix. Supports ``CV_8U`` , ``CV_16U`` , ``CV_16S`` and ``CV_32F`` depth.
:param a: Source matrix. Supports ``CV_8U`` , ``CV_16U`` , ``CV_16S`` and ``CV_32F`` depth.
:param dst: Destination matrix with the same size and type as ``src`` .
:param b: Destination matrix with the same size and type as ``a`` .
:param stream: Stream for the asynchronous version.
......@@ -246,11 +256,13 @@ Computes per-element absolute difference of two matrices (or of a matrix and sca
.. ocv:function:: void gpu::absdiff( const GpuMat& a, const Scalar& s, GpuMat& c, Stream& stream=Stream::Null() )
:param src1: First source matrix.
:param a: First source matrix.
:param src2: Second source matrix or a scalar to be added to ``src1`` .
:param b: Second source matrix to be added to ``a`` .
:param dst: Destination matrix with the same size and type as ``src1`` .
:param s: A scalar to be added to ``a`` .
:param c: Destination matrix with the same size and type as ``a`` .
:param stream: Stream for the asynchronous version.
......@@ -264,20 +276,24 @@ Compares elements of two matrices.
.. ocv:function:: void gpu::compare( const GpuMat& a, const GpuMat& b, GpuMat& c, int cmpop, Stream& stream=Stream::Null() )
:param src1: First source matrix.
.. ocv:function:: void gpu::compare(const GpuMat& a, Scalar sc, GpuMat& c, int cmpop, Stream& stream = Stream::Null())
:param src2: Second source matrix with the same size and type as ``src1`` .
:param a: First source matrix.
:param b: Second source matrix with the same size and type as ``a`` .
:param sc: A scalar to be compared with ``a`` .
:param dst: Destination matrix with the same size as ``src1`` and the ``CV_8UC1`` type.
:param c: Destination matrix with the same size as ``a`` and the ``CV_8UC1`` type.
:param cmpop: Flag specifying the relation between the elements to be checked:
* **CMP_EQ:** ``src1(.) == src2(.)``
* **CMP_GT:** ``src1(.) < src2(.)``
* **CMP_GE:** ``src1(.) <= src2(.)``
* **CMP_LT:** ``src1(.) < src2(.)``
* **CMP_LE:** ``src1(.) <= src2(.)``
* **CMP_NE:** ``src1(.) != src2(.)``
* **CMP_EQ:** ``a(.) == b(.)``
* **CMP_GT:** ``a(.) < b(.)``
* **CMP_GE:** ``a(.) <= b(.)``
* **CMP_LT:** ``a(.) < b(.)``
* **CMP_LE:** ``a(.) <= b(.)``
* **CMP_NE:** ``a(.) != b(.)``
:param stream: Stream for the asynchronous version.
......
......@@ -433,11 +433,11 @@ CV_EXPORTS void split(const GpuMat& src, vector<GpuMat>& dst, Stream& stream = S
//! computes magnitude of complex (x(i).re, x(i).im) vector
//! supports only CV_32FC2 type
CV_EXPORTS void magnitude(const GpuMat& x, GpuMat& magnitude, Stream& stream = Stream::Null());
CV_EXPORTS void magnitude(const GpuMat& xy, GpuMat& magnitude, Stream& stream = Stream::Null());
//! computes squared magnitude of complex (x(i).re, x(i).im) vector
//! supports only CV_32FC2 type
CV_EXPORTS void magnitudeSqr(const GpuMat& x, GpuMat& magnitude, Stream& stream = Stream::Null());
CV_EXPORTS void magnitudeSqr(const GpuMat& xy, GpuMat& magnitude, Stream& stream = Stream::Null());
//! computes magnitude of each (x(i), y(i)) vector
//! supports only floating-point source
......@@ -482,7 +482,7 @@ CV_EXPORTS void divide(const GpuMat& a, const GpuMat& b, GpuMat& c, double scale
//! computes element-wise weighted quotient of matrix and scalar (c = a / s)
CV_EXPORTS void divide(const GpuMat& a, const Scalar& sc, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());
//! computes element-wise weighted reciprocal of an array (dst = scale/src2)
CV_EXPORTS void divide(double scale, const GpuMat& src2, GpuMat& dst, int dtype = -1, Stream& stream = Stream::Null());
CV_EXPORTS void divide(double scale, const GpuMat& b, GpuMat& c, int dtype = -1, Stream& stream = Stream::Null());
//! computes the weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)
CV_EXPORTS void addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2, double beta, double gamma, GpuMat& dst,
......@@ -527,7 +527,7 @@ CV_EXPORTS void pow(const GpuMat& src, double power, GpuMat& dst, Stream& stream
//! compares elements of two arrays (c = a <cmpop> b)
CV_EXPORTS void compare(const GpuMat& a, const GpuMat& b, GpuMat& c, int cmpop, Stream& stream = Stream::Null());
CV_EXPORTS void compare(const GpuMat& a, Scalar sc, GpuMat& dst, int cmpop, Stream& stream = Stream::Null());
CV_EXPORTS void compare(const GpuMat& a, Scalar sc, GpuMat& c, int cmpop, Stream& stream = Stream::Null());
//! performs per-elements bit-wise inversion
CV_EXPORTS void bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null());
......
......@@ -177,7 +177,7 @@ Creates the font to draw a text on an image.
:param text: Text to write on an image.
:param location: Point(x,y) where the text should start on an image.
:param org: Point(x,y) where the text should start on an image.
:param font: Font to use to draw a text.
......@@ -236,7 +236,7 @@ Sets a callback function to be called to draw on top of displayed image.
:param window_name: Name of the window.
:param callbackOpenGL: Pointer to the function to be called every frame. This function should be prototyped as ``void Foo(void*)`` .
:param onOpenGlDraw: Pointer to the function to be called every frame. This function should be prototyped as ``void Foo(void*)`` .
:param userdata: Pointer passed to the callback function. *(Optional)*
......
......@@ -182,9 +182,9 @@ Sets mouse handler for the specified window
.. ocv:cfunction:: void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param=NULL )
.. ocv:pyoldfunction:: cv.SetMouseCallback(windowName, onMouse, param=None) -> None
:param name: Window name
:param window_name: Window name
:param onMouse: Mouse callback. See OpenCV samples, such as http://code.opencv.org/svn/opencv/trunk/opencv/samples/cpp/ffilldemo.cpp, on how to specify and use the callback.
:param on_mouse: Mouse callback. See OpenCV samples, such as http://code.opencv.org/svn/opencv/trunk/opencv/samples/cpp/ffilldemo.cpp, on how to specify and use the callback.
:param param: The optional parameter passed to the callback.
......
......@@ -52,7 +52,7 @@ Calculates eigenvalues and eigenvectors of image blocks for corner detection.
:param blockSize: Neighborhood size (see details below).
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
......@@ -105,7 +105,7 @@ Harris edge detector.
:param blockSize: Neighborhood size (see the details on :ocv:func:`cornerEigenValsAndVecs` ).
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param k: Harris detector free parameter. See the formula below.
......@@ -145,7 +145,7 @@ Calculates the minimal eigenvalue of gradient matrices for corner detection.
:param blockSize: Neighborhood size (see the details on :ocv:func:`cornerEigenValsAndVecs` ).
:param apertureSize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param ksize: Aperture parameter for the :ocv:func:`Sobel` operator.
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
......@@ -232,9 +232,9 @@ Determines strong corners on an image.
:param image: Input 8-bit or floating-point 32-bit, single-channel image.
:param eigImage: The parameter is ignored.
:param eig_image: The parameter is ignored.
:param tempImage: The parameter is ignored.
:param temp_image: The parameter is ignored.
:param corners: Output vector of detected corners.
......@@ -298,7 +298,7 @@ Finds circles in a grayscale image using the Hough transform.
:param circles: Output vector of found circles. Each vector is encoded as a 3-element floating-point vector :math:`(x, y, radius)` .
:param circleStorage: In C function this is a memory storage that will contain the output sequence of found circles.
:param circle_storage: In C function this is a memory storage that will contain the output sequence of found circles.
:param method: Detection method to use. Currently, the only implemented method is ``CV_HOUGH_GRADIENT`` , which is basically *21HT* , described in [Yuen90]_.
......@@ -516,7 +516,7 @@ Calculates a feature map for corner detection.
:param dst: Output image that has the type ``CV_32F`` and the same size as ``src`` .
:param apertureSize: Aperture size of the :ocv:func:`Sobel` .
:param ksize: Aperture size of the :ocv:func:`Sobel` .
:param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` .
......
This diff is collapsed.
......@@ -210,7 +210,7 @@ Calculates an affine matrix of 2D rotation.
:param scale: Isotropic scale factor.
:param mapMatrix: The output affine transformation, 2x3 floating-point matrix.
:param map_matrix: The output affine transformation, 2x3 floating-point matrix.
The function calculates the following matrix:
......
......@@ -18,13 +18,13 @@ Calculates a histogram of a set of arrays.
.. ocv:cfunction:: void cvCalcHist( IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr* mask=NULL )
.. ocv:pyoldfunction:: cv.CalcHist(image, hist, accumulate=0, mask=None)-> None
:param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
:param images: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
:param narrays: Number of source arrays.
:param nimages: Number of source images.
:param channels: List of the ``dims`` channels used to compute the histogram. The first array channels are numerated from 0 to ``arrays[0].channels()-1`` , the second array channels are counted from ``arrays[0].channels()`` to ``arrays[0].channels() + arrays[1].channels()-1``, and so on.
:param channels: List of the ``dims`` channels used to compute the histogram. The first array channels are numerated from 0 to ``images[0].channels()-1`` , the second array channels are counted from ``images[0].channels()`` to ``images[0].channels() + images[1].channels()-1``, and so on.
:param mask: Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size as ``arrays[i]`` . The non-zero mask elements mark the array elements counted in the histogram.
:param mask: Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size as ``images[i]`` . The non-zero mask elements mark the array elements counted in the histogram.
:param hist: Output histogram, which is a dense or sparse ``dims`` -dimensional array.
......@@ -115,15 +115,15 @@ Calculates the back projection of a histogram.
.. ocv:cfunction:: void cvCalcBackProject( IplImage** image, CvArr* backProject, const CvHistogram* hist )
.. ocv:pyoldfunction:: cv.CalcBackProject(image, back_project, hist) -> None
:param arrays: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
:param images: Source arrays. They all should have the same depth, ``CV_8U`` or ``CV_32F`` , and the same size. Each of them can have an arbitrary number of channels.
:param narrays: Number of source arrays.
:param nimages: Number of source images.
:param channels: The list of channels used to compute the back projection. The number of channels must match the histogram dimensionality. The first array channels are numerated from 0 to ``arrays[0].channels()-1`` , the second array channels are counted from ``arrays[0].channels()`` to ``arrays[0].channels() + arrays[1].channels()-1``, and so on.
:param channels: The list of channels used to compute the back projection. The number of channels must match the histogram dimensionality. The first array channels are numerated from 0 to ``images[0].channels()-1`` , the second array channels are counted from ``images[0].channels()`` to ``images[0].channels() + images[1].channels()-1``, and so on.
:param hist: Input histogram that can be dense or sparse.
:param backProject: Destination back projection array that is a single-channel array of the same size and depth as ``arrays[0]`` .
:param backProject: Destination back projection array that is a single-channel array of the same size and depth as ``images[0]`` .
:param ranges: Array of arrays of the histogram bin boundaries in each dimension. See :ocv:func:`calcHist` .
......@@ -235,7 +235,7 @@ Computes the "minimal work" distance between two weighted point configurations.
:param distType: Used metric. ``CV_DIST_L1, CV_DIST_L2`` , and ``CV_DIST_C`` stand for one of the standard metrics. ``CV_DIST_USER`` means that a pre-calculated cost matrix ``cost`` is used.
:param distFunc: Custom distance function supported by the old interface. ``CvDistanceFunction`` is defined as: ::
:param distance_func: Custom distance function supported by the old interface. ``CvDistanceFunction`` is defined as: ::
typedef float (CV_CDECL * CvDistanceFunction)( const float* a,
const float* b, void* userdata );
......@@ -333,7 +333,7 @@ Divides one histogram by another.
:param hist2: Second histogram.
:param dsthist: Destination histogram.
:param dst_hist: Destination histogram.
:param scale: Scale factor for the destination histogram.
......
......@@ -499,7 +499,7 @@ Fills a connected component with the given color.
.. note:: Since the mask is larger than the filled image, a pixel :math:`(x, y)` in ``image`` corresponds to the pixel :math:`(x+1, y+1)` in the ``mask`` .
:param seed: Starting point.
:param seedPoint: Starting point.
:param newVal: New value of the repainted domain pixels.
......@@ -529,7 +529,7 @@ The functions ``floodFill`` fill a connected component starting from the seed po
.. math::
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)+ \texttt{upDiff}
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}
in case of a grayscale image and fixed range
......@@ -556,17 +556,17 @@ The functions ``floodFill`` fill a connected component starting from the seed po
.. math::
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_r+ \texttt{upDiff} _r,
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,
.. math::
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_g+ \texttt{upDiff} _g
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g
and
.. math::
\texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seed} .x, \texttt{seed} .y)_b+ \texttt{upDiff} _b
\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b
in case of a color image and fixed range
......@@ -663,9 +663,9 @@ Applies a fixed-level threshold to each array element.
:param thresh: Threshold 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 thresholdType: 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
......@@ -673,19 +673,19 @@ bi-level (binary) image out of a grayscale image (
:ocv:func:`compare` could
be also used for this purpose) or for removing a noise, that is, filtering
out pixels with too small or too large values. There are several
types of thresholding supported by the function. They are determined by ``thresholdType`` :
types of thresholding supported by the function. They are determined by ``type`` :
* **THRESH_BINARY**
.. math::
\texttt{dst} (x,y) = \fork{\texttt{maxVal}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}
\texttt{dst} (x,y) = \fork{\texttt{maxval}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}
* **THRESH_BINARY_INV**
.. math::
\texttt{dst} (x,y) = \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{maxVal}}{otherwise}
\texttt{dst} (x,y) = \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{maxval}}{otherwise}
* **THRESH_TRUNC**
......@@ -755,7 +755,7 @@ Runs the GrabCut algorithm.
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> None
:param image: Input 8-bit 3-channel image.
:param img: Input 8-bit 3-channel image.
:param mask: Input/output 8-bit single-channel mask. The mask is initialized by the function when ``mode`` is set to ``GC_INIT_WITH_RECT``. Its elements may have one of following values:
......
......@@ -175,7 +175,7 @@ Approximates a polygonal curve(s) with the specified precision.
.. ocv:pyfunction:: cv2.approxPolyDP(curve, epsilon, closed[, approxCurve]) -> approxCurve
.. ocv:cfunction:: CvSeq* cvApproxPoly( const void* src_seq, int header_size, CvMemStorage* storage, int method, double parameter, int parameter2=0 )
.. ocv:cfunction:: CvSeq* cvApproxPoly( const void* src_seq, int header_size, CvMemStorage* storage, int method, double eps, int recursive=0 )
:param curve: Input vector of a 2D point stored in:
......@@ -191,7 +191,7 @@ Approximates a polygonal curve(s) with the specified precision.
:param closed: If true, the approximated curve is closed (its first and last vertices are connected). Otherwise, it is not closed.
:param headerSize: Header size of the approximated curve. Normally, ``sizeof(CvContour)`` is used.
:param header_size: Header size of the approximated curve. Normally, ``sizeof(CvContour)`` is used.
:param storage: Memory storage where the approximated curve is stored.
......@@ -213,7 +213,7 @@ Approximates Freeman chain(s) with a polygonal curve.
.. ocv:pyoldfunction:: cv.ApproxChains(src_seq, storage, method=CV_CHAIN_APPROX_SIMPLE, parameter=0, minimal_perimeter=0, recursive=0)-> contours
:param chain: Pointer to the approximated Freeman chain that can refer to other chains.
:param src_seq: Pointer to the approximated Freeman chain that can refer to other chains.
:param storage: Storage location for the resulting polylines.
......@@ -221,7 +221,7 @@ Approximates Freeman chain(s) with a polygonal curve.
: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 minimal_perimeter: 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 from ``chain`` by using the ``h_next`` or ``v_next`` links. Otherwise, the single input chain is approximated.
......@@ -323,7 +323,7 @@ Finds the convex hull of a point set.
: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 are the convex hull points themselves.
:param storage: Output memory storage in the old API (``cvConvexHull2`` returns a sequence containing the convex hull points or their indices).
:param hull_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 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.
......
......@@ -351,8 +351,8 @@ CVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );
a tree of polygonal curves (contours) */
CVAPI(CvSeq*) cvApproxPoly( const void* src_seq,
int header_size, CvMemStorage* storage,
int method, double parameter,
int parameter2 CV_DEFAULT(0));
int method, double eps,
int recursive CV_DEFAULT(0));
/* Calculates perimeter of a contour or length of a part of contour */
CVAPI(double) cvArcLength( const void* curve,
......
......@@ -70,15 +70,15 @@ CvSeq* icvApproximateChainTC89( CvChain* chain, int header_size,
CvChainPtReader reader;
CvSeqWriter writer;
CvPoint pt = chain->origin;
CV_Assert( CV_IS_SEQ_CHAIN_CONTOUR( chain ));
CV_Assert( header_size >= (int)sizeof(CvContour) );
cvStartWriteSeq( (chain->flags & ~CV_SEQ_ELTYPE_MASK) | CV_SEQ_ELTYPE_POINT,
header_size, sizeof( CvPoint ), storage, &writer );
if( chain->total == 0 )
{
{
CV_WRITE_SEQ_ELEM( pt, writer );
return cvEndWriteSeq( &writer );
}
......@@ -380,13 +380,13 @@ CV_IMPL CvSeq*
cvApproxChains( CvSeq* src_seq,
CvMemStorage* storage,
int method,
double /*parameter*/,
int minimal_perimeter,
double /*parameter*/,
int minimal_perimeter,
int recursive )
{
CvSeq *prev_contour = 0, *parent = 0;
CvSeq *dst_seq = 0;
if( !src_seq || !storage )
CV_Error( CV_StsNullPtr, "" );
if( method > CV_CHAIN_APPROX_TC89_KCOS || method <= 0 || minimal_perimeter < 0 )
......@@ -399,7 +399,7 @@ cvApproxChains( CvSeq* src_seq,
if( len >= minimal_perimeter )
{
CvSeq *contour = 0;
switch( method )
{
case CV_CHAIN_APPROX_NONE:
......@@ -471,7 +471,7 @@ cvApproxChains( CvSeq* src_seq,
/* the version for integer point coordinates */
template<typename T> static CvSeq*
icvApproxPolyDP( CvSeq* src_contour, int header_size,
icvApproxPolyDP( CvSeq* src_contour, int header_size,
CvMemStorage* storage, double eps )
{
typedef cv::Point_<T> PT;
......@@ -486,7 +486,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
CvMemStorage* temp_storage = 0;
CvSeq* stack = 0;
CvSeq* dst_contour;
assert( CV_SEQ_ELTYPE(src_contour) == cv::DataType<PT>::type );
cvStartWriteSeq( src_contour->flags, header_size, sizeof(pt), storage, &writer );
......@@ -518,7 +518,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
init_iters = 1;
}
}
if( is_closed )
{
/* 1. Find approximately two farthest points of the contour */
......@@ -629,10 +629,10 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
CV_WRITE_SEQ_ELEM( end_pt, writer );
dst_contour = cvEndWriteSeq( &writer );
// last stage: do final clean-up of the approximated contour -
// remove extra points on the [almost] stright lines.
// remove extra points on the [almost] stright lines.
cvStartReadSeq( dst_contour, &reader, is_closed );
CV_READ_SEQ_ELEM( start_pt, reader );
......@@ -675,7 +675,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
CV_IMPL CvSeq*
cvApproxPoly( const void* array, int header_size,
CvMemStorage* storage, int method,
CvMemStorage* storage, int method,
double parameter, int parameter2 )
{
CvSeq* dst_seq = 0;
......
......@@ -15,6 +15,17 @@ params_blacklist = {
"gpu::swapChannels" : ("dstOrder") # parameter is not parsed correctly by the hdr_parser
}
ERROR_001_SECTIONFAILURE = 1
ERROR_002_HDRWHITESPACE = 2
ERROR_003_PARENTHESES = 3
WARNING_004_TABS = 4
ERROR_005_REDEFENITIONPARAM = 5
ERROR_006_REDEFENITIONFUNC = 6
WARNING_007_UNDOCUMENTEDPARAM = 7
WARNING_008_MISSINGPARAM = 8
WARNING_009_HDRMISMATCH = 9
ERROR_010_NOMODULE = 10
params_mapping = {
"composeRT" : {
"dr3dr1" : "d*d*",
......@@ -122,15 +133,16 @@ class RstParser(object):
self.parse_section(module_name, section_name, file_name, lineno, lines)
except AssertionError, args:
if show_errors:
print >> sys.stderr, "RST parser error: assertion in \"%s\" File: %s (line %s)" % (section_name, file_name, lineno)
print >> sys.stderr, "RST parser error E%03d: assertion in \"%s\" at %s:%s" % (ERROR_001_SECTIONFAILURE, section_name, file_name, lineno)
print >> sys.stderr, " Details: %s" % args
def parse_section(self, module_name, section_name, file_name, lineno, lines):
self.sections_total += 1
# skip sections having whitespace in name
if section_name.find(" ") >= 0 and section_name.find("::operator") < 0:
#if section_name.find(" ") >= 0 and section_name.find("::operator") < 0:
if section_name.find(" ") >= 0 and not bool(re.match(r"(\w+::)*operator\s*(\w+|>>|<<|\(\)|->|\+\+|--|=|==|\+=|-=)", section_name)):
if show_errors:
print "SKIPPED: \"%s\" File: %s (line %s)" % (section_name, file_name, lineno)
print "RST parser error E%03d: SKIPPED: \"%s\" File: %s:%s" % (ERROR_002_HDRWHITESPACE, section_name, file_name, lineno)
self.sections_skipped += 1
return
......@@ -273,7 +285,7 @@ class RstParser(object):
if fdecl.balance != 0:
if show_critical_errors:
print >> sys.stderr, "RST parser error: invalid parentheses balance in \"%s\" File: %s:%s" % (section_name, file_name, lineno)
print >> sys.stderr, "RST parser error E%03d: invalid parentheses balance in \"%s\" at %s:%s" % (ERROR_003_PARENTHESES, section_name, file_name, lineno)
return
# save last parameter if needed
......@@ -309,7 +321,7 @@ class RstParser(object):
if l.find("\t") >= 0:
whitespace_warnings += 1
if whitespace_warnings <= max_whitespace_warnings and show_warnings:
print >> sys.stderr, "RST parser warning: tab symbol instead of space is used at file %s (line %s)" % (doc, lineno)
print >> sys.stderr, "RST parser warning W%03d: tab symbol instead of space is used at %s:%s" % (WARNING_004_TABS, doc, lineno)
l = l.replace("\t", " ")
# handle first line
......@@ -358,8 +370,8 @@ class RstParser(object):
if show_errors:
#check black_list
if decl.name not in params_blacklist.get(func["name"], []):
print >> sys.stderr, "RST parser error: redefinition of parameter \"%s\" in \"%s\" File: %s (line %s)" \
% (decl.name, func["name"], func["file"], func["line"])
print >> sys.stderr, "RST parser error E%03d: redefinition of parameter \"%s\" in \"%s\" at %s:%s" \
% (ERROR_005_REDEFENITIONPARAM, decl.name, func["name"], func["file"], func["line"])
else:
params[decl.name] = decl.comment
func["params"] = params
......@@ -369,7 +381,7 @@ class RstParser(object):
if skipped:
print >> out, "SKIPPED DEFINITION:"
print >> out, "name: %s" % (func.get("name","~empty~"))
print >> out, "file: %s (line %s)" % (func.get("file","~empty~"), func.get("line","~empty~"))
print >> out, "file: %s:%s" % (func.get("file","~empty~"), func.get("line","~empty~"))
print >> out, "is class: %s" % func.get("isclass",False)
print >> out, "is struct: %s" % func.get("isstruct",False)
print >> out, "module: %s" % func.get("module","~unknown~")
......@@ -396,8 +408,8 @@ class RstParser(object):
return False
if func["name"] in self.definitions:
if show_errors:
print >> sys.stderr, "RST parser error: \"%s\" from file: %s (line %s) is already documented in file: %s (line %s)" \
% (func["name"], func["file"], func["line"], self.definitions[func["name"]]["file"], self.definitions[func["name"]]["line"])
print >> sys.stderr, "RST parser error E%03d: \"%s\" from: %s:%s is already documented at %s:%s" \
% (ERROR_006_REDEFENITIONFUNC, func["name"], func["file"], func["line"], self.definitions[func["name"]]["file"], self.definitions[func["name"]]["line"])
return False
return self.validateParams(func)
......@@ -417,13 +429,13 @@ class RstParser(object):
# 1. all params are documented
for p in params:
if p not in documentedParams and show_warnings:
print >> sys.stderr, "RST parser warning: parameter \"%s\" of \"%s\" is undocumented. File: %s (line %s)" % (p, func["name"], func["file"], func["line"])
print >> sys.stderr, "RST parser warning W%03d: parameter \"%s\" of \"%s\" is undocumented. %s:%s" % (WARNING_007_UNDOCUMENTEDPARAM, p, func["name"], func["file"], func["line"])
# 2. only real params are documented
for p in documentedParams:
if p not in params and show_warnings:
if p not in params_blacklist.get(func["name"], []):
print >> sys.stderr, "RST parser warning: unexisting parameter \"%s\" of \"%s\" is documented. File: %s (line %s)" % (p, func["name"], func["file"], func["line"])
print >> sys.stderr, "RST parser warning W%03d: unexisting parameter \"%s\" of \"%s\" is documented at %s:%s" % (WARNING_008_MISSINGPARAM, p, func["name"], func["file"], func["line"])
return True
def normalize(self, func):
......@@ -490,11 +502,11 @@ class RstParser(object):
fname = fname.replace(".", "::")
if fname.startswith("cv::cv"):
if fname[6:] == func.get("name", ""):
if fname[6:] == func.get("name", "").replace("*", "_n"):
func["name"] = fname[4:]
func["method"] = fname[4:]
elif show_warnings:
print >> sys.stderr, "\"%s\" - section name is \"%s\" instead of \"%s\". File: %s (line %s)" % (fname, func["name"], fname[6:], func["file"], func["line"])
print >> sys.stderr, "RST parser warning W%03d: \"%s\" - section name is \"%s\" instead of \"%s\" at %s:%s" % (WARNING_009_HDRMISMATCH, fname, func["name"], fname[6:], func["file"], func["line"])
#self.print_info(func)
def normalizeText(self, s):
......@@ -711,7 +723,7 @@ if __name__ == "__main__":
module = sys.argv[1]
if module != "all" and not os.path.isdir(os.path.join(rst_parser_dir, "../" + module)):
print "Module \"" + module + "\" could not be found."
print "RST parser error E%03d: module \"%s\" could not be found." % (ERROR_010_NOMODULE, module)
exit(1)
parser = RstParser(hdr_parser.CppHeaderParser())
......
......@@ -77,7 +77,7 @@ Estimates the Gaussian mixture parameters from a sample set.
:param samples: Samples from which the Gaussian mixture model will be estimated.
:param sample_idx: Mask of samples to use. All samples are used by default.
:param sampleIdx: Mask of samples to use. All samples are used by default.
:param params: Parameters of the EM algorithm.
......
......@@ -260,9 +260,6 @@ Trains a randomized tree classifier using an input set of keypoints.
:param num_quant_bits: Number of bits used for quantization.
:param print_status: Current status of training printed on the console.
RTreeClassifier::getSignature
---------------------------------
......
......@@ -16,27 +16,27 @@ Calculates the optical flow for two images by using the block matching method.
:param curr: Second image, 8-bit, single-channel
:param blockSize: Size of basic blocks that are compared
:param block_size: Size of basic blocks that are compared
:param shiftSize: Block coordinate increments
:param shift_size: Block coordinate increments
:param maxRange: Size of the scanned neighborhood in pixels around the block
:param max_range: Size of the scanned neighborhood in pixels around the block
:param usePrevious: Flag that specifies whether to use the input velocity as initial approximations or not.
:param use_previous: Flag that specifies whether to use the input velocity as initial approximations or not.
:param velx: Horizontal component of the optical flow of
.. math::
\left \lfloor \frac{\texttt{prev->width} - \texttt{blockSize.width}}{\texttt{shiftSize.width}} \right \rfloor \times \left \lfloor \frac{\texttt{prev->height} - \texttt{blockSize.height}}{\texttt{shiftSize.height}} \right \rfloor
\left \lfloor \frac{\texttt{prev->width} - \texttt{block_size.width}}{\texttt{shift_size.width}} \right \rfloor \times \left \lfloor \frac{\texttt{prev->height} - \texttt{block_size.height}}{\texttt{shift_size.height}} \right \rfloor
size, 32-bit floating-point, single-channel
:param vely: Vertical component of the optical flow of the same size ``velx`` , 32-bit floating-point, single-channel
The function calculates the optical flow for overlapped blocks ``blockSize.width x blockSize.height`` pixels each, thus the velocity fields are smaller than the original images. For every block in ``prev``
the functions tries to find a similar block in ``curr`` in some neighborhood of the original block or shifted by ``(velx(x0,y0), vely(x0,y0))`` block as has been calculated by previous function call (if ``usePrevious=1``)
The function calculates the optical flow for overlapped blocks ``block_size.width x block_size.height`` pixels each, thus the velocity fields are smaller than the original images. For every block in ``prev``
the functions tries to find a similar block in ``curr`` in some neighborhood of the original block or shifted by ``(velx(x0,y0), vely(x0,y0))`` block as has been calculated by previous function call (if ``use_previous=1``)
CalcOpticalFlowHS
......@@ -51,7 +51,7 @@ Calculates the optical flow for two images using Horn-Schunck algorithm.
:param curr: Second image, 8-bit, single-channel
:param usePrevious: Flag that specifies whether to use the input velocity as initial approximations or not.
:param use_previous: Flag that specifies whether to use the input velocity as initial approximations or not.
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
......@@ -77,7 +77,7 @@ Calculates the optical flow for two images using Lucas-Kanade algorithm.
:param curr: Second image, 8-bit, single-channel
:param winSize: Size of the averaging window used for grouping pixels
:param win_size: Size of the averaging window used for grouping pixels
:param velx: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
......
......@@ -33,7 +33,7 @@ Extract features and computes their descriptors using SIFT algorithm
.. ocv:function:: void SIFT::operator()(InputArray img, InputArray mask, vector<KeyPoint>& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
:param image: Input 8-bit grayscale image
:param img: Input 8-bit grayscale image
:param mask: Optional input mask that marks the regions where we should detect features.
......
......@@ -336,6 +336,10 @@ class CppHeaderParser(object):
else:
atype = arg
aname = "param"
if aname.endswith("]"):
bidx = aname.find('[')
atype += aname[bidx:]
aname = aname[:bidx]
decl[3].append([atype, aname, defval, []])
if static_method:
......
......@@ -79,13 +79,13 @@ 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 prevImg: First 8-bit single-channel input image.
:param prev: First 8-bit single-channel input image.
:param nextImg: Second input image of the same size and the same type as ``prevImg`` .
: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 ``prevImg`` and type ``CV_32FC2`` .
:param flow: Computed flow image that has the same size as ``prev`` and type ``CV_32FC2`` .
:param pyrScale: Parameter specifying the image scale (<1) to build pyramids for each image. ``pyrScale=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.
......@@ -93,9 +93,9 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
:param iterations: Number of iterations the algorithm does at each pyramid level.
:param polyN: 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, ``polyN`` =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 polySigma: Standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion. For ``polyN=5`` , you can set ``polySigma=1.1`` . For ``polyN=7`` , a good value would be ``polySigma=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:
......@@ -103,11 +103,11 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
* **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.
The function finds an optical flow for each ``prevImg`` pixel using the [Farneback2003]_ algorithm so that
The function finds an optical flow for each ``prev`` pixel using the [Farneback2003]_ algorithm so that
.. math::
\texttt{prevImg} (y,x) \sim \texttt{nextImg} ( y + \texttt{flow} (y,x)[1], x + \texttt{flow} (y,x)[0])
\texttt{prev} (y,x) \sim \texttt{next} ( y + \texttt{flow} (y,x)[1], x + \texttt{flow} (y,x)[0])
estimateRigidTransform
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment