ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Stereo Calibration from images file

asked 2018-08-08 00:26:59 -0500

Astronaut gravatar image

updated 2018-08-08 01:06:09 -0500

Hi

I have a set of images of a checkerboard pattern from a camera whose calibration info I would like to find out. I have a ROS driver for my Point Grey Chameleon3 Camerars and can publish rostopic list like

/camera/left/camera_info
/camera/left/image_raw
/camera/left/image_raw/compressed
/camera/left/image_raw/compressed/parameter_descriptions
/camera/left/image_raw/compressed/parameter_updates
/camera/left/image_raw/compressedDepth
/camera/left/image_raw/compressedDepth/parameter_descriptions
/camera/left/image_raw/compressedDepth/parameter_updates
/camera/left/image_raw/theora
/camera/left/image_raw/theora/parameter_descriptions
/camera/left/image_raw/theora/parameter_updates
/camera/parameter_descriptions
/camera/parameter_updates
/camera/right/camera_info
/camera/right/image_raw
/camera/right/image_raw/compressed
/camera/right/image_raw/compressed/parameter_descriptions
/camera/right/image_raw/compressed/parameter_updates
/camera/right/image_raw/compressedDepth
/camera/right/image_raw/compressedDepth/parameter_descriptions
/camera/right/image_raw/compressedDepth/parameter_updates
/camera/right/image_raw/theora
/camera/right/image_raw/theora/parameter_descriptions
/camera/right/image_raw/theora/parameter_updates
/diagnostics

Unfortunately I can not find instructions on how to feed images to the Camera calibration tool instead of the camera itself. Is there any way to do this using the ROS package? So far my understanding is, firstly to rectify the images coming from my camera. So I need to rectify the images that I saved and wonna use later for the Calibration. Is that right? I find this launch file that need to modify

<launch>
<arg name="video_device" default="/dev/video0" />
<arg name="image_width" default="640" />
<arg name="image_height" default="480" />
<arg name="image_topic_name" default="/usb_cam/image_raw" />
<arg name="camera_info_topic_name" default="/usb_cam/camera_info" />
<node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
<param name="video_device" value="$(arg video_device)" />
<param name="image_width" value="$(arg image_width)" />
<param name="image_height" value="$(arg image_height)"/>
<param name="pixel_format" value="mjpeg" />
<param name="io_method" value="mmap"/>
<!-- update these line accroding to your setting, here are some examples:--> 
<!-- <param name="camera_info_url" value="package://your_cameras/info/camera.yaml"/> -->
<!-- <param name="camera_info_url" value="file:///home/behnam/.ros/camera_info/head_camera.yaml"/> -->
<param name="camera_info_url" value="file://${ROS_HOME}/camera_info/head_camera.yaml"/> 
<remap from="/usb_cam/camera_info" to="$(arg camera_info_topic_name)"/>
<remap from="/usb_cam/image_raw" to="$(arg image_topic_name)"/>
</node>
</launch>

Then run this image proc.launch file

    <arg name="name_space" default="usb_cam" />
<!-- this line is for: ROS_NAMESPACE=usb_cam rosrun image_proc image_proc -->
<node name="image_proc" pkg="image_proc" type="image_proc" ns="$(arg name_space)"/>
<!-- this line is for: rosrun image_view image_view image:=usb_cam/image_rect_color -->
<node name="image_rect_color" pkg="image_view" type="image_view" >
<remap from="image" to="$(arg name_space)/image_rect_color" />
</node>
<node name="image_raw" pkg="image_view" type="image_view" >
<remap from="image" to="$(arg name_space)/image_raw" />
</node>
</launch>

Is that correcet sequence and if the case what after that?Alternatively, are there any other tools I could use? Any help? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-08 01:45:53 -0500

Femer gravatar image

Hi,

if I got your question correctly then I can tell you what I usually do for calibrating a camera:

  1. You can use kalibr to obtain a yaml file containing the calibration of your camera. See its readme page and the wiki. It's better if you use an aprilgrid if you have one, instead of the check-board.
  2. You can use the yaml file obtained from kalibr with one node of the repo image_undistort. For example, in case of just one camera you can use image_undistort_node to rectify images and publish the camera_info topic. Have a look at the readme file. Moreover in the 'launch' folder you can fine some examples.

I hope this helps.

Regards,

Marco.

edit flag offensive delete link more

Comments

I would like to use saved camera images instead to feed directly the calibration tool with real time camera. Also i have another big issue that I need to calibrate camera by long distances, means 30-40 m. Is that possible and in which way?

Astronaut gravatar image Astronaut  ( 2018-08-08 03:33:17 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-08-08 00:26:59 -0500

Seen: 607 times

Last updated: Aug 08 '18