1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Unified handling of InputOutputArrays in Python wrapper generator

This makes arguments of type InputOutputArray required in python unless they
have a default value in C++.

As result following python functions changes signatures in non-trivial way:

* calcOpticalFlowFarneback
* calcOpticalFlowPyrLK
* calibrateCamera
* findContours
* findTransformECC
* floodFill
* kmeans
* PCACompute
* stereoCalibrate

And the following functions become return their modified inputs as a return
value:

* accumulate
* accumulateProduct
* accumulateSquare
* accumulateWeighted
* circle
* completeSymm
* cornerSubPix
* drawChessboardCorners
* drawContours
* drawDataMatrixCodes
* ellipse
* fillConvexPoly
* fillPoly
* filterSpeckles
* grabCut
* insertChannel
* line
* patchNaNs
* polylines
* randn
* randShuffle
* randu
* rectangle
* setIdentity
* updateMotionHistory
* validateDisparity
* watershed
This commit is contained in:
Andrey Kamaev
2013-03-15 16:55:58 +04:00
parent a1c456b7c3
commit e75df56317
18 changed files with 51 additions and 47 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ 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
.. ocv:pyfunction:: cv2.cornerSubPix(image, corners, winSize, zeroZone, criteria) -> corners
.. ocv:cfunction:: void cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners, int count, CvSize win, CvSize zero_zone, CvTermCriteria criteria )
@@ -488,7 +488,7 @@ Fills a connected component with the given color.
.. ocv:function:: int floodFill( InputOutputArray image, InputOutputArray mask, Point seedPoint, 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:pyfunction:: cv2.floodFill(image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]) -> retval, image, mask, rect
.. ocv:cfunction:: void cvFloodFill( CvArr* image, CvPoint seed_point, CvScalar new_val, CvScalar lo_diff=cvScalarAll(0), CvScalar up_diff=cvScalarAll(0), CvConnectedComp* comp=NULL, int flags=4, CvArr* mask=NULL )
.. ocv:pyoldfunction:: cv.FloodFill(image, seed_point, new_val, lo_diff=(0, 0, 0, 0), up_diff=(0, 0, 0, 0), flags=4, mask=None)-> comp
@@ -731,7 +731,7 @@ Performs a marker-based image segmentation using the watershed algorithm.
.. ocv:cfunction:: void cvWatershed( const CvArr* image, CvArr* markers )
.. ocv:pyfunction:: cv2.watershed(image, markers) -> None
.. ocv:pyfunction:: cv2.watershed(image, markers) -> markers
:param image: Input 8-bit 3-channel image.
@@ -753,7 +753,7 @@ Runs the GrabCut algorithm.
.. ocv:function:: void grabCut( InputArray img, InputOutputArray mask, Rect rect, InputOutputArray bgdModel, InputOutputArray fgdModel, int iterCount, int mode=GC_EVAL )
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> None
.. ocv:pyfunction:: cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> mask, bgdModel, fgdModel
:param img: Input 8-bit 3-channel image.
@@ -9,7 +9,7 @@ Adds an image to the accumulator.
.. ocv:function:: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
.. ocv:pyfunction:: cv2.accumulate(src, dst[, mask]) -> None
.. ocv:pyfunction:: cv2.accumulate(src, dst[, mask]) -> dst
.. ocv:cfunction:: void cvAcc( const CvArr* image, CvArr* sum, const CvArr* mask=NULL )
@@ -45,7 +45,7 @@ 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]) -> None
.. ocv:pyfunction:: cv2.accumulateSquare(src, dst[, mask]) -> dst
.. ocv:cfunction:: void cvSquareAcc( const CvArr* image, CvArr* sqsum, const CvArr* mask=NULL )
@@ -79,7 +79,7 @@ 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]) -> None
.. ocv:pyfunction:: cv2.accumulateProduct(src1, src2, dst[, mask]) -> dst
.. ocv:cfunction:: void cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc, const CvArr* mask=NULL )
@@ -115,7 +115,7 @@ 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]) -> None
.. ocv:pyfunction:: cv2.accumulateWeighted(src, dst, alpha[, mask]) -> dst
.. ocv:cfunction:: void cvRunningAvg( const CvArr* image, CvArr* acc, double alpha, const CvArr* mask=NULL )
.. ocv:pyoldfunction:: cv.RunningAvg(image, acc, alpha, mask=None)-> None
@@ -159,7 +159,7 @@ Finds contours in a binary image.
.. ocv:function:: void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())
.. ocv:pyfunction:: cv2.findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> contours, hierarchy
.. ocv:pyfunction:: cv2.findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
.. ocv:cfunction:: int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour, int header_size=sizeof(CvContour), int mode=CV_RETR_LIST, int method=CV_CHAIN_APPROX_SIMPLE, CvPoint offset=cvPoint(0,0) )