A ToF camera calibration toolbox; tested with Intel Creative; tests for Kinect 2 in progress
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gaussian_kernel_reg initial commit Apr 30, 2015
.directory various changes Sep 7, 2015
README README editing Oct 25, 2015
calib_from_homographies.m initial commit Apr 30, 2015
calibrate_intel.m bug fixing; adding select_subset_calib May 8, 2015
calibrate_intel_cost.m added a flag for fixed intrinsic initialization Oct 24, 2015
calibrate_intel_cost_color.m updated corner detector (use matlab function); Oct 24, 2015
calibrate_intel_cost_depth.m various changes Sep 7, 2015
calibrate_intel_cost_depth_corners.m initial commit Apr 30, 2015
calibrate_intel_cost_depth_plane.m updated corner detector (use matlab function); Oct 24, 2015
calibrate_intel_cost_raw.m bug fixing; adding select_subset_calib May 8, 2015
calibrate_intel_r2s.m initial commit Apr 30, 2015
calibrate_intel_s2r.m initial commit Apr 30, 2015
calibrate_options.m added a flag for fixed intrinsic initialization Oct 24, 2015
color_depth_overlay.m updated corner detector (use matlab function); Oct 24, 2015
color_depth_overlayi.m initial commit Apr 30, 2015
compute_collineation.m initial commit Apr 30, 2015
compute_cost2im_mapping.m adding helper functions; fixing depth plane rendering May 5, 2015
compute_depth_error.m adding helper functions; fixing depth plane rendering May 5, 2015
compute_full_derror.m updated corner detector (use matlab function); Oct 24, 2015
compute_homography.m initial commit Apr 30, 2015
cornerfinder.m initial commit Apr 30, 2015
correct_depth.m initial commit Apr 30, 2015
count_squares.m initial commit Apr 30, 2015
depth2rgb.m initial commit Apr 30, 2015
depth2rgbi.m initial commit Apr 30, 2015
depth2world.m adding helper functions; fixing depth plane rendering May 5, 2015
distort.m initial commit Apr 30, 2015
do_initial_calib.m initial commit Apr 30, 2015
do_initial_calib_intel.m added a flag for fixed intrinsic initialization Oct 24, 2015
do_initial_conf_calib.m unified x count, y count, dx; depth is taken into account May 5, 2015
do_initial_relative_transform.m initial commit Apr 30, 2015
do_initial_rgb_calib.m added a flag for fixed intrinsic initialization Oct 24, 2015
do_process_depth_regions.m fixing depth image loading; cleaning depth data added. May 5, 2015
do_select_conf_corners.m updated corner detector (use matlab function); Oct 24, 2015
do_select_corners.m updated corner detector (use matlab function); Oct 24, 2015
do_select_corners_from_images.m updated corner detector (use matlab function); Oct 24, 2015
do_select_images_Intel.m bug fixing; adding select_subset_calib May 8, 2015
do_select_planes_Intel.m small fixes May 5, 2015
do_select_rgb_corners.m updated corner detector (use matlab function); Oct 24, 2015
draw_axes.m initial commit Apr 30, 2015
estimate_plane_to_plane.m initial commit Apr 30, 2015
estimate_relative.m initial commit Apr 30, 2015
extern_from_homography.m initial commit Apr 30, 2015
extract_grid.m updated corner detector (use matlab function); Oct 24, 2015
extrinsic2plane.m initial commit Apr 30, 2015
find_images_Intel.m initial commit Apr 30, 2015
fit_depth_correction.m various changes Sep 7, 2015
get4points.m adding get4points.m Apr 17, 2016
get_depth_error_Intel.m initial commit Apr 30, 2015
get_depth_error_all_Intel.m initial commit Apr 30, 2015
get_depth_samples.m fixing depth image loading; cleaning depth data added. May 5, 2015
get_dpoint_direction.m adding helper functions; fixing depth plane rendering May 5, 2015
global_vars.m various changes Sep 7, 2015
grid2world.m adding randomized samples selection for depth estimation. May 5, 2015
homography_from_corners.m initial commit Apr 30, 2015
hs_err_pid6284.log initial commit Apr 30, 2015
imshow.asv initial commit Apr 30, 2015
imshowi.m initial commit Apr 30, 2015
iterative_calib.m added a flag for fixed intrinsic initialization Oct 24, 2015
mat2rgb.m initial commit Apr 30, 2015
plot_all_images.m bug fixing; adding select_subset_calib May 8, 2015
plot_confidence.m initial commit Apr 30, 2015
plot_fit.m initial commit Apr 30, 2015
points2plane.m initial commit Apr 30, 2015
print_calib_color.m initial commit Apr 30, 2015
print_calib_conf.m initial commit Apr 30, 2015
print_calib_depth.m initial commit Apr 30, 2015
project_points_k.m initial commit Apr 30, 2015
projectedGrid.m initial commit Apr 30, 2015
read_disparity.m setting uniform convention for invalid depth values to 0 Oct 24, 2015
reduce_depth_samples.m adding randomized samples selection for depth estimation. May 5, 2015
remove_invalid.m setting uniform convention for invalid depth values to 0 Oct 24, 2015
render_expected_plane.m adding helper functions; fixing depth plane rendering May 5, 2015
reorder_corners.m initial commit Apr 30, 2015
rgb_calib.m initial commit Apr 30, 2015
rgb_calib_cost.m added a flag for fixed intrinsic initialization Oct 24, 2015
rgb_calib_p2r.m initial commit Apr 30, 2015
rgb_calib_r2p.m initial commit Apr 30, 2015
rotationmat.m initial commit Apr 30, 2015
rotationpars.m initial commit Apr 30, 2015
save_globals.m initial commit Apr 30, 2015
select_plane_polygon.m initial commit Apr 30, 2015
select_rgb_corners_im.m updated corner detector (use matlab function); Oct 24, 2015
select_subset_calib.m fixing where the coordinates for depth correction are set May 10, 2015
show_plane_conf_depth.m adding helper functions; fixing depth plane rendering May 5, 2015
tight_subplot.m initial commit Apr 30, 2015
undistort.m initial commit Apr 30, 2015
visualize_disparity.m initial commit Apr 30, 2015

README

Copyright (C) 2014 Alina Kuznetsova

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Author: Alina Kuznetsova 

=================================News===========================================

- The test data collected using Intel Creative Depth Sensor can be downloaded from
here: https://dl.dropboxusercontent.com/u/25197257/data.zip

- The corner detector is switched to the automatic MATLAB corner detector - 
now you only need to select the regions where the checkerboard is and not the 
exact corners (-> faster)

================================================================================

Please cite the following work if you use the code:

Alina Kuznetsova, Bodo Rosenhahn 
"On calibration of a low-cost time-of-flight camera"
ECCVW 2013

@InProceedings{Kuznetsova_2014_ECCV_Workshops,
author = {Alina Kuznetsova and Bodo Rosenhahn},
title = {On calibration of a low-cost time-of-flight camera},
booktitle = {The IEEE European Conference on Computer Vision (ECCV) Workshops},
month = {September},
year = {2014}
}

If you have any questions, please contact me: kuznetso@tnt.uni-hannover.de

=========================3d-party code used======================================

The following 3d-party code is used and included with the code:

1) the ToF Calibration toolbox is based on Matlab Kinect calibration toolbox (http://www.ee.oulu.fi/~dherrera/kinect/)
2) the code uses Gaussian Kernel regression by Youngmok Yun (http://youngmok.com/gaussian-kernel-regression-for-multidimensional-feature-with-matlab-code/)
3) the code uses fast distance matrix computation by Mo Chen (http://www.mathworks.de/matlabcentral/fileexchange/24599-pairwise-distance-matrix)

=========================Usage======================================

Please note, that right now the Toolbox supports only one color camera. 
This will be corrected in future releases.

Starting new calibration, firstly call:
 
global_vars(); %make all global variables visible in the workspace
dataset_path = '%ENTER YOUR PATH HERE%'; %set the path to the folder, containing RGB, conf and depth images
iterative_calib %start calibration

Then follow the instructions printed in MATLAB;
At some point, you will have to select checkerboard corners, but the corners might not be found correctly.
If it happends, break the process (Ctrl+C) and start again; the process will be started from the same point

The final calibration will be available in workspace as 

calib %object containing calibration parameters
errors %errors at each iteration

* To show color-depth overlay:
function color_depth_overlay(calib,rgbfile,depthfile) %show depth-to-rgb overlay
function color_depth_overlayi(calib,i) %show depth-to-rgb overlay of the i-th calibration image

* To transform depth to world coordinates

pn = get_dpoint_direction_Intel(p(1,:),p(2,:),calib.cK,calib.ckc); %pixel coordinates to normalized coordinates
p3D = [pn.*repmat(d,2,1); d]; %coordinates in 3D (d denotes corresponding depth value)

* To transform depth to rgb camera system

p3Drgb = calib.cR * p3D + repmat(calib.ct,1, size(p3D,2)); 

* To reproject depth points to RGB camera plane 

function prgb = depth2rgb(p,d,calib)
    
* Save all global variables

function save_globals(fn)

* Load all global variables

load(filename) %standard MATLAB function

* To run the calibration from the start, set the corresponding fields in calib0 to []