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

View File

@@ -27,7 +27,7 @@ if __name__ == '__main__':
img_mask = img_mask[0]
except:
img_mask = '../cpp/left*.jpg'
img_names = glob(img_mask)
debug_dir = args.get('--debug')
square_size = float(args.get('--square_size', 1.0))
@@ -46,7 +46,7 @@ if __name__ == '__main__':
if img is None:
print "Failed to load", fn
continue
h, w = img.shape[:2]
found, corners = cv2.findChessboardCorners(img, pattern_size)
if found:
@@ -65,7 +65,7 @@ if __name__ == '__main__':
print 'ok'
rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h))
rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h), None, None)
print "RMS:", rms
print "camera matrix:\n", camera_matrix
print "distortion coefficients: ", dist_coefs.ravel()