Ask Your Question
0

Reuse camera calibration parameters?

asked 2016-04-10 13:44:40 -0500

Sood gravatar image

I am using a stereo camera set up which I need to recalibrate every time I want to use it. Is there anyway to save the best camera calibraiton parameters I got and just reuse them?

It would probably only work under the assumption that the camera's do not change in orientation with respect to each other, which is fairly trivial to do.

edit retag flag offensive close merge delete

Comments

Most of the ROS camera drivers already have functionality for storing the camera calibration on disk or on the camera, and reloading it at startup. Which camera driver are you using?

ahendrix gravatar image ahendrix  ( 2016-04-10 15:59:59 -0500 )edit

The usb_cam driver.

Sood gravatar image Sood  ( 2016-04-10 22:55:10 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-04-11 15:07:08 -0500

The next time you calibrate the cameras save the calibration parameters in a .yaml file. Next time you launch the usb_cam node, enter the file path in the camera_info_url parameter. It is easier if you use a launch file so you don't have to remember to do it every time.

edit flag offensive delete link more
0

answered 2016-04-20 08:58:44 -0500

Sood gravatar image

Thought I'd answer my own question because I figured a way to do it.

Once you have calibrated your camera and clicked the save and commit button you will find a file

/tmp/calibrationdata.tar.gz

Copy it to some location and then extract it as

tar -xzf calibrationdata.tar.gz

You will get a left.yaml and right.yaml file. If not use this to get the files.

Once that's done you will need a launch file that looks something like this

<group ns="stereo">

  <node pkg="uvc_camera" type="uvc_stereo_node" name="uvc_camera_stereo">

    <param name="width" type="int" value="640" />
    <param name="height" type="int" value="480" />
    <param name="fps" type="int" value="30" />
    <param name="frame" type="string" value="wide_stereo" />

    <param name="auto_focus" type="bool" value="False" />
    <param name="focus_absolute" type="int" value="0" />
    <!-- other supported params: auto_exposure, exposure_absolute, brightness, power_line_frequency -->

    <param name="left/device" type="string" value="/dev/video1" />
    <param name="right/device" type="string" value="/dev/video2" />
    <param name="left/camera_info_url" type="string" value="file://$(find ksas)/cameracalibration/left.yaml" />
    <param name="right/camera_info_url" type="string" value="file://$(find ksas)/cameracalibration/right.yaml" />
  </node>
</group>

Note:

ksas

is the name of the package I have written.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-10 13:44:40 -0500

Seen: 509 times

Last updated: Apr 20 '16