#QUESTION# My number of inliers is too low
Closed this issue · 3 comments
Hello,
To explain it simple i run this command :
rosrun hand_eye_calibration target_extractor_interface.py --bag bagfiles/calibrationV1.bag --calib_file_camera camera_info/D435_Hand_Eye_Calib.yaml --calib_file_target camera_info/april.yaml --image_topic /image_raw --output_file csv_files/camera_poses_timestampedV1.csv
and i have modify target_extractor.cc to see what happen because each time this script finish i just get this result :
I0726 11:49:52.944243 21896 target_extractor.cc:361] #########################################
I0726 11:49:52.944249 21896 target_extractor.cc:362] Total # observations: 423
I0726 11:49:52.944252 21896 target_extractor.cc:363] # successful: 271
I0726 11:49:52.944254 21896 target_extractor.cc:364] # pnp successful: 271
I0726 11:49:52.944257 21896 target_extractor.cc:365] # inlier count ok: 0
I0726 11:49:52.944278 21896 target_extractor.cc:366] Written reprojected corners to: corner_reprojections.csv
I0726 11:49:52.944285 21896 target_extractor.cc:367] Written extracted camera poses to: csv_files/camera_poses_timestampedV1.csv
I0726 11:49:52.944289 21896 target_extractor.cc:369] #########################################
Which is not very helpful because i don't know what happened
So now each time this script will look an observation it will print this :
I0726 11:49:47.426782 21896 target_extractor.cc:255] observation number : 271/423
I0726 11:49:52.942883 21896 target_extractor.cc:274] number_inliers = 9
I0726 11:49:52.942906 21896 target_extractor.cc:275] number_keypoints = 144
I0726 11:49:52.942929 21896 target_extractor.cc:276] inlier_ratio = number_inliers / number_keypoints = 0.0625
I0726 11:49:52.942934 21896 target_extractor.cc:277] FLAGS_inlier_ratio_for_good_camera_pose = 0.4
I0726 11:49:52.942939 21896 target_extractor.cc:278] sufficient_inliers = inlier_ratio > FLAGS_inlier_ratio_for_good_camera_pose = 0
With that i can see how many point are detected on the pattern, the current number of the observation
and many others things.
And as we can see here 144 is the number of point detected on the pattern, it is good because it detect all the points on it.
But 9 is the number of the inliers point which is not good at all because you need o have at least 40% of 144 to have a good camera pose if not this observation doesn't count.
And that is the case for all my observation.
So i wanted to know if there is a way to improve the number of inlier.
Edit 1 :
I have try it with an other camera but the result is the same.
Thanks you in advance,
Bwaki
Can you send us a sample image of the detected target?
Do you have the proper target configured? (is camera_info/april.yaml correct)
Did you try to run our test bags (https://projects.asl.ethz.ch/datasets/doku.php?id=handeyecalibration2017)?
So my april.yaml look like that (download from there https://drive.google.com/file/d/0B0T1sizOvRsUdjFJem9mQXdiMTQ/edit print in A3 format)
target_type: 'aprilgrid'
april_tag_number_vertical: 6
april_tag_number_horizontal: 6
april_tag_size_m: 0.028
april_tag_gap_size_m: 0.007
april_tag_number_pixel_boarder: 2
And here is one of the detected target :
I will try to execute your test bags and I will give you my feedback as soon as possible.
Edit 1 :
I have test it with robot_arm_sim_color dataset and the results are perfect
Ok i found a solution @ffurrer,
The model from my intrinsic parameter was different from plumb bob model (i use opencv model : https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html) so i just ignore tangential distorsion and only take the radial distorsion from my previous intrinsic, copy paste it in the rigth yaml format.
Thanks you for your time and have a good week-end
Bwaki