Presentation is loading. Please wait.

Presentation is loading. Please wait.

Homogeneous coordinates

Similar presentations


Presentation on theme: "Homogeneous coordinates"— Presentation transcript:

1

2 Homogeneous coordinates
In 2D: add a third coordinate, w Point [x,y]T expanded to [u,v,w]T Any two sets of points [u1,v1,w1]T and [u2,v2,w2]T represent the same point if one is multiple of the other [u,v,w]T  [x,y] with x=u/w, and y=v/w [u,v,0]T is the point at the infinite along direction (u,v)

3 Transformations translation by vector [dx,dy]T scaling (by different factors in x and y) rotation by angle q

4 Homogeneous coordinates
In 3D: add a fourth coordinate, t Point [X,Y,Z]T expanded to [x,y,z,t]T Any two sets of points [x1,y1,z1,t1]T and [x2,y2,z2,t2]T represent the same point if one is multiple of the other [x,y,z,t]T  [X,Y,Z] with X=x/t, Y=y/t, and Z=z/t [x,y,z,0]T is the point at the infinite along direction (x,y,z)

5 Transformations translation scaling rotation Obs: rotation matrix is an orthogonal matrix i.e.: R-1 = RT

6 Homogeneous coordinates
Homogeneous representation of lines equivalence class of vectors, any vector is representative Set of all equivalence classes in R3(0,0,0)T forms P2 Homogeneous representation of points on if and only if The point x lies on the line l if and only if xTl=lTx=0 Homogeneous coordinates Inhomogeneous coordinates but only 2DOF

7 Duality Duality principle:
To any theorem of 2-dimensional projective geometry there corresponds a dual theorem, which may be derived by interchanging the role of points and lines in the original theorem

8 Conics Curve described by 2nd-degree equation in the plane
or homogenized or in matrix form with 5DOF:

9 Five points define a conic
For each point the conic passes through or stacking constraints yields

10 Pole-polar relationship
The polar line l=Cx of the point x with respect to the conic C intersects the conic in two points. The two lines tangent to C at these points intersect at x

11 Polarity: cross ratio Cross ratio of 4 colinear points y = x + q x’ (with i=1,..,4) ratio of ratios i i Harmonic 4-tuple of colinear points: such that CR=-1

12 Chasles’ theorem A B C X D
Conic = locus of constant cross-ratio towards 4 ref. points A B C X D

13 Polarity: conjugacy Given a point y and a conic C, a point z is conjugated of y wrt C if the 4-tuple (y,z,x’ ,x’’ ) is harmonic, where x’ and x’’ are the intersection points between C and line (y,z). Intersection points (y+q z) C (y +q z) = 0 is a 2-nd degree equation on q y Cy + 2 q y Cz + q z Cz = 0 --> two solutions q’ and q’’. Since y and z correspond to q = 0 and q = , harmonic -> q’+ q’’ = 0 Hence the two solutions sum up to zero: y Cz = 0, and also z Cy = 0  the point z is on the line Cy, which is called the polar line of y wrt C the polar line Cy is the locus of the points conjugate of y wrt C Conic C is the locus of points belonging to their own polar line y Cy = 0 T T T 2 T T T T

14 Correlations and conjugate points
A correlation is an invertible mapping from points of P2 to lines of P2. It is represented by a 3x3 non-singular matrix A as l=Ax Conjugate points with respect to C (on each others polar) Conjugate lines with respect to C* (through each others pole)

15 Polarity and tangent lines
Consider a line through a point y, tangent to a conic C: let us determine the point z conjugate of y wrt C: since the intersection points coincide, then q’ = q’’  harmonic 4-tuple: also z coincides with the tangency point  All points y on the tangent are conjugate to tangency point z wrt C  polar line of a point z on the conic C is tangent to C through z In addition: since there are two tangents to C through a point y not on C, both tangency points are conjugate to y wrt C polar line of y wrt C (=locus of the conjugate points) = line through the two tangency points of lines through y

16 Tangent lines to conics
The line l tangent to C at point x on C is given by l=Cx l x C

17 Dual conics  l C C C l = 0  C = C = C
A line tangent to the conic C satisfies In general (C full rank): in fact -1 Line l is the polar line of y : y = C l , but since y Cy = 0  l C C C l = 0  C = C = C T T -T -1 * -T -1 Dual conics = line conics = conic envelopes

18 Degenerate conics A conic is degenerate if matrix C is not of full rank e.g. two lines (rank 2) e.g. repeated line (rank 1) Degenerate line conics: 2 points (rank 2), double point (rank1) Note that for degenerate conics

19 Projective transformations
Definition: A projectivity is an invertible mapping h from P2 to itself such that three points x1,x2,x3 lie on the same line if and only if h(x1),h(x2),h(x3) do. A mapping h:P2P2 is a projectivity if and only if there exist a non-singular 3x3 matrix H such that for any point in P2 represented by a vector x it is true that h(x)=Hx Theorem: Definition: Projective transformation or 8DOF projectivity=collineation=projective transformation=homography

20 Overview transformations
Concurrency, collinearity, order of contact (intersection, tangency, inflection, etc.), cross ratio Projective 8dof Parallellism, ratio of areas, ratio of lengths on parallel lines (e.g midpoints), linear combinations of vectors (centroids). The line at infinity l∞ Affine 6dof Ratios of lengths, angles. The circular points I,J Similarity 4dof Euclidean 3dof lengths, areas.

21 Mapping between planes
central projection may be expressed by x’=Hx (application of theorem)

22 Transformation of lines and conics
For a point transformation Transformation for lines Transformation for conics Transformation for dual conics

23 Camera: optical system
da=a -a 2 1 curvature radius r r Z 1 2 thin lens small angles:

24 Y incident light beam lens refraction index: n deviated beam Z deviation angle ? Dq = q’’-q

25 Thin lens rules a) Y=0  Dq = 0 f Dq
beams through lens center: undeviated b) f Dq = Y  independent of y parallel rays converge onto a focal plane Y f Dq

26 f r Where do all rays starting from a scene point P converge ? P Y O Z
Fresnel law Obs. For Z  ∞, r  f

27 f d if d ≠ r … image of a point = blurring circle image plane Z P O a
F(blurring circle)=a (d-r)/r r focussed image: F(blurring circle) <image resolution d depth of field: range [Z1, Z2] where image is focussed

28 Hp: Z >> a r  f the image of a point P belongs to the line (P,O) P image plane O p p = image of P = image plane ∩ line(O,P) interpretation line of p: line(O,p) = locus of the scene points projecting onto image point p

29 P Y X c f O Z x y p perspective projection nonlinear not shape-preserving not length-ratio preserving

30 Pinhole camera model

31 Scene->Image mapping: perspective transformation
with With “ad hoc” reference frames, for both image and scene

32 Let us recall them Y X c f O Z x y scene reference centered on lens center Z-axis orthogonal to image plane X- and Y-axes opposite to image x- and y-axes image reference - centered on principal point - x- and y-axes parallel to the sensor rows and columns - Euclidean reference

33 Actual references are generic
x y principal axis c f O principal point Y X image reference - centered on upper left corner - nonsquare pixels (aspect ratio)  noneuclidean reference Z scene reference not attached to the camera

34 Principal point offset

35 CCD camera

36 Scene-image relationship wrt actual reference frames
normally, s=0 scene

37 K upper triangular: intrinsic camera parameters
scene-camera tranformation orthogonal (3D rotation) matrix extrinsic camera parameters K upper triangular: intrinsic camera parameters P: degrees of freedom (10 if s=0)

38 with and i.e., defining x = [x, y, z]T

39 Interpretation of o: u is image of x if i.e., if The locus of the points x whose image is u is a straight line through o having direction is independent of u o is the camera viewpoint (perspective projection center) line(o, d) = Interpretation line of image point u

40 Intrinsic and extrinsic parameters from P
M  K and R RQ-decomposition of a matrix: as the product between an orthogonal matrix and an upper triangular matrix M and m  t

41 The circular points The circular points I, J are fixed points under the projective transformation H iff H is a similarity

42 The circular points “circular points” l∞
Intersection points between any circle and l∞ Algebraically, encodes orthogonal directions

43 Conic dual to the circular points
: line conic = set of lines through any of the circular points The dual conic is fixed conic under the projective transformation H iff H is a similarity Note: has 4DOF l∞ is the null vector

44 Angles Euclidean: Projective: (orthogonal)

45 The image of the absolute conic
The calibration matrix K is related to the image of the absolute conic w The image of pts on p¥ can be easily derived The mapping btw p¥ and an image is given by the planar homography x=Hd, with H=KR Note: this map does not depend on the position of the camera C but only on orientation and intrinsics!

46 The image of the absolute conic
Since the absolute conic W¥ is on p¥, we can compute its image through the homography H=KR The image of the absolute conic (IAC) is the conic w=(KKT)-1

47 Properties of the IAC The IAC depends only on the intrinsic camera parameters The angle between two rays is The dual of the IAC (DIAC) is a line conic with matrix and is the image of the dual absolute quadric

48 Properties of the IAC Once w is identified in an image, then K is also identified A symmetric matrix w*=KKT can be uniquely decomposed into a product of a upper triangular matrix and its transposed (Cholesky factorization) A plane p intersects p¥ in a line, which in turn intersects W¥ in two pts which are the circular pts of p The imaged circular pts lie on w at the pts of intersection btw the vanishing line of p and w These two properties can be used for calibration purposes

49 A simple calibration device
compute Hi for each square (corners  (0,0),(1,0),(0,1),(1,1)) compute the imaged circular points Hi [1,±i,0]T fit a conic w to 6 imaged circular points compute K from w=K-T K-1 through Cholesky factorization (= Zhang’s calibration method)

50 A calibration method The image of three squares (on non-parallel planes) provides enough constraints to compute K The correspondence between the 4 corners of each square and their image allows us to compute the homography H between the plane of the square and the image plane The same homography can be used to determine the image of the circular pts on p as H(1, ±i,0)T Repeating that for each one of the three squares we obtain three distinct pairs of images of circular pts, which are enough to characterize the IAC w (5 pts are enough to determine a conic) K can be computed from w=KKT through Cholesky factorization

51 A calibration method Compute the homography H between the plane of the square and the image plane Detemine the image of the circular pts as H(1, ±i,0)T Z=0 Y X H Z

52 A calibration method The image of circular points lies on the image of the absolute conic: Requiring that both real and imaginary parts be zero yields: Two constraints for every image of the model plane Three images are required

53 The image of the absolute conic
mapping between p∞ to an image is given by the planar homogaphy x=Hd, with H=KR absolute conic (IAC), represented by I3 within p∞ (w=0) its image (IAC) IAC depends only on intrinsics angle between two rays DIAC=w*=KKT w  K (Cholesky factorization) image of circular points belong to w (image of absolute conic)

54 What can be told from a single image?

55 Action of projective camera on planes
The most general transformation that can occur between a scene plane and an image plane under perspective imaging is a plane projective transformation

56 Interpretation plane of line l
Action of projective camera on lines forward projection back-projection with Interpretation plane of line l

57 Image of a conic therefore

58 C Action of projective camera on conics
back-projection of a conic C to cone C

59 Interpretation cone of a conic C
back-projection of a conic C to cone with Interpretation cone of a conic C example:

60 Images of smooth surfaces
The contour generator G is the set of points X on S at which rays are tangent to the surface. The corresponding apparent contour g is the set of points x which are the image of X, i.e. g is the image of G The contour generator G depends only on position of projection center, g depends also on rest of P

61 the set of planes tangent to Q
Action of projective camera on quadrics apparent contour of a quadric Q dual quadric is a plane quadric: the set of planes tangent to Q Let us consider only those planes that are backprojection of image lines with its dual is

62 P=QO back-projection to cone
The plane containing the apparent contour G of a quadric Q from a camera center O follows from pole-polar relationship P=QO The cone with vertex V and tangent to the quadric Q is back-projection to cone

63 What does calibration give?
An image line l defines a plane through the camera center with normal n=KTl measured in the camera’s Euclidean frame. In fact the backprojection of l is PTl  n=KTl


Download ppt "Homogeneous coordinates"

Similar presentations


Ads by Google