From: Andrey Kamaev Date: Tue, 29 May 2012 10:36:19 +0000 (+0000) Subject: Fixed documentation: corrected parameter names X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4851 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05de6302fdf5e5df5ff641bc05b697f3ec047e85;p=platform%2Fupstream%2Fopencv.git Fixed documentation: corrected parameter names --- diff --git a/doc/check_docs2.py b/doc/check_docs2.py index 2d7fe68..6434f91 100644 --- a/doc/check_docs2.py +++ b/doc/check_docs2.py @@ -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]), " " 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) diff --git a/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst b/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst index 77067e9..732bf0e 100644 --- a/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst +++ b/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst @@ -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. diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index 344f5ed..a763c4a 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -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`` 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.). diff --git a/modules/core/doc/clustering.rst b/modules/core/doc/clustering.rst index d0d17fd..46130bc 100644 --- a/modules/core/doc/clustering.rst +++ b/modules/core/doc/clustering.rst @@ -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 diff --git a/modules/core/doc/drawing_functions.rst b/modules/core/doc/drawing_functions.rst index 06c6fb5..3140a24 100644 --- a/modules/core/doc/drawing_functions.rst +++ b/modules/core/doc/drawing_functions.rst @@ -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 diff --git a/modules/core/doc/dynamic_structures.rst b/modules/core/doc/dynamic_structures.rst index 59a8865..deb36d8 100644 --- a/modules/core/doc/dynamic_structures.rst +++ b/modules/core/doc/dynamic_structures.rst @@ -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 diff --git a/modules/core/doc/old_basic_structures.rst b/modules/core/doc/old_basic_structures.rst index 2b0e6e0..b43affa 100644 --- a/modules/core/doc/old_basic_structures.rst +++ b/modules/core/doc/old_basic_structures.rst @@ -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 diff --git a/modules/core/doc/old_xml_yaml_persistence.rst b/modules/core/doc/old_xml_yaml_persistence.rst index e644062..b439734 100644 --- a/modules/core/doc/old_xml_yaml_persistence.rst +++ b/modules/core/doc/old_xml_yaml_persistence.rst @@ -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. diff --git a/modules/core/doc/operations_on_arrays.rst b/modules/core/doc/operations_on_arrays.rst index a5b39c9..db5f49f 100644 --- a/modules/core/doc/operations_on_arrays.rst +++ b/modules/core/doc/operations_on_arrays.rst @@ -10,7 +10,8 @@ Computes an absolute value of each matrix element. .. ocv:function:: MatExpr abs( const Mat& m ) .. ocv:function:: MatExpr abs( const MatExpr& e ) - :param src: Matrix or matrix expression. + :param m: Matrix. + :param e: Matrix expression. ``abs`` is a meta-function that is expanded to one of :ocv:func:`absdiff` forms: @@ -464,7 +465,7 @@ Checks every element of an input array for invalid values. .. ocv:pyfunction:: cv2.checkRange(a[, quiet[, minVal[, maxVal]]]) -> retval, pos - :param src: Array to check. + :param a: Array to check. :param quiet: Flag indicating whether the functions quietly return false when the array elements are out of range or they throw an exception. @@ -639,13 +640,13 @@ Counts non-zero array elements. .. ocv:pyoldfunction:: cv.CountNonZero(arr)-> int - :param mtx: Single-channel array. + :param src: Single-channel array. -The function returns the number of non-zero elements in ``mtx`` : +The function returns the number of non-zero elements in ``src`` : .. math:: - \sum _{I: \; \texttt{mtx} (I) \ne0 } 1 + \sum _{I: \; \texttt{src} (I) \ne0 } 1 .. seealso:: @@ -663,7 +664,7 @@ Converts ``CvMat``, ``IplImage`` , or ``CvMatND`` to ``Mat``. .. ocv:function:: Mat cvarrToMat( const CvArr* arr, bool copyData=false, bool allowND=true, int coiMode=0 ) - :param src: Source ``CvMat``, ``IplImage`` , or ``CvMatND`` . + :param arr: Source ``CvMat``, ``IplImage`` , or ``CvMatND`` . :param copyData: When it is false (default value), no data is copied and only the new header is created. In this case, the original array should not be deallocated while the new matrix header is used. If the parameter is true, all the data is copied and you may deallocate the original array right after the conversion. @@ -678,7 +679,7 @@ Converts ``CvMat``, ``IplImage`` , or ``CvMatND`` to ``Mat``. The function ``cvarrToMat`` converts ``CvMat``, ``IplImage`` , or ``CvMatND`` header to :ocv:class:`Mat` header, and optionally duplicates the underlying data. The constructed header is returned by the function. -When ``copyData=false`` , the conversion is done really fast (in O(1) time) and the newly created matrix header will have ``refcount=0`` , which means that no reference counting is done for the matrix data. In this case, you have to preserve the data until the new header is destructed. Otherwise, when ``copyData=true`` , the new buffer is allocated and managed as if you created a new matrix from scratch and copied the data there. That is, ``cvarrToMat(src, true)`` is equivalent to ``cvarrToMat(src, false).clone()`` (assuming that COI is not set). The function provides a uniform way of supporting +When ``copyData=false`` , the conversion is done really fast (in O(1) time) and the newly created matrix header will have ``refcount=0`` , which means that no reference counting is done for the matrix data. In this case, you have to preserve the data until the new header is destructed. Otherwise, when ``copyData=true`` , the new buffer is allocated and managed as if you created a new matrix from scratch and copied the data there. That is, ``cvarrToMat(arr, true)`` is equivalent to ``cvarrToMat(arr, false).clone()`` (assuming that COI is not set). The function provides a uniform way of supporting ``CvArr`` paradigm in the code that is migrated to use new-style data structures internally. The reverse transformation, from ``Mat`` to ``CvMat`` or @@ -1113,11 +1114,11 @@ Extracts the selected image channel. .. ocv:function:: void extractImageCOI( const CvArr* arr, OutputArray coiimg, int coi=-1 ) - :param src: Source array. It should be a pointer to ``CvMat`` or ``IplImage`` . + :param arr: Source array. It should be a pointer to ``CvMat`` or ``IplImage`` . - :param dst: Destination array with a single channel and the same size and depth as ``src`` . + :param coiimg: Destination array with a single channel and the same size and depth as ``arr`` . - :param coi: If the parameter is ``>=0`` , it specifies the channel to extract. If it is ``<0`` and ``src`` is a pointer to ``IplImage`` with a valid COI set, the selected COI is extracted. + :param coi: If the parameter is ``>=0`` , it specifies the channel to extract. If it is ``<0`` and ``arr`` is a pointer to ``IplImage`` with a valid COI set, the selected COI is extracted. The function ``extractImageCOI`` is used to extract an image COI from an old-style array and put the result to the new-style C++ matrix. As usual, the destination matrix is reallocated using ``Mat::create`` if needed. @@ -1134,11 +1135,11 @@ Copies the selected image channel from a new-style C++ matrix to the old-style C .. ocv:function:: void insertImageCOI( InputArray coiimg, CvArr* arr, int coi=-1 ) - :param src: Source array with a single channel and the same size and depth as ``dst``. + :param coiimg: Source array with a single channel and the same size and depth as ``arr``. - :param dst: Destination array, it should be a pointer to ``CvMat`` or ``IplImage``. + :param arr: Destination array, it should be a pointer to ``CvMat`` or ``IplImage``. - :param coi: If the parameter is ``>=0`` , it specifies the channel to insert. If it is ``<0`` and ``dst`` is a pointer to ``IplImage`` with a valid COI set, the selected COI is extracted. + :param coi: If the parameter is ``>=0`` , it specifies the channel to insert. If it is ``<0`` and ``arr`` is a pointer to ``IplImage`` with a valid COI set, the selected COI is extracted. The function ``insertImageCOI`` is used to extract an image COI from a new-style C++ matrix and put the result to the old-style array. @@ -1899,11 +1900,11 @@ Copies specified channels from input arrays to the specified channels of output :param src: Input array or vector of matrices. All the matrices must have the same size and the same depth. - :param nsrc: Number of matrices in ``src`` . + :param nsrcs: Number of matrices in ``src`` . :param dst: Output array or vector of matrices. All the matrices *must be allocated* . Their size and depth must be the same as in ``src[0]`` . - :param ndst: Number of matrices in ``dst`` . + :param ndsts: Number of matrices in ``dst`` . :param fromTo: Array of index pairs specifying which channels are copied and where. ``fromTo[k*2]`` is a 0-based index of the input channel in ``src`` . ``fromTo[k*2+1]`` is an index of the output channel in ``dst`` . The continuous channel numbering is used: the first input image channels are indexed from ``0`` to ``src[0].channels()-1`` , the second input image channels are indexed from ``src[0].channels()`` to ``src[0].channels() + src[1].channels()-1``, and so on. The same scheme is used for the output image channels. As a special case, when ``fromTo[k*2]`` is negative, the corresponding output channel is filled with zero . @@ -1959,13 +1960,13 @@ Performs the per-element multiplication of two Fourier spectrums. :param flags: Operation flags. Currently, the only supported flag is ``DFT_ROWS``, which indicates that each row of ``src1`` and ``src2`` is an independent 1D Fourier spectrum. - :param conj: Optional flag that conjugates the second source array before the multiplication (true) or not (false). + :param conjB: Optional flag that conjugates the second source array before the multiplication (true) or not (false). The function ``mulSpectrums`` performs the per-element multiplication of the two CCS-packed or complex matrices that are results of a real or complex Fourier transform. The function, together with :ocv:func:`dft` and -:ocv:func:`idft` , may be used to calculate convolution (pass ``conj=false`` ) or correlation (pass ``conj=true`` ) of two arrays rapidly. When the arrays are complex, they are simply multiplied (per element) with an optional conjugation of the second-array elements. When the arrays are real, they are assumed to be CCS-packed (see +:ocv:func:`idft` , may be used to calculate convolution (pass ``conjB=false`` ) or correlation (pass ``conjB=true`` ) of two arrays rapidly. When the arrays are complex, they are simply multiplied (per element) with an optional conjugation of the second-array elements. When the arrays are real, they are assumed to be CCS-packed (see :ocv:func:`dft` for details). @@ -2037,11 +2038,11 @@ Calculates the product of a matrix and its transposition. :param aTa: Flag specifying the multiplication ordering. See the description below. - :param delta: Optional delta matrix subtracted from ``src`` before the multiplication. When the matrix is empty ( ``delta=noArray()`` ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as ``src`` , it is simply subtracted. Otherwise, it is "repeated" (see :ocv:func:`repeat` ) to cover the full ``src`` and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created destination matrix. See the ``rtype`` parameter description below. + :param delta: Optional delta matrix subtracted from ``src`` before the multiplication. When the matrix is empty ( ``delta=noArray()`` ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as ``src`` , it is simply subtracted. Otherwise, it is "repeated" (see :ocv:func:`repeat` ) to cover the full ``src`` and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created destination matrix. See the ``dtype`` parameter description below. :param scale: Optional scale factor for the matrix product. - :param rtype: Optional type of the destination matrix. When it is negative, the destination matrix will have the same type as ``src`` . Otherwise, it will be ``type=CV_MAT_DEPTH(rtype)`` that should be either ``CV_32F`` or ``CV_64F`` . + :param dtype: Optional type of the destination matrix. When it is negative, the destination matrix will have the same type as ``src`` . Otherwise, it will be ``type=CV_MAT_DEPTH(dtype)`` that should be either ``CV_32F`` or ``CV_64F`` . The function ``mulTransposed`` calculates the product of ``src`` and its transposition: @@ -2143,7 +2144,7 @@ Normalizes the norm or value range of an array. :param normType: Normalization type. See the details below. - :param rtype: When the parameter is negative, the destination array has the same type as ``src``. Otherwise, it has the same number of channels as ``src`` and the depth ``=CV_MAT_DEPTH(rtype)`` . + :param dtype: When the parameter is negative, the destination array has the same type as ``src``. Otherwise, it has the same number of channels as ``src`` and the depth ``=CV_MAT_DEPTH(dtype)`` . :param mask: Optional operation mask. @@ -2334,7 +2335,7 @@ Performs the perspective matrix transformation of vectors. :param dst: Destination array of the same size and type as ``src`` . - :param mtx: ``3x3`` or ``4x4`` floating-point transformation matrix. + :param m: ``3x3`` or ``4x4`` floating-point transformation matrix. The function ``perspectiveTransform`` transforms every element of ``src`` by treating it as a 2D or 3D vector, in the following way: @@ -2447,15 +2448,15 @@ Raises every array element to a power. :param src: Source array. - :param p: Exponent of power. + :param power: Exponent of power. :param dst: Destination array of the same size and type as ``src`` . -The function ``pow`` raises every element of the input array to ``p`` : +The function ``pow`` raises every element of the input array to ``power`` : .. math:: - \texttt{dst} (I) = \fork{\texttt{src}(I)^p}{if \texttt{p} is integer}{|\texttt{src}(I)|^p}{otherwise} + \texttt{dst} (I) = \fork{\texttt{src}(I)^power}{if \texttt{power} is integer}{|\texttt{src}(I)|^power}{otherwise} So, for a non-integer power exponent, the absolute values of input array elements are used. However, it is possible to get true values for negative values using some extra operations. In the example below, computing the 5th root of array ``src`` shows: :: @@ -2464,7 +2465,7 @@ So, for a non-integer power exponent, the absolute values of input array element subtract(Scalar::all(0), dst, dst, mask); -For some values of ``p`` , such as integer values, 0.5 and -0.5, specialized faster algorithms are used. +For some values of ``power`` , such as integer values, 0.5 and -0.5, specialized faster algorithms are used. Special values (NaN, Inf) are not handled. @@ -2633,7 +2634,7 @@ Generates a single uniformly-distributed random number or an array of random num .. ocv:pyfunction:: cv2.randu(dst, low, high) -> None - :param mtx: Output array of random numbers. The array must be pre-allocated. + :param dst: Output array of random numbers. The array must be pre-allocated. :param low: Inclusive lower boundary of the generated random numbers. @@ -2642,11 +2643,11 @@ Generates a single uniformly-distributed random number or an array of random num The template functions ``randu`` generate and return the next uniformly-distributed random value of the specified type. ``randu()`` is an equivalent to ``(int)theRNG();`` , and so on. See :ocv:class:`RNG` description. -The second non-template variant of the function fills the matrix ``mtx`` with uniformly-distributed random numbers from the specified range: +The second non-template variant of the function fills the matrix ``dst`` with uniformly-distributed random numbers from the specified range: .. math:: - \texttt{low} _c \leq \texttt{mtx} (I)_c < \texttt{high} _c + \texttt{low} _c \leq \texttt{dst} (I)_c < \texttt{high} _c .. seealso:: @@ -2664,13 +2665,13 @@ Fills the array with normally distributed random numbers. .. ocv:pyfunction:: cv2.randn(dst, mean, stddev) -> None - :param mtx: Output array of random numbers. The array must be pre-allocated and have 1 to 4 channels. + :param dst: Output array of random numbers. The array must be pre-allocated and have 1 to 4 channels. :param mean: Mean value (expectation) of the generated random numbers. :param stddev: Standard deviation of the generated random numbers. It can be either a vector (in which case a diagonal standard deviation matrix is assumed) or a square matrix. -The function ``randn`` fills the matrix ``mtx`` with normally distributed random numbers with the specified mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the value range of the destination array data type. +The function ``randn`` fills the matrix ``dst`` with normally distributed random numbers with the specified mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the value range of the destination array data type. .. seealso:: @@ -2687,13 +2688,13 @@ Shuffles the array elements randomly. .. ocv:pyfunction:: cv2.randShuffle(dst[, iterFactor]) -> None - :param mtx: Input/output numerical 1D array. + :param dst: Input/output numerical 1D array. :param iterFactor: Scale factor that determines the number of random swap operations. See the details below. :param rng: Optional random number generator used for shuffling. If it is zero, :ocv:func:`theRNG` () is used instead. -The function ``randShuffle`` shuffles the specified 1D array by randomly choosing pairs of elements and swapping them. The number of such swap operations will be ``mtx.rows*mtx.cols*iterFactor`` . +The function ``randShuffle`` shuffles the specified 1D array by randomly choosing pairs of elements and swapping them. The number of such swap operations will be ``dst.rows*dst.cols*iterFactor`` . .. seealso:: @@ -2713,13 +2714,13 @@ Reduces a matrix to a vector. .. ocv:cfunction:: void cvReduce(const CvArr* src, CvArr* dst, int dim=-1, int op=CV_REDUCE_SUM) .. ocv:pyoldfunction:: cv.Reduce(src, dst, dim=-1, op=CV_REDUCE_SUM)-> None - :param mtx: Source 2D matrix. + :param src: Source 2D matrix. - :param vec: Destination vector. Its size and type is defined by ``dim`` and ``dtype`` parameters. + :param dst: Destination vector. Its size and type is defined by ``dim`` and ``dtype`` parameters. :param dim: Dimension index along which the matrix is reduced. 0 means that the matrix is reduced to a single row. 1 means that the matrix is reduced to a single column. - :param reduceOp: Reduction operation that could be one of the following: + :param rtype: Reduction operation that could be one of the following: * **CV_REDUCE_SUM** The output is the sum of all rows/columns of the matrix. @@ -2729,7 +2730,7 @@ Reduces a matrix to a vector. * **CV_REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the matrix. - :param dtype: When it is negative, the destination vector will have the same type as the source matrix. Otherwise, its type will be ``CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels())`` . + :param dtype: When it is negative, the destination vector will have the same type as the source matrix. Otherwise, its type will be ``CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels())`` . The function ``reduce`` reduces the matrix to a vector by treating the matrix rows/columns as a set of 1D vectors and performing the specified operation on the vectors until a single row/column is obtained. For example, the function can be used to compute horizontal and vertical projections of a raster image. In case of ``CV_REDUCE_SUM`` and ``CV_REDUCE_AVG`` , the output may have a larger element bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction modes. @@ -2831,7 +2832,7 @@ Initializes a scaled identity matrix. .. ocv:pyoldfunction:: cv.SetIdentity(mat, value=1)-> None - :param dst: Matrix to initialize (not necessarily square). + :param mtx: Matrix to initialize (not necessarily square). :param value: Value to assign to diagonal elements. @@ -2840,7 +2841,7 @@ The function .. math:: - \texttt{dst} (i,j)= \fork{\texttt{value}}{ if $i=j$}{0}{otherwise} + \texttt{mtx} (i,j)= \fork{\texttt{value}}{ if $i=j$}{0}{otherwise} The function can also be emulated using the matrix initializers and the matrix expressions: :: @@ -3047,15 +3048,15 @@ Divides a multi-channel array into several single-channel arrays. .. ocv:pyoldfunction:: cv.Split(src, dst0, dst1, dst2, dst3)-> None - :param mtx: Source multi-channel array. + :param src: Source multi-channel array. - :param mv: Destination array or vector of arrays. In the first variant of the function the number of arrays must match ``mtx.channels()`` . The arrays themselves are reallocated, if needed. + :param mv: Destination array or vector of arrays. In the first variant of the function the number of arrays must match ``src.channels()`` . The arrays themselves are reallocated, if needed. The functions ``split`` split a multi-channel array into separate single-channel arrays: .. math:: - \texttt{mv} [c](I) = \texttt{mtx} (I)_c + \texttt{mv} [c](I) = \texttt{src} (I)_c If you need to extract a single channel or do some other sophisticated channel permutation, use :ocv:func:`mixChannels` . @@ -3248,7 +3249,7 @@ Performs SVD of a matrix :param u: Computed left singular vectors - :param v: Computed right singular vectors + :param V: Computed right singular vectors :param vt: Transposed matrix of right singular values @@ -3296,7 +3297,7 @@ Performs a singular value back substitution. :param u: Left singular vectors - :param v: Right singular vectors + :param V: Right singular vectors :param vt: Transposed matrix of right singular vectors. @@ -3395,30 +3396,30 @@ Performs the matrix transformation of every array element. .. ocv:pyoldfunction:: cv.Transform(src, dst, transmat, shiftvec=None)-> None - :param src: Source array that must have as many channels (1 to 4) as ``mtx.cols`` or ``mtx.cols-1``. + :param src: Source array that must have as many channels (1 to 4) as ``m.cols`` or ``m.cols-1``. - :param dst: Destination array of the same size and depth as ``src`` . It has as many channels as ``mtx.rows`` . + :param dst: Destination array of the same size and depth as ``src`` . It has as many channels as ``m.rows`` . - :param mtx: Transformation ``2x2`` or ``2x3`` floating-point matrix. + :param m: Transformation ``2x2`` or ``2x3`` floating-point matrix. - :param shiftvec: Optional translation vector (when ``mtx`` is ``2x2``) + :param shiftvec: Optional translation vector (when ``m`` is ``2x2``) The function ``transform`` performs the matrix transformation of every element of the array ``src`` and stores the results in ``dst`` : .. math:: - \texttt{dst} (I) = \texttt{mtx} \cdot \texttt{src} (I) + \texttt{dst} (I) = \texttt{m} \cdot \texttt{src} (I) -(when ``mtx.cols=src.channels()`` ), or +(when ``m.cols=src.channels()`` ), or .. math:: - \texttt{dst} (I) = \texttt{mtx} \cdot [ \texttt{src} (I); 1] + \texttt{dst} (I) = \texttt{m} \cdot [ \texttt{src} (I); 1] -(when ``mtx.cols=src.channels()+1`` ) +(when ``m.cols=src.channels()+1`` ) Every element of the ``N`` -channel array ``src`` is interpreted as ``N`` -element vector that is transformed using -the ``M x N`` or ``M x (N+1)`` matrix ``mtx`` +the ``M x N`` or ``M x (N+1)`` matrix ``m`` to ``M``-element vector - the corresponding element of the destination array ``dst`` . The function may be used for geometrical transformation of diff --git a/modules/core/doc/utility_and_system_functions_and_macros.rst b/modules/core/doc/utility_and_system_functions_and_macros.rst index fe6195f..6433495 100644 --- a/modules/core/doc/utility_and_system_functions_and_macros.rst +++ b/modules/core/doc/utility_and_system_functions_and_macros.rst @@ -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. diff --git a/modules/core/doc/xml_yaml_persistence.rst b/modules/core/doc/xml_yaml_persistence.rst index 058f7ca..9f053ea 100644 --- a/modules/core/doc/xml_yaml_persistence.rst +++ b/modules/core/doc/xml_yaml_persistence.rst @@ -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. diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index e544258..ebb66a3 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -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, diff --git a/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst b/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst index 2ddd986..1694388 100644 --- a/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst +++ b/modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst @@ -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. diff --git a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst index 0556ccb..76ba82d 100644 --- a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst +++ b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst @@ -415,7 +415,7 @@ DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector ---------------------------------------------------------------- The constructor -.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr& adjaster, int min_features=400, int max_features=500, int max_iters=5 ) +.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr& adjuster, int min_features=400, int max_features=500, int max_iters=5 ) :param adjuster: :ocv:class:`AdjusterAdapter` that detects features and adjusts parameters. diff --git a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst index 5e360d9..2669ab9 100644 --- a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst +++ b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst @@ -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. diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index 52165e1..91795a0 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -51,15 +51,15 @@ namespace cv { - + CV_EXPORTS bool initModule_features2d(); /*! The Keypoint Class - + The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint detectors, such as Harris corner detector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT, cv::LDetector etc. - + The keypoint is characterized by the 2D position, scale (proportional to the diameter of the neighborhood that needs to be taken into account), orientation and some other parameters. The keypoint neighborhood is then analyzed by another algorithm that builds a descriptor @@ -81,9 +81,9 @@ public: float _response=0, int _octave=0, int _class_id=-1) : pt(x, y), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} - + size_t hash() const; - + //! converts vector of keypoints to vector of points static void convert(const vector& keypoints, CV_OUT vector& points2f, @@ -103,13 +103,13 @@ public: CV_PROP_RW float angle; //!< computed orientation of the keypoint (-1 if not applicable) CV_PROP_RW float response; //!< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted - CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to) + CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to) }; - + //! writes vector of keypoints to the file storage CV_EXPORTS void write(FileStorage& fs, const string& name, const vector& keypoints); //! reads vector of keypoints from the specified file storage node -CV_EXPORTS void read(const FileNode& node, CV_OUT vector& keypoints); +CV_EXPORTS void read(const FileNode& node, CV_OUT vector& keypoints); /* * A class filters a vector of keypoints. @@ -138,14 +138,14 @@ public: * Remove duplicated keypoints. */ static void removeDuplicated( vector& keypoints ); - + /* * Retain the specified number of the best keypoints (according to the response) */ static void retainBest(vector& keypoints, int npoints); }; - + /************************************ Base Classes ************************************/ /* @@ -155,7 +155,7 @@ class CV_EXPORTS_W FeatureDetector : public virtual Algorithm { public: virtual ~FeatureDetector(); - + /* * Detect keypoints in an image. * image The image. @@ -164,7 +164,7 @@ public: * matrix with non-zero values in the region of interest. */ CV_WRAP void detect( const Mat& image, CV_OUT vector& keypoints, const Mat& mask=Mat() ) const; - + /* * Detect keypoints in an image set. * images Image collection. @@ -172,16 +172,16 @@ public: * masks Masks for image set. masks[i] is a mask for images[i]. */ void detect( const vector& images, vector >& keypoints, const vector& masks=vector() ) const; - + // Return true if detector object is empty CV_WRAP virtual bool empty() const; - + // Create feature detector by detector name. CV_WRAP static Ptr create( const string& detectorType ); - + protected: virtual void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const = 0; - + /* * Remove keypoints that are not in the mask. * Helper function, useful when wrapping a library call for keypoint detection that @@ -189,8 +189,8 @@ protected: */ static void removeInvalidPoints( const Mat& mask, vector& keypoints ); }; - - + + /* * Abstract base class for computing descriptors for image keypoints. * @@ -204,7 +204,7 @@ class CV_EXPORTS_W DescriptorExtractor : public virtual Algorithm { public: virtual ~DescriptorExtractor(); - + /* * Compute the descriptors for a set of keypoints in an image. * image The image. @@ -212,7 +212,7 @@ public: * descriptors Copmputed descriptors. Row i is the descriptor for keypoint i. */ CV_WRAP void compute( const Mat& image, CV_OUT CV_IN_OUT vector& keypoints, CV_OUT Mat& descriptors ) const; - + /* * Compute the descriptors for a keypoints collection detected in image collection. * images Image collection. @@ -221,26 +221,26 @@ public: * descriptors Descriptor collection. descriptors[i] are descriptors computed for set keypoints[i]. */ void compute( const vector& images, vector >& keypoints, vector& descriptors ) const; - + CV_WRAP virtual int descriptorSize() const = 0; CV_WRAP virtual int descriptorType() const = 0; - + CV_WRAP virtual bool empty() const; - + CV_WRAP static Ptr create( const string& descriptorExtractorType ); - + protected: virtual void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const = 0; - + /* * Remove keypoints within borderPixels of an image edge. */ static void removeBorderKeypoints( vector& keypoints, Size imageSize, int borderSize ); }; - - - + + + /* * Abstract base class for simultaneous 2D feature detection descriptor extraction. */ @@ -254,18 +254,18 @@ public: * mask Mask specifying where to look for keypoints (optional). Must be a char * matrix with non-zero values in the region of interest. * useProvidedKeypoints If true, the method will skip the detection phase and will compute - * descriptors for the provided keypoints + * descriptors for the provided keypoints */ CV_WRAP_AS(detectAndCompute) virtual void operator()( InputArray image, InputArray mask, CV_OUT vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false ) const = 0; - + // Create feature detector and descriptor extractor by name. static Ptr create( const string& name ); }; - - + + /*! ORB implementation. */ @@ -289,14 +289,14 @@ public: // Compute the ORB features and descriptors on an image void operator()( InputArray image, InputArray mask, vector& keypoints, OutputArray descriptors, bool useProvidedKeypoints=false ) const; - + AlgorithmInfo* info() const; - + protected: void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const; void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; - + CV_PROP_RW int nfeatures; CV_PROP_RW double scaleFactor; CV_PROP_RW int nlevels; @@ -306,18 +306,18 @@ protected: CV_PROP_RW int scoreType; CV_PROP_RW int patchSize; }; - + typedef ORB OrbFeatureDetector; typedef ORB OrbDescriptorExtractor; /*! Maximal Stable Extremal Regions class. - + The class implements MSER algorithm introduced by J. Matas. Unlike SIFT, SURF and many other detectors in OpenCV, this is salient region detector, not the salient point detector. - + It returns the regions, each of those is encoded as a contour. */ class CV_EXPORTS_W MSER : public FeatureDetector @@ -328,15 +328,15 @@ public: double _max_variation=0.25, double _min_diversity=.2, int _max_evolution=200, double _area_threshold=1.01, double _min_margin=0.003, int _edge_blur_size=5 ); - + //! the operator that extracts the MSERs from the image or the specific part of it CV_WRAP_AS(detect) void operator()( const Mat& image, CV_OUT vector >& msers, - const Mat& mask=Mat() ) const; + const Mat& mask=Mat() ) const; AlgorithmInfo* info() const; - + protected: void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; - + int delta; int minArea; int maxArea; @@ -347,12 +347,12 @@ protected: double minMargin; int edgeBlurSize; }; - + typedef MSER MserFeatureDetector; /*! The "Star" Detector. - + The class implements the keypoint detector introduced by K. Konolige. */ class CV_EXPORTS_W StarDetector : public FeatureDetector @@ -363,16 +363,16 @@ public: int _lineThresholdProjected=10, int _lineThresholdBinarized=8, int _suppressNonmaxSize=5); - + //! finds the keypoints in the image CV_WRAP_AS(detect) void operator()(const Mat& image, CV_OUT vector& keypoints) const; - + AlgorithmInfo* info() const; - + protected: void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; - + int maxSize; int responseThreshold; int lineThresholdProjected; @@ -389,7 +389,7 @@ class CV_EXPORTS_W FastFeatureDetector : public FeatureDetector public: CV_WRAP FastFeatureDetector( int threshold=10, bool nonmaxSuppression=true ); AlgorithmInfo* info() const; - + protected: virtual void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; @@ -469,7 +469,7 @@ protected: Params params; }; - + class CV_EXPORTS DenseFeatureDetector : public FeatureDetector { public: @@ -486,10 +486,10 @@ protected: double initFeatureScale; int featureScaleLevels; double featureScaleMul; - + int initXyStep; int initImgBound; - + bool varyXyStepWithScale; bool varyImgBoundWithScale; }; @@ -511,7 +511,7 @@ public: CV_WRAP GridAdaptedFeatureDetector( const Ptr& detector, int maxTotalKeypoints=1000, int gridRows=4, int gridCols=4 ); - + // TODO implement read/write virtual bool empty() const; @@ -533,7 +533,7 @@ class CV_EXPORTS_W PyramidAdaptedFeatureDetector : public FeatureDetector public: // maxLevel - The 0-based index of the last pyramid layer CV_WRAP PyramidAdaptedFeatureDetector( const Ptr& detector, int maxLevel=2 ); - + // TODO implement read/write virtual bool empty() const; @@ -549,7 +549,7 @@ protected: */ class CV_EXPORTS AdjusterAdapter: public FeatureDetector { -public: +public: /** pure virtual interface */ virtual ~AdjusterAdapter() {} @@ -588,13 +588,13 @@ class CV_EXPORTS DynamicAdaptedFeatureDetector: public FeatureDetector { public: - /** \param adjaster an AdjusterAdapter that will do the detection and parameter adjustment + /** \param adjuster an AdjusterAdapter that will do the detection and parameter adjustment * \param max_features the maximum desired number of features * \param max_iters the maximum number of times to try to adjust the feature detector params * for the FastAdjuster this can be high, but with Star or Surf this can get time consuming * \param min_features the minimum desired features */ - DynamicAdaptedFeatureDetector( const Ptr& adjaster, int min_features=400, int max_features=500, int max_iters=5 ); + DynamicAdaptedFeatureDetector( const Ptr& adjuster, int min_features=400, int max_features=500, int max_iters=5 ); virtual bool empty() const; @@ -741,7 +741,7 @@ protected: /****************************************************************************************\ * Distance * \****************************************************************************************/ - + template struct CV_EXPORTS Accumulator { @@ -762,7 +762,7 @@ struct CV_EXPORTS SL2 enum { normType = NORM_L2SQR }; typedef T ValueType; typedef typename Accumulator::Type ResultType; - + ResultType operator()( const T* a, const T* b, int size ) const { return normL2Sqr(a, b, size); @@ -778,7 +778,7 @@ struct CV_EXPORTS L2 enum { normType = NORM_L2 }; typedef T ValueType; typedef typename Accumulator::Type ResultType; - + ResultType operator()( const T* a, const T* b, int size ) const { return (ResultType)sqrt((double)normL2Sqr(a, b, size)); @@ -794,7 +794,7 @@ struct CV_EXPORTS L1 enum { normType = NORM_L1 }; typedef T ValueType; typedef typename Accumulator::Type ResultType; - + ResultType operator()( const T* a, const T* b, int size ) const { return normL1(a, b, size); @@ -810,7 +810,7 @@ struct CV_EXPORTS Hamming enum { normType = NORM_HAMMING }; typedef unsigned char ValueType; typedef int ResultType; - + /** this will count the bits in a ^ b */ ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const @@ -826,13 +826,13 @@ template struct CV_EXPORTS HammingMultilevel enum { normType = NORM_HAMMING + (cellsize>1) }; typedef unsigned char ValueType; typedef int ResultType; - + ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const { return normHamming(a, b, size, cellsize); } -}; - +}; + /****************************************************************************************\ * DMatch * \****************************************************************************************/ @@ -1042,7 +1042,7 @@ public: virtual void train(); virtual bool isMaskSupported() const; - + virtual Ptr clone( bool emptyTrainData=false ) const; protected: diff --git a/modules/gpu/doc/image_filtering.rst b/modules/gpu/doc/image_filtering.rst index 2e522a8..348a425 100644 --- a/modules/gpu/doc/image_filtering.rst +++ b/modules/gpu/doc/image_filtering.rst @@ -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`. diff --git a/modules/gpu/doc/initalization_and_information.rst b/modules/gpu/doc/initalization_and_information.rst index c281185..c679b4e 100644 --- a/modules/gpu/doc/initalization_and_information.rst +++ b/modules/gpu/doc/initalization_and_information.rst @@ -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`` . diff --git a/modules/gpu/doc/operations_on_matrices.rst b/modules/gpu/doc/operations_on_matrices.rst index 19ec350..7f586a1 100644 --- a/modules/gpu/doc/operations_on_matrices.rst +++ b/modules/gpu/doc/operations_on_matrices.rst @@ -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()) diff --git a/modules/gpu/doc/per_element_operations.rst b/modules/gpu/doc/per_element_operations.rst index 29278b6..2670ba3 100644 --- a/modules/gpu/doc/per_element_operations.rst +++ b/modules/gpu/doc/per_element_operations.rst @@ -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. diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index aebe6d4..e411094 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -433,11 +433,11 @@ CV_EXPORTS void split(const GpuMat& src, vector& 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 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()); diff --git a/modules/highgui/doc/qt_new_functions.rst b/modules/highgui/doc/qt_new_functions.rst index e84e3ef..bd889db 100644 --- a/modules/highgui/doc/qt_new_functions.rst +++ b/modules/highgui/doc/qt_new_functions.rst @@ -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)* diff --git a/modules/highgui/doc/user_interface.rst b/modules/highgui/doc/user_interface.rst index bad9244..659d86e 100644 --- a/modules/highgui/doc/user_interface.rst +++ b/modules/highgui/doc/user_interface.rst @@ -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. diff --git a/modules/imgproc/doc/feature_detection.rst b/modules/imgproc/doc/feature_detection.rst index 449a83e..f5fba80 100644 --- a/modules/imgproc/doc/feature_detection.rst +++ b/modules/imgproc/doc/feature_detection.rst @@ -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` . diff --git a/modules/imgproc/doc/filtering.rst b/modules/imgproc/doc/filtering.rst index 5a79ac0..3ed4297 100644 --- a/modules/imgproc/doc/filtering.rst +++ b/modules/imgproc/doc/filtering.rst @@ -678,9 +678,9 @@ Returns an engine for smoothing images with the Gaussian filter. :param ksize: Aperture size. See :ocv:func:`getGaussianKernel` . - :param sigmaX: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` . + :param sigma1: Gaussian sigma in the horizontal direction. See :ocv:func:`getGaussianKernel` . - :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 borderType: Border type to use. See :ocv:func:`borderInterpolate` . @@ -701,7 +701,7 @@ createLinearFilter ---------------------- Creates a non-separable linear filter engine. -.. ocv:function:: Ptr createLinearFilter( int srcType, int dstType, InputArray kernel, Point _anchor=Point(-1,-1), double delta=0, int _rowBorderType=BORDER_DEFAULT, int _columnBorderType=-1, const Scalar& _borderValue=Scalar() ) +.. ocv:function:: Ptr createLinearFilter( int srcType, int dstType, InputArray kernel, Point _anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar() ) .. ocv:function:: Ptr getLinearFilter(int srcType, int dstType, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int bits=0) @@ -737,7 +737,7 @@ createMorphologyFilter -------------------------- Creates an engine for non-separable morphological operations. -.. ocv:function:: Ptr createMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1), int _rowBorderType=BORDER_CONSTANT, int _columnBorderType=-1, const Scalar& _borderValue=morphologyDefaultBorderValue() ) +.. ocv:function:: Ptr createMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, int columnBorderType=-1, const Scalar& borderValue=morphologyDefaultBorderValue() ) .. ocv:function:: Ptr getMorphologyFilter( int op, int type, InputArray kernel, Point anchor=Point(-1,-1) ) @@ -751,9 +751,9 @@ Creates an engine for non-separable morphological operations. :param type: Input/output image type. The number of channels can be arbitrary. The depth should be one of ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F` or ``CV_64F``. - :param element: 2D 8-bit structuring element for a morphological operation. Non-zero elements indicate the pixels that belong to the element. + :param kernel: 2D 8-bit structuring element for a morphological operation. Non-zero elements indicate the pixels that belong to the element. - :param esize: Horizontal or vertical structuring element size for separable morphological operations. + :param ksize: Horizontal or vertical structuring element size for separable morphological operations. :param anchor: Anchor position within the structuring element. Negative values mean that the anchor is at the kernel center. @@ -783,7 +783,7 @@ createSeparableLinearFilter ------------------------------- Creates an engine for a separable linear filter. -.. ocv:function:: Ptr createSeparableLinearFilter( int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, Point _anchor=Point(-1,-1), double delta=0, int _rowBorderType=BORDER_DEFAULT, int _columnBorderType=-1, const Scalar& _borderValue=Scalar() ) +.. ocv:function:: Ptr createSeparableLinearFilter( int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, Point anchor=Point(-1,-1), double delta=0, int rowBorderType=BORDER_DEFAULT, int columnBorderType=-1, const Scalar& borderValue=Scalar() ) .. ocv:function:: Ptr getLinearColumnFilter( int bufType, int dstType, InputArray kernel, int anchor, int symmetryType, double delta=0, int bits=0 ) @@ -1126,9 +1126,9 @@ Returns a structuring element of the specified size and shape for morphological :param anchor: Anchor position within the element. The default value :math:`(-1, -1)` means that the anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor position. In other cases the anchor just regulates how much the result of the morphological operation is shifted. - :param anchorX: x-coordinate of the anchor + :param anchor_x: x-coordinate of the anchor - :param anchorY: y-coordinate of the anchor + :param anchor_y: y-coordinate of the anchor :param values: integer array of ``cols``*``rows`` elements that specifies the custom shape of the structuring element, when ``shape=CV_SHAPE_CUSTOM``. @@ -1418,9 +1418,9 @@ Applies a separable linear filter to an image. when ``ddepth=-1``, the destination image will have the same depth as the source. - :param rowKernel: Coefficients for filtering each row. + :param kernelX: Coefficients for filtering each row. - :param columnKernel: Coefficients for filtering each column. + :param kernelY: Coefficients for filtering each column. :param anchor: Anchor position within the kernel. The default value :math:`(-1, 1)` means that the anchor is at the kernel center. @@ -1428,7 +1428,7 @@ Applies a separable linear filter to an image. :param borderType: Pixel extrapolation method. See :ocv:func:`borderInterpolate` for details. -The function applies a separable linear filter to the image. That is, first, every row of ``src`` is filtered with the 1D kernel ``rowKernel`` . Then, every column of the result is filtered with the 1D kernel ``columnKernel`` . The final result shifted by ``delta`` is stored in ``dst`` . +The function applies a separable linear filter to the image. That is, first, every row of ``src`` is filtered with the 1D kernel ``kernelX`` . Then, every column of the result is filtered with the 1D kernel ``kernelY`` . The final result shifted by ``delta`` is stored in ``dst`` . .. seealso:: @@ -1454,32 +1454,32 @@ Smooths the image in one of several ways. :param smoothtype: Type of the smoothing: - * **CV_BLUR_NO_SCALE** linear convolution with :math:`\texttt{param1}\times\texttt{param2}` box kernel (all 1's). If you want to smooth different pixels with different-size box kernels, you can use the integral image that is computed using :ocv:func:`integral` + * **CV_BLUR_NO_SCALE** linear convolution with :math:`\texttt{size1}\times\texttt{size2}` box kernel (all 1's). If you want to smooth different pixels with different-size box kernels, you can use the integral image that is computed using :ocv:func:`integral` - * **CV_BLUR** linear convolution with :math:`\texttt{param1}\times\texttt{param2}` box kernel (all 1's) with subsequent scaling by :math:`1/(\texttt{param1}\cdot\texttt{param2})` + * **CV_BLUR** linear convolution with :math:`\texttt{size1}\times\texttt{size2}` box kernel (all 1's) with subsequent scaling by :math:`1/(\texttt{size1}\cdot\texttt{size2})` - * **CV_GAUSSIAN** linear convolution with a :math:`\texttt{param1}\times\texttt{param2}` Gaussian kernel + * **CV_GAUSSIAN** linear convolution with a :math:`\texttt{size1}\times\texttt{size2}` Gaussian kernel - * **CV_MEDIAN** median filter with a :math:`\texttt{param1}\times\texttt{param1}` square aperture + * **CV_MEDIAN** median filter with a :math:`\texttt{size1}\times\texttt{size1}` square aperture - * **CV_BILATERAL** bilateral filter with a :math:`\texttt{param1}\times\texttt{param1}` square aperture, color sigma= ``param3`` and spatial sigma= ``param4`` . If ``param1=0`` , the aperture square side is set to ``cvRound(param4*1.5)*2+1`` . Information about bilateral filtering can be found at http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.html + * **CV_BILATERAL** bilateral filter with a :math:`\texttt{size1}\times\texttt{size1}` square aperture, color sigma= ``sigma1`` and spatial sigma= ``sigma2`` . If ``size1=0`` , the aperture square side is set to ``cvRound(sigma2*1.5)*2+1`` . Information about bilateral filtering can be found at http://www.dai.ed.ac.uk/CVonline/LOCAL\_COPIES/MANDUCHI1/Bilateral\_Filtering.html - :param param1: The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...) + :param size1: The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...) - :param param2: The second parameter of the smoothing operation, the aperture height. Ignored by ``CV_MEDIAN`` and ``CV_BILATERAL`` methods. In the case of simple scaled/non-scaled and Gaussian blur if ``param2`` is zero, it is set to ``param1`` . Otherwise it must be a positive odd number. + :param size2: The second parameter of the smoothing operation, the aperture height. Ignored by ``CV_MEDIAN`` and ``CV_BILATERAL`` methods. In the case of simple scaled/non-scaled and Gaussian blur if ``size2`` is zero, it is set to ``size1`` . Otherwise it must be a positive odd number. - :param param3: In the case of a Gaussian parameter this parameter may specify Gaussian :math:`\sigma` (standard deviation). If it is zero, it is calculated from the kernel size: + :param sigma1: In the case of a Gaussian parameter this parameter may specify Gaussian :math:`\sigma` (standard deviation). If it is zero, it is calculated from the kernel size: .. math:: - \sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{param1} for horizontal kernel} \\ \mbox{\texttt{param2} for vertical kernel} \end{array} + \sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{size1} for horizontal kernel} \\ \mbox{\texttt{size2} for vertical kernel} \end{array} - Using standard sigma for small kernels ( :math:`3\times 3` to :math:`7\times 7` ) gives better speed. If ``param3`` is not zero, while ``param1`` and ``param2`` are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation). + Using standard sigma for small kernels ( :math:`3\times 3` to :math:`7\times 7` ) gives better speed. If ``sigma1`` is not zero, while ``size1`` and ``size2`` are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation). The function smooths an image using one of several methods. Every of the methods has some features and restrictions listed below: @@ -1593,9 +1593,9 @@ Calculates the first x- or y- image derivative using Scharr operator. :param ddepth: Destination image depth. See :ocv:func:`Sobel` for the list of supported combination of ``src.depth()`` and ``ddepth``. - :param xorder: Order of the derivative x. + :param dx: Order of the derivative x. - :param yorder: Order of the derivative y. + :param dy: Order of the derivative y. :param scale: Optional scale factor for the computed derivative values. By default, no scaling is applied. See :ocv:func:`getDerivKernels` for details. @@ -1607,13 +1607,13 @@ The function computes the first x- or y- spatial image derivative using the Scha .. math:: - \texttt{Scharr(src, dst, ddepth, xorder, yorder, scale, delta, borderType)} + \texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)} is equivalent to .. math:: - \texttt{Sobel(src, dst, ddepth, xorder, yorder, CV\_SCHARR, scale, delta, borderType)} . + \texttt{Sobel(src, dst, ddepth, dx, dy, CV\_SCHARR, scale, delta, borderType)} . .. seealso:: diff --git a/modules/imgproc/doc/geometric_transformations.rst b/modules/imgproc/doc/geometric_transformations.rst index 5391a04..998a077 100644 --- a/modules/imgproc/doc/geometric_transformations.rst +++ b/modules/imgproc/doc/geometric_transformations.rst @@ -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: diff --git a/modules/imgproc/doc/histograms.rst b/modules/imgproc/doc/histograms.rst index f20bfd0..db731a8 100644 --- a/modules/imgproc/doc/histograms.rst +++ b/modules/imgproc/doc/histograms.rst @@ -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. diff --git a/modules/imgproc/doc/miscellaneous_transformations.rst b/modules/imgproc/doc/miscellaneous_transformations.rst index c70f2c0..863e5dd 100644 --- a/modules/imgproc/doc/miscellaneous_transformations.rst +++ b/modules/imgproc/doc/miscellaneous_transformations.rst @@ -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: diff --git a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst index 6ef45c1..6b4eda0 100644 --- a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst +++ b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst @@ -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. diff --git a/modules/imgproc/include/opencv2/imgproc/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc/imgproc.hpp index 68eba83..9bbcde4 100644 --- a/modules/imgproc/include/opencv2/imgproc/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc/imgproc.hpp @@ -60,20 +60,20 @@ namespace cv //! various border interpolation methods enum { BORDER_REPLICATE=IPL_BORDER_REPLICATE, BORDER_CONSTANT=IPL_BORDER_CONSTANT, - BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP, + BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP, BORDER_REFLECT_101=IPL_BORDER_REFLECT_101, BORDER_REFLECT101=BORDER_REFLECT_101, BORDER_TRANSPARENT=IPL_BORDER_TRANSPARENT, BORDER_DEFAULT=BORDER_REFLECT_101, BORDER_ISOLATED=16 }; -//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p. +//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p. CV_EXPORTS_W int borderInterpolate( int p, int len, int borderType ); /*! The Base Class for 1D or Row-wise Filters - + This is the base class for linear or non-linear filters that process 1D data. In particular, such filters are used for the "horizontal" filtering parts in separable filters. - + Several functions in OpenCV return Ptr for the specific types of filters, and those pointers can be used directly or within cv::FilterEngine. */ @@ -93,17 +93,17 @@ public: /*! The Base Class for Column-wise Filters - + This is the base class for linear or non-linear filters that process columns of 2D arrays. Such filters are used for the "vertical" filtering parts in separable filters. - + Several functions in OpenCV return Ptr for the specific types of filters, and those pointers can be used directly or within cv::FilterEngine. - + Unlike cv::BaseRowFilter, cv::BaseColumnFilter may have some context information, i.e. box filter keeps the sliding sum of elements. To reset the state BaseColumnFilter::reset() must be called (e.g. the method is called by cv::FilterEngine) - */ + */ class CV_EXPORTS BaseColumnFilter { public: @@ -121,15 +121,15 @@ public: /*! The Base Class for Non-Separable 2D Filters. - + This is the base class for linear or non-linear 2D filters. - + Several functions in OpenCV return Ptr for the specific types of filters, and those pointers can be used directly or within cv::FilterEngine. - + Similar to cv::BaseColumnFilter, the class may have some context information, that should be reset using BaseFilter::reset() method before processing the new array. -*/ +*/ class CV_EXPORTS BaseFilter { public: @@ -148,7 +148,7 @@ public: /*! The Main Class for Image Filtering. - + The class can be used to apply an arbitrary filtering operation to an image. It contains all the necessary intermediate buffers, it computes extrapolated values of the "virtual" pixels outside of the image etc. @@ -156,45 +156,45 @@ public: are returned by various OpenCV functions, such as cv::createSeparableLinearFilter(), cv::createLinearFilter(), cv::createGaussianFilter(), cv::createDerivFilter(), cv::createBoxFilter() and cv::createMorphologyFilter(). - + Using the class you can process large images by parts and build complex pipelines that include filtering as some of the stages. If all you need is to apply some pre-defined filtering operation, you may use cv::filter2D(), cv::erode(), cv::dilate() etc. functions that create FilterEngine internally. - + Here is the example on how to use the class to implement Laplacian operator, which is the sum of second-order derivatives. More complex variant for different types is implemented in cv::Laplacian(). - + \code void laplace_f(const Mat& src, Mat& dst) { CV_Assert( src.type() == CV_32F ); // make sure the destination array has the proper size and type dst.create(src.size(), src.type()); - + // get the derivative and smooth kernels for d2I/dx2. // for d2I/dy2 we could use the same kernels, just swapped Mat kd, ks; getSobelKernels( kd, ks, 2, 0, ksize, false, ktype ); - + // let's process 10 source rows at once int DELTA = std::min(10, src.rows); Ptr Fxx = createSeparableLinearFilter(src.type(), - dst.type(), kd, ks, Point(-1,-1), 0, borderType, borderType, Scalar() ); + dst.type(), kd, ks, Point(-1,-1), 0, borderType, borderType, Scalar() ); Ptr Fyy = createSeparableLinearFilter(src.type(), dst.type(), ks, kd, Point(-1,-1), 0, borderType, borderType, Scalar() ); - + int y = Fxx->start(src), dsty = 0, dy = 0; Fyy->start(src); const uchar* sptr = src.data + y*src.step; - + // allocate the buffers for the spatial image derivatives; // the buffers need to have more than DELTA rows, because at the // last iteration the output may take max(kd.rows-1,ks.rows-1) // rows more than the input. Mat Ixx( DELTA + kd.rows - 1, src.cols, dst.type() ); Mat Iyy( DELTA + kd.rows - 1, src.cols, dst.type() ); - + // inside the loop we always pass DELTA rows to the filter // (note that the "proceed" method takes care of possibe overflow, since // it was given the actual image height in the "start" method) @@ -241,7 +241,7 @@ public: int srcType, int dstType, int bufType, int _rowBorderType=BORDER_REPLICATE, int _columnBorderType=-1, const Scalar& _borderValue=Scalar()); - //! starts filtering of the specified ROI of an image of size wholeSize. + //! starts filtering of the specified ROI of an image of size wholeSize. virtual int start(Size wholeSize, Rect roi, int maxBufRows=-1); //! starts filtering of the specified ROI of the specified image. virtual int start(const Mat& src, const Rect& srcRoi=Rect(0,0,-1,-1), @@ -256,10 +256,10 @@ public: bool isolated=false); //! returns true if the filter is separable bool isSeparable() const { return (const BaseFilter*)filter2D == 0; } - //! returns the number + //! returns the number int remainingInputRows() const; int remainingOutputRows() const; - + int srcType, dstType, bufType; Size ksize; Point anchor; @@ -276,7 +276,7 @@ public: vector constBorderRow; int bufStep, startY, startY0, endY, rowCount, dstY; vector rows; - + Ptr filter2D; Ptr rowFilter; Ptr columnFilter; @@ -309,16 +309,16 @@ CV_EXPORTS Ptr getLinearFilter(int srcType, int dstType, //! returns the separable linear filter engine CV_EXPORTS Ptr createSeparableLinearFilter(int srcType, int dstType, InputArray rowKernel, InputArray columnKernel, - Point _anchor=Point(-1,-1), double delta=0, - int _rowBorderType=BORDER_DEFAULT, - int _columnBorderType=-1, - const Scalar& _borderValue=Scalar()); + Point anchor=Point(-1,-1), double delta=0, + int rowBorderType=BORDER_DEFAULT, + int columnBorderType=-1, + const Scalar& borderValue=Scalar()); //! returns the non-separable linear filter engine CV_EXPORTS Ptr createLinearFilter(int srcType, int dstType, InputArray kernel, Point _anchor=Point(-1,-1), - double delta=0, int _rowBorderType=BORDER_DEFAULT, - int _columnBorderType=-1, const Scalar& _borderValue=Scalar()); + double delta=0, int rowBorderType=BORDER_DEFAULT, + int columnBorderType=-1, const Scalar& borderValue=Scalar()); //! returns the Gaussian kernel with the specified parameters CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F ); @@ -335,7 +335,7 @@ CV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky, CV_EXPORTS Ptr createDerivFilter( int srcType, int dstType, int dx, int dy, int ksize, int borderType=BORDER_DEFAULT ); -//! returns horizontal 1D box filter +//! returns horizontal 1D box filter CV_EXPORTS Ptr getRowSumFilter(int srcType, int sumType, int ksize, int anchor=-1); //! returns vertical 1D box filter @@ -347,11 +347,11 @@ CV_EXPORTS Ptr createBoxFilter( int srcType, int dstType, Size ksi Point anchor=Point(-1,-1), bool normalize=true, int borderType=BORDER_DEFAULT); - + //! returns the Gabor kernel with the specified parameters CV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd, double gamma, double psi=CV_PI*0.5, int ktype=CV_64F ); - + //! type of morphological operation enum { MORPH_ERODE=CV_MOP_ERODE, MORPH_DILATE=CV_MOP_DILATE, MORPH_OPEN=CV_MOP_OPEN, MORPH_CLOSE=CV_MOP_CLOSE, @@ -365,15 +365,15 @@ CV_EXPORTS Ptr getMorphologyColumnFilter(int op, int type, int //! returns 2D morphological filter CV_EXPORTS Ptr getMorphologyFilter(int op, int type, InputArray kernel, Point anchor=Point(-1,-1)); - + //! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation. static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); } //! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported. CV_EXPORTS Ptr createMorphologyFilter(int op, int type, InputArray kernel, - Point anchor=Point(-1,-1), int _rowBorderType=BORDER_CONSTANT, - int _columnBorderType=-1, - const Scalar& _borderValue=morphologyDefaultBorderValue()); + Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT, + int columnBorderType=-1, + const Scalar& borderValue=morphologyDefaultBorderValue()); //! shape of the structuring element enum { MORPH_RECT=0, MORPH_CROSS=1, MORPH_ELLIPSE=2 }; @@ -382,7 +382,7 @@ CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor=Point template<> CV_EXPORTS void Ptr::delete_obj(); -//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode +//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode CV_EXPORTS_W void copyMakeBorder( InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar& value=Scalar() ); @@ -418,7 +418,7 @@ CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth, InputArray kernelX, InputArray kernelY, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT ); - + //! applies generalized Sobel operator to the image CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, @@ -452,7 +452,7 @@ CV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize, // low-level function for computing eigenvalues and eigenvectors of 2x2 matrices CV_EXPORTS void eigen2x2( const float* a, float* e, int n ); - + //! computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix at each pixel. The output is stored as 6-channel matrix. CV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst, int blockSize, int ksize, @@ -483,7 +483,7 @@ CV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 ); -//! finds circles in the grayscale image using 2+1 gradient Hough transform +//! finds circles in the grayscale image using 2+1 gradient Hough transform CV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, @@ -494,13 +494,13 @@ CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ); - + //! dilates the image (applies the local maximum operator) CV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ); - + //! applies an advanced morphological operation to the image CV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst, int op, InputArray kernel, @@ -531,7 +531,7 @@ CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar()); - + //! warps the image using perspective transformation CV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, @@ -556,7 +556,7 @@ CV_EXPORTS_W void remap( InputArray src, OutputArray dst, CV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, int dstmap1type, bool nninterpolation=false ); - + //! returns 2x3 affine transformation matrix for the planar rotation. CV_EXPORTS_W Mat getRotationMatrix2D( Point2f center, double angle, double scale ); //! returns 3x3 perspective transformation for the corresponding 4 point pairs. @@ -597,12 +597,12 @@ CV_EXPORTS_W void accumulateProduct( InputArray src1, InputArray src2, CV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() ); -//! computes PSNR image/video quality metric +//! computes PSNR image/video quality metric CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2); - + CV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2, InputArray window = noArray()); CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type); - + //! type of the threshold operation enum { THRESH_BINARY=CV_THRESH_BINARY, THRESH_BINARY_INV=CV_THRESH_BINARY_INV, THRESH_TRUNC=CV_THRESH_TRUNC, THRESH_TOZERO=CV_THRESH_TOZERO, @@ -637,7 +637,7 @@ CV_EXPORTS_W void undistort( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray() ); - + //! initializes maps for cv::remap() to correct lens distortion and optionally rectify the image CV_EXPORTS_W void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, @@ -647,25 +647,25 @@ enum { PROJ_SPHERICAL_ORTHO = 0, PROJ_SPHERICAL_EQRECT = 1 -}; - +}; + //! initializes maps for cv::remap() for wide-angle CV_EXPORTS_W float initWideAngleProjMap( InputArray cameraMatrix, InputArray distCoeffs, Size imageSize, int destImageWidth, int m1type, OutputArray map1, OutputArray map2, int projType=PROJ_SPHERICAL_EQRECT, double alpha=0); - + //! returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true) CV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize=Size(), bool centerPrincipalPoint=false ); - + //! returns points' coordinates after lens distortion correction CV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=noArray(), InputArray P=noArray()); template<> CV_EXPORTS void Ptr::delete_obj(); - + //! computes the joint dense histogram for a set of images. CV_EXPORTS void calcHist( const Mat* images, int nimages, const int* channels, InputArray mask, @@ -678,7 +678,7 @@ CV_EXPORTS void calcHist( const Mat* images, int nimages, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false ); - + CV_EXPORTS_W void calcHist( InputArrayOfArrays images, const vector& channels, InputArray mask, OutputArray hist, @@ -694,7 +694,7 @@ CV_EXPORTS void calcBackProject( const Mat* images, int nimages, //! computes back projection for the set of images CV_EXPORTS void calcBackProject( const Mat* images, int nimages, - const int* channels, const SparseMat& hist, + const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true ); @@ -705,8 +705,8 @@ CV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const vector& /*CV_EXPORTS void calcBackProjectPatch( const Mat* images, int nimages, const int* channels, InputArray hist, OutputArray dst, Size patchSize, - int method, double factor=1 ); - + int method, double factor=1 ); + CV_EXPORTS_W void calcBackProjectPatch( InputArrayOfArrays images, const vector& channels, InputArray hist, OutputArray dst, Size patchSize, int method, double factor=1 );*/ @@ -719,7 +719,7 @@ CV_EXPORTS double compareHist( const SparseMat& H1, const SparseMat& H2, int met //! normalizes the grayscale image brightness and contrast by normalizing its histogram CV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst ); - + CV_EXPORTS float EMD( InputArray signature1, InputArray signature2, int distType, InputArray cost=noArray(), float* lowerBound=0, OutputArray flow=noArray() ); @@ -739,7 +739,7 @@ enum GC_BGD = 0, //!< background GC_FGD = 1, //!< foreground GC_PR_BGD = 2, //!< most probably background - GC_PR_FGD = 3 //!< most probably foreground + GC_PR_FGD = 3 //!< most probably foreground }; //! GrabCut algorithm flags @@ -751,7 +751,7 @@ enum }; //! segments the image using GrabCut algorithm -CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect, +CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode = GC_EVAL ); @@ -760,7 +760,7 @@ enum DIST_LABEL_CCOMP = 0, DIST_LABEL_PIXEL = 1 }; - + //! builds the discrete Voronoi diagram CV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize, @@ -784,27 +784,27 @@ CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 ); - + enum { COLOR_BGR2BGRA =0, COLOR_RGB2RGBA =COLOR_BGR2BGRA, - + COLOR_BGRA2BGR =1, COLOR_RGBA2RGB =COLOR_BGRA2BGR, - + COLOR_BGR2RGBA =2, COLOR_RGB2BGRA =COLOR_BGR2RGBA, - + COLOR_RGBA2BGR =3, COLOR_BGRA2RGB =COLOR_RGBA2BGR, - + COLOR_BGR2RGB =4, COLOR_RGB2BGR =COLOR_BGR2RGB, - + COLOR_BGRA2RGBA =5, COLOR_RGBA2BGRA =COLOR_BGRA2RGBA, - + COLOR_BGR2GRAY =6, COLOR_RGB2GRAY =7, COLOR_GRAY2BGR =8, @@ -813,7 +813,7 @@ enum COLOR_GRAY2RGBA =COLOR_GRAY2BGRA, COLOR_BGRA2GRAY =10, COLOR_RGBA2GRAY =11, - + COLOR_BGR2BGR565 =12, COLOR_RGB2BGR565 =13, COLOR_BGR5652BGR =14, @@ -822,10 +822,10 @@ enum COLOR_RGBA2BGR565 =17, COLOR_BGR5652BGRA =18, COLOR_BGR5652RGBA =19, - + COLOR_GRAY2BGR565 =20, COLOR_BGR5652GRAY =21, - + COLOR_BGR2BGR555 =22, COLOR_RGB2BGR555 =23, COLOR_BGR5552BGR =24, @@ -834,86 +834,86 @@ enum COLOR_RGBA2BGR555 =27, COLOR_BGR5552BGRA =28, COLOR_BGR5552RGBA =29, - + COLOR_GRAY2BGR555 =30, COLOR_BGR5552GRAY =31, - + COLOR_BGR2XYZ =32, COLOR_RGB2XYZ =33, COLOR_XYZ2BGR =34, COLOR_XYZ2RGB =35, - + COLOR_BGR2YCrCb =36, COLOR_RGB2YCrCb =37, COLOR_YCrCb2BGR =38, COLOR_YCrCb2RGB =39, - + COLOR_BGR2HSV =40, COLOR_RGB2HSV =41, - + COLOR_BGR2Lab =44, COLOR_RGB2Lab =45, - + COLOR_BayerBG2BGR =46, COLOR_BayerGB2BGR =47, COLOR_BayerRG2BGR =48, COLOR_BayerGR2BGR =49, - + COLOR_BayerBG2RGB =COLOR_BayerRG2BGR, COLOR_BayerGB2RGB =COLOR_BayerGR2BGR, COLOR_BayerRG2RGB =COLOR_BayerBG2BGR, COLOR_BayerGR2RGB =COLOR_BayerGB2BGR, - + COLOR_BGR2Luv =50, COLOR_RGB2Luv =51, COLOR_BGR2HLS =52, COLOR_RGB2HLS =53, - + COLOR_HSV2BGR =54, COLOR_HSV2RGB =55, - + COLOR_Lab2BGR =56, COLOR_Lab2RGB =57, COLOR_Luv2BGR =58, COLOR_Luv2RGB =59, COLOR_HLS2BGR =60, COLOR_HLS2RGB =61, - + COLOR_BayerBG2BGR_VNG =62, COLOR_BayerGB2BGR_VNG =63, COLOR_BayerRG2BGR_VNG =64, COLOR_BayerGR2BGR_VNG =65, - + COLOR_BayerBG2RGB_VNG =COLOR_BayerRG2BGR_VNG, COLOR_BayerGB2RGB_VNG =COLOR_BayerGR2BGR_VNG, COLOR_BayerRG2RGB_VNG =COLOR_BayerBG2BGR_VNG, COLOR_BayerGR2RGB_VNG =COLOR_BayerGB2BGR_VNG, - + COLOR_BGR2HSV_FULL = 66, COLOR_RGB2HSV_FULL = 67, COLOR_BGR2HLS_FULL = 68, COLOR_RGB2HLS_FULL = 69, - + COLOR_HSV2BGR_FULL = 70, COLOR_HSV2RGB_FULL = 71, COLOR_HLS2BGR_FULL = 72, COLOR_HLS2RGB_FULL = 73, - + COLOR_LBGR2Lab = 74, COLOR_LRGB2Lab = 75, COLOR_LBGR2Luv = 76, COLOR_LRGB2Luv = 77, - + COLOR_Lab2LBGR = 78, COLOR_Lab2LRGB = 79, COLOR_Luv2LBGR = 80, COLOR_Luv2LRGB = 81, - + COLOR_BGR2YUV = 82, COLOR_RGB2YUV = 83, COLOR_YUV2BGR = 84, COLOR_YUV2RGB = 85, - + COLOR_BayerBG2GRAY = 86, COLOR_BayerGB2GRAY = 87, COLOR_BayerRG2GRAY = 88, @@ -921,7 +921,7 @@ enum //YUV 4:2:0 formats family COLOR_YUV2RGB_NV12 = 90, - COLOR_YUV2BGR_NV12 = 91, + COLOR_YUV2BGR_NV12 = 91, COLOR_YUV2RGB_NV21 = 92, COLOR_YUV2BGR_NV21 = 93, COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21, @@ -933,7 +933,7 @@ enum COLOR_YUV2BGRA_NV21 = 97, COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21, COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21, - + COLOR_YUV2RGB_YV12 = 98, COLOR_YUV2BGR_YV12 = 99, COLOR_YUV2RGB_IYUV = 100, @@ -942,7 +942,7 @@ enum COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV, COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12, COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12, - + COLOR_YUV2RGBA_YV12 = 102, COLOR_YUV2BGRA_YV12 = 103, COLOR_YUV2RGBA_IYUV = 104, @@ -951,7 +951,7 @@ enum COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV, COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12, COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12, - + COLOR_YUV2GRAY_420 = 106, COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420, COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420, @@ -960,7 +960,7 @@ enum COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420, COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420, COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420, - + //YUV 4:2:2 formats family COLOR_YUV2RGB_UYVY = 107, COLOR_YUV2BGR_UYVY = 108, @@ -970,7 +970,7 @@ enum COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY, COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY, COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY, - + COLOR_YUV2RGBA_UYVY = 111, COLOR_YUV2BGRA_UYVY = 112, //COLOR_YUV2RGBA_VYUY = 113, @@ -979,7 +979,7 @@ enum COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY, COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY, COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY, - + COLOR_YUV2RGB_YUY2 = 115, COLOR_YUV2BGR_YUY2 = 116, COLOR_YUV2RGB_YVYU = 117, @@ -988,7 +988,7 @@ enum COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2, COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2, COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2, - + COLOR_YUV2RGBA_YUY2 = 119, COLOR_YUV2BGRA_YUY2 = 120, COLOR_YUV2RGBA_YVYU = 121, @@ -997,7 +997,7 @@ enum COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2, COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2, COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2, - + COLOR_YUV2GRAY_UYVY = 123, COLOR_YUV2GRAY_YUY2 = 124, //COLOR_YUV2GRAY_VYUY = COLOR_YUV2GRAY_UYVY, @@ -1006,11 +1006,11 @@ enum COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2, COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2, COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2, - + COLOR_COLORCVT_MAX = 125 }; - - + + //! converts image from one color space to another CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 ); @@ -1027,7 +1027,7 @@ public: Moments( const CvMoments& moments ); //! the conversion to CvMoments operator CvMoments() const; - + //! spatial moments CV_PROP_RW double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; //! central moments @@ -1093,7 +1093,7 @@ CV_EXPORTS_W double contourArea( InputArray contour, bool oriented=false ); CV_EXPORTS_W RotatedRect minAreaRect( InputArray points ); //! computes the minimal enclosing circle for a set of points CV_EXPORTS_W void minEnclosingCircle( InputArray points, - CV_OUT Point2f& center, CV_OUT float& radius ); + CV_OUT Point2f& center, CV_OUT float& radius ); //! matches two contours using one of the available algorithms CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2, int method, double parameter ); @@ -1118,7 +1118,7 @@ CV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType, double param, double reps, double aeps ); //! checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary CV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist ); - + class CV_EXPORTS_W Subdiv2D { @@ -1131,7 +1131,7 @@ public: PTLOC_VERTEX = 1, PTLOC_ON_EDGE = 2 }; - + enum { NEXT_AROUND_ORG = 0x00, @@ -1143,30 +1143,30 @@ public: PREV_AROUND_LEFT = 0x20, PREV_AROUND_RIGHT = 0x02 }; - + CV_WRAP Subdiv2D(); CV_WRAP Subdiv2D(Rect rect); CV_WRAP void initDelaunay(Rect rect); - + CV_WRAP int insert(Point2f pt); CV_WRAP void insert(const vector& ptvec); CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex); - + CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt=0); CV_WRAP void getEdgeList(CV_OUT vector& edgeList) const; CV_WRAP void getTriangleList(CV_OUT vector& triangleList) const; CV_WRAP void getVoronoiFacetList(const vector& idx, CV_OUT vector >& facetList, CV_OUT vector& facetCenters); - + CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge=0) const; - + CV_WRAP int getEdge( int edge, int nextEdgeType ) const; CV_WRAP int nextEdge(int edge) const; CV_WRAP int rotateEdge(int edge, int rotate) const; CV_WRAP int symEdge(int edge) const; CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt=0) const; CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt=0) const; - + protected: int newEdge(); void deleteEdge(int edge); @@ -1180,7 +1180,7 @@ protected: void calcVoronoi(); void clearVoronoi(); void checkSubdiv() const; - + struct CV_EXPORTS Vertex { Vertex(); @@ -1199,13 +1199,13 @@ protected: int next[4]; int pt[4]; }; - + vector vtx; vector qedges; int freeQEdge; int freePoint; bool validGeometry; - + int recentEdge; Point2f topLeft; Point2f bottomRight; diff --git a/modules/imgproc/include/opencv2/imgproc/imgproc_c.h b/modules/imgproc/include/opencv2/imgproc/imgproc_c.h index 440490c..ec84cf8 100644 --- a/modules/imgproc/include/opencv2/imgproc/imgproc_c.h +++ b/modules/imgproc/include/opencv2/imgproc/imgproc_c.h @@ -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, diff --git a/modules/imgproc/src/approx.cpp b/modules/imgproc/src/approx.cpp index fe86df3..bd0e3da 100644 --- a/modules/imgproc/src/approx.cpp +++ b/modules/imgproc/src/approx.cpp @@ -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 static CvSeq* -icvApproxPolyDP( CvSeq* src_contour, int header_size, +icvApproxPolyDP( CvSeq* src_contour, int header_size, CvMemStorage* storage, double eps ) { typedef cv::Point_ 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::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; diff --git a/modules/java/rst_parser.py b/modules/java/rst_parser.py index 6d8f9ee..861c192 100644 --- a/modules/java/rst_parser.py +++ b/modules/java/rst_parser.py @@ -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()) diff --git a/modules/legacy/doc/expectation_maximization.rst b/modules/legacy/doc/expectation_maximization.rst index 4884232..d97d152 100644 --- a/modules/legacy/doc/expectation_maximization.rst +++ b/modules/legacy/doc/expectation_maximization.rst @@ -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. diff --git a/modules/legacy/doc/feature_detection_and_description.rst b/modules/legacy/doc/feature_detection_and_description.rst index fbec994..222d7a0 100644 --- a/modules/legacy/doc/feature_detection_and_description.rst +++ b/modules/legacy/doc/feature_detection_and_description.rst @@ -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 --------------------------------- diff --git a/modules/legacy/doc/motion_analysis.rst b/modules/legacy/doc/motion_analysis.rst index bc03977..2fc4b00 100644 --- a/modules/legacy/doc/motion_analysis.rst +++ b/modules/legacy/doc/motion_analysis.rst @@ -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 diff --git a/modules/nonfree/doc/feature_detection.rst b/modules/nonfree/doc/feature_detection.rst index 36958c8..91ebf30 100644 --- a/modules/nonfree/doc/feature_detection.rst +++ b/modules/nonfree/doc/feature_detection.rst @@ -33,7 +33,7 @@ Extract features and computes their descriptors using SIFT algorithm .. ocv:function:: void SIFT::operator()(InputArray img, InputArray mask, vector& 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. diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index 5f91bb0..4f9c2c0 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -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: diff --git a/modules/video/doc/motion_analysis_and_object_tracking.rst b/modules/video/doc/motion_analysis_and_object_tracking.rst index f56e6dc..aa4e200 100644 --- a/modules/video/doc/motion_analysis_and_object_tracking.rst +++ b/modules/video/doc/motion_analysis_and_object_tracking.rst @@ -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