fixed "import cv" in the new python samples. corrected Python bindings to match the documentation and vice versa (NOTE: in cv2.stereoCalibrate the parameter ordering has been changed)

This commit is contained in:
Vadim Pisarevsky
2011-07-16 09:35:56 +00:00
parent 5a5fe40542
commit f2e1a64c1b
21 changed files with 46 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
import numpy as np
import cv2, cv
import cv2
import cv2.cv as cv
import os
from common import splitfn
@@ -50,10 +51,7 @@ if __name__ == '__main__':
print 'ok'
camera_matrix = np.zeros((3, 3))
dist_coefs = np.zeros(4)
img_n = len(img_points)
rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coefs)
rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h))
print "RMS:", rms
print "camera matrix:\n", camera_matrix
print "distortion coefficients: ", dist_coefs.ravel()