You are here: Start » Tutorial Exercises » Removing Camera Lens Distortion: Chessboard (distortions)
Removing Camera Lens Distortion: Chessboard (distortions)
Aim
Prepare an FabImage program, which will remove a lens distortion from the provided images.
The program should process all the images in an endless loop and display the results. The image size after correction should be chosen optimally.
Input
A set of images before calibration.
Images are stored in
distortion
directory.
Output
An application that shows images after calibration.
Hints
Calibration of a camera is based on images which contain a calibration chessboard.
Calibration of the camera can be done in two ways:
- Using the Calibration Editor in UndistortImage,
- Using DetectChessboardGrid, CalibrateCamera and CreateUndistortionMap filters.
Both ways results in this same calibration results but the second one is only for advanced users.
Solution (FIS)
-
Add filter EnumerateImages to project,
-
Add filter UndistortImage and open the calibration editor,
-
Using the Add images... add images from directory distortion,
-
Choose only these images which covers entire image.
-
Generate SpatialMap and close editor.
-
Run the resulting program, showing the original and remapped images next to each other.