Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
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
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 <>.

Author: Alina Kuznetsova 


- The test data collected using Intel Creative Depth Sensor can be downloaded from

- 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

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:

=========================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 (
2) the code uses Gaussian Kernel regression by Youngmok Yun (
3) the code uses fast distance matrix computation by Mo Chen (


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 []


A ToF camera calibration toolbox; tested with Intel Creative; tests for Kinect 2 in progress



No releases published


No packages published