image_pipeline icon indicating copy to clipboard operation
image_pipeline copied to clipboard

fisheye calibration file of the image_pipleline calibration node doesn't use correct model for rectification.

Open bjajoh opened this issue 2 years ago • 9 comments

Hi,

I used the integrated camera calibration tool with the fisheye model. The camera is been calibrated nicely and the calibration tool shows a good rectified image. However when the exported ost.yaml is loaded in the "camera_info_url" and processed with image_proc, the rectification is not working correctly. I assume the distrortion model is wrong, however I'm not sure how to solve it or if it is an actual bug. I'm using Melodic. Here my ost.yaml calibration file:

image_width: 1640 image_height: 1232 camera_name: csi_cam_0 camera_matrix: rows: 3 cols: 3 data: [ 403.97646, -0.96635, 871.2187 , 0. , 404.70652, 597.37327, 0. , 0. , 1. ] camera_model: fisheye distortion_coefficients: rows: 1 cols: 4 data: [0.175653, -0.031772, 0.000362, -0.000719] rectification_matrix: rows: 3 cols: 3 data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.] projection_matrix: rows: 3 cols: 4 data: [ 403.97646, -0.96635, 871.2187 , 0. , 0. , 404.70652, 597.37327, 0. , 0. , 0. , 1. , 0. ]

bjajoh avatar Jul 16 '21 18:07 bjajoh

Any update on the issue? I'm in the same boat.

frequiem11 avatar Aug 15 '21 22:08 frequiem11

Here is my working config:

image_width: 1640 image_height: 1232 camera_name: csi_cam_0 camera_matrix: rows: 3 cols: 3 data: [ 403.97646, -0.96635, 871.2187 , 0. , 404.70652, 597.37327, 0. , 0. , 1. ] #camera_model: fisheye distortion_model: equidistant distortion_coefficients: rows: 1 cols: 4 data: [0.175653, -0.031772, 0.000362, -0.000719] rectification_matrix: rows: 3 cols: 3 data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.] projection_matrix: rows: 3 cols: 4 data: [ 403.97646, -0.96635, 871.2187 , 0. , 0. , 404.70652, 597.37327, 0. , 0. , 0. , 1. , 0. ]

You need to replace #camera_model: fisheye with distortion_model: equidistant. This is definitely a bug/incompatibility!

bjajoh avatar Aug 16 '21 09:08 bjajoh

@bjajoh Would you mind submitting a pull request to fix the issue?

JWhitleyWork avatar Aug 16 '21 19:08 JWhitleyWork

@JWhitleyWork Yes, I'll do it soon :)

bjajoh avatar Aug 17 '21 08:08 bjajoh

@bjajoh How did you run the node for fisheye calibration? I'm getting only zeros for the distortion coefficients :(

chinitaberrio avatar Oct 13 '21 00:10 chinitaberrio

Hi @bjajoh , what do you mean with rectification is not working correctly? I came to this issue, because the image rectification using image_proc does not work under Melodic for me at all. If one looks into image_geometry, neither fisheye nor equidistant models are processed. Only neotic is able to handle the rectification of equidistant. Under melodic it gives me:

$ ROS_NAMESPACE=camera rosrun image_proc image_proc
terminate called after throwing an instance of 'image_geometry::Exception'
  what():  Cannot call rectifyImage when distortion is unknown.
Aborted (core dumped)

tik0 avatar Nov 24 '21 20:11 tik0

i also had similar issues in ros melodic

arjunskumar avatar Mar 11 '22 07:03 arjunskumar

Similar issues on ros melodic too I will try it in a VM with ros noetic

IamPhytan avatar Mar 30 '22 18:03 IamPhytan

I got it working using ros noetic. Eg. for a t265 with a camera_info topic: ROS_NAMESPACE=camera/fisheye1/ rosrun image_proc image_proc

Runepx4 avatar May 05 '22 08:05 Runepx4

It would appear that this was an issue with melodic due to an older image_geometry package - melodic is now EOL, and it looks like this is working in both Noetic and ROS2

mikeferguson avatar Feb 01 '24 21:02 mikeferguson