如何解决?
Traceback (most recent call last): File "/opt/ros/indigo/lib/camera_calibration/cameracalibrator.py", line 252, in on_mouse self.c.do_calibration() File "/opt/ros/indigo/lib/python2.7/dist-packages/camera_calibration/calibrator.py", line 1053, in do_calibration self.cal_fromcorners(self.good_corners) File "/opt/ros/indigo/lib/python2.7/dist-packages/camera_calibration/calibrator.py", line 856, in cal_fromcorners flags = flags) SystemError: new style getargs format but argument is not a tuple
def cal_fromcorners(self, good):
# Perform monocular calibrations
lcorners = [(l, b) for (l, r, b) in good]
rcorners = [(r, b) for (l, r, b) in good]
self.l.cal_fromcorners(lcorners)
self.r.cal_fromcorners(rcorners)
lipts = [ l for (l, _, _) in good ]
ripts = [ r for (_, r, _) in good ]
boards = [ b for (_, _, b) in good ]
opts = self.mk_object_points(boards, True)
flags = cv2.CALIB_FIX_INTRINSIC
self.T = numpy.zeros((3, 1), dtype=numpy.float64)
self.R = numpy.eye(3, dtype=numpy.float64)
cv2.stereoCalibrate(opts, lipts, ripts, self.size,
self.l.intrinsics, self.l.distortion,
self.r.intrinsics, self.r.distortion,
self.R, # R
self.T, # T
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 1, 1e-5),
flags = flags)
self.set_alpha(0.0)
答案 0 :(得分:0)
我使用cv2.calibrateCamera
收到了相同的错误消息。这个LINK表明,给出了一个列表,其中有一个元组。就我而言,论证imageSize
是罪魁祸首。
您的flags
,criteria
,T
和R
看起来不错,但请检查其他参数,尤其是self.size
。