Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing calibration and camera_model yaml param not read #100

Closed
ghost opened this issue Apr 23, 2021 · 3 comments
Closed

missing calibration and camera_model yaml param not read #100

ghost opened this issue Apr 23, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 23, 2021

Hi,

I've used this node to publish RTSP to a ROS topic in order to calibrate the camera using ROS camera_calibrate node. Calibration generated the following yaml output below. However, upon loading this calibration file a warning is logged that it couldn't find the distortion_model parameter in the yaml, however that should be listed as camera_model, at least in ROS melodic.

Also, when camera_calibration writes the yaml output, this node has told it the incorrect height of 360. I filed a separate issue for this, but I've verified it still persists even if I launch this node with a dummy yaml config file (all distortion set to 1) with height config'd as 480 (the resulting calibration file still outputs 360)

image_width: 640
image_height: 480  # this value incorrectly set to 360
camera_name: rugged_hd_ip
camera_matrix:
  rows: 3
  cols: 3
  data: [ 543.2134 ,    0.     ,  321.01119,
            0.     ,  543.06716,  190.99665,
            0.     ,    0.     ,    1.     ]
camera_model: plumb_bob # this node expects "distortion_model"
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.480672, 0.184891, -0.001901, 0.002792, 0.000000]
rectification_matrix:
  rows: 3
  cols: 3
  data: [ 1.,  0.,  0.,
          0.,  1.,  0.,
          0.,  0.,  1.]
projection_matrix:
  rows: 3
  cols: 4
  data: [ 429.48141,    0.     ,  325.60516,    0.     ,
            0.     ,  512.12939,  191.97364,    0.     ,
            0.     ,    0.     ,    1.     ,    0.     ]

Without calibration:
without_cal

With calibration (if I change camera_model to distortion_model):

roslaunch video_stream_opencv camera.launch video_stream_provider:=rtsp://192.168.1.1:554/h264 camera_info_url:='file:////root/git/adas/rugged_hd_ip_cal.yaml' width:=640 height:=480 camera_name:=rugged_hd_ip

with_cal

@awesomebytes
Copy link
Member

awesomebytes commented Apr 24, 2021 via email

@ghost
Copy link
Author

ghost commented Apr 24, 2021

@awesomebytes I am using image_proc to rectify. But I needed to still correct the following yaml config:

image_width: 640
image_height: 480
distortion_model: plumb_bob

I think it's a bug expecting "distortion_model" in ros melodic? Also the image height was set wrong (360)

@awesomebytes
Copy link
Member

@zoombinis not sure what version of camera_calibration you are using, the latest seem to correctly write distortion_model: https://github.com/ros-perception/image_pipeline/blob/noetic/camera_calibration/src/camera_calibration/calibrator.py#L652

Seems it was fixed in August 2020: ros-perception/image_pipeline#580

Oh wait! I saw that the last release was Previous that merge: https://github.com/ros-perception/image_pipeline/releases/tag/melodic-1.15.0

You could use the latest version from source and you'll have that bug fixed. This is not an issue from this repo, though. I'll close this issue (I answered in your other issues too as far as I could).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant