Lecture-3.ppt - Lecture-3 Computing Optical Flow Hamburg...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture-3 Computing Optical Flow Hamburg Taxi seq 1 2 Horn&Schunck Optical Flow f ( x, y, t ) Image Sequence df ( x, y, t ) ∂f dx ∂f dy ∂f = + + =0 dt ∂x dt ∂y dt ∂t † f x u + f y v + f t = 0 brightness constancy eq 3 Horn&Schunck Optical Flow f ( x, y, t ) = f ( x + dx, y + dy, t + dt ) Taylor Series f ( x, y, t ) = f ( x, y, t ) + ∂f ∂f ∂f dx + dy + dt ∂x ∂y ∂t f x dx + f y dy + f t dt = 0 f x u + f y v + f t = 0 brightness constancy eq Interpretation of optical flow eq f xu + f y v + f t = 0 d=normal flow p=parallel flow f f v=- x u- t fy fy d= ft f x2 + f y2 Equation of st.line 4 Horn&Schunck (contd) Ú Ú {( f u + f v + f ) x y 2 t + l (u x2 + u y2 + v x2 + v y2 )}dxdy variational calculus min P D P v = v av - f y D u = uav - f x 2 ( f x u + f y v + f t ) f x + l ( D u) = 0 ( f x u + f y v + f t ) f y + l (( D2 v) = 0 discrete version P = f x uav + f y v av + f t ( f x u + f y v + f t ) f x + l (u - uav ) = 0 ( f x u + f y v + f t ) f y + l ((v - vav ) = 0 D = l + f x2 + f y2 D2u = u xx + u yy Algorithm-1 • k=0 uK vK • Initialize • Repeat until some error measure is satisfied (converges) P D P - fy D k u K = uav-1 - f x K v = v av-1 P = f x uav + f y vav + f t D = l + f x2 + f y2 5 Derivatives • Derivative: Rate of change of some quantity – Speed is a rate of change of a distance – Acceleration is a rate of change of speed Derivative df f ( x) - f ( x - Dx) = lim Dx Æ0 = f ¢( x) = f x dx Dx ds v= speed dt dv a= acceleration dt 6 Examples y = x2 + x4 dy = 2 x + 4 x3 dx y = sin x + e - x dy = cos x + (-1)e - x dx Second Derivative df x = f ¢¢( x) = f xx dx y = x2 + x4 dy = 2 x + 4 x3 dx d2y = 2 + 12 x 2 2 dx 7 Discrete Derivative df f ( x) - f ( x - Dx) = lim Dx Æ0 = f ¢( x) dx Dx df f ( x) - f ( x - 1) = = f ¢( x) dx 1 df = f ( x) - f ( x - 1) = f ¢( x) dx (Finite Difference) Discrete Derivative df = f ( x) - f ( x - 1) = f ¢( x) dx df = f ( x) - f ( x + 1) = f ¢( x) dx df = f ( x + 1) - f ( x - 1) = f ¢( x) dx Left difference Right difference Center difference 8 Example F(x)=10 F’(x)=0 Left difference F’’(x)=0 10 0 0 -1 1 1 -1 -1 0 1 10 0 0 10 0 0 20 10 10 20 0 -10 20 0 0 left difference right difference center difference Derivatives in Two Dimensions f ( x, y ) ∂f f ( x, y ) - f ( x - Dx, y ) = f x = lim Dx Æ0 (partial ∂x Dx Derivatives) ∂f f ( x, y ) - f ( x, y - Dy ) = f y = lim Dy Æ0 ∂y Dy ( f x , f y ) Gradient Vector magnitude = ( f x2 + f y2 ) direction = q = tan -1 2 fy fx D f = f xx + f yy = Laplacian 9 Derivatives of an Image Derivative & average È10 Í10 Í I ( x, y ) = Í10 Í Í10 Í10 Î -1 0 1 -1 0 1 -1 0 1 fx 10 10 10 10 10 20 20 20 20 20 20 20 20 20 20 -1 -1 -1 000 111 fy Prewit È0 0 0 20˘ Í0 30 30 Í 20˙ ˙ I = Í0 30 30 20˙ x Í ˙ Í0 30 30 20˙ Í0 0 0 Î 20˙ ˚ 0 0 0 0 0 0˘ 0˙ ˙ 0˙ ˙ 0˙ 0˙ ˚ Derivatives of an Image È10 Í Í10 I( x, y ) = Í10 Í Í10 Í10 Î 20˘ ˙ 20˙ 20˙ ˙ 20˙ 10 20 20 20˙ ˚ 10 10 10 10 20 20 20 20 20 20 20 20 È0 Í0 Í I y = Í0 Í Í0 Í0 Î 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0˘ 0˙ ˙ 0˙ ˙ 0˙ 0˙ ˚ † 10 Laplacian 0 - 1 4 0 - 1 4 1 1 - 1 4 1 0 4 f xx + f yy - † Convolution 11 Convolution (contd) 1 1 h( x, y ) = Â Â f ( x + i, y + j ) g (i, j ) i = -1 j = -1 h ( x, y ) = f ( x, y ) * g ( x, y ) h( x, y ) = f ( x - 1, y - 1)g(-1, -1) + f ( x, y - 1) g(0, -1) + f ( x + 1, y - 1) g(1, -1) + f ( x - 1, y )g(-1, 0) + f ( x, y )g(0, 0) + f ( x + 1, y ) g(1, 0) + f ( x - 1, y + 1)g(-1,1) + f ( x, y + 1)g(0,1) + f ( x + 1, y + 1) g(1,1) † Derivative Masks È- 1 Í- 1 Î È- 1 Í- 1 Î fx 1˘ first image 1˙ ˚ 1˘ second image 1˙ ˚ È- 1 - 1˘ Í 1 1 ˙ first image Î ˚ È- 1 - 1˘ Í 1 1 ˙second image Î ˚ fy È- 1 - 1˘ Í- 1 - 1˙ first image Î ˚ È1 1˘ Í1 1˙second image Î ˚ ft 12 Synthetic Images Results One iteration 10 iterations l=4 13 Homework Due 9/9/02 • Derive Euler Angles matrix from three rotations around x, y and Z. (Lecture-2, page 3, do not hand in). • Derive bi-quadratic motion model from the projective motion model using Taylor series. (Lecture-2, page 11). • Verify 3-D rigid motion using instantaneous motion model can be written as a cross product of W rotational velocities and object location (X). Lecture-2, page 16. • Verify that pseudo perspective motion model can be derived assuming planar scene and perspective projection. Lecture-2, page 18. 14 ...
View Full Document

Ask a homework question - tutors are online