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

Slides:



Advertisements
Similar presentations
Motion.
Advertisements

Feature Tracking and Optical Flow
Computer Vision Optical Flow
Automatic Image Alignment (direct) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and Rick.
Announcements Quiz Thursday Quiz Review Tomorrow: AV Williams 4424, 4pm. Practice Quiz handout.
Optical Flow Methods 2007/8/9.
Lecture 9 Optical Flow, Feature Tracking, Normal Flow
Announcements Project1 artifact reminder counts towards your grade Demos this Thursday, 12-2:30 sign up! Extra office hours this week David (T 12-1, W/F.
Announcements Project 1 test the turn-in procedure this week (make sure your folder’s there) grading session next Thursday 2:30-5pm –10 minute slot to.
Optical flow and Tracking CISC 649/849 Spring 2009 University of Delaware.
Caltech, Oct Lihi Zelnik-Manor
Motion Computing in Image Analysis
Optical Flow Estimation
Lecture 19: Optical flow CS6670: Computer Vision Noah Snavely
Visual motion Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys.
Motion Estimation Today’s Readings Trucco & Verri, 8.3 – 8.4 (skip 8.3.3, read only top half of p. 199) Numerical Recipes (Newton-Raphson), 9.4 (first.
1 Stanford CS223B Computer Vision, Winter 2006 Lecture 7 Optical Flow Professor Sebastian Thrun CAs: Dan Maynes-Aminzade, Mitul Saha, Greg Corrado Slides.
COMP 290 Computer Vision - Spring Motion II - Estimation of Motion field / 3-D construction from motion Yongjik Kim.
3D Rigid/Nonrigid RegistrationRegistration 1)Known features, correspondences, transformation model – feature basedfeature based 2)Specific motion type,
Matching Compare region of image to region of image. –We talked about this for stereo. –Important for motion. Epipolar constraint unknown. But motion small.
Where have all the flowers gone? (motion and tracking) Computer Vision COS429 Fall /02 Guest lecture by Andras Ferencz Many slides adapted from.
Computational Photography: Image Registration Jinxiang Chai.
Optical Flow Digital Photography CSE558, Spring 2003 Richard Szeliski (notes cribbed from P. Anandan)
Announcements Project1 due Tuesday. Motion Estimation Today’s Readings Trucco & Verri, 8.3 – 8.4 (skip 8.3.3, read only top half of p. 199) Supplemental:
CSCE 641 Computer Graphics: Image Registration Jinxiang Chai.
3D Computer Vision and Video Computing 3D Vision Topic 8 of Part 2 Visual Motion (II) CSC I6716 Spring 2004 Zhigang Zhu, NAC 8/203A
Motion and optical flow Thursday, Nov 20 Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys, S. Lazebnik.
Optical flow Combination of slides from Rick Szeliski, Steve Seitz, Alyosha Efros and Bill Freeman.
Feature Tracking and Optical Flow
Video Analysis Mei-Chen Yeh May 29, Outline Video representation Motion Actions in Video.
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 19 – Dense motion estimation (OF) 1.
Feature Tracking and Optical Flow Computer Vision ECE 5554 Virginia Tech Devi Parikh 11/12/13 Slides borrowed from Derek Hoiem, who adapted many from Lana.
Optical Flow Donald Tanguay June 12, Outline Description of optical flow General techniques Specific methods –Horn and Schunck (regularization)
Structure from Motion, Feature Tracking, and Optical Flow Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 04/15/10 Many slides adapted.
EECS 274 Computer Vision Motion Estimation.
Motion Segmentation By Hadas Shahar (and John Y.A.Wang, and Edward H. Adelson, and Wikipedia and YouTube) 1.
CSE 185 Introduction to Computer Vision Feature Tracking and Optical Flow.
Visual motion Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys.
Perceptual and Sensory Augmented Computing Computer Vision WS 08/09 Computer Vision – Lecture 18 Motion and Optical Flow Bastian Leibe RWTH.
3D Imaging Motion.
Optical Flow. Distribution of apparent velocities of movement of brightness pattern in an image.
Miguel Tavares Coimbra
Motion Estimation Today’s Readings Trucco & Verri, 8.3 – 8.4 (skip 8.3.3, read only top half of p. 199) Newton's method Wikpedia page
Feature Tracking and Optical Flow Computer Vision ECE 5554, ECE 4984 Virginia Tech Devi Parikh 11/10/15 Slides borrowed from Derek Hoiem, who adapted many.
Lecture 9 Feature Extraction and Motion Estimation Slides by: Michael Black Clark F. Olson Jean Ponce.
Motion Estimation Today’s Readings Trucco & Verri, 8.3 – 8.4 (skip 8.3.3, read only top half of p. 199) Newton's method Wikpedia page
Representing Moving Images with Layers J. Y. Wang and E. H. Adelson MIT Media Lab.
Optical flow and keypoint tracking Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys.
1 Motion Estimation Readings: Ch 9: plus papers change detection optical flow analysis Lucas-Kanade method with pyramid structure Ming Ye’s improved.
MASKS © 2004 Invitation to 3D vision Lecture 3 Image Primitives andCorrespondence.
Image Motion. The Information from Image Motion 3D motion between observer and scene + structure of the scene –Wallach O’Connell (1953): Kinetic depth.
Motion estimation Digital Visual Effects, Spring 2005 Yung-Yu Chuang 2005/3/23 with slides by Michael Black and P. Anandan.
Motion and optical flow
Feature Tracking and Optical Flow
Visual motion Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys.
CPSC 641: Image Registration
Estimating Parametric and Layered Motion
Motion and Optical Flow
Feature Tracking and Optical Flow
Representing Moving Images with Layers
Motion Estimation Today’s Readings
Filtering Things to take away from this lecture An image as a function
Announcements more panorama slots available now
Announcements Questions on the project? New turn-in info online
Announcements more panorama slots available now
23 April 2019.
Optical flow Computer Vision Spring 2019, Lecture 21
Open Topics.
Filtering An image as a function Digital vs. continuous images
Optical flow and keypoint tracking
Presentation transcript:

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

Outline Applications of segmentation to video Motion and perceptual organization Motion field Optical flow Motion segmentation with layers

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)

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

Applications of segmentation to video Background subtraction Form an initial background estimate For each frame: –Update estimate using a moving average –Subtract the background estimate from the frame –Label as foreground each pixel where the magnitude of the difference is greater than some threshold –Use median filtering to “clean up” the results

Applications of segmentation to 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

Applications of segmentation to video Background subtraction Shot boundary detection For each frame –Compute the distance between the current frame and the previous one »Pixel-by-pixel differences »Differences of color histograms »Block comparison –If the distance is greater than some threshold, classify the frame as a shot boundary

Applications of segmentation to 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

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

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

Uses of motion Estimating 3D structure Segmenting objects based on motion cues Learning dynamical models Recognizing events and activities Improving video quality (motion stabilization)

Motion estimation techniques Direct 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 field The motion field is the projection of the 3D scene motion into the image

Motion field and parallax P(t) is a moving 3D point Velocity of scene point: V = dP/dt p(t) = (x(t),y(t)) is the projection of P in the image Apparent velocity v in the image: given by components v x = dx/dt and v y = dy/dt These components are known as the motion field of the image p(t)p(t) p(t+dt) P(t)P(t) P(t+dt) V v

Motion field and parallax p(t)p(t) p(t+dt) P(t)P(t) P(t+dt) V v To find image velocity v, differentiate p with respect to t (using quotient rule): Image motion is a function of both the 3D motion (V) and the depth of the 3D point (Z)

Motion field and parallax Pure translation: V is constant everywhere

Motion field and parallax Pure translation: V is constant everywhere V z is nonzero: Every motion vector points toward (or away from) v 0, the vanishing point of the translation direction

Motion field and parallax Pure translation: V is constant everywhere V z is nonzero: Every motion vector points toward (or away from) v 0, the vanishing point of the translation direction V z is zero: Motion is parallel to the image plane, all the motion vectors are parallel The length of the motion vectors is inversely proportional to the depth Z

Optical flow Definition: optical flow is the apparent motion of brightness patterns in the image Ideally, optical flow would be the same as the motion field Have to be careful: apparent motion can be caused by lighting changes without any actual motion Think of a uniform rotating sphere under fixed lighting vs. a stationary sphere under moving illumination

Estimating optical flow Given two subsequent frames, estimate the apparent motion field u(x,y) and v(x,y) between them Key assumptions Brightness constancy: projection of the same point looks the same in every frame Small motion: points do not move very far Spatial coherence: points move like their neighbors I(x,y,t–1)I(x,y,t)I(x,y,t)

Brightness Constancy Equation: Linearizing the right side using Taylor expansion: The brightness constancy constraint I(x,y,t–1)I(x,y,t)I(x,y,t) Hence,

The brightness constancy constraint How many equations and unknowns per pixel? One equation, two unknowns Intuitively, what does this constraint mean? The component of the flow perpendicular to the gradient (i.e., parallel to the edge) is unknown

The brightness constancy constraint How many equations and unknowns per pixel? One equation, two unknowns Intuitively, what does this constraint mean? The component of the flow perpendicular to the gradient (i.e., parallel to the edge) is unknown edge (u,v)(u,v) (u’,v’) gradient (u+u’,v+v’) If (u, v) satisfies the equation, so does (u+u’, v+v’) if

The aperture problem Perceived motion

The aperture problem Actual motion

The barber pole illusion

The barber pole illusion

The barber pole illusion

Solving the aperture problem How to get more equations for a pixel? Spatial coherence constraint: pretend the pixel’s neighbors have the same (u,v) If we use a 5x5 window, that gives us 25 equations per pixel B. Lucas and T. Kanade. An iterative image registration technique with an application toAn iterative image registration technique with an application to stereo vision.stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, 1981.

Solving the aperture problem Least squares problem: B. Lucas and T. Kanade. An iterative image registration technique with an application toAn iterative image registration technique with an application to stereo vision.stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, When is this system solvable? What if the window contains just a single straight edge?

Conditions for solvability “Bad” case: single straight edge

Conditions for solvability “Good” case

Lucas-Kanade flow Overconstrained linear system B. Lucas and T. Kanade. An iterative image registration technique with an application toAn iterative image registration technique with an application to stereo vision.stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, The summations are over all pixels in the K x K window Least squares solution for d given by

Conditions for solvability Optimal (u, v) satisfies Lucas-Kanade equation When is this solvable? A T A should be invertible A T A entries should not be too small (noise) A T A should be well-conditioned

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 1 2 “Corner” 1 and 2 are large, 1 ~ 2 1 and 2 are small “Edge” 1 >> 2 “Edge” 2 >> 1 “Flat” region Classification of image points using eigenvalues of the second moment matrix:

Edge – gradients very large or very small – large  1, small 2

Low-texture region – gradients have small magnitude – small  1, small 2

High-texture region – gradients are different, large magnitudes – large  1, large 2

What are good features to track? Recall the Harris corner detector Can measure “quality” of features from just a single image

Motion models Translation 2 unknowns Affine 6 unknowns Perspective 8 unknowns 3D rotation 3 unknowns

Substituting into the brightness constancy equation: Affine motion

Substituting into the brightness constancy equation: Each pixel provides 1 linear constraint in 6 unknowns Least squares minimization: Affine motion

Errors in Lucas-Kanade The motion is large (larger than a pixel) Iterative refinement, 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

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 Refine estimate by repeating the process

Dealing with large motions

Reduce the resolution!

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

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

Motion segmentation How do we represent the motion in this scene? J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

Layered motion Break image sequence into “layers” each of which has a coherent motion J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

What are layers? Each layer is defined by an alpha mask and an affine motion model J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

Local flow estimates Motion segmentation with an affine model J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

Motion segmentation with an affine model Equation of a plane (parameters a 1, a 2, a 3 can be found by least squares) J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

Motion segmentation with an affine model 1D example u(x,y)u(x,y) Local flow estimate Segmented estimateLine fitting Equation of a plane (parameters a 1, a 2, a 3 can be found by least squares) True flow “Foreground” “Background” Occlusion J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

How do we estimate the layers? Compute local flow in a coarse-to-fine fashion Obtain a set of initial affine motion hypotheses Divide the image into blocks and estimate affine motion parameters in each block by least squares –Eliminate hypotheses with high residual error Perform k-means clustering on affine motion parameters –Merge clusters that are close and retain the largest clusters to obtain a smaller set of hypotheses to describe all the motions in the scene Iterate until convergence: Assign each pixel to best hypothesis –Pixels with high residual error remain unassigned Perform region filtering to enforce spatial constraints Re-estimate affine motions in each region J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.

Example result J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.Layered Representation for Motion Analysis.