410 likes | 578 Views
Formation et Analyse d’Images. Daniela Hall 30 Septembre 2004. Course material. course slides (.pdf) http://www-prima.inrialpes.fr/perso/Hall/Courses/FAI04/ last years documents http://www-prima.inrialpes.fr/Prima/Homepages/jlc/Courses/2003/ENSI3/FAI/ENSI3.FAI.html Tensor notation
E N D
Formation et Analyse d’Images Daniela Hall 30 Septembre 2004
Course material • course slides (.pdf) • http://www-prima.inrialpes.fr/perso/Hall/Courses/FAI04/ • last years documents • http://www-prima.inrialpes.fr/Prima/Homepages/jlc/Courses/2003/ENSI3/FAI/ENSI3.FAI.html • Tensor notation • book: R. Hartley, A.Zisserman: Multiple view geometry in computer vision, Appendix 1, Cambridge University Press, 2000
Course Overview • Session 1: • Homogenous coordinates and tensor notation • Image transformations • Camera models • Session 2: • Camera models • Reflection models • Color spaces • Session 3: • Review color spaces • Pixel based image analysis • Gaussian filter operators • Session 4: • Scale Space
Course overview • Session 5: • Contrast description • Hough transform • Session 6: • Kalman filter • Tracking of regions, pixels, and lines • Session 7: • Stereo vision • Epipolar geometry • Session 8: exam
Session Overview • Homogeneous coordinates • Tensor notation • Image transformations • Camera models
Motivation How can we transform images? Apply transformation to all pixels First do translation, then rotation, then scaling
Motivation • Transformation in 2D • Transformation using homogenous coordinates
Session Overview • Homogeneous coordinates • Tensor notation • Image transformations • Camera models
Homogenous coordinates • Allow to manipulate n-dim vectors in a n+1-dim space • A point p can be written as vector • In homogenous coordinates we add a scaling factor • To transform the homogenous coordinates in normal coordinate, divide by the n+1 coordinate.
Homogenous coordinates • we note • Proof:
Classic Homogenous coordinates Translation
Classic Homogenous coordinates Rotation (clockwise) x p pl y
Classic Homogenous coordinates Translation and rotation
Classic Homogenous coordinates Translation, rotation and scaling
Session Overview • Homogeneous coordinates • Tensor notation • Image transformations • Camera models
Tensor notation • In tensor notation a superscript stands for a column vector • a subscript for a row vector (useful to specify lines) • A matrix is written as
Tensor notation • Tensor summation convention: • an index repeated as sub and superscript in a product represents summation over the range of the index. • Example:
Tensor notation • Scalar product can be written as • where the subscript has the same index as the superscript. This implicitly computes the sum. • This is commutative • Multiplication of a matrix and a vector • This means a change of P from the coordinate system i to the coordinate system j (transformation).
Line equation • In R a line is defined by the equation • In homogenous coordinates we can write this as • In tensor notation we can write this as
The tensor operator Eijk and Eijk • The tensor Eijk is defined for i,j,k=1,...,3 as odd even 1 2 3 2 3 1 3 1 2 3 2 1 1 3 2 2 1 3
Example • Line equation in tensor notation
Example • Intersection of two lines • L: l1x+l2y+l3=0, M: m1x+m2y+m3=0 • Intersection: • Tensor: • Result:
Classic Tensor notation T is a transformation from the system A to B Homogenous coordinates Translation
Homogenous coordinates Rotation • Classic • Tensor notation
Session Overview • Homogeneous coordinates • Tensor notation • Image transformations • Camera models
Tsd Destination image Source image Image transformation For each position Pd in the destination image we search the pixel color I(Pd).
Tsd Destination image Source image Image transformation First we compute a position Ps in the source image.
Pd Ps1 Ps0 Ps Ps3 Ps2 Image transformation • P is not integer. • How do we compute I(Pd)=I(Ps)? • Answer: by a linear combination of the neighboring pixels I(Psi) (interpolation). Tsd
Interpolation methods • 0th order: take value of closest neighbor • fast, applied for binary images • 1st order: linear interpolation and bi-linear interpolation • 3rd order: cubic spline interpolation
intensity I(P) Ps0 Ps1 Ps Ps3 Ps2 Ps0 Ps1 Ps position P 1D linear interpolation Gradient Pixel color
2D linear interpolation intensity I(P) y Ps0 Ps1 I(Ps) Psy Ps Ps Ps3 Ps2 Ps1 x Psx Ps0 Gradient Pixel color
Bi-linear interpolation intensity I(P) y Ps0 Ps1 I(Ps) Ps3 Psy Ps Ps Ps3 Ps2 Ps1 x Psx Ps0 The bilinear approach computes the weighted average of the four neighboring pixels. Bilinear formula:
Higher order interpolation • Cubic spline interpolation takes into account more than only the closest pixels. • Result: more expensive to compute, but image has less artefacts, image is smoother.
Session Overview • Homogeneous coordinates • Tensor notation • Image transformations • Camera model
Camera model • Physical geometry
Camera model • Projective model Scene coordinates Camera coordinates Image coordinates
Change of coordinate systems • Transformation from scene to camera coordinates • Projection of camera coordinates to retina coordinates • Transformation from retina coordinates to image coordinates • Composition
Transformation Scene - Camera • (xs,ys,zs) is position of the origin of the camera system with respect to the scene coordinates (translation). • R is the orientation of the camera system with respect to the scene system (3d rotation).
3d rotation • Around x-axis (counter-clockwise) • Around y-axis • Around z-axis • General