1 Stanford CS223B Computer Vision, Winter 2006 Lecture 7 Optical Flow Professor Sebastian Thrun CAs: Dan Maynes-Aminzade, Mitul Saha, Greg Corrado Slides.

Slides:



Advertisements
Similar presentations
CSCE 643 Computer Vision: Lucas-Kanade Registration
Advertisements

Optical Flow Estimation
Motion.
Feature Tracking and Optical Flow
Computer Vision Optical Flow
A New Block Based Motion Estimation with True Region Motion Field Jozef Huska & Peter Kulla EUROCON 2007 The International Conference on “Computer as a.
Automatic Image Alignment (direct) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and Rick.
Motion Estimation I What affects the induced image motion? Camera motion Object motion Scene structure.
Stanford CS223B Computer Vision, Winter 2007 Lecture 12 Tracking Motion Professors Sebastian Thrun and Jana Košecká CAs: Vaibhav Vaish and David Stavens.
Announcements Quiz Thursday Quiz Review Tomorrow: AV Williams 4424, 4pm. Practice Quiz handout.
CSCE 641 Computer Graphics: Image Registration Jinxiang Chai.
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.
Feature matching and tracking Class 5 Read Section 4.1 of course notes Read Shi and Tomasi’s paper on.
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.
Visual motion Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys.
Motion Computing in Image Analysis
Stanford CS223B Computer Vision, Winter 2007 Lecture 12 Tracking Motion Professors Sebastian Thrun and Jana Košecká CAs: Vaibhav Vaish and David Stavens.
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.
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.
Automatic Image Alignment via Motion Estimation
Where have all the flowers gone? (motion and tracking) Computer Vision COS429 Fall /02 Guest lecture by Andras Ferencz Many slides adapted from.
KLT tracker & triangulation Class 6 Read Shi and Tomasi’s paper on good features to track
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.
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
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.
1 Motion Estimation Readings: Ch 9: plus papers change detection optical flow analysis Lucas-Kanade method with pyramid structure Ming Ye’s improved.
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.
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.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm Lecture #16.
3D Imaging Motion.
Optical Flow. Distribution of apparent velocities of movement of brightness pattern in an image.
Motion ECE 847: Digital Image Processing Stan Birchfield
Miguel Tavares Coimbra
O PTICAL F LOW & L AYERED M OTION Prepared by: Lidya Tonkonogi Mu’in Rizik 1.
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
Motion Estimation I What affects the induced image motion?
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.
1 Lucas-Kanade Motion Estimation Thanks to Steve Seitz, Simon Baker, Takeo Kanade, and anyone else who helped develop these slides.
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
Motion estimation Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/12 with slides by Michael Black and P. Anandan.
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
CPSC 641: Image Registration
Motion and Optical Flow
Motion Estimation Today’s Readings
Announcements more panorama slots available now
Motion Estimation Thanks to Steve Seitz, Simon Baker, Takeo Kanade, and anyone else who helped develop these slides.
Announcements Questions on the project? New turn-in info online
Announcements more panorama slots available now
Optical flow Computer Vision Spring 2019, Lecture 21
Optical flow and keypoint tracking
Presentation transcript:

1 Stanford CS223B Computer Vision, Winter 2006 Lecture 7 Optical Flow Professor Sebastian Thrun CAs: Dan Maynes-Aminzade, Mitul Saha, Greg Corrado Slides by: Gary Bradski, Intel Research and Stanford SAIL

2

3 Optical Flow: Outline Examples Formal definition, 1D case From 1D to 2D: Aperture Problem Course motion and pyramids Flow Segmentation

4 * Picture from Khurram Hassan-Shafique CAP5415 Computer Vision 2003 Optical Flow

5 Optical Flow, Example

6 Another Example in Robotics 1) Rich local sensor data determines drivability 2) Use optical flow for near-far association 3) Associate known driveability with visually similar regions

7 Optical Flow, Example Harris Corners David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004)

8 Optical Flow, Example David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004) Optical flow

9 Optical Flow, Example David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004) “Reward”

10 Optical Flow, Example David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004) Particle Filter

11 Optical Flow, Example David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004) Result

12 Conference Paper David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004)

13 Optical Flow: Outline Examples Formal definition, 1D case From 1D to 2D: Aperture Problem Course motion and pyramids Flow Segmentation

14 Optical Flow Image sequence (single camera) Tracked sequence 3D structure + 3D trajectory Image tracking 3D computation

15 What is Optical Flow? Optical Flow Velocity vectors Common assumption: The appearance of the image patches do not change (brightness constancy)

16  * From Marc Pollefeys COMP Optical Flow Break Down? Perhaps an aperture problem discussed later.

17 Optical Flow Assumptions: Brightness Constancy * Slide from Michael Black, CS

18 Optical Flow Assumptions: * Slide from Michael Black, CS

19 Optical Flow Assumptions: * Slide from Michael Black, CS

20 Optical Flow: 1D Case Brightness Constancy Assumption: IxIx vItIt  Because no change in brightness with time

21? Tracking in the 1D case:

22 Spatial derivative Temporal derivative Tracking in the 1D case:Assumptions: Brightness constancy Brightness constancy Small motion Small motion

23 Tracking in the 1D case: Temporal derivative at 2 nd iteration Iterating helps refining the velocity vector Can keep the same estimate for spatial derivative Converges in about 5 iterations

24 Algorithm for 1D tracking:  Compute local image derivative at :  Compute local image derivative at p:  Initialize velocity vector:  Repeat until convergence:  Compensate for current velocity vector:  Compute temporal derivative:  Update velocity vector: For all pixel of interest : For all pixel of interest p:  Need access to neighborhood pixels round p to compute  Need access to the second image patch, for velocity compensation:  The pixel data to be accessed in next image depends on current velocity estimate (bad?)  Compensation stage requires a bilinear interpolation (because is not integer)  Compensation stage requires a bilinear interpolation (because v is not integer)  The image derivative needs to be kept in memory throughout the iteration process Requirements:

25 Optical Flow: Outline Examples Formal definition, 1D case From 1D to 2D: Aperture Problem Course motion and pyramids Flow Segmentation

26 From 1D to 2D tracking 1D: 2D: Shoot! One equation, two velocity (u,v) unknowns…

27 From 1D to 2D tracking * Slide from Michael Black, CS We get at most “Normal Flow” – with one point we can only detect movement perpendicular to the brightness gradient. Solution is to take a patch of pixels Around the pixel of interest.

28 How does this show up visually? Known as the “Aperture Problem”

29 Aperture Problem Exposed Motion along just an edge is ambiguous

30 Aperture Problem: Example

31 Aperture Problem in Real Life

32 From 1D to 2D tracking The Math is very similar: Window size here ~ 5x5 or 11x11

33 More Detail: 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! * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

34 Lukas-Kanade flow Prob: we have more equations than unknowns –The summations are over all pixels in the K x K window –This technique was first proposed by Lukas & Kanade (1981) described in Trucco & Verri reading Solution: solve least squares problem –minimum least squares solution given by solution (in d) of: * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

35 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) * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

36 Eigenvectors of A T A –gradients along edge all point the same direction –gradients away from edge have small magnitude – is an eigenvector with eigenvalue –What’s the other eigenvector of A T A? let N be perpendicular to N is the second eigenvector with eigenvalue 0 The eigenvectors of A T A relate to edge direction and magnitude Suppose (x,y) is on an edge. What is A T A? * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

37 Edge – large gradients, all the same – large  1, small 2 * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

38 Low texture region – gradients have small magnitude – small  1, small 2 * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

39 High textured region – gradients are different, large magnitudes – large  1, large 2 * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

40 Observation This is a two image problem BUT –Can measure sensitivity by just looking at one of the images! –This tells us which pixels are easy to track, which are hard very useful later on when we do feature tracking... –Once suggestion: Track Harris Corners! * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

41 Optical Flow, Example Harris Corners David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004)

42 Optical Flow, Example David Stavens, Andrew Lookingbill, David Lieb (CS223B 2004) Optical flow

43 Optical Flow: Outline Examples Formal definition, 1D case From 1D to 2D: Aperture Problem Course motion and pyramids Flow Segmentation

44 Revisiting the small motion assumption Is this motion small enough? –Probably not—it’s much larger than one pixel (2 nd order terms dominate) –How might we solve this problem? * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

45 Reduce the resolution! * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

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

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

48 Multi-resolution Lucas Kanade Algorithm

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

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

51 Optical Flow: Outline Examples Formal definition, 1D case From 1D to 2D: Aperture Problem Course motion and pyramids Flow Segmentation

52 Problem Multiple motion types in the image –(e.g., moving cars on 280 or El Camino Real)

53 Motion Template Idea

54 Stamp the current motion history template with the system time and overlay it on top of the others: Motion Segmentation Algorithm

55 Measure gradients of the overlaid motion history templates: Motion Segmentation Algorithm

56 Threshold large gradients to get rid of motion template edges resulting from too large of a time delay: Motion Segmentation Algorithm

57 Motion Segmentation Algorithm Find boundaries of most recent motions “Walk around boundary If drop not too high, Flood fill downwards to segment motions Segmented Motion Segmented Motion

58 Motion Segmentation Algorithm Actually need a two-pass algorithm for labeling all motion segments: 1.Fill downwards; At bottom, turn around and fill upwards. 2.Keep the union of these fills as the segmented motion.

59 Motion Template for Motion Segmentation and Gesture Pose Recognition Motion Segmentation Gesture Recognition Motion Segmentation Overlay silhouettes, take gradient for normal optical flow. Flood fill to segment motions.