work on calibration sample
This commit is contained in:
parent
22970b8270
commit
6616606ea4
@ -51,7 +51,7 @@ if __name__ == '__main__':
|
|||||||
cv2.imwrite('%s/%s_chess.bmp' % (debug_dir, name), vis)
|
cv2.imwrite('%s/%s_chess.bmp' % (debug_dir, name), vis)
|
||||||
if not found:
|
if not found:
|
||||||
print 'chessboard not found'
|
print 'chessboard not found'
|
||||||
break
|
continue
|
||||||
img_points.append(corners.reshape(-1, 2))
|
img_points.append(corners.reshape(-1, 2))
|
||||||
obj_points.append(pattern_points)
|
obj_points.append(pattern_points)
|
||||||
|
|
||||||
@ -59,5 +59,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
camera_matrix = np.zeros((3, 3))
|
camera_matrix = np.zeros((3, 3))
|
||||||
dist_coefs = np.zeros(4)
|
dist_coefs = np.zeros(4)
|
||||||
rms = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coefs)
|
img_n = len(img_points)
|
||||||
print rms
|
rvecs = [np.zeros(3) for i in xrange(img_n)]
|
||||||
|
tvecs = [np.zeros(3) for i in xrange(img_n)]
|
||||||
|
rms = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coefs) #, rvecs, tvecs)
|
||||||
|
print rms
|
||||||
|
Loading…
x
Reference in New Issue
Block a user