游尚霖
游尚霖

Reputation: 33

Image correction in visual odometry

I am trying to implement visual odometry algorithm via matlab. According to step 2 in http://en.wikipedia.org/wiki/Visual_odometry. I need to do image correction before feature detection, matching and motion estimation. I think I need to undistort image like the function (here) in matlab. Can I use the original intrinsic and extrinsic parameter for motion estimation after matching the feature? I think the intrinsic parameter is for the distorted image.

I am confused that in the Camera Calibration Toolbox for Matlab. The intrinsic matrix can only turn the pixel back to distorted plane. If I do image correction first before feature detection according to step 2 in wiki. I think the original intrinsic matrix would cause some error.

Upvotes: 3

Views: 499

Answers (3)

Dima
Dima

Reputation: 39389

To use the undistortImage function you need to calibrate your camera using the Camera Calibrator App or the estimateCameraParameters function in the Computer Vision System Toolbox.

Upvotes: 0

bendervader
bendervader

Reputation: 2660

Here are the steps you need to do:

  1. Estimate the intrinsic parameters of the camera using a calibration target. You can user Matlab camera calibration toolbox, or http://www.vision.caltech.edu/bouguetj/calib_doc/
  2. Take your time performing this step and make sure the calibration is correct. Calibration toolboxes will give you statistics on how good the calibration is. Make sure the reprojection error (and standard deviation) is small. Also make sure to collect images of the calibration target that cover the filed of view of the camera with various poses
  3. The calibration you get include the 3x3 intrinsic matrix (K) of the undistorted image, as well as a vector of distortion coefficients.

    Use K and the distortion coefficients to "undistort" the images.

  4. Undistort all your images and save them to disk.
  5. From this point onward, use the undistored images (with the matrix K) to perform VO or other tasks.

Disclaimer. You can do VO without undistorting images, but depending on the degree of image distortion using the raw images might affect the feature/descriptor detector. It is also more work per iteration to map between distorted and undistorted

Good luck

Upvotes: 1

Andrzej Pronobis
Andrzej Pronobis

Reputation: 36096

First, there are several visual odometry libraries that already exist for matlab. One of those is http://www.cvlibs.net/software/libviso/

However, if you plan to implement it yourself and are looking for a way to rectify your images, you can get the intrinsic/extrinsic camera parameters using the camera calibration matlab toolbox: http://www.vision.caltech.edu/bouguetj/calib_doc/

Upvotes: 0

Related Questions