120 likes | 146 Views
Learn the process of computing 2D motion in computer vision using the gradient method on images to find contours and perpendicular directions, optimizing for minimum error in velocity calculations.
E N D
Computational VisionCSCI 363, Fall 2018Lecture 16Computing Motion
t0 t1 I1(x, y) I2(x, y) Using the Gradient Method to compute 2D motion 1. In practice in computer vision, we compute motion from two frames: Two images taken at slightly different times. 2. Convolve the images with the Laplacian of a Gaussian (to localize contours).
+ - (nx, ny) C2(x, y) Direction Perpendicular to Contours 3. The gradient of C2 at a zero crossing points in the direction perpendicular to the contour at that location. nx= ? ny = ? The vector, n = (nx, ny), points in the direction of the steepest increase of the function C2(x,y). At zero-crossings, it points in the direction perpendicular to the local contour, and from the negative to the positive side of the crossing.
n ny nx The unit length normal 4. The unit length normal to the contour is given by the gradient vector divided by its length. length of n = ? Let p be the unit vector in the direction of n. p = ?
v q vp p Contour p has length 1. Velocity perpendicular to a contour vp is the projection of v onto p. We find the magnitude of this projection by taking the dot product of v and p. vp= ? |vp| = ?
Using the Gradient Constraint Equation Recall the gradient constraint equation: From this we can show that: where: The direction of vpis the same as that of the gradient vector (nx, ny).
Combining multiple measurements vp2 vy Recall intersection of constraints: vp2 p2 V p1 vx vp1 vp1 |vp1| = ? |vp2| = ? Rearranging, we have: We will work out an example in class.
The Problem of Noise • Problem: • Measurements are often inaccurate because: • Noise in the image measurements • Inaccuracies due to the discrete (pixelated) image. Solution: Make multiple measurements and find V that bestmatches all the measurements. The effects of noise will tend to average out.
Predicted perpendicular velocity Measured perpendicular velocity Finding the best fit Because of noise, there will be no single V that satisfies all the local measurements. We want to find a V that fits the measurements best, i.e. it gives the least error when compared with predictions from measured quantities.
Add up the errors For a given V = (Vx, Vy), we can find the total error by summing all the error terms for all the measured perpendicular velocities. Goal: Find V that gives the minimum error, E.
Finding the Minimum To find the minimum, we find the point where the derivative is zero. Rearranging, we have:
The Solution The previous equation has the form: where Solving, we obtain: