Small project that implements different camera models with different distortions and which allows to apply the distortions to images.
This camera model implements the radial and tangential distortion as proposed in the Matlab camera calibration tool box by Bouguet. The pinhole camera models in OpenCV and in Matlab follow a similar model.
Explanations about radial and tangential distortion can be found in [1].
This camera model implements the angular distortion as it is used in the fisheye models available in the Matlab camera calibration tool box by Bouguet and in OpenCV.
A equidistant projection model and a fisheye distortion similar to the one proposed in [2] is applied. The equidistant projection is given by equation (3) in [2] and the fisheye distortion follows equation (6) in the same work with k1=1 (k1 already captured by focal distance f).
This camera model is the same as implemented in the omnidirectional camera model in OpenCV. It was introduced in [3].
Both build systems, meson and cmake are supported.
- Move to project root directory
- Run meson to initialize build directory:
meson build
- Build library and tools with ninja:
ninja -C build
- Move to project root directory
- Create build directory and enter it:
mkdir build && cd build
- Run cmake:
cmake .. && cd ../
- Build library and tools with make:
make -C build
In project root directory run: ./build/distort GridForDistortionEffectsScale1_5.png
Currently the distortion parameters for the different models need to be changed by hand in the source file src/mainDistortImage.cpp
. There are parameters available for all three models.
[1] Janne Heikkila and Olli Silven. A four-step camera calibration procedure with implicit image correction. In Proceedings of IEEE computer society conference on computer vision and pattern recognition, pages 1106–1112, 1997.
[2] Juho Kannala and Sami S Brandt. A generic camera model and calibration method for conventional, wide-angle, and fish-eye lenses. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(8):1335–1340, 2006.
[3] Christopher Mei and Patrick Rives. Single View Point Omnidirectional Camera Calibration from Planar Grids. In Proceedings 2007 IEEE International Conference on Robotics and Automation, pages 3945–3950, 2007.