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:
@@ -14,9 +14,9 @@ from common import mosaic
|
||||
from digits import *
|
||||
|
||||
def main():
|
||||
try:
|
||||
try:
|
||||
src = sys.argv[1]
|
||||
except:
|
||||
except:
|
||||
src = 0
|
||||
cap = video.create_capture(src)
|
||||
|
||||
@@ -35,7 +35,7 @@ def main():
|
||||
|
||||
bin = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 31, 10)
|
||||
bin = cv2.medianBlur(bin, 3)
|
||||
contours, heirs = cv2.findContours( bin.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
|
||||
_, contours, heirs = cv2.findContours( bin.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
|
||||
try:
|
||||
heirs = heirs[0]
|
||||
except:
|
||||
|
Reference in New Issue
Block a user