CS 4495 Computer Vision Motion and Optic Flow

Similar documents
Peripheral drift illusion

Multi-stable Perception. Necker Cube

Ninio, J. and Stevens, K. A. (2000) Variations on the Hermann grid: an extinction illusion. Perception, 29,

Feature Tracking and Optical Flow

Feature Tracking and Optical Flow

Motion and Optical Flow. Slides from Ce Liu, Steve Seitz, Larry Zitnick, Ali Farhadi

Computer Vision Lecture 20

Optical flow and tracking

Computer Vision Lecture 20

Finally: Motion and tracking. Motion 4/20/2011. CS 376 Lecture 24 Motion 1. Video. Uses of motion. Motion parallax. Motion field

CS6670: Computer Vision

Fundamental matrix. Let p be a point in left image, p in right image. Epipolar relation. Epipolar mapping described by a 3x3 matrix F

Lucas-Kanade Motion Estimation. Thanks to Steve Seitz, Simon Baker, Takeo Kanade, and anyone else who helped develop these slides.

VC 11/12 T11 Optical Flow

ECE Digital Image Processing and Introduction to Computer Vision

Visual motion. Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys

Computer Vision Lecture 20

EECS 556 Image Processing W 09

EE795: Computer Vision and Intelligent Systems

EE795: Computer Vision and Intelligent Systems

Matching. Compare region of image to region of image. Today, simplest kind of matching. Intensities similar.

Lecture 16: Computer Vision

Comparison between Motion Analysis and Stereo

Overview. Video. Overview 4/7/2008. Optical flow. Why estimate motion? Motion estimation: Optical flow. Motion Magnification Colorization.

Dense Image-based Motion Estimation Algorithms & Optical Flow

Lecture 16: Computer Vision

Automatic Image Alignment (direct) with a lot of slides stolen from Steve Seitz and Rick Szeliski

Optical Flow-Based Motion Estimation. Thanks to Steve Seitz, Simon Baker, Takeo Kanade, and anyone else who helped develop these slides.

Motion and Tracking. Andrea Torsello DAIS Università Ca Foscari via Torino 155, Mestre (VE)

CSCI 1290: Comp Photo

COMPUTER VISION > OPTICAL FLOW UTRECHT UNIVERSITY RONALD POPPE

CS 4495 Computer Vision A. Bobick. Motion and Optic Flow. Stereo Matching

Lecture 19: Motion. Effect of window size 11/20/2007. Sources of error in correspondences. Review Problem set 3. Tuesday, Nov 20

Optical Flow CS 637. Fuxin Li. With materials from Kristen Grauman, Richard Szeliski, S. Narasimhan, Deqing Sun

Visual Tracking (1) Feature Point Tracking and Block Matching

Lecture 14: Tracking mo3on features op3cal flow

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

Motion Estimation. There are three main types (or applications) of motion estimation:

Fi#ng & Matching Region Representa3on Image Alignment, Op3cal Flow

Visual Tracking. Image Processing Laboratory Dipartimento di Matematica e Informatica Università degli studi di Catania.

CS664 Lecture #18: Motion

Particle Tracking. For Bulk Material Handling Systems Using DEM Models. By: Jordan Pease

Optical flow. Cordelia Schmid

Lecture 13: Tracking mo3on features op3cal flow

CS 4495 Computer Vision A. Bobick. Motion and Optic Flow. Stereo Matching

Capturing, Modeling, Rendering 3D Structures

Visual Tracking. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

Computer Vision Lecture 18

SURVEY OF LOCAL AND GLOBAL OPTICAL FLOW WITH COARSE TO FINE METHOD

Spatial track: motion modeling

CS231A Section 6: Problem Set 3

Optic Flow and Basics Towards Horn-Schunck 1

Lecture 20: Tracking. Tuesday, Nov 27

Motion. 1 Introduction. 2 Optical Flow. Sohaib A Khan. 2.1 Brightness Constancy Equation

CPSC 425: Computer Vision

Optical flow. Cordelia Schmid

CS 565 Computer Vision. Nazar Khan PUCIT Lectures 15 and 16: Optic Flow

3D Photography. Marc Pollefeys, Torsten Sattler. Spring 2015

Visual Tracking (1) Pixel-intensity-based methods

Leow Wee Kheng CS4243 Computer Vision and Pattern Recognition. Motion Tracking. CS4243 Motion Tracking 1

CS-465 Computer Vision

Autonomous Navigation for Flying Robots

Computer Vision II Lecture 4

Spatial track: motion modeling

Image processing and features

Mariya Zhariy. Uttendorf Introduction to Optical Flow. Mariya Zhariy. Introduction. Determining. Optical Flow. Results. Motivation Definition

CS201: Computer Vision Introduction to Tracking

Displacement estimation

Notes 9: Optical Flow

Final Exam Study Guide

Feature Based Registration - Image Alignment

3D Vision. Viktor Larsson. Spring 2019

CS5670: Computer Vision

Edge and corner detection

Video Alignment. Literature Survey. Spring 2005 Prof. Brian Evans Multidimensional Digital Signal Processing Project The University of Texas at Austin

Local Feature Detectors

Optic Flow and Motion Detection

Local invariant features

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

CS4495 Fall 2014 Computer Vision Problem Set 5: Optic Flow

EE 264: Image Processing and Reconstruction. Image Motion Estimation I. EE 264: Image Processing and Reconstruction. Outline

Horn-Schunck and Lucas Kanade 1

Computer Vision I - Filtering and Feature detection

Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

Ruch (Motion) Rozpoznawanie Obrazów Krzysztof Krawiec Instytut Informatyki, Politechnika Poznańska. Krzysztof Krawiec IDSS

Features Points. Andrea Torsello DAIS Università Ca Foscari via Torino 155, Mestre (VE)

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Selim Aksoy

Computer Vision II Lecture 4

Dense 3D Reconstruction. Christiano Gava

Comparison Between The Optical Flow Computational Techniques

(More) Algorithms for Cameras: Edge Detec8on Modeling Cameras/Objects. Connelly Barnes

Chaplin, Modern Times, 1936

Wikipedia - Mysid

MASTER THESIS. Optical Flow Features for Event Detection. Mohammad Afrooz Mehr, Maziar Haghpanah

Computational Optical Imaging - Optique Numerique. -- Single and Multiple View Geometry, Stereo matching --

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

What have we leaned so far?

Local Features: Detection, Description & Matching

ELEC Dr Reji Mathew Electrical Engineering UNSW

Transcription:

CS 4495 Computer Vision Aaron Bobick School of Interactive Computing

Administrivia PS4 is out, due Sunday Oct 27 th. All relevant lectures posted Details about Problem Set: You may *not* use built in Harris corner functions. We provide instructions to download a SIFT library. (VLFeat) It is callable from Matlab. Library provides both SIFT computation and matching. If using C or Python, you can use the relevant functions in OpenCV There is a supplement document that explains these two systems. Scale is not explored.

Visual motion Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys, K. Grauman and others

Video A video is a sequence of frames captured over time Now our image data is a function of space (x, y) and time (t)

Motion Applications: Segmentation of video Background subtraction A static camera is observing a scene Goal: separate the static background from the moving foreground

Motion Applications: Segmentation of video Background subtraction Shot boundary detection Commercial video is usually composed of shots or sequences showing the same objects or scene Goal: segment video into shots for summarization and browsing (each shot can be represented by a single keyframe in a user interface) Difference from background subtraction: the camera is not necessarily stationary

Motion Applications: Segmentation of video Background subtraction Shot boundary detection Motion segmentation Segment the video into multiple coherently moving objects

Motion and perceptual organization Sometimes, motion is the only cue

Motion and perceptual organization Sometimes, motion is the only cue http://www.youtube.com/watch?v=aeoxo_rdghe

Motion and perceptual organization Even impoverished motion data can evoke a strong percept

Motion and perceptual organization Even impoverished motion data can evoke a strong percept

Mosaicing (Michal Irani, Weizmann)

Mosaicing (Michal Irani, Weizmann)

More applications of motion Segmentation of objects in space or time Estimating 3D structure Learning dynamical models how things move Recognizing events and activities Improving video quality (motion stabilization)

Motion estimation techniques Direct, dense methods Directly recover image motion at each pixel from spatio-temporal image brightness variations Dense motion fields, but sensitive to appearance variations Suitable for video and when image motion is small Feature-based methods Extract visual features (corners, textured areas) and track them over multiple frames Sparse motion fields, but more robust tracking Suitable when image motion is large (10s of pixels)

Motion estimation: Optical flow Will start by estimating motion of each pixel separately Then will consider motion of entire image

Problem definition: optical flow How to estimate pixel motion from image I(x,y,t) to I(x,y,t+1)? Solve pixel correspondence problem given a pixel in I(x,y,t), look for nearby pixels of the same color in I(x,y,t+1) Key assumptions I(, xyt,) I( xyt+,, 1) color constancy: a point in I(x,y, looks the same in I(x,y,t+1) For grayscale images, this is brightness constancy small motion: points do not move very far This is called the optical flow problem

Optical flow constraints (grayscale images) I(, xyt,) I( xyt+,, 1) Let s look at these constraints more closely brightness constancy constraint (equation) I( x, y, t) = I( x+ u, y+ v, t+ 1) small motion: (u and v are less than 1 pixel, or smooth) Taylor series expansion of I: I I I( x+ u, y+ v) = I( x, y) + u+ v+ [higher order terms] x y I I Ixy (, ) + u+ v x y

Optical flow equation Combining these two equations 0 = I( x+ u, y+ v, t + 1) I( x, y, t) I( xyt,, + 1) + Iu+ Iv I( xyt,, ) x y (Short hand: I x = for t or t+1)

Optical flow equation Combining these two equations 0 = I( x+ u, y+ v, t+ 1) I( x, y, t) I( xyt,, + 1) + Iu+ Iv I( xyt,, ) [ I( xyt,, + 1) I( xyt,, )] + Iu+ Iv I + Iu+ Iv t x y I+ I < uv, > t x y x y (Short hand: I x = for t or t+1)

Optical flow equation Combining these two equations 0 = I( x+ u, y+ v, t+ 1) I( x, y, t) I( xyt,, + 1) + Iu+ Iv I( xyt,, ) [ I( xyt,, + 1) I( xyt,, )] + Iu+ Iv I + Iu+ Iv t x y I+ I < uv, > t x y x y (Short hand: I x = for t or t+1) In the limit as u and v go to zero, this becomes exact 0 = I+ I < uv, > t Brightness constancy constraint equation I u + I v+ I = x y t 0

Optical flow equation 0 = I+ I < uv, > or t Iu x + Iv y + It = 0 Q: how many unknowns and equations per pixel? 2 unknowns, one equation Intuitively, what does this constraint mean? The component of the flow in the gradient direction is determined The component of the flow parallel to an edge is unknown gradient (u,v) (u,v ) edge (u+u,v+v )

Aperture problem

Aperture problem

Apparently an aperture problem

Optical flow equation Q: how many unknowns and equations per pixel? 2 unknowns, one equation Intuitively, what does this constraint mean? The component of the flow in the gradient direction is determined The component of the flow parallel to an edge is unknown Some folks say: This explains the Barber Pole illusion http://www.sandlotscience.com/ambiguous/barberpole_illusion.htm http://www.liv.ac.uk/~marcob/trieste/barberpole.html Not quite where do the vectors point? http://en.wikipedia.org/wiki/barber's_pole

Smooth Optical Flow (Horn and Schunk - long ago) Formulate Error in Optical Flow Constraint: We need additional constraints! 2 ec = ( I xu + I yv + It) dx dy image Smoothness Constraint (as in shape from shading and stereo): Usually motion field varies smoothly in the image. So, penalize departure from smoothness: 2 2 2 2 es ( ux + u y ) + ( vx + vy ) = image dx dy Find (u,v) at each image point that MINIMIZES: e = e + λe weighting s c factor

Solving the aperture problem How to get more equations for a pixel? Basic idea: impose additional constraints most common is to assume that the flow field is smooth locally one method: pretend the pixel s neighbors have the same (u,v) If we use a 5x5 window, that gives us 25 equations per pixel!

RGB version How to get more equations for a pixel? Basic idea: impose additional constraints most common is to assume that the flow field is smooth locally one method: pretend the pixel s neighbors have the same (u,v) If we use a 5x5 window, that gives us 25*3 equations per pixel! Note that RGB alone at pixel is not enough to disambiguate because R, G & B are correlated. Just provides better gradient

Lukas-Kanade flow Prob: we have more equations than unknowns Solution: solve least squares problem minimum least squares solution given by solution (in d) of: The summations are over all pixels in the K x K window This technique was first proposed by Lukas & Kanade (1981)

Aperture Problem and Normal Flow The gradient constraint: I x u + I yv + It = I U = Defines a line in the (u,v) space 0 0 v Normal Flow: u

Combining Local Constraints v 1 1 I U = I t I I 2 3 U = U = 2 I t 3 I t u etc.

Conditions for solvability Optimal (u, v) satisfies Lucas-Kanade equation When is This Solvable? A T A should be invertible A T A should not be too small due to noise eigenvalues λ 1 and λ 2 of A T A should not be too small A T A should be well-conditioned λ 1 / λ 2 should not be too large (λ 1 = larger eigenvalue) A T A is solvable when there is no aperture problem Does this remind you of something???

Eigenvectors of A T A Recall the Harris corner detector: M = A T A is the second moment matrix The eigenvectors and eigenvalues of M relate to edge direction and magnitude The eigenvector associated with the larger eigenvalue points in the direction of fastest intensity change The other eigenvector is orthogonal to it

Interpreting the eigenvalues Classification of image points using eigenvalues of the second moment matrix: λ 2 Edge λ 2 >> λ 1 Corner λ 1 and λ 2 are large, λ 1 ~ λ 2 λ 1 and λ 2 are small Flat region Edge λ 1 >> λ 2 λ 1

Low texture region gradients have small magnitude small λ 1, small λ 2

Edge large gradients, all the same large λ 1, small λ 2

High textured region gradients are different, large magnitudes large λ 1, large λ 2

Errors in Lucas-Kanade The motion is large (larger than a pixel) Not-linear: Iterative refinement Local minima: coarse-to-fine estimation A point does not move like its neighbors Motion segmentation Brightness constancy does not hold Do exhaustive neighborhood search with normalized correlation - tracking features maybe SIFT more later.

Not tangent: Iterative Refinement Iterative Lukas-Kanade Algorithm 1. Estimate velocity at each pixel by solving Lucas-Kanade equations 2. Warp I t towards I t+1 using the estimated flow field - use image warping techniques 3. Repeat until convergence

Optical Flow: Iterative Estimation estimate update Initial guess: Estimate: x 0 x (using d for displacement here instead of u)

Optical Flow: Iterative Estimation estimate update Initial guess: Estimate: x 0 x

Optical Flow: Iterative Estimation estimate update Initial guess: Estimate: x 0 x

Optical Flow: Iterative Estimation x 0 x

Optical Flow: Iterative Estimation Some Implementation Issues: Warping is not easy (ensure that errors in warping are smaller than the estimate refinement) but it is in MATLAB! Often useful to low-pass filter the images before motion estimation (for better derivative estimation, and linear approximations to image intensity)

Revisiting the small motion assumption Is this motion small enough? Probably not it s much larger than one pixel How might we solve this problem?

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? actual shift estimated shift nearest match is correct (no aliasing) To overcome aliasing: coarse-to-fine estimation. nearest match is incorrect (aliasing)

Reduce the resolution!

Coarse-to-fine optical flow estimation u=1.25 pixels u=2.5 pixels u=5 pixels image 1 image 1 u=10 pixels image 2 Gaussian pyramid of image 1 Gaussian pyramid of image 2

Coarse-to-fine optical flow estimation run iterative L-K run iterative L-K warp & upsample... image J 1 image I image 2 Gaussian pyramid of image 1 Gaussian pyramid of image 2

Optical Flow Results * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Optical Flow Results * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Large displacement optical flow, Brox et al., CVPR 2009 CS 4495 Computer Vision A. Bobick State-of-the-art optical flow Start with something similar to Lucas-Kanade + gradient constancy + energy minimization with smoothing term + region matching + keypoint matching (long-range) Region-based +Pixel-based +Keypoint-based