work on calibration sample
authorAlexander Mordvintsev <no@email>
Tue, 14 Jun 2011 12:14:02 +0000 (12:14 +0000)
committerAlexander Mordvintsev <no@email>
Tue, 14 Jun 2011 12:14:02 +0000 (12:14 +0000)
samples/python2/calibrate.py

index e72170d..f334ba2 100644 (file)
@@ -51,7 +51,7 @@ if __name__ == '__main__':
             cv2.imwrite('%s/%s_chess.bmp' % (debug_dir, name), vis)\r
         if not found:\r
             print 'chessboard not found'\r
-            break\r
+            continue\r
         img_points.append(corners.reshape(-1, 2))\r
         obj_points.append(pattern_points)\r
         \r
@@ -59,5 +59,8 @@ if __name__ == '__main__':
 \r
     camera_matrix = np.zeros((3, 3))\r
     dist_coefs = np.zeros(4)\r
-    rms = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coefs)\r
-    print rms
\ No newline at end of file
+    img_n = len(img_points)\r
+    rvecs = [np.zeros(3) for i in xrange(img_n)]\r
+    tvecs = [np.zeros(3) for i in xrange(img_n)]\r
+    rms = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coefs) #, rvecs, tvecs)\r
+    print rms\r