Professional Documents
Culture Documents
Lecture Outline"
2 !
3 !
2D Transformations"
The basic building blocks of transformations are: ! Scaling (isotropic, non-isotropic)! Rotation (around one rotation axis)! Translation (motion along the two axes)! Transformations are dened by their action on point coordinates.! ! Notation:!
p = (x, y) =
original point!
x y
p = (x , y ) =
transformed point!
x y
4 !
2D Transformations Scaling"
Isotropic scaling: same scaling factor in both spatial dimensions!
x y
s 0
0 s
x y
5 !
2D Transformations Scaling"
Non-isotropic scaling: different scaling factors in the two spatial dimensions!
x y
sx 0
0 sy
x y
6 !
2D Transformations Rotation"
"
x y
cos sin
sin cos
x y
7 !
2D Transformations Rotation"
p= x y = r cos() r sin()
y!
r!
x!
8 !
2D Transformations Translation"
x y
x y
tx ty
9 !
2D Transformations"
Have you noticed we have two types of representations for the basic transformations seen so far?! ! Scaling, Rotation: !Matrix-vector product" ! x sx 0 x x cos sin = = ! y 0 sy y y sin cos ! Translation: !Sum of vectors" " x x tx = + " y y ty " " How to achieve a matrix-vector product form for all types of transformations?!
Kinect Lab Course - Transformations and Cameras!
x y
10 !
11 !
x p = y R3 1
x 1 y = 0 1 0
0 1 0
x + tx tx x ty y = y + ty 1 1 1
12 !
x cos y = sin 1 0
sin cos 0
0 x 0 y 1 1
x cos y = sin 1 0
sin cos 0
13 !
p=
x y
R2
x p = y P2 1
Kinect Lab Course - Transformations and Cameras! 14 !
k(x,y,1)! p = (x,y,1)!
Point in Projective 2D space. All points on the orange line represent the same point. A homogeneous vector in 2D projective space represents an equivalence class of points.!
15 !
(x, y, 1). !
16 !
ax + by + c = 0
l = (a, b, c) .!
A point
lies on a line
x l = 0 .!
Two lines
x = l ! l
.!
and x is
l = x x.!
17 !
18 !
19 !
!
!
!
Afne transformations!
!
!
!
Similarity transformations!
!
!
Containment relation from general to specialized, e.g.: afne transformations have all properties of projective transformations, plus additional ones.!
20 !
x cos y = sin 1 0
sin cos 0
tx x ty y 1 1
R R = I det(R) = 1
Teuclidean =
R 0
t 1
Degrees of freedom: !
3 (1 rotation, 2 translation) !
x scos y = ssin 1 0
sR 0 t 1
ssin scos 0
tx x ty y 1 1
R R = I
Tsimilarity =
det(R) = 1
Degrees of freedom: !
4 (1 rotation, 2 translation, 1 isotropic scaling) !
x a11 y = a21 1 0
A 0
a12 a22 0
t 1
tx x ty y 1 1
A
non-singular!
Tanity =
Degrees of freedom: !
6 (2 translation, 4 entries of A) !
Rotation!
Non-isotropic Scaling!
A = R()R()
1 0
0 2
R()
24 !
x a11 y = a21 1 v1
A v
a12 a22 v2
t v
tx x ty y v 1
A
non-singular!
Tprojectivity =
Degrees of freedom: !
8 (9 arbitrary matrix entries, up to scale) !
Projective
"8 DOF!
! ! !
Afne " "6 DOF!
Tprojectivity =
A v A 0 sR 0
R 0
t v t 1 t 1
t 1
26 !
! ! !
Similarity "4 DOF!
Tanity =
Tsimilarity =
! ! !
Euclidean "3 DOF!
Teuclidean =
a11 a21 0
a12 a22 0
Point at innity, Mapped by afne e.g. intersection ! transformation to another of blue lines! point at innity!
27 !
a11 a21 v1
a12 a22 v2
29 !
! 3D projective space: properties analogous to 2D homogeneous representation! All types of transformations (scaling, translation, rotation, etc.) can be written as a matrix-vector product! Several transformations can be composed into one transformation matrix!
x y R4 p= z 1
30 !
Teuclidean =
Degrees of freedom: !
R 0
t 1
tx x ty y tz z 1 1
R R = I det(R) = 1
6 (3 rotation, 3 translation) !
Tsimilarity =
Degrees of freedom: !
sR 0
t 1
tx x ty y z tz 1 1
R R = I det(R) = 1
Invariants: angles!
32 !
Tanity =
Degrees of freedom: !
A 0
t 1
tx x ty y tz z 1 1
non-singular!
12 (3 translation, 9 entries of A) !
Tprojectivity =
Degrees of freedom: !
A v
t v
tx x ty y tz z v 1
A
non-singular!
Projective
"15 DOF!
! ! !
Afne " "12 DOF!
Tprojectivity =
A v A 0 sR 0
R 0
t v t 1 t 1
t 1
35 !
! ! !
Similarity "7 DOF!
Tanity =
Tsimilarity =
! ! !
Euclidean "6 DOF!
Teuclidean =
Lecture Outline"
36 !
37 !
*! 0 # , 0 ,# ,# 1 0 +# "
X Y Z 1
principal point (perpendicular intersection point of principal axis and image plane)
40 !
! fX + Zp x # # fY + Zpx # # Z "
px f py 1
*! 0 # , 0 ,# ,# 0 ,# +"
X Y Z 1
! f # K =# # # "
Kinect Lab Course - Transformations and Cameras!
41 !
3D point in camera coordinates projection to image plane from camera coordinates projection to image plane from world coordinates
x = K [ I | 0 ] X cam
! x = KR "I | !C$ X # %
! x = KR "I | !C$ X # %
x = PX
! P = KR "I | !C$ # %
projection matrix, 9 DOF
! f # K =# # # "
! R, C
extrinsic parameters, each 3 DOF
mx , my
! m # x K =# my # # " ! ! # x K =# !y # # "
1 x0 y0 1
$! f px &# f py &# &# 1 &# %" $ & & 4 DOF & & %
10 DOF
! P = KR "I | !C$ # %
44 !
skew parameter
! ! s x # K =# !y # # "
5 DOF
! P = KR "I | !C$ # %
11 DOF
45 !
Camera Calibration"
Relating the ideal camera model to the properties of an actual physical device and determining the position and orientation of the camera w.r.t. the world coordinate frame1.!
! ! s x # K =# !y # # "
! P = KR "I | !C$ # %
http://www.dis.uniroma1.it/~iocchi/stereo/calib.html!
46 !
Camera Calibration"
Checkerboard pattern captured from multiple views (the checker sizes in the real world are known)
Linear and non-linear optimization for estimating camera parameters MATLAB calibration toolbox: http://www.vision.caltech.edu/bouguetj/calib_doc!
Kinect Lab Course - Transformations and Cameras!
Images from http://www.vision.caltech.edu/bouguetj/calib_doc!
47 !
Camera Calibration"
sdfsdf!
48 !
Stereo Calibration"
Find the spatial relation between two cameras observing the same scene (stereo setup)! For each orientation of the calibration pattern, capture corresponding left and right camera images! Calibrate each camera separately, as before! Perform stereo calibration using the result of separate calibration as an input!
49 !
RGB Image!
Kinect Lab Course - Transformations and Cameras!
Depth Image!
50 !
Infrared image is used internally for computing depth image, but is accessible through the API! Checkerboard pattern is not visible in depth images, but visible in IR images!
Infrared! Projector! RGB! Infrared! Camera! Camera!
RGB Image!
Infrared Image!
Kinect Lab Course - Transformations and Cameras! 51 !
Step 1: Back-project every 2D point from depth image into 3D space! Step 2: Apply rigid transformation between two cameras to 3D points! Step 3: Project every transformed 3D point into the RGB image!
R, t
RGB"
52 !
Depth Image!
Kinect Lab Course - Transformations and Cameras!
3D Point Cloud!
53 !
x fx y = 0 0 w
0 fy 0
cx cy 1
(x cx )Z X= fx
X 0 fx X + cx Z Y = fy Y + cy Z 0 Z 0 Z W
(y cy )Z Y = fy
56 !
Assignment 3"
Extend your application such that it can read out Kinect IR images! Extend your application for saving IR and RGB images to bitmap les! Familiarize yourself with the Matlab Camera Calibration Toolbox http://www.vision.caltech.edu/bouguetj/calib_doc/!
Read the examples (especially examples 1 and 5)! Download the toolbox! Try out the examples!
" Outlook Assignment 4:" Implement a 3D point cloud visualization for kinect depth data! Add a feature to color the 3D points with the colors from the RGB camera!
57 !