Obtain intrinsic matrix from OCamCalib?

596 views
Skip to first unread message

joaquin.gonz...@gmail.com

unread,
Apr 4, 2016, 4:17:24 AM4/4/16
to OCamCalib Toolbox
Hi everyone!

I have one question. I have to obtain the intrinsic matrix for a Camera with eyefish. Using the Caltech Calibration Toolbox, I obtain this matrix but the undistort function doesn't work with my camera.
Instead, using the OCamCalib, I obtain a good undistorted images, but I don't know how to obtain the instrinsic matrix from the calib_data.

Thanks!.

Bernd Pfrommer

unread,
Apr 4, 2016, 3:21:34 PM4/4/16
to OCamCalib Toolbox, joaquin.gonz...@gmail.com
You can think of fish-eye "undistortion" as a two-step process:

1) from the distorted image, use the rho function from the ocam calib toolbox to recover the angle at which the light rays entered the lens
2) pick a calibration matrix of your liking to do the pinhole camera perspective projection and obtain an undistorted image.

The OCamCalib toolbox does step 1) for you, but what K-matrix you pick in step 2) is up to you. You can pick focal length, resolution etc however you please.

That said, there are a couple of convenient choices:

- pick K such that all (or almost all) pixels of the perspective image fit into the undistorted image.
- pick K such that the undistorted image is cropped in a way that it has no "empty pixels".

Attached is matlab code that will help you with the undistortion. The functions have documentation, please read.You first need to run ocam_undistort_map(). This will give you a structure back that has a member ".K" containing the perspective matrix, and a precomputed index for undistortion. This map has to be precomputed only once for a given camera model. Use it then as an argument to ocam_undistort().

Good luck.
ocam_undistort.tar
Reply all
Reply to author
Forward
0 new messages