使用Kalibr工具标定单目相机和IMU的外参,操作过程和联合标定双目相机和IMU类似,以下介绍不同部分。
最后标定时所需要的相机参数由双目变成了单目,以下是配置文件的格式:
cam0:
camera_model: pinhole
distortion_coeffs: [-7.1295821564421172e-02, -4.3443376760623504e-03,-5.1875249882739520e-03,1.3588426034275964e-03]
distortion_model: equidistant
intrinsics: [5.3509541321021049e+02, 5.3512807716648979e+02, 6.4285236686543988e+02, 5.2015046295410457e+02]
resolution: [1280, 1024]
rostopic: /camera/image_right
在标定过程中出现了以下问题:
Extracting calibration target corners
Progress 3 / 857 Time remaining: 38m 28s Process Process-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/var/kalibr-build/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/TargetExtractor.py", line 24, in multicoreExtractionWrapper
success, obs = detector.findTarget(stamp, np.array(image))
TypeError: Conversion is only valid for arrays with 1 or 2 dimensions. Argument has 3 dimensions
。。。。
success, obs = detector.findTarget(stamp, np.array(image))
TypeError: Conversion is only valid for arrays with 1 or 2 dimensions. Argument has 3 dimensions
success, obs = detector.findTarget(stamp, np.array(image))
TypeError: Conversion is only valid for arrays with 1 or 2 dimensions. Argument has 3 dimensions
[FATAL] [1595408077.066000]: No corners could be extracted for camera /camera/image_right! Check the calibration target configuration and dataset.
解决办法(在github lssues 中查到):
将ImageDatasetReader.py中117行img_data = np.array(self.CVB.imgmsg_to_cv(data))修改为
img_data = np.squeeze(np.array(self.CVB.imgmsg_to_cv2(data, "mono8")))