Algorithms & Applications in Computer Vision. Lihi Zelnik -Manor Lecture 9: Optical Flow. Last Time: Alignment. Homographies Rotational Panoramas RANSAC Global alignment Warping Blending. Today: Motion and Flow. Motion estimation Patch-based motion (optic flow)

Download Presentation

Algorithms & Applications in Computer Vision

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

Introduction • Given a video sequence with camera/objects moving we can better understand the scene if we find the motions of the camera/objects.

Scene Interpretation • How is the camera moving? • How many moving objects are there? • Which directions are they moving in? • How fast are they moving? • Can we recognize their type of motion (e.g. walking, running, etc.)?

Applications • Recover camera ego-motion. Result by MobilEye (www.mobileye.com)

Applications • Motion segmentation Result by: L.Zelnik-Manor, M.Machline, M.Irani “Multi-body Segmentation: Revisiting Motion Consistency” To appear, IJCV

Applications • Structure from Motion Input Reconstructed shape Result by: L. Zhang, B. Curless, A. Hertzmann, S.M. Seitz “Shape and motion under varying illumination: Unifying structure from motion, photometric stereo, and multi-view stereo” ICCV’03

Examples of Motion fields Closer objects appear to move faster!! Forward motion Rotation Horizontal translation

CCD 3D motion vector 2D optical flow vector Motion Field & Optical Flow Field • Motion Field = Real world 3D motion • Optical Flow Field = Projection of the motion field onto the 2d image

The Optical Flow Field Still, in many cases it does work…. • Goal:Find for each pixel a velocity vector which says: • How quickly is the pixel moving across the image • In which direction it is moving

Brightness Constancy Equation First order Taylor Expansion Simplify notations: Gradient and flow are orthogonal Divide by dt and denote: Problem I: One equation, two unknowns

Time t Time t+dt Time t+dt Problem II: “The Aperture Problem” • For points on a line of fixed intensity we can only recover the normal flow ? Where did the blue point move to? We need additional constraints

Iterative Refinement • Estimate velocity at each pixel using one iteration of Lucas and Kanade estimation • Warp one image toward the other using the estimated flow field (easier said than done) • Refine estimate by repeating the process

Optical Flow: Iterative Estimation • Some Implementation Issues: • Warping is not easy (ensure that errors in warping are smaller than the estimate refinement) • Warp one image, take derivatives of the other so you don’t need to re-compute the gradient after each iteration. • Often useful to low-pass filter the images before motion estimation (for better derivative estimation, and linear approximations to image intensity)

Correlation based methods Regularization based methods Use multi-scale estimation Other break-downs • Brightness constancy is not satisfied • A point does not move like its neighbors • what is the ideal window size? • The motion is not small (Taylor expansion doesn’t hold) • Aliasing

actual shift estimated shift Optical Flow: Aliasing Temporal aliasing causes ambiguities in optical flow because images can have many pixels with the same intensity. I.e., how do we know which ‘correspondence’ is correct? nearest match is correct (no aliasing) nearest match is incorrect (aliasing) To overcome aliasing: coarse-to-fine estimation.

u=1.25 pixels u=2.5 pixels u=5 pixels u=10 pixels image It-1 image I Multi-Scale Flow Estimation image It image It+1 Gaussian pyramid of image It Gaussian pyramid of image It+1

warp & upsample run Lucas-Kanade . . . image It-1 image I Multi-Scale Flow Estimation run Lucas-Kanade image It image It+1 Gaussian pyramid of image It Gaussian pyramid of image It+1

Correlation based methods Regularization based methods Use multi-scale estimation Other break-downs • Brightness constancy is not satisfied • A point does not move like its neighbors • what is the ideal window size? • The motion is not small (Taylor expansion doesn’t hold) • Aliasing

Spatial Coherence Assumption * Neighboring points in the scene typically belong to the same surface and hence typically have similar motions. * Since they also project to nearby points in the image, we expect spatial coherence in image flow. Black

Discontinuities u q(x) x What about this discontinuity? What is happening here? What can we do? Black

velocity space u2 + + u1 Robust Estimation Noise distributions are often non-Gaussian, having much heavier tails. Noise samples from the tails are called outliers. • Sources of outliers (multiple motions): • specularities / highlights • jpeg artifacts / interlacing / motion blur • multiple motions (occlusion boundaries, transparency) Black

Occlusion occlusion disocclusion shear Multiple motions within a finite region. Black