Commit c21cf06c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

integrated most of the new Python stuff into the reference manual

parent 4bf7000c
......@@ -9,6 +9,8 @@ Finds centers of clusters and groups input samples around the clusters.
.. ocv:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() )
.. ocv:pyfunction:: cv2.kmeans(data, K, criteria, attempts, flags[, bestLabels[, centers]]) -> retval, bestLabels, centers
:param samples: Floating-point matrix of input samples, one row per sample.
:param clusterCount: Number of clusters to split the set by.
......
......@@ -32,8 +32,10 @@ Draws a circle.
.. ocv:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.circle(img, center, radius, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvCircle( CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Circle(img, center, radius, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.Circle(img, center, radius, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image where the circle is drawn.
......@@ -59,8 +61,10 @@ Clips the line against the image rectangle.
.. ocv:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2)
.. ocv:pyfunction:: cv2.clipLine(imgRect, pt1, pt2) -> retval, pt1, pt2
.. ocv:cfunction:: int cvClipLine( CvSize imgSize, CvPoint* pt1, CvPoint* pt2 )
.. ocv:pyoldfunction:: ClipLine(imgSize, pt1, pt2) -> (clippedPt1, clippedPt2)
.. ocv:pyoldfunction:: cv.ClipLine(imgSize, pt1, pt2) -> (clippedPt1, clippedPt2)
:param imgSize: Image size. The image rectangle is ``Rect(0, 0, imgSize.width, imgSize.height)`` .
......@@ -81,8 +85,11 @@ Draws a simple or thick elliptic arc or fills an ellipse sector.
.. ocv:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8)
.. ocv:pyfunction:: cv2.ellipse(img, center, axes, angle, startAngle, endAngle, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:pyfunction:: cv2.ellipse(img, box, color[, thickness[, lineType]]) -> None
.. ocv:cfunction:: void cvEllipse( CvArr* img, CvPoint center, CvSize axes, double angle, double startAngle, double endAngle, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image.
......@@ -122,6 +129,8 @@ Approximates an elliptic arc with a polyline.
.. ocv:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts )
.. ocv:pyfunction:: cv2.ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta) -> pts
:param center: Center of the arc.
:param axes: Half-sizes of the arc. See the :ocv:func:`ellipse` for details.
......@@ -147,8 +156,10 @@ Fills a convex polygon.
.. ocv:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.fillConvexPoly(img, points, color[, lineType[, shift]]) -> None
.. ocv:cfunction:: void cvFillConvexPoly( CvArr* img, CvPoint* pts, int npts, CvScalar color, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: FillConvexPoly(img, pn, color, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.FillConvexPoly(img, pn, color, lineType=8, shift=0)-> None
:param img: Image.
......@@ -174,8 +185,10 @@ Fills the area bounded by one or more polygons.
.. ocv:function:: void fillPoly(Mat& img, const Point** pts, const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() )
.. ocv:pyfunction:: cv2.fillPoly(img, pts, color[, lineType[, shift[, offset]]]) -> None
.. ocv:cfunction:: void cvFillPoly( CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: FillPoly(img, polys, color, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.FillPoly(img, polys, color, lineType=8, shift=0)-> None
:param img: Image.
......@@ -202,8 +215,10 @@ Calculates the width and height of a text string.
.. ocv:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
.. ocv:pyfunction:: cv2.getTextSize(text, fontFace, fontScale, thickness) -> retval, baseLine
.. ocv:cfunction:: void cvGetTextSize( const char* textString, const CvFont* font, CvSize* textSize, int* baseline )
.. ocv:pyoldfunction:: GetTextSize(textString, font)-> (textSize, baseline)
.. ocv:pyoldfunction:: cv.GetTextSize(textString, font)-> (textSize, baseline)
:param text: Input text string.
......@@ -256,8 +271,10 @@ Draws a line segment connecting two points.
.. ocv:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.line(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Line(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.Line(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image.
......@@ -335,8 +352,10 @@ Draws a simple, thick, or filled up-right rectangle.
.. ocv:function:: void rectangle(Mat& img, Rect r, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
.. ocv:pyfunction:: cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> None
.. ocv:cfunction:: void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyoldfunction:: Rectangle(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
.. ocv:pyoldfunction:: cv.Rectangle(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)-> None
:param img: Image.
......@@ -364,6 +383,8 @@ Draws several polygonal curves.
.. ocv:function:: void polylines(Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
.. ocv:pyfunction:: cv2.polylines(img, pts, isClosed, color[, thickness[, lineType[, shift]]]) -> None
:param img: Image.
:param pts: Array of polygonal curves.
......@@ -392,8 +413,10 @@ Draws a text string.
.. ocv:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
.. ocv:pyfunction:: cv2.putText(img, text, org, fontFace, fontScale, color[, thickness[, linetype[, bottomLeftOrigin]]]) -> None
.. ocv:cfunction:: void cvPutText( CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color )
.. ocv:pyoldfunction:: PutText(img, text, org, font, color)-> None
.. ocv:pyoldfunction:: cv.PutText(img, text, org, font, color)-> None
:param img: Image.
......
This diff is collapsed.
......@@ -213,6 +213,8 @@ Returns the number of ticks.
.. ocv:function:: int64 getTickCount()
.. ocv:pyfunction:: cv2.getTickCount() -> retval
The function returns the number of ticks after the certain event (for example, when the machine was turned on).
It can be used to initialize
:ocv:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
......@@ -225,6 +227,8 @@ Returns the number of ticks per second.
.. ocv:function:: double getTickFrequency()
.. ocv:pyfunction:: cv2.getTickFrequency() -> retval
The function returns the number of ticks per second.
That is, the following code computes the execution time in seconds: ::
......@@ -240,6 +244,8 @@ Returns the number of CPU ticks.
.. ocv:function:: int64 getCPUTickCount()
.. ocv:pyfunction:: cv2.getCPUTickCount() -> retval
The function returns the current number of CPU ticks on some architectures (such as x86, x64, PowerPC). On other platforms the function is equivalent to ``getTickCount``. It can also be used for very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU systems a thread, from which ``getCPUTickCount`` is called, can be suspended and resumed at another CPU with its own counter. So, theoretically (and practically) the subsequent calls to the function do not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU frequency depending on the load, the number of CPU clocks spent in some code cannot be directly converted to time units. Therefore, ``getTickCount`` is generally a preferable solution for measuring execution time.
......@@ -266,6 +272,8 @@ Enables or disables the optimized code.
.. ocv:function:: void setUseOptimized(bool onoff)
.. ocv:pyfunction:: cv2.setUseOptimized(onoff) -> None
:param onoff: The boolean flag specifying whether the optimized code should be used (``onoff=true``) or not (``onoff=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.
......@@ -278,4 +286,6 @@ Returns the status of optimized code usage.
.. ocv:function:: bool useOptimized()
.. ocv:pyfunction:: cv2.useOptimized() -> retval
The function returns ``true`` if the optimized code is enabled. Otherwise, it returns ``false``.
......@@ -63,6 +63,8 @@ Changes parameters of a window dynamically.
.. ocv:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
.. ocv:pyfunction:: cv2.setWindowProperty(winname, prop_id, prop_value) -> None
.. ocv:cfunction:: void cvSetWindowProperty(const char* name, int propId, double propValue)
:param name: Name of the window.
......@@ -97,6 +99,8 @@ Provides parameters of a window.
.. ocv:function:: void getWindowProperty(const string& name, int prop_id)
.. ocv:pyfunction:: cv2.getWindowProperty(winname, prop_id) -> retval
.. ocv:cfunction:: void cvGetWindowProperty(const char* name, int propId)
:param name: Name of the window.
......
......@@ -9,6 +9,8 @@ Reads an image from a buffer in memory.
.. ocv:function:: Mat imdecode( InputArray buf, int flags )
.. ocv:pyfunction:: cv2.imdecode(buf, flags) -> retval
:param buf: Input array of vector of bytes.
:param flags: The same flags as in :ocv:func:`imread` .
......@@ -25,6 +27,8 @@ Encodes an image into a memory buffer.
.. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
.. ocv:pyfunction:: cv2.imencode(ext, img, buf[, params]) -> retval
:param ext: File extension that defines the output format.
:param img: Image to be written.
......@@ -43,6 +47,8 @@ Loads an image from a file.
.. ocv:function:: Mat imread( const string& filename, int flags=1 )
.. ocv:pyfunction:: cv2.imread(filename[, flags]) -> retval
:param filename: Name of file to be loaded.
:param flags: Flags specifying the color type of a loaded image:
......@@ -83,6 +89,8 @@ Saves an image to a specified file.
.. ocv:function:: bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>())
.. ocv:pyfunction:: cv2.imwrite(filename, img[, params]) -> retval
:param filename: Name of the file.
:param img: Image to be saved.
......@@ -203,6 +211,8 @@ Returns the specified ``VideoCapture`` property
.. ocv:function:: double VideoCapture::get(int property_id)
.. ocv:pyfunction:: cv2.VideoCapture.get(propId) -> retval
:param property_id: Property identifier. It can be one of the following:
* **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds or video capture timestamp.
......@@ -252,6 +262,8 @@ Sets a property in the ``VideoCapture``.
.. ocv:function:: bool VideoCapture::set(int property_id, double value)
.. ocv:pyfunction:: cv2.VideoCapture.set(propId, value) -> retval
:param property_id: Property identifier. It can be one of the following:
* **CV_CAP_PROP_POS_MSEC** Current position of the video file in milliseconds.
......
......@@ -10,7 +10,7 @@ Creates a trackbar and attaches it to the specified window.
.. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
.. ocv:cfunction:: int cvCreateTrackbar( const char* trackbarName, const char* windowName, int* value, int count, CvTrackbarCallback onChange )
.. ocv:pyoldfunction:: CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None
.. ocv:pyoldfunction:: cv.CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None
:param trackbarname: Name of the created trackbar.
......@@ -38,8 +38,10 @@ Returns the trackbar position.
.. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
.. ocv:pyfunction:: cv2.getTrackbarPos(trackbarname, winname) -> retval
.. ocv:cfunction:: int cvGetTrackbarPos( const char* trackbarName, const char* windowName )
.. ocv:pyoldfunction:: GetTrackbarPos(trackbarName, windowName)-> None
.. ocv:pyoldfunction:: cv.GetTrackbarPos(trackbarName, windowName)-> None
:param trackbarname: Name of the trackbar.
......@@ -57,6 +59,8 @@ Displays an image in the specified window.
.. ocv:function:: void imshow( const string& winname, InputArray image )
.. ocv:pyfunction:: cv2.imshow(winname, mat) -> None
:param winname: Name of the window.
:param image: Image to be shown.
......@@ -76,8 +80,10 @@ Creates a window.
.. ocv:function:: void namedWindow( const string& winname, int flags )
.. ocv:pyfunction:: cv2.namedWindow(winname[, flags]) -> None
.. ocv:cfunction:: int cvNamedWindow( const char* name, int flags )
.. ocv:pyoldfunction:: NamedWindow(name, flags=CV_WINDOW_AUTOSIZE)-> None
.. ocv:pyoldfunction:: cv.NamedWindow(name, flags=CV_WINDOW_AUTOSIZE)-> None
:param name: Name of the window in the window caption that may be used as a window identifier.
......@@ -107,8 +113,10 @@ Destroys a window.
.. ocv:function:: void destroyWindow( const string &winname )
.. ocv:pyfunction:: cv2.destroyWindow(winname) -> None
.. ocv:cfunction:: void cvDestroyWindow( const char* name )
.. ocv:pyoldfunction:: DestroyWindow(name)-> None
.. ocv:pyoldfunction:: cv.DestroyWindow(name)-> None
:param winname: Name of the window to be destroyed.
......@@ -121,6 +129,8 @@ Destroys all of the HighGUI windows.
.. ocv:function:: void destroyAllWindows()
.. ocv:pyfunction:: cv2.destroyAllWindows() -> None
The function ``destroyAllWindows`` destroys all of the opened HighGUI windows.
......@@ -130,8 +140,10 @@ Sets the trackbar position.
.. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
.. ocv:pyfunction:: cv2.setTrackbarPos(trackbarname, winname, pos) -> None
.. ocv:cfunction:: void cvSetTrackbarPos( const char* trackbarName, const char* windowName, int pos )
.. ocv:pyoldfunction:: SetTrackbarPos(trackbarName, windowName, pos)-> None
.. ocv:pyoldfunction:: cv.SetTrackbarPos(trackbarName, windowName, pos)-> None
:param trackbarname: Name of the trackbar.
......@@ -151,8 +163,10 @@ Waits for a pressed key.
.. ocv:function:: int waitKey(int delay=0)
.. ocv:pyfunction:: cv2.waitKey([, delay]) -> retval
.. ocv:cfunction:: int cvWaitKey( int delay=0 )
.. ocv:pyoldfunction:: WaitKey(delay=0)-> int
.. ocv:pyoldfunction:: cv.WaitKey(delay=0)-> int
:param delay: Delay in milliseconds. 0 is the special value that means "forever".
......
......@@ -11,8 +11,10 @@ Finds edges in an image using the Canny algorithm.
.. ocv:function:: void Canny( InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
.. ocv:pyfunction:: cv2.Canny(image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]]) -> edges
.. ocv:cfunction:: void cvCanny( const CvArr* image, CvArr* edges, double threshold1, double threshold2, int apertureSize=3 )
.. ocv:pyoldfunction:: Canny(image, edges, threshold1, threshold2, apertureSize=3)-> None
.. ocv:pyoldfunction:: cv.Canny(image, edges, threshold1, threshold2, apertureSize=3)-> None
:param image: Single-channel 8-bit input image.
......@@ -37,8 +39,10 @@ Calculates eigenvalues and eigenvectors of image blocks for corner detection.
.. ocv:function:: void cornerEigenValsAndVecs( InputArray src, OutputArray dst, int blockSize, int apertureSize, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerEigenValsAndVecs(src, blockSize, ksize[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv, int blockSize, int apertureSize=3 )
.. ocv:pyoldfunction:: CornerEigenValsAndVecs(image, eigenvv, blockSize, apertureSize=3)-> None
.. ocv:pyoldfunction:: cv.CornerEigenValsAndVecs(image, eigenvv, blockSize, apertureSize=3)-> None
:param src: Input single-channel 8-bit or floating-point image.
......@@ -86,8 +90,10 @@ Harris edge detector.
.. ocv:function:: void cornerHarris( InputArray src, OutputArray dst, int blockSize, int apertureSize, double k, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerHarris(src, blockSize, ksize, k[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvCornerHarris( const CvArr* image, CvArr* harrisDst, int blockSize, int apertureSize=3, double k=0.04 )
.. ocv:pyoldfunction:: CornerHarris(image, harrisDst, blockSize, apertureSize=3, k=0.04)-> None
.. ocv:pyoldfunction:: cv.CornerHarris(image, harrisDst, blockSize, apertureSize=3, k=0.04)-> None
:param src: Input single-channel 8-bit or floating-point image.
......@@ -123,8 +129,10 @@ Calculates the minimal eigenvalue of gradient matrices for corner detection.
.. ocv:function:: void cornerMinEigenVal( InputArray src, OutputArray dst, int blockSize, int apertureSize=3, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.cornerMinEigenVal(src, blockSize[, dst[, ksize[, borderType]]]) -> dst
.. ocv:cfunction:: void cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval, int blockSize, int apertureSize=3 )
.. ocv:pyoldfunction:: CornerMinEigenVal(image, eigenval, blockSize, apertureSize=3)-> None
.. ocv:pyoldfunction:: cv.CornerMinEigenVal(image, eigenval, blockSize, apertureSize=3)-> None
:param src: Input single-channel 8-bit or floating-point image.
......@@ -149,6 +157,8 @@ Refines the corner locations.
.. ocv:function:: void cornerSubPix( InputArray image, InputOutputArray corners, Size winSize, Size zeroZone, TermCriteria criteria )
.. ocv:pyfunction:: cv2.cornerSubPix(image, corners, winSize, zeroZone, criteria) -> None
:param image: Input image.
:param corners: Initial coordinates of the input corners and refined coordinates provided for output.
......@@ -205,8 +215,10 @@ Determines strong corners on an image.
.. ocv:function:: void goodFeaturesToTrack( InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=noArray(), int blockSize=3, bool useHarrisDetector=false, double k=0.04 )
.. ocv:pyfunction:: cv2.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
.. ocv:cfunction:: void cvGoodFeaturesToTrack( const CvArr* image CvArr* eigImage, CvArr* tempImage CvPoint2D32f* corners int* cornerCount double qualityLevel double minDistance const CvArr* mask=NULL int blockSize=3 int useHarris=0 double k=0.04 )
.. ocv:pyoldfunction:: GoodFeaturesToTrack(image, eigImage, tempImage, cornerCount, qualityLevel, minDistance, mask=None, blockSize=3, useHarris=0, k=0.04)-> corners
.. ocv:pyoldfunction:: cv.GoodFeaturesToTrack(image, eigImage, tempImage, cornerCount, qualityLevel, minDistance, mask=None, blockSize=3, useHarris=0, k=0.04)-> corners
:param image: Input 8-bit or floating-point 32-bit, single-channel image.
......@@ -265,6 +277,8 @@ Finds circles in a grayscale image using the Hough transform.
.. ocv:function:: void HoughCircles( InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 )
.. ocv:pyfunction:: cv2.HoughCircles(image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]]) -> circles
:param image: 8-bit, single-channel, grayscale input image.
:param circles: Output vector of found circles. Each vector is encoded as a 3-element floating-point vector :math:`(x, y, radius)` .
......@@ -330,6 +344,8 @@ Finds lines in a binary image using the standard Hough transform.
.. ocv:function:: void HoughLines( InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
.. ocv:pyfunction:: cv2.HoughLines(image, rho, theta, threshold[, lines[, srn[, stn]]]) -> lines
:param image: 8-bit, single-channel binary source image. The image may be modified by the function.
:param lines: Output vector of lines. Each line is represented by a two-element vector :math:`(\rho, \theta)` . :math:`\rho` is the distance from the coordinate origin :math:`(0,0)` (top-left corner of the image). :math:`\theta` is the line rotation angle in radians ( :math:`0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}` ).
......@@ -356,6 +372,8 @@ Finds line segments in a binary image using the probabilistic Hough transform.
.. ocv:function:: void HoughLinesP( InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )
.. ocv:pyfunction:: cv2.HoughLinesP(image, rho, theta, threshold[, lines[, minLineLength[, maxLineGap]]]) -> lines
:param image: 8-bit, single-channel binary source image. The image may be modified by the function.
:param lines: Output vector of lines. Each line is represented by a 4-element vector :math:`(x_1, y_1, x_2, y_2)` , where :math:`(x_1,y_1)` and :math:`(x_2, y_2)` are the ending points of each detected line segment.
......@@ -443,8 +461,10 @@ Calculates a feature map for corner detection.
.. ocv:function:: void preCornerDetect( InputArray src, OutputArray dst, int apertureSize, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.preCornerDetect(src, ksize[, dst[, borderType]]) -> dst
.. ocv:cfunction:: void cvPreCornerDetect( const CvArr* image, CvArr* corners, int apertureSize=3 )
.. ocv:pyoldfunction:: PreCornerDetect(image, corners, apertureSize=3)-> None
.. ocv:pyoldfunction:: cv.PreCornerDetect(image, corners, apertureSize=3)-> None
:param src: Source single-channel 8-bit of floating-point image.
......
This diff is collapsed.
......@@ -39,6 +39,8 @@ Converts image transformation maps from one representation to another.
.. ocv:function:: void convertMaps( InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, int dstmap1type, bool nninterpolation=false )
.. ocv:pyfunction:: cv2.convertMaps(map1, map2, dstmap1type[, dstmap1[, dstmap2[, nninterpolation]]]) -> dstmap1, dstmap2
:param map1: The first input map of type ``CV_16SC2`` , ``CV_32FC1`` , or ``CV_32FC2`` .
:param map2: The second input map of type ``CV_16UC1`` , ``CV_32FC1`` , or none (empty matrix), respectively.
......@@ -77,8 +79,10 @@ Calculates an affine transform from three pairs of the corresponding points.
.. ocv:function:: Mat getAffineTransform( const Point2f src[], const Point2f dst[] )
.. ocv:pyfunction:: cv2.getAffineTransform(src, dst) -> retval
.. ocv:cfunction:: CvMat* cvGetAffineTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix )
.. ocv:pyoldfunction:: GetAffineTransform(src, dst, mapMatrix)-> None
.. ocv:pyoldfunction:: cv.GetAffineTransform(src, dst, mapMatrix)-> None
:param src: Coordinates of triangle vertices in the source image.
......@@ -110,8 +114,10 @@ Calculates a perspective transform from four pairs of the corresponding points.
.. ocv:function:: Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] )
.. ocv:pyfunction:: cv2.getPerspectiveTransform(src, dst) -> retval
.. ocv:cfunction:: CvMat* cvGetPerspectiveTransform( const CvPoint2D32f* src, const CvPoint2D32f* dst, CvMat* mapMatrix )
.. ocv:pyoldfunction:: GetPerspectiveTransform(src, dst, mapMatrix)-> None
.. ocv:pyoldfunction:: cv.GetPerspectiveTransform(src, dst, mapMatrix)-> None
:param src: Coordinates of quadrangle vertices in the source image.
......@@ -143,8 +149,10 @@ Retrieves a pixel rectangle from an image with sub-pixel accuracy.
.. ocv:function:: void getRectSubPix( InputArray image, Size patchSize, Point2f center, OutputArray dst, int patchType=-1 )
.. ocv:pyfunction:: cv2.getRectSubPix(image, patchSize, center[, patch[, patchType]]) -> patch
.. ocv:cfunction:: void cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center )
.. ocv:pyoldfunction:: GetRectSubPix(src, dst, center)-> None
.. ocv:pyoldfunction:: cv.GetRectSubPix(src, dst, center)-> None
:param src: Source image.
......@@ -181,7 +189,9 @@ Calculates an affine matrix of 2D rotation.
.. ocv:function:: Mat getRotationMatrix2D( Point2f center, double angle, double scale )
.. ocv:pyoldfunction:: GetRotationMatrix2D(center, angle, scale, mapMatrix)-> None
.. ocv:pyfunction:: cv2.getRotationMatrix2D(center, angle, scale) -> retval
.. ocv:pyoldfunction:: cv.GetRotationMatrix2D(center, angle, scale, mapMatrix)-> None
:param center: Center of the rotation in the source image.
......@@ -218,6 +228,8 @@ Inverts an affine transformation.
.. ocv:function:: void invertAffineTransform(InputArray M, OutputArray iM)
.. ocv:pyfunction:: cv2.invertAffineTransform(M[, iM]) -> iM
:param M: Original affine transformation.
:param iM: Output reverse affine transformation.
......@@ -242,8 +254,10 @@ Applies a generic geometrical transformation to an image.
.. ocv:function:: void remap( InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.remap(src, map1, map2, interpolation[, dst[, borderMode[, borderValue]]]) -> dst
.. ocv:cfunction:: void cvRemap( const CvArr* src, CvArr* dst, const CvArr* mapx, const CvArr* mapy, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: Remap(src, dst, mapx, mapy, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
.. ocv:pyoldfunction:: cv.Remap(src, dst, mapx, mapy, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image.
......@@ -287,8 +301,10 @@ Resizes an image.
.. ocv:function:: void resize( InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR )
.. ocv:pyfunction:: cv2.resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -> dst
.. ocv:cfunction:: void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR )
.. ocv:pyoldfunction:: Resize(src, dst, interpolation=CV_INTER_LINEAR)-> None
.. ocv:pyoldfunction:: cv.Resize(src, dst, interpolation=CV_INTER_LINEAR)-> None
:param src: Source image.
......@@ -355,8 +371,10 @@ Applies an affine transformation to an image.
.. ocv:function:: void warpAffine( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.warpAffine(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
.. ocv:cfunction:: void cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: WarpAffine(src, dst, mapMatrix, flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
.. ocv:pyoldfunction:: cv.WarpAffine(src, dst, mapMatrix, flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image.
......@@ -397,8 +415,10 @@ Applies a perspective transformation to an image.
.. ocv:function:: void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
.. ocv:pyfunction:: cv2.warpPerspective(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
.. ocv:cfunction:: void cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
.. ocv:pyoldfunction:: WarpPerspective(src, dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
.. ocv:pyoldfunction:: cv.WarpPerspective(src, dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0))-> None
:param src: Source image.
......@@ -441,8 +461,10 @@ Computes the undistortion and rectification transformation map.
.. ocv:function:: void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2 )
.. ocv:pyfunction:: cv2.initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, m1type[, map1[, map2]]) -> map1, map2
.. ocv:cfunction:: void cvInitUndistortRectifyMap( const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R, const CvMat* newCameraMatrix, CvArr* map1, CvArr* map2 )
.. ocv:pyoldfunction:: InitUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, map1, map2)-> None
.. ocv:pyoldfunction:: cv.InitUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, map1, map2)-> None
:param cameraMatrix: Input camera matrix :math:`A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}` .
......@@ -498,6 +520,8 @@ Returns the default new camera matrix.
.. ocv:function:: Mat getDefaultNewCameraMatrix(InputArray cameraMatrix, Size imgSize=Size(), bool centerPrincipalPoint=false )
.. ocv:pyfunction:: cv2.getDefaultNewCameraMatrix(cameraMatrix[, imgsize[, centerPrincipalPoint]]) -> retval
:param cameraMatrix: Input camera matrix.
:param imageSize: Camera view image size in pixels.
......@@ -531,6 +555,8 @@ Transforms an image to compensate for lens distortion.
.. ocv:function:: void undistort( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray() )
.. ocv:pyfunction:: cv2.undistort(src, cameraMatrix, distCoeffs[, dst[, newCameraMatrix]]) -> dst
:param src: Input (distorted) image.
:param dst: Output (corrected) image that has the same size and type as ``src`` .
......@@ -567,7 +593,7 @@ Computes the ideal point coordinates from the observed point coordinates.
.. ocv:function:: void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=noArray(), InputArray P=noArray())
.. ocv:cfunction:: void cvUndistortPoints( const CvMat* src, CvMat* dst, const CvMat* cameraMatrix, const CvMat* distCoeffs, const CvMat* R=NULL, const CvMat* P=NULL)
.. ocv:pyoldfunction:: UndistortPoints(src, dst, cameraMatrix, distCoeffs, R=None, P=None)-> None
.. ocv:pyoldfunction:: cv.UndistortPoints(src, dst, cameraMatrix, distCoeffs, R=None, P=None)-> None
:param src: Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
......
......@@ -13,8 +13,10 @@ Calculates a histogram of a set of arrays.
.. ocv:function:: void calcHist( const Mat* arrays, int narrays, const int* channels, InputArray mask, SparseMat& hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )
.. ocv:pyfunction:: cv2.calcHist(images, channels, mask, histSize, ranges[, hist[, accumulate]]) -> hist
.. ocv:cfunction:: void cvCalcHist( IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr* mask=NULL )
.. ocv:pyoldfunction:: CalcHist(image, hist, accumulate=0, mask=None)-> None
.. 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.
......@@ -108,8 +110,10 @@ Calculates the back projection of a histogram.
.. ocv:function:: void calcBackProject( const Mat* arrays, int narrays, const int* channels, const SparseMat& hist, OutputArray backProject, const float** ranges, double scale=1, bool uniform=true )
.. ocv:pyfunction:: cv2.calcBackProject(images, channels, hist, ranges[, dst[, scale]]) -> dst
.. ocv:cfunction:: void cvCalcBackProject( IplImage** image, CvArr* backProject, const CvHistogram* hist )
.. ocv:pyoldfunction:: CalcBackProject(image, backProject, hist)-> None
.. ocv:pyoldfunction:: cv.CalcBackProject(image, backProject, 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.
......@@ -154,8 +158,10 @@ Compares two histograms.
.. ocv:function:: double compareHist( const SparseMat& H1, const SparseMat& H2, int method )
.. ocv:pyfunction:: cv2.compareHist(H1, H2, method) -> retval
.. ocv:cfunction:: double cvCompareHist( const CvHistogram* hist1, const CvHistogram* hist2, int method )
.. ocv:pyoldfunction:: CompareHist(hist1, hist2, method)->float
.. ocv:pyoldfunction:: cv.CompareHist(hist1, hist2, method)->float
:param H1: The first compared histogram.
......@@ -243,6 +249,8 @@ Equalizes the histogram of a grayscale image.
.. ocv:function:: void equalizeHist( InputArray src, OutputArray dst )
.. ocv:pyfunction:: cv2.equalizeHist(src[, dst]) -> dst
:param src: Source 8-bit single channel image.
:param dst: Destination image of the same size and type as ``src`` .
......
......@@ -10,8 +10,10 @@ Applies an adaptive threshold to an array.
.. ocv:function:: void adaptiveThreshold( InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C )
.. ocv:pyfunction:: cv2.adaptiveThreshold(src, maxValue, adaptiveMethod, thresholdType, blockSize, C[, dst]) -> dst
.. ocv:cfunction:: void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double maxValue, int adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, int thresholdType=CV_THRESH_BINARY, int blockSize=3, double param1=5 )
.. ocv:pyoldfunction:: AdaptiveThreshold(src, dst, maxValue, adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, thresholdType=CV_THRESH_BINARY, blockSize=3, param1=5)-> None
.. ocv:pyoldfunction:: cv.AdaptiveThreshold(src, dst, maxValue, adaptiveMethod=CV_ADAPTIVE_THRESH_MEAN_C, thresholdType=CV_THRESH_BINARY, blockSize=3, param1=5)-> None
:param src: Source 8-bit single-channel image.
......@@ -71,8 +73,10 @@ Converts an image from one color space to another.
.. ocv:function:: void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 )
.. ocv:pyfunction:: cv2.cvtColor(src, code[, dst[, dstCn]]) -> dst
.. ocv:cfunction:: void cvCvtColor( const CvArr* src, CvArr* dst, int code )
.. ocv:pyoldfunction:: CvtColor(src, dst, code)-> None
.. ocv:pyoldfunction:: cv.CvtColor(src, dst, code)-> None
:param src: Source image: 8-bit unsigned, 16-bit unsigned ( ``CV_16UC...`` ), or single-precision floating-point.
......@@ -408,6 +412,8 @@ Calculates the distance to the closest zero pixel for each pixel of the source i
.. ocv:function:: void distanceTransform( InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize )
.. ocv:pyfunction:: cv2.distanceTransform(src, distanceType, maskSize[, dst[, labels]]) -> dst, labels
:param src: 8-bit, single-channel (binary) source image.
:param dst: Output image with calculated distances. It is a 32-bit floating-point, single-channel image of the same size as ``src`` .
......@@ -476,8 +482,10 @@ Fills a connected component with the given color.
.. ocv:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seed, Scalar newVal, Rect* rect=0, Scalar loDiff=Scalar(), Scalar upDiff=Scalar(), int flags=4 )
.. ocv:pyfunction:: cv2.floodFill(image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]) -> retval, rect
.. ocv:cfunction:: void cvFloodFill( CvArr* image, CvPoint seedPoint, CvScalar newVal, CvScalar loDiff=cvScalarAll(0), CvScalar upDiff=cvScalarAll(0), CvConnectedComp* comp=NULL, int flags=4, CvArr* mask=NULL )
.. ocv:pyoldfunction:: FloodFill(image, seedPoint, newVal, loDiff=(0, 0, 0, 0), upDiff=(0, 0, 0, 0), flags=4, mask=None)-> comp
.. ocv:pyoldfunction:: cv.FloodFill(image, seedPoint, newVal, loDiff=(0, 0, 0, 0), upDiff=(0, 0, 0, 0), flags=4, mask=None)-> comp
:param image: Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the function unless the ``FLOODFILL_MASK_ONLY`` flag is set in the second variant of the function. See the details below.
......@@ -579,8 +587,10 @@ Restores the selected region in an image using the region neighborhood.
.. ocv:function:: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags )
.. ocv:pyfunction:: cv2.inpaint(src, inpaintMask, inpaintRange, flags[, dst]) -> dst
.. ocv:cfunction:: void cvInpaint( const CvArr* src, const CvArr* mask, CvArr* dst, double inpaintRadius, int flags)
.. ocv:pyoldfunction:: Inpaint(src, mask, dst, inpaintRadius, flags) -> None
.. ocv:pyoldfunction:: cv.Inpaint(src, mask, dst, inpaintRadius, flags) -> None
:param src: Input 8-bit 1-channel or 3-channel image.
......@@ -612,8 +622,10 @@ Calculates the integral of an image.
.. ocv:function:: void integral( InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )
.. ocv:pyfunction:: cv2.integral(src[, sum[, sdepth]]) -> sum
.. ocv:cfunction:: void cvIntegral( const CvArr* image, CvArr* sum, CvArr* sqsum=NULL, CvArr* tiltedSum=NULL )
.. ocv:pyoldfunction:: Integral(image, sum, sqsum=None, tiltedSum=None)-> None
.. ocv:pyoldfunction:: cv.Integral(image, sum, sqsum=None, tiltedSum=None)-> None
:param image: Source image as :math:`W \times H` , 8-bit or floating-point (32f or 64f).
......@@ -661,8 +673,10 @@ Applies a fixed-level threshold to each array element.
.. ocv:function:: double threshold( InputArray src, OutputArray dst, double thresh, double maxVal, int thresholdType )
.. ocv:pyfunction:: cv2.threshold(src, thresh, maxval, type[, dst]) -> retval, dst
.. ocv:cfunction:: double cvThreshold( const CvArr* src, CvArr* dst, double threshold, double maxValue, int thresholdType )
.. ocv:pyoldfunction:: Threshold(src, dst, threshold, maxValue, thresholdType)-> None
.. ocv:pyoldfunction:: cv.Threshold(src, dst, threshold, maxValue, thresholdType)-> None
:param src: Source array (single-channel, 8-bit of 32-bit floating point)
......@@ -735,6 +749,8 @@ Performs a marker-based image segmentation using the watershed algrorithm.
.. ocv:function:: void watershed( InputArray image, InputOutputArray markers )
.. ocv:pyfunction:: cv2.watershed(image, markers) -> None
:param image: Input 8-bit 3-channel image.
:param markers: Input/output 32-bit single-channel image (map) of markers. It should have the same size as ``image`` .
......@@ -773,6 +789,8 @@ Runs the GrabCut algorithm.
.. ocv:function:: void grabCut(InputArray image, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode )
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> None
:param image: 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:
......
......@@ -9,6 +9,8 @@ Adds an image to the accumulator.
.. ocv:function:: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulate(src, dst[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
......@@ -38,6 +40,8 @@ Adds the square of a source image to the accumulator.
.. ocv:function:: void accumulateSquare( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateSquare(src, dst[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
......@@ -65,6 +69,8 @@ Adds the per-element product of two input images to the accumulator.
.. ocv:function:: void accumulateProduct( InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateProduct(src1, src2, dst[, mask]) -> dst
:param src1: First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
:param src2: Second input image of the same type and the same size as ``src1`` .
......@@ -94,6 +100,8 @@ Updates a running average.
.. ocv:function:: void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulateWeighted(src, dst, alpha[, mask]) -> dst
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
......
......@@ -9,8 +9,10 @@ Compares a template against overlapped image regions.
.. ocv:function:: void matchTemplate( InputArray image, InputArray temp, OutputArray result, int method )
.. ocv:pyfunction:: cv2.matchTemplate(image, templ, method[, result]) -> result
.. ocv:cfunction:: void cvMatchTemplate( const CvArr* image, const CvArr* templ, CvArr* result, int method )
.. ocv:pyoldfunction:: MatchTemplate(image, templ, result, method)-> None
.. ocv:pyoldfunction:: cv.MatchTemplate(image, templ, result, method)-> None
:param image: Image where the search is running. It must be 8-bit or 32-bit floating-point.
......
......@@ -9,8 +9,10 @@ Calculates all of the moments up to the third order of a polygon or rasterized s
.. ocv:function:: Moments moments( InputArray array, bool binaryImage=false )
.. ocv:pyfunction:: cv2.moments(array[, binaryImage]) -> retval
.. ocv:cfunction:: void cvMoments( const CvArr* arr, CvMoments* moments, int binary=0 )
.. ocv:pyoldfunction:: Moments(arr, binary=0) -> moments
.. ocv:pyoldfunction:: cv.Moments(arr, binary=0) -> moments
:param array: A raster image (single-channel, 8-bit or floating-point 2D array) or an array ( :math:`1 \times N` or :math:`N \times 1` ) of 2D points (``Point`` or ``Point2f`` ).
......@@ -86,6 +88,8 @@ Calculates the seven Hu invariants.
.. ocv:function:: void HuMoments( const Moments& moments, double h[7] )
.. ocv:pyfunction:: cv2.HuMoments(m) -> hu
:param moments: Input moments computed with :ocv:func:`moments` .
:param h: Output Hu invariants.
......@@ -116,7 +120,7 @@ Finds contours in a binary image.
.. ocv:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
.. ocv:cfunction:: int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** firstContour, int headerSize=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0, 0) )
.. ocv:pyoldfunction:: FindContours(image, storage, mode=CV_RETR_LIST, method=CV_CHAIN_APPROX_SIMPLE, offset=(0, 0)) -> cvseq
.. ocv:pyoldfunction:: cv.FindContours(image, storage, mode=CV_RETR_LIST, method=CV_CHAIN_APPROX_SIMPLE, offset=(0, 0)) -> cvseq
:param image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero pixels remain 0's, so the image is treated as ``binary`` . You can use :ocv:func:`compare` , :ocv:func:`inRange` , :ocv:func:`threshold` , :ocv:func:`adaptiveThreshold` , :ocv:func:`Canny` , and others to create a binary image out of a grayscale or color one. The function modifies the ``image`` while extracting the contours.
......@@ -159,8 +163,10 @@ 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:pyfunction:: cv2.drawContours(image, contours, contourIdx, color[, thickness[, lineType[, hierarchy[, maxLevel[, offset]]]]]) -> None
.. ocv:cfunction:: void cvDrawContours( CvArr *img, CvSeq* contour, CvScalar externalColor, CvScalar holeColor, int maxLevel, int thickness=1, int lineType=8 )
.. ocv:pyoldfunction:: DrawContours(img, contour, externalColor, holeColor, maxLevel, thickness=1, lineType=8, offset=(0, 0))-> None
.. ocv:pyoldfunction:: cv.DrawContours(img, contour, externalColor, holeColor, maxLevel, thickness=1, lineType=8, offset=(0, 0))-> None
:param image: Destination image.
......@@ -233,6 +239,8 @@ Approximates a polygonal curve(s) with the specified precision.
.. ocv:function:: void approxPolyDP( InputArray curve, OutputArray approxCurve, double epsilon, bool closed )
.. ocv:pyfunction:: cv2.approxPolyDP(curve, epsilon, closed[, approxCurve]) -> approxCurve
:param curve: Input vector of 2d point, stored in ``std::vector`` or ``Mat``.
:param approxCurve: Result of the approximation. The type should match the type of the input curve.
......@@ -254,8 +262,10 @@ Calculates a contour perimeter or a curve length.
.. ocv:function:: double arcLength( InputArray curve, bool closed )
.. ocv:pyfunction:: cv2.arcLength(curve, closed) -> retval
.. ocv:cfunction:: double cvArcLength( const void* curve, CvSlice slice=CV_WHOLE_SEQ, int isClosed=-1 )
.. ocv:pyoldfunction:: ArcLength(curve, slice=CV_WHOLE_SEQ, isClosed=-1)-> double
.. ocv:pyoldfunction:: cv.ArcLength(curve, slice=CV_WHOLE_SEQ, isClosed=-1)-> double
:param curve: Input vector of 2D points, stored in ``std::vector`` or ``Mat``.
......@@ -271,8 +281,10 @@ Calculates the up-right bounding rectangle of a point set.
.. ocv:function:: Rect boundingRect( InputArray points )
.. ocv:pyfunction:: cv2.boundingRect(points) -> retval
.. ocv:cfunction:: CvRect cvBoundingRect( CvArr* points, int update=0 )
.. ocv:pyoldfunction:: BoundingRect(points, update=0)-> CvRect
.. ocv:pyoldfunction:: cv.BoundingRect(points, update=0)-> CvRect
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
......@@ -287,8 +299,10 @@ Calculates a contour area.
.. ocv:function:: double contourArea( InputArray contour, bool oriented=false )
.. ocv:pyfunction:: cv2.contourArea(contour[, oriented]) -> retval
.. ocv:cfunction:: double cvContourArea( const CvArr* contour, CvSlice slice=CV_WHOLE_SEQ )
.. ocv:pyoldfunction:: ContourArea(contour, slice=CV_WHOLE_SEQ)-> double
.. ocv:pyoldfunction:: cv.ContourArea(contour, slice=CV_WHOLE_SEQ)-> double
:param contour: Input vector of 2d points (contour vertices), stored in ``std::vector`` or ``Mat``.
:param orientation: Oriented area flag. If it is true, the function returns a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking sign of the area. By default the parameter is ``false``, which means that the absolute value is returned.
......@@ -322,6 +336,8 @@ Finds the convex hull of a point set.
.. ocv:function:: void convexHull( InputArray points, OutputArray hull, bool clockwise=false, bool returnPoints=true )
.. ocv:pyfunction:: cv2.convexHull(points[, hull[, returnPoints[, clockwise]]]) -> hull
:param points: Input 2D point set, stored in ``std::vector`` or ``Mat``.
:param hull: Output convex hull. It is either an integer vector of indices or vector of points. In the first case the ``hull`` elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case ``hull`` elements will be the convex hull points themselves.
......@@ -343,6 +359,8 @@ Fits an ellipse around a set of 2D points.
.. ocv:function:: RotatedRect fitEllipse( InputArray points )
.. ocv:pyfunction:: cv2.fitEllipse(points) -> retval
:param points: Input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates the ellipse that fits (in least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed.
......@@ -355,8 +373,10 @@ Fits a line to a 2D or 3D point set.
.. ocv:function:: void fitLine( InputArray points, OutputArray line, int distType, double param, double reps, double aeps )
.. ocv:pyfunction:: cv2.fitLine(points, distType, param, reps, aeps) -> line
.. ocv:cfunction:: void cvFitLine( const CvArr* points, int distType, double param, double reps, double aeps, float* line )
.. ocv:pyoldfunction:: FitLine(points, distType, param, reps, aeps) -> line
.. ocv:pyoldfunction:: cv.FitLine(points, distType, param, reps, aeps) -> line
:param points: Input vector of 2D or 3D points, stored in ``std::vector<>`` or ``Mat``.
......@@ -424,6 +444,8 @@ Tests a contour convexity.
.. ocv:function:: bool isContourConvex( InputArray contour )
.. ocv:pyfunction:: cv2.isContourConvex(contour) -> retval
:param contour: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined.
......@@ -436,6 +458,8 @@ Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
.. ocv:function:: RotatedRect minAreaRect( InputArray points )
.. ocv:pyfunction:: cv2.minAreaRect(points) -> retval
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. See the OpenCV sample ``minarea.cpp`` .
......@@ -448,8 +472,10 @@ Finds a circle of the minimum area enclosing a 2D point set.
.. ocv:function:: void minEnclosingCircle( InputArray points, Point2f& center, float& radius )
.. ocv:pyfunction:: cv2.minEnclosingCircle(points, center, radius) -> None
.. ocv:cfunction:: int cvMinEnclosingCircle( const CvArr* points, CvPoint2D32f* center, float* radius )
.. ocv:pyoldfunction:: MinEnclosingCircle(points)-> (int, center, radius)
.. ocv:pyoldfunction:: cv.MinEnclosingCircle(points)-> (int, center, radius)
:param points: The input vector of 2D points, stored in ``std::vector<>`` or ``Mat``.
......@@ -467,8 +493,10 @@ Compares two shapes.
.. ocv:function:: double matchShapes( InputArray object1, InputArray object2, int method, double parameter=0 )
.. ocv:pyfunction:: cv2.matchShapes(contour1, contour2, method, parameter) -> retval
.. ocv:cfunction:: double cvMatchShapes( const void* object1, const void* object2, int method, double parameter=0 )
.. ocv:pyoldfunction:: MatchShapes(object1, object2, method, parameter=0)-> None
.. ocv:pyoldfunction:: cv.MatchShapes(object1, object2, method, parameter=0)-> None
:param object1: The first contour or grayscale image.
......@@ -520,8 +548,10 @@ Performs a point-in-contour test.
.. ocv:function:: double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist )
.. ocv:pyfunction:: cv2.pointPolygonTest(contour, pt, measureDist) -> retval
.. ocv:cfunction:: double cvPointPolygonTest( const CvArr* contour, CvPoint2D32f pt, int measureDist )
.. ocv:pyoldfunction:: PointPolygonTest(contour, pt, measureDist)-> double
.. ocv:pyoldfunction:: cv.PointPolygonTest(contour, pt, measureDist)-> double
:param contour: Input contour.
......
......@@ -146,6 +146,8 @@ Trains a boosted tree classifier.
.. ocv:function:: bool CvBoost::train( const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvBoostParams params=CvBoostParams(), bool update=false )
.. ocv:pyfunction:: cv2.CvBoost.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params[, update]]]]]]) -> retval
.. ocv:cfunction:: bool CvBoost::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvBoostParams params=CvBoostParams(), bool update=false )
.. ocv:cfunction:: bool CvBoost::train( CvMLData* data, CvBoostParams params=CvBoostParams(), bool update=false )
......@@ -160,6 +162,8 @@ Predicts a response for an input sample.
.. ocv:function:: float CvBoost::predict( const Mat& sample, const Mat& missing=Mat(), const Range& slice=Range::all(), bool rawMode=false, bool returnSum=false ) const
.. ocv:pyfunction:: cv2.CvBoost.predict(sample[, missing[, slice[, rawMode[, returnSum]]]]) -> retval
The method runs the sample through the trees in the ensemble and returns the output class label based on the weighted voting.
CvBoost::prune
......@@ -168,6 +172,8 @@ Removes the specified weak classifiers.
.. ocv:function:: void CvBoost::prune( CvSlice slice )
.. ocv:pyfunction:: cv2.CvBoost.prune(slice) -> None
The method removes the specified weak classifiers from the sequence.
.. note:: Do not confuse this method with the pruning of individual decision trees, which is currently not supported.
......
......@@ -222,6 +222,8 @@ Trains a decision tree.
.. ocv:function:: bool CvDTree::train( CvDTreeTrainData* trainData, const CvMat* subsampleIdx )
.. ocv:pyfunction:: cv2.CvDTree.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params]]]]]) -> retval
There are four ``train`` methods in :ocv:class:`CvDTree`:
* The **first two** methods follow the generic ``CvStatModel::train`` conventions. It is the most complete form. Both data layouts (``tflag=CV_ROW_SAMPLE`` and ``tflag=CV_COL_SAMPLE``) are supported, as well as sample and variable subsets, missing measurements, arbitrary combinations of input and output variable types, and so on. The last parameter contains all of the necessary training parameters (see the :ref:`CvDTreeParams` description).
......@@ -240,6 +242,8 @@ Returns the leaf node of a decision tree corresponding to the input vector.
.. ocv:function:: CvDTreeNode* CvDTree::predict( const CvMat* sample, const CvMat* missingDataMask=0, bool preprocessedInput=false ) const
.. ocv:pyfunction:: cv2.CvDTree.predict(sample[, missingDataMask[, preprocessedInput]]) -> retval
:param sample: Sample for prediction.
:param missing_data: Optional input missing measurement mask.
......
......@@ -155,6 +155,8 @@ Estimates the Gaussian mixture parameters from a sample set.
.. ocv:function:: bool CvEM::train( const CvMat* samples, const CvMat* sampleIdx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 )
.. ocv:pyfunction:: cv2.CvEM.train(samples[, sampleIdx[, params]]) -> retval, labels
: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.
......@@ -187,6 +189,8 @@ Returns a mixture component index of a sample.
.. ocv:function:: float CvEM::predict( const CvMat* sample, CvMat* probs ) const
.. ocv:pyfunction:: cv2.CvEM.predict(sample) -> retval, probs
:param sample: A sample for classification.
:param probs: If it is not null then the method will write posterior probabilities of each component given the sample data to this parameter.
......
......@@ -169,6 +169,8 @@ Trains a Gradient boosted tree model.
.. ocv:function:: bool CvGBTrees::train(const Mat& trainData, int tflag, const Mat& responses, const Mat& varIdx=Mat(), const Mat& sampleIdx=Mat(), const Mat& varType=Mat(), const Mat& missingDataMask=Mat(), CvGBTreesParams params=CvGBTreesParams(), bool update=false)
.. ocv:pyfunction:: cv2.CvGBTrees.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params[, update]]]]]]) -> retval
.. ocv:cfunction:: bool CvGBTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvGBTreesParams params=CvGBTreesParams(), bool update=false )
.. ocv:cfunction:: bool CvGBTrees::train(CvMLData* data, CvGBTreesParams params=CvGBTreesParams(), bool update=false)
......@@ -194,6 +196,8 @@ Predicts a response for an input sample.
.. ocv:function:: float CvGBTrees::predict(const Mat& sample, const Mat& missing=Mat(), const Range& slice = Range::all(), int k=-1) const
.. ocv:pyfunction:: cv2.CvGBTrees.predict(sample[, missing[, slice[, k]]]) -> retval
.. ocv:cfunction:: float CvGBTrees::predict( const CvMat* sample, const CvMat* missing=0, CvMat* weakResponses=0, CvSlice slice = CV_WHOLE_SEQ, int k=-1 ) const
:param sample: Input feature vector that has the same format as every training set
......@@ -235,6 +239,8 @@ Clears the model.
.. ocv:function:: void CvGBTrees::clear()
.. ocv:pyfunction:: cv2.CvGBTrees.clear() -> None
The function deletes the data set information and all the weak models and sets all internal
variables to the initial state. The function is called in :ocv:func:`CvGBTrees::train` and in the
destructor.
......
......@@ -29,6 +29,8 @@ Trains the model.
.. ocv:function:: bool CvKNearest::train( const Mat& trainData, const Mat& responses, const Mat& sampleIdx=Mat(), bool isRegression=false, int maxK=32, bool updateBase=false )
.. ocv:pyfunction:: cv2.CvKNearest.train(trainData, responses[, sampleIdx[, isRegression[, maxK[, updateBase]]]]) -> retval
.. ocv:cfunction:: bool CvKNearest::train( const CvMat* trainData, const CvMat* responses, const CvMat* sampleIdx=0, bool is_regression=false, int maxK=32, bool updateBase=false )
:param isRegression: Type of the problem: ``true`` for regression and ``false`` for classification.
......@@ -52,6 +54,8 @@ Finds the neighbors and predicts responses for input vectors.
.. ocv:function:: float CvKNearest::find_nearest( const Mat& samples, int k, Mat& results, Mat& neighborResponses, Mat& dists) const
.. ocv:pyfunction:: cv2.CvKNearest.find_nearest(samples, k[, results[, neighborResponses[, dists]]]) -> retval, results, neighborResponses, dists
.. ocv:cfunction:: float CvKNearest::find_nearest( const CvMat* samples, int k, CvMat* results=0, const float** neighbors=0, CvMat* neighborResponses=0, CvMat* dist=0 ) const
:param samples: Input samples stored by rows. It is a single-precision floating-point matrix of :math:`number\_of\_samples \times number\_of\_features` size.
......
......@@ -33,6 +33,8 @@ Trains the model.
.. ocv:function:: bool CvNormalBayesClassifier::train( const Mat& trainData, const Mat& responses, const Mat& varIdx = Mat(), const Mat& sampleIdx=Mat(), bool update=false )
.. ocv:pyfunction:: cv2.CvNormalBayesClassifier.train(trainData, responses[, varIdx[, sampleIdx[, update]]]) -> retval
.. ocv:cfunction:: bool CvNormalBayesClassifier::train( const CvMat* trainData, const CvMat* responses, const CvMat* varIdx = 0, const CvMat* sampleIdx=0, bool update=false )
:param update: Identifies whether the model should be trained from scratch (``update=false``) or should be updated using the new training data (``update=true``).
......@@ -50,6 +52,8 @@ Predicts the response for sample(s).
.. ocv:function:: float CvNormalBayesClassifier::predict( const Mat& samples, Mat* results=0 ) const
.. ocv:pyfunction:: cv2.CvNormalBayesClassifier.predict(samples) -> retval, results
.. ocv:cfunction:: float CvNormalBayesClassifier::predict( const CvMat* samples, CvMat* results=0 ) const
The method estimates the most probable classes for input vectors. Input vectors (one or more) are stored as rows of the matrix ``samples``. In case of multiple input vectors, there should be one output vector ``results``. The predicted class for a single input vector is returned by the method.
......
......@@ -105,6 +105,8 @@ Trains the Random Trees model.
.. ocv:function:: bool CvRTrees::train( const CvMat* trainData, int tflag, const CvMat* responses, const CvMat* varIdx=0, const CvMat* sampleIdx=0, const CvMat* varType=0, const CvMat* missingDataMask=0, CvRTParams params=CvRTParams() )
.. ocv:pyfunction:: cv2.CvRTrees.train(trainData, tflag, responses[, varIdx[, sampleIdx[, varType[, missingDataMask[, params]]]]]) -> retval
The method :ocv:func:`CvRTrees::train` is very similar to the method :ocv:func:`CvDTree::train` and follows the generic method :ocv:func:`CvStatModel::train` conventions. All the parameters specific to the algorithm training are passed as a :ocv:class:`CvRTParams` instance. The estimate of the training error (``oob-error``) is stored in the protected class member ``oob_error``.
CvRTrees::predict
......@@ -115,6 +117,8 @@ Predicts the output for an input sample.
.. ocv:function:: float CvRTrees::predict( const CvMat* sample, const CvMat* missing = 0 ) const
.. ocv:pyfunction:: cv2.CvRTrees.predict(sample[, missing]) -> retval
:param sample: Sample for classification.
:param missing: Optional missing measurement mask of the sample.
......@@ -130,6 +134,8 @@ Returns a fuzzy-predicted class label.
.. ocv:function:: float CvRTrees::predict_prob( const CvMat* sample, const CvMat* missing = 0 ) const
.. ocv:pyfunction:: cv2.CvRTrees.predict_prob(sample[, missing]) -> retval
:param sample: Sample for classification.
:param missing: Optional missing measurement mask of the sample.
......
......@@ -89,6 +89,8 @@ Saves the model to a file.
.. ocv:function:: void CvStatModel::save( const char* filename, const char* name=0 )
.. ocv:pyfunction:: cv2.CvStatModel.save(filename[, name]) -> None
The method ``save`` saves the complete model state to the specified XML or YAML file with the specified name or default name (which depends on a particular class). *Data persistence* functionality from ``CxCore`` is used.
CvStatModel::load
......@@ -97,6 +99,8 @@ Loads the model from a file.
.. ocv:function:: void CvStatModel::load( const char* filename, const char* name=0 )
.. ocv:pyfunction:: cv2.CvStatModel.load(filename[, name]) -> None
The method ``load`` loads the complete model state with the specified name (or default model-dependent name) from the specified XML or YAML file. The previous model state is cleared by ``clear()`` .
......
......@@ -117,6 +117,8 @@ Trains an SVM.
.. ocv:function:: bool CvSVM::train( const Mat& _train_data, const Mat& _responses, const Mat& _var_idx=Mat(), const Mat& _sample_idx=Mat(), CvSVMParams _params=CvSVMParams() )
.. ocv:pyfunction:: cv2.CvSVM.train(trainData, responses[, varIdx[, sampleIdx[, params]]]) -> retval
The method trains the SVM model. It follows the conventions of the generic ``train`` approach with the following limitations:
* Only the ``CV_ROW_SAMPLE`` data layout is supported.
......
......@@ -199,12 +199,16 @@ Checks whether the classifier has been loaded.
.. ocv:function:: bool CascadeClassifier::empty() const
.. ocv:pyfunction:: cv2.CascadeClassifier.empty() -> retval
CascadeClassifier::load
---------------------------
Loads a classifier from a file.
.. ocv:function:: bool CascadeClassifier::load(const string& filename)
.. ocv:pyfunction:: cv2.CascadeClassifier.load(filename) -> retval
:param filename: Name of the file from which the classifier is loaded. The file may contain an old HAAR classifier trained by the haartraining application or a new cascade classifier trained by the traincascade application.
......@@ -224,6 +228,9 @@ Detects objects of different sizes in the input image. The detected objects are
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size())
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects
:param image: Matrix of the type ``CV_8U`` containing an image where objects are detected.
:param objects: Vector of rectangles where each rectangle contains the detected object.
......@@ -271,6 +278,10 @@ Groups the object candidate rectangles.
.. ocv:function:: void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps=0.2)
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold[, eps]) -> None
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold[, eps]) -> weights
.. ocv:pyfunction:: cv2.groupRectangles(rectList, groupThreshold, eps, weights, levelWeights) -> None
:param rectList: Input/output vector of rectangles. Output vector includes retained and grouped rectangles.
:param groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
......
......@@ -11,8 +11,10 @@ Calculates an optical flow for a sparse feature set using the iterative Lucas-Ka
.. ocv:function:: void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err, Size winSize=Size(15,15), int maxLevel=3, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), double derivLambda=0.5, int flags=0 )
.. ocv:pyfunction:: cv2.calcOpticalFlowPyrLK(prevImg, nextImg, prevPts[, nextPts[, status[, err[, winSize[, maxLevel[, criteria[, derivLambda[, flags]]]]]]]]) -> nextPts, status, err
.. ocv:cfunction:: void cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, CvArr* prevPyr, CvArr* currPyr, const CvPoint2D32f* prevFeatures, CvPoint2D32f* currFeatures, int count, CvSize winSize, int level, char* status, float* trackError, CvTermCriteria criteria, int flags )
.. ocv:pyoldfunction:: CalcOpticalFlowPyrLK( prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses=None) -> (currFeatures, status, trackError)
.. ocv:pyoldfunction:: cv.CalcOpticalFlowPyrLK( prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses=None) -> (currFeatures, status, trackError)
:param prevImg: First 8-bit single-channel or 3-channel input image.
......@@ -50,6 +52,8 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
.. ocv:function:: void calcOpticalFlowFarneback( InputArray prevImg, InputArray nextImg, InputOutputArray flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags )
.. 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 nextImg: Second input image of the same size and the same type as ``prevImg`` .
......@@ -89,6 +93,8 @@ Computes an optimal affine transformation between two 2D point sets.
.. ocv:function:: Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine )
.. ocv:pyfunction:: cv2.estimateRigidTransform(src, dst, fullAffine) -> retval
:param src: First input 2D point set stored in ``std::vector`` or ``Mat``, or an image stored in ``Mat``.
:param dst: Second input 2D point set of the same size and the same type as ``A``, or another image.
......@@ -132,8 +138,10 @@ Updates the motion history image by a moving silhouette.
.. ocv:function:: void updateMotionHistory( InputArray silhouette, InputOutputArray mhi, double timestamp, double duration )
.. ocv:pyfunction:: cv2.updateMotionHistory(silhouette, mhi, timestamp, duration) -> None
.. ocv:cfunction:: void cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, double timestamp, double duration )
.. ocv:pyoldfunction:: UpdateMotionHistory(silhouette, mhi, timestamp, duration)-> None
.. ocv:pyoldfunction:: cv.UpdateMotionHistory(silhouette, mhi, timestamp, duration)-> None
:param silhouette: Silhouette mask that has non-zero pixels where the motion occurs.
......@@ -168,8 +176,10 @@ Calculates a gradient orientation of a motion history image.
.. ocv:function:: void calcMotionGradient( InputArray mhi, OutputArray mask, OutputArray orientation, double delta1, double delta2, int apertureSize=3 )
.. ocv:pyfunction:: cv2.calcMotionGradient(mhi, delta1, delta2[, mask[, orientation[, apertureSize]]]) -> mask, orientation
.. ocv:cfunction:: void cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, double delta1, double delta2, int apertureSize=3 )
.. ocv:pyoldfunction:: CalcMotionGradient(mhi, mask, orientation, delta1, delta2, apertureSize=3)-> None
.. ocv:pyoldfunction:: cv.CalcMotionGradient(mhi, mask, orientation, delta1, delta2, apertureSize=3)-> None
:param mhi: Motion history single-channel floating-point image.
......@@ -204,8 +214,10 @@ Calculates a global motion orientation in a selected region.
.. ocv:function:: double calcGlobalOrientation( InputArray orientation, InputArray mask, InputArray mhi, double timestamp, double duration )
.. ocv:pyfunction:: cv2.calcGlobalOrientation(orientation, mask, mhi, timestamp, duration) -> retval
.. ocv:cfunction:: double cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask, const CvArr* mhi, double timestamp, double duration )
.. ocv:pyoldfunction:: CalcGlobalOrientation(orientation, mask, mhi, timestamp, duration)-> float
.. ocv:pyoldfunction:: cv.CalcGlobalOrientation(orientation, mask, mhi, timestamp, duration)-> float
:param orientation: Motion gradient orientation image calculated by the function :ocv:func:`calcMotionGradient` .
......@@ -232,8 +244,10 @@ Splits a motion history image into a few parts corresponding to separate indepen
.. ocv:function:: void segmentMotion(InputArray mhi, OutputArray segmask, vector<Rect>& boundingRects, double timestamp, double segThresh)
.. ocv:pyfunction:: cv2.segmentMotion(mhi, boundingRects, timestamp, segThresh[, segmask]) -> segmask
.. ocv:cfunction:: CvSeq* cvSegmentMotion( const CvArr* mhi, CvArr* segMask, CvMemStorage* storage, double timestamp, double segThresh )
.. ocv:pyoldfunction:: SegmentMotion(mhi, segMask, storage, timestamp, segThresh)-> None
.. ocv:pyoldfunction:: cv.SegmentMotion(mhi, segMask, storage, timestamp, segThresh)-> None
:param mhi: Motion history image.
......@@ -257,8 +271,10 @@ Finds an object center, size, and orientation.
.. ocv:function:: RotatedRect CamShift( InputArray probImage, Rect& window, TermCriteria criteria )
.. ocv:pyfunction:: cv2.CamShift(probImage, window, criteria) -> retval, window
.. ocv:cfunction:: int cvCamShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp, CvBox2D* box=NULL )
.. ocv:pyoldfunction:: CamShift(probImage, window, criteria)-> (int, comp, box)
.. ocv:pyoldfunction:: cv.CamShift(probImage, window, criteria)-> (int, comp, box)
:param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` .
......@@ -282,8 +298,10 @@ Finds an object on a back projection image.
.. ocv:function:: int meanShift( InputArray probImage, Rect& window, TermCriteria criteria )
.. ocv:pyfunction:: cv2.meanShift(probImage, window, criteria) -> retval, window
.. ocv:cfunction:: int cvMeanShift( const CvArr* probImage, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp )
.. ocv:pyoldfunction:: MeanShift(probImage, window, criteria)-> comp
.. ocv:pyoldfunction:: cv.MeanShift(probImage, window, criteria)-> comp
:param probImage: Back projection of the object histogram. See :ocv:func:`calcBackProject` for details.
......@@ -355,6 +373,8 @@ Computes a predicted state.
.. ocv:function:: const Mat& KalmanFilter::predict(const Mat& control=Mat())
.. ocv:pyfunction:: cv2.KalmanFilter.predict([, control]) -> retval
:param control: The optional input control
......@@ -364,6 +384,8 @@ Updates the predicted state from the measurement.
.. ocv:function:: const Mat& KalmanFilter::correct(const Mat& measurement)
.. ocv:pyfunction:: cv2.KalmanFilter.correct(measurement) -> retval
:param control: The measured system parameters
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment