Calibration / Rectification Tool / Simple shiftSum demo
---------------------------------------------------------
Requirements:
-------------
SLAM++ experimental code - https://sourceforge.net/projects/slam-plus-plus-experimental/
Graphic card supporting CUDA
CMake
Installation:
-------------
- cmake set paths:
SLAM_PLUS_PLUS_PATH - path to slam++ experimental code
EIGEN3_INCLUDE_DIR - <SLAM_PLUS_PLUS_PATH>/include/eigen33 //alternatively use /eigen34 if there are problems
Eigen_DIR - <SLAM_PLUS_PLUS_PATH>/include/eigen33 //alternatively use /eigen34 if there are problems
GPU_ENABLED - check
- Generate
- Make
TL;DR version:
---------------------------------------------------------
Calibrate:
./bin/calib_app -i my_images/ -cf my_config.txt -n2n
Rectify:
./bin/calib_app --rectify my_images/ out/ my_images_rect/ 36 -cf my_config.txt
ShiftSum demo:
./bin/calib_app --shift-sum my_images_rect/ calib_rect/ 8 -cf my_config.txt
LONG version:
---------------------------------------------------------
Calibration:
-------------
./bin/calib_app -i <path> -cf <configuration file> [-n2n]
parameres:
-i path to dir with images, number of images is assumed accoding to configuration
-cf configuration file containing system parameters, see the example file for details
-n2n optional parameter, perform N-to-N matching, not only adjacant cameras, increases accuracy
output:
the application outputs calibration results to directories "out" and "out2"
"out" directory contains calibration results for each camera in format:
fx fy // focal length x, y
cx cy // principal point
d // distortion coefficient (k0)
t0 t1 t2 // translation vector
r0 r1 r2 // rotation matrix
r3 r4 r5
r6 r7 r8
// note that the Rt matrix is in world->camera format
"out2" directory contains calibration results for each camera in format:
fc = [ fx ; fy ];
cc = [ cx ; cy ];
alpha_c = fx / fy;
kc = [ k0; 0.0 ; 0.0 ; 0.0 ; 0.0 ];
Tc_ext = [ t0 t1 t2 ];
Rc_ext = [ r0 r1 r2
r3 r4 r5
r6 r7 r8 ];
// note that the Rt matrix is in world->camera format
Rectification:
-------------
./bin/calib_app --rectify <path images> <path calibration> <output dir> ref_cam_id -cf <configuration file>
parameters:
--rectify
<path images> - path to dir with original images
<path calibration> - path to calibration in the first format ("out" directory)
<output dir> - output directory for rectified images
ref_cam_id - index of reference camera (usually middle, in 8x8 array its like 36)
-cf configuration file containing system parameters, see the example file for details
output:
This application rectifies images according to the calibration files and outputs:
rectified images -> to the directory specified by <output dir>
new calibration files in first format -> to directory "calib_rect", this are the calibration files for RECTIFIED images (e.g. rotation is identity, focal length is same for all cameras)
new calibration files in second format -> to directory "calib_rect2", this are the calibration files for RECTIFIED images (e.g. rotation is identity, focal length is same for all cameras)
Shiftsum demo:
-------------
./bin/calib_app --shift-sum <path rectified images> <path to new calibration files> aperture -cf <configuration file>
parameters:
--shift-sum
<path rectified images> - path to images rectified by --rectify
<path to new calibration files> - path to NEW calibration files ("calib_rect")
aperture -> how many adjacant images to use for shiftsum (1 - only central image, 2 - nearest neighbours ... 8 - all images)
-cf configuration file containing system parameters, see the example file for details
Application shows shiftsum image, use keys up/down to move focal plane, left/right to set step