hengli / camodocal

CamOdoCal: Automatic Intrinsic and Extrinsic Calibration of a Rig with Multiple Generic Cameras and Odometry
Other
1.16k stars 389 forks source link

Segmentation fault (core dumped) for kitti data #116

Closed sandeepnmenon closed 2 years ago

sandeepnmenon commented 2 years ago

While running extrinsic calibration, since my installed opencv does not seem to have the nonfree options enabled, I replaced SURF_GPU_DETECTOR and SURF_GPU_DESCRIPTOR with corresponding ORB detectors here https://github.com/hengli/camodocal/blob/b399fa9ee81b5182e59f717e67a8ddd6503cdcb4/src/calib/CamOdoThread.cc#L192

Post this I am getting the following error

./extrinsic_calib -v --calib /root/camodocal/data/kitti/intrinsics/ --camera-count 4 --output /root/camodocal/data/kitti/extrinsic_calibration_data --input /root/camodocal/data/kitti/input_data
# INFO: Initializing... 
Reading /root/camodocal/data/kitti/intrinsics/camera_0_calib.yaml
Reading /root/camodocal/data/kitti/intrinsics/camera_1_calib.yaml
Reading /root/camodocal/data/kitti/intrinsics/camera_2_calib.yaml
Reading /root/camodocal/data/kitti/intrinsics/camera_3_calib.yaml
Get images and pose files out from result directory
image name : /root/camodocal/data/kitti/input_data/camera_1_0000000143.png time : 143 
image name : /root/camodocal/data/kitti/input_data/camera_0_0000000119.png time : 119 
.
.
.
# INFO: Initialization finished!
# INFO: Running camera-odometry calibration for each of the 4 cameras.
# ERROR: No segments, calibration fails!!# ERROR: No segments, calibration fails!!
# INFO: Calibrating odometry - camera 3...
# ERROR: No segments, calibration fails!!Rotation: 

# ERROR: No segments, calibration fails!!

6.93175e-310 6.93171e-310 6.93175e-310
6.93175e-310 6.93171e-310 7.90505e-323
6.93171e-310 6.93171e-310 6.93171e-310
Translation: 
2.52962e-321            0 6.93175e-310
# INFO: Reprojection error for camera 3: avg = 0 px | max = 0 px
# INFO: Calibrating odometry - camera 1...
Rotation: 
6.93175e-310 6.93172e-310 6.93175e-310
6.93175e-310 6.93172e-310 7.90505e-323
6.93172e-310 6.93172e-310 6.93172e-310
Translation: 
2.52962e-321            0 6.93175e-310
# INFO: Reprojection error for camera 1: avg = 0 px | max = 0 px# INFO: Calibrating odometry - camera 
0...
Rotation: 
6.93175e-310 6.93173e-310 6.93175e-310
6.93175e-310 6.93173e-310 7.90505e-323
6.93173e-310 6.93173e-310 6.93173e-310
Translation: 
2.52962e-321            0 6.93175e-310
# INFO: Reprojection error for camera 0: avg = 0 px | max = # INFO: Calibrating odometry - camera 0 px2...

Rotation: 
6.93175e-310 6.93172e-310 6.93175e-310
6.93175e-310 6.93172e-310 7.90505e-323
6.93172e-310 6.93172e-310 6.93172e-310
Translation: 
2.52962e-321            0 6.93175e-310
# INFO: Reprojection error for camera 2: avg = 0 px | max = 0 px
# INFO: Completed camera-odometry calibration for all cameras.
# INFO: Saving intermediate data... Done. Took 0.00s.
# INFO: Running camera rig calibration.
# INFO: # segments = 0
# INFO: Reprojection error: avg = 0.00 px | max = 0.00 px | # obs = 0
# INFO: Triangulating feature correspondences... 
# INFO: Reprojection error after triangulation: avg = 0.00 px | max = 0.00 px | # obs = 0
# INFO: # 3D scene points: 0
# INFO: Checking the validity of the graph...
# INFO: Finished checking the validity of the graph.
# INFO: Reprojection error after pruning: avg = 0.00 px | max = 0.00 px | # obs = 0
# INFO: # 3D scene points: 0
# INFO: Running BA on odometry data... 
# INFO: Loss parameter = 25
# INFO: sqrt precision matrix (keypoint position):
5 0
0 5
Ceres Solver Report: Iterations: -2, Initial cost: 0.000000e+00, Final cost: 0.000000e+00, Termination: CONVERGENCE
# INFO: Done.
# INFO: Reprojection error after BA (odometry): avg = 0.00 px | max = 0.00 px | # obs = 0
# INFO: # 3D scene points: 0
Segmentation fault (core dumped)

What could be the issue?

I am using the following kitti data and the corresponding calibration

Environment details ubuntu: 16.04 cuda: 8.0 eigen: 3.2.10 ceres-solver: 1.11.0 Opencv: 3.4.7

sandeepnmenon commented 2 years ago

I also replaced GPU versions of the detectors ORB_GPU_DETECTOR, ORB_GPU_DESCRIPTOR and RATIO_GPU with ORB_DETECTOR, ORB_DESCRIPTOR and RATIO and the issue is resolved for me.

Now I am able to run the algorithm but its failing in the findLoopClosures function while trying to load the vocabulary https://github.com/hengli/camodocal/blob/b399fa9ee81b5182e59f717e67a8ddd6503cdcb4/src/location_recognition/LocationRecognition.cc#L19 Will raise a separate issue for that. Closing this issue.