Skip to content

c++ implementation of the polynomial omnidirectional camera model

Notifications You must be signed in to change notification settings

JianCui1992/omni_cam

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omni_cam

C++ implementation of the polynomial omnidirectional camera model by Davide Scaramuzza. The implementation works with the output of the OCamCalib toolbox.

In this code, the projection and backprojection functions are implemented. The Jacobian for the projection (i.e., image coordinates w.r.t. 3D point) is implemented as well.

Note that the visibility check in this implementation only checks the boundary of the image. Since images from fisheye and catadioptric cameras usually occupy only part of the image rectangle (e.g., a circle in the center), you probably want to add a mask when using this implementation in your project.

How to Install

We provide the implementation as a ROS package. The dependencies are:

Clone the packages into your workspace, then clone this repository and compile.

The second and the third are just catkin wrappers for eigen and glog. If you do not use catkin, it should be easy to adapt the code to work with the plain packages.

Polynomial Camera Model

The camera model uses polynomials to calculate the projection and backprojection functions. It is able to deal with fisheye cameras and catadioptric cameras within one framework.

In this implementation, we use 5 parameters for the backprojection and 12 parameters for the projection. For more details, please refer to the page of the Matlab toolbox.

Coordinate System Definition

We use the column major convention for the image coordinate system: x coordinate is the column index and y coordinate the row index. The x y axes of the camera coordinate system are aligned with the image coordinate system , and the z axis is defined so that it is a right hand system.

Note that the Matlab toolbox uses a row-major convention, which is different from this implementation.

How to use the OCam class

We provide a simple function to load parameter:

ocam_ = omni_cam::OCam::loadOCam(ocam_param);

You will need a calibration file ocam_param to create the camera model. You can find the usage of the class in more details from the unit tests.

Convert Matlab toolbox output to Calibration File

Use the script scripts/matlab_to_cpp.py

./matlab_to_cpp.py input_file output_file

About

c++ implementation of the polynomial omnidirectional camera model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 82.7%
  • Python 12.8%
  • CMake 4.5%