Lecture 13: Tracking mo3on features op3cal flow

Similar documents
Optical Flow, Motion Segmentation, Feature Tracking

Optical flow. Subhransu Maji. CMPSCI 670: Computer Vision. October 20, 2016

Lecture 17: Face Recogni2on

Lecture 17: Face Recogni2on

Elaborazione delle Immagini Informazione multimediale - Immagini. Raffaella Lanzarotti

6.869 Advances in Computer Vision. Bill Freeman, Antonio Torralba and Phillip Isola MIT Oct. 3, 2018

Introduction to motion correspondence

CS4495/6495 Introduction to Computer Vision. 6B-L1 Dense flow: Brightness constraint

CS4670: Computer Vision Kavita Bala. Lecture 7: Harris Corner Detec=on

Motion Estimation (I) Ce Liu Microsoft Research New England

Video and Motion Analysis Computer Vision Carnegie Mellon University (Kris Kitani)

Image Processing 1 (IP1) Bildverarbeitung 1

Image Alignment and Mosaicing

Lecture 8: Interest Point Detection. Saad J Bedros

CSCI 360 Introduc/on to Ar/ficial Intelligence Week 2: Problem Solving and Op/miza/on

Motion estimation. Digital Visual Effects Yung-Yu Chuang. with slides by Michael Black and P. Anandan

Lucas-Kanade Optical Flow. Computer Vision Carnegie Mellon University (Kris Kitani)

Corners, Blobs & Descriptors. With slides from S. Lazebnik & S. Seitz, D. Lowe, A. Efros

Feature extraction: Corners and blobs

Computer Vision. Pa0ern Recogni4on Concepts Part I. Luis F. Teixeira MAP- i 2012/13

CS 3710: Visual Recognition Describing Images with Features. Adriana Kovashka Department of Computer Science January 8, 2015

Edges and Scale. Image Features. Detecting edges. Origin of Edges. Solution: smooth first. Effects of noise

Lecture 7: Finding Features (part 2/2)

Motion Estimation (I)

Least Square Es?ma?on, Filtering, and Predic?on: ECE 5/639 Sta?s?cal Signal Processing II: Linear Es?ma?on

Latent Dirichlet Alloca/on

Least Mean Squares Regression. Machine Learning Fall 2017

6.869 Advances in Computer Vision. Prof. Bill Freeman March 1, 2005

Dr. Ulas Bagci

Lecture 6: Edge Detection. CAP 5415: Computer Vision Fall 2008

Lecture 8: Interest Point Detection. Saad J Bedros

Lecture: Face Recognition

Iterative Image Registration: Lucas & Kanade Revisited. Kentaro Toyama Vision Technology Group Microsoft Research

Unsupervised Learning: K- Means & PCA

Robust Motion Segmentation by Spectral Clustering

INTEREST POINTS AT DIFFERENT SCALES

CSE 473: Ar+ficial Intelligence

Computer Vision Motion

Feature detectors and descriptors. Fei-Fei Li

Image Alignment and Mosaicing Feature Tracking and the Kalman Filter

Lecture: Face Recognition and Feature Reduction

Lecture 7: Finding Features (part 2/2)

Feature detectors and descriptors. Fei-Fei Li

Scale & Affine Invariant Interest Point Detectors

Advances in Computer Vision. Prof. Bill Freeman. Image and shape descriptors. Readings: Mikolajczyk and Schmid; Belongie et al.

Last Lecture Recap UVA CS / Introduc8on to Machine Learning and Data Mining. Lecture 3: Linear Regression

CS376 Computer Vision Lecture 6: Optical Flow

Blobs & Scale Invariance

Lecture 5. Epipolar Geometry. Professor Silvio Savarese Computational Vision and Geometry Lab. 21-Jan-15. Lecture 5 - Silvio Savarese

Recap: edge detection. Source: D. Lowe, L. Fei-Fei

Methods in Computer Vision: Introduction to Optical Flow

Computer Vision I. Announcements

Global Behaviour Inference using Probabilistic Latent Semantic Analysis

Lecture: Face Recognition and Feature Reduction

Subsampling and image pyramids

Bellman s Curse of Dimensionality

CS 6140: Machine Learning Spring What We Learned Last Week 2/26/16

Lecture 6: Finding Features (part 1/2)

Camera calibration. Outline. Pinhole camera. Camera projection models. Nonlinear least square methods A camera calibration tool

CS 664 Segmentation (2) Daniel Huttenlocher

Human Pose Tracking I: Basics. David Fleet University of Toronto

Supervised object recognition, unsupervised object recognition then Perceptual organization

Image Processing 1 (IP1) Bildverarbeitung 1

Outline. What is Machine Learning? Why Machine Learning? 9/29/08. Machine Learning Approaches to Biological Research: Bioimage Informa>cs and Beyond

Machine vision. Summary # 4. The mask for Laplacian is given

Lecture 12. Local Feature Detection. Matching with Invariant Features. Why extract features? Why extract features? Why extract features?

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news

CSE 473/573 Computer Vision and Image Processing (CVIP)

2D Image Processing (Extended) Kalman and particle filter

Reduced Models for Process Simula2on and Op2miza2on

Machine vision, spring 2018 Summary 4

Least Squares Parameter Es.ma.on

COMP 562: Introduction to Machine Learning

Unit 2. Projec.ons and Subspaces

CSE 473: Ar+ficial Intelligence. Probability Recap. Markov Models - II. Condi+onal probability. Product rule. Chain rule.

Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems

EE 6882 Visual Search Engine

Corner detection: the basic idea

Theory and Applica0on of Gas Turbine Systems

Image Analysis. Feature extraction: corners and blobs

Feature Tracking. 2/27/12 ECEn 631

Machine Learning and Data Mining. Linear regression. Prof. Alexander Ihler

Lecture 3: Linear Filters

Lecture 3: Linear Filters

Lecture 13 Visual recognition

Multi-Frame Factorization Techniques

Probabilistic Models of the Brain: Perception and Neural Function

UVA CS 4501: Machine Learning. Lecture 6: Linear Regression Model with Dr. Yanjun Qi. University of Virginia

Sta$s$cal sequence recogni$on

STAD68: Machine Learning

Lecture 7 Rolling Constraints

Statistical Modeling of Visual Patterns: Part I --- From Statistical Physics to Image Models

Templates, Image Pyramids, and Filter Banks

Fields, wave and electromagne3c pulses. fields, waves <- > par0cles pulse <- > bunch (finite in 0me),

Tracking Human Heads Based on Interaction between Hypotheses with Certainty

Feature detection.

Applied Time Series Analysis FISH 507. Eric Ward Mark Scheuerell Eli Holmes

VIDEO SYNCHRONIZATION VIA SPACE-TIME INTEREST POINT DISTRIBUTION. Jingyu Yan and Marc Pollefeys

Transcription:

Lecture 13: Tracking mo3on features op3cal flow Professor Fei- Fei Li Stanford Vision Lab Lecture 14-1!

What we will learn today? Introduc3on Op3cal flow Feature tracking Applica3ons Reading: [Szeliski] Chapters: 8.4, 8.5 Lecture 14-2!

From images to videos A video is a sequence of frames captured over 3me Now our image data is a func3on of space (x, y) and 3me (t) Lecture 14-3!

Mo3on es3ma3on techniques Op3cal flow Recover image mo3on at each pixel from spa3o- temporal image brightness varia3ons (op3cal flow) Feature- tracking Extract visual features (corners, textured areas) and track them over mul3ple frames Lecture 14-4!

Op3cal flow Vector field func3on of the spa3o- temporal image brightness varia3ons Picture courtesy of Selim Temizer - Learning and Intelligent Systems (LIS) Group, MIT Lecture 14-5!

Feature- tracking Courtesy of Jean- Yves Bouguet Vision Lab, California Ins3tute of Technology Lecture 14-6!

Feature- tracking Courtesy of Jean- Yves Bouguet Vision Lab, California Ins3tute of Technology Lecture 14-7!

Op3cal flow Defini3on: op3cal flow is the apparent mo3on of brightness pagerns in the image Note: apparent mo3on can be caused by ligh3ng changes without any actual mo3on Think of a uniform rota3ng sphere under fixed ligh3ng vs. a sta3onary sphere under moving illumina3on GOAL: Recover image mo3on at each pixel from op3cal flow Lecture 14-8!

Es3ma3ng op3cal flow I(x,y,t 1) I(x,y,t) Given two subsequent frames, es3mate the apparent mo3on field u(x,y), v(x,y) between them Key assump3ons Brightness constancy: projec3on of the same point looks the same in every frame Small mo9on: points do not move very far Spa9al coherence: points move like their neighbors Lecture 14-9!

Lecture 14 -! t y x I y x v I y x u I t y x I t u y u x I + + + + + ), ( ), ( 1),, ( ),, ( Brightness Constancy Equa3on: ), ( 1),, ( ),, ( ), ( t y x y x v y u x I t y x I + + = Linearizing the right side using Taylor expansion: The brightness constancy constraint I(x,y,t 1) I(x,y,t) 0 + + t y x I v I u I Hence, Image deriva3ve along x [ ] 0 I v u I t T = + t y x I y x v I y x u I t y x I t u y u x I + + = + + ), ( ), ( 1),, ( ),, ( 10

The brightness constancy constraint Can we use this equa3on to recover image mo3on (u,v) at each pixel? I [ ] T u v + I = 0 How many equa3ons and unknowns per pixel? One equa3on (this is a scalar equa3on!), two unknowns (u,v) t The component of the flow perpendicular to the gradient (i.e., parallel to the edge) cannot be measured If (u, v ) sa3sfies the equa3on, so does (u+u, v+v ) if I [ u' v' ] T = 0 (u,v ) gradient edge (u,v) (u+u,v+v ) Lecture 14-11!

The aperture problem Actual mo9on Lecture 14-12!

The aperture problem Perceived mo9on Lecture 14-13!

The barber pole illusion hgp://en.wikipedia.org/wiki/barberpole_illusion Lecture 14-14!

The barber pole illusion hgp://en.wikipedia.org/wiki/barberpole_illusion Lecture 14-15!

Aperture problem cont d * From Marc Pollefeys COMP 256 2003 Lecture 14-16!

Solving the ambiguity B. Lucas and T. Kanade. An itera3ve image registra3on technique with an applica3on to stereo vision. In Proceedings of the Interna6onal Joint Conference on Ar6ficial Intelligence, pp. 674 679, 1981. How to get more equa3ons for a pixel? Spa9al coherence constraint: Assume the pixel s neighbors have the same (u,v) If we use a 5x5 window, that gives us 25 equa3ons per pixel Lecture 14-17!

Lucas- Kanade flow Overconstrained linear system: Lecture 14-18!

Condi3ons for solvability When is this system solvable? What if the window contains just a single straight edge? Lecture 14-19!

Lucas- Kanade flow Overconstrained linear system Least squares solu3on for d given by The summa3ons are over all pixels in the K x K window Lecture 14-20!

Condi3ons for solvability Op3mal (u, v) sa3sfies Lucas- Kanade equa3on When is This Solvable? A T A should be inver3ble 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- condi3oned λ 1 / λ 2 should not be too large (λ 1 = larger eigenvalue) Does this remind anything to you? Lecture 14-21!

M = A T A is the second moment matrix! (Harris corner detector ) Eigenvectors and eigenvalues of A T A relate to edge direc3on and magnitude The eigenvector associated with the larger eigenvalue points in the direc3on of fastest intensity change The other eigenvector is orthogonal to it Lecture 14-22!

Interpre3ng the eigenvalues Classifica3on 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 Lecture 14-23!

Edge gradients very large or very small large λ 1, small λ 2 Lecture 14-24!

Low- texture region gradients have small magnitude small λ 1, small λ 2 Lecture 14-25!

High- texture region gradients are different, large magnitudes large λ 1, large λ 2 Lecture 14-26!

What we will learn today? Introduc3on Op3cal flow Feature tracking Applica3ons Lecture 14-27!

What are good features to track? Can measure quality of features from just a single image Hence: tracking Harris corners (or equivalent) guarantees small error sensi3vity! à Implemented in Open CV Lecture 14-28!

Recap Key assump3ons (Errors in Lucas- Kanade) Small mo9on: points do not move very far Brightness constancy: projec3on of the same point looks the same in every frame Spa9al coherence: points move like their neighbors Lecture 14-29!

Revisi3ng the small mo3on assump3on Is this mo3on 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 Lecture 14-30!

Reduce the resolu3on! * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003 Lecture 14-31!

Mul3- resolu3on Lucas Kanade Algorithm Lecture 14-32!

Coarse- to- fine op3cal flow es3ma3on u=1.25 pixels u=2.5 pixels u=5 pixels image 1 H u=10 pixels image 2 I Gaussian pyramid of image 1 Gaussian pyramid of image 2 Lecture 14-33!

Itera3ve Refinement Iterative Lukas-Kanade Algorithm 1. Estimate velocity at each pixel by solving Lucas- Kanade equations 2. Warp I(t-1) towards I(t) using the estimated flow field - use image warping techniques 3. Repeat until convergence * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003 Lecture 14-34!

Coarse- to- fine op3cal flow es3ma3on run itera3ve L- K run itera3ve L- K warp & upsample... image 1 J Gaussian pyramid of image 1 (t) image 2 I Gaussian pyramid of image 2 (t+1) Lecture 14-35!

Op3cal Flow Results * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003 Lecture 14-36!

Op3cal Flow Results hgp://www.ces.clemson.edu/~stb/klt/ OpenCV * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003 Lecture 14-37!

Recap Key assump3ons (Errors in Lucas- Kanade) Small mo9on: points do not move very far Brightness constancy: projec3on of the same point looks the same in every frame Spa9al coherence: points move like their neighbors Lecture 14-38!

Reminder: Gestalt common fate Lecture 14-39!

Mo3on segmenta3on How do we represent the mo3on in this scene? Lecture 14-40!

Mo3on segmenta3on J. Wang and E. Adelson. Layered Representa3on for Mo3on Analysis. CVPR 1993. Break image sequence into layers each of which has a coherent (affine) mo3on Lecture 14-41!

What are layers? Each layer is defined by an alpha mask and an affine mo3on model J. Wang and E. Adelson. Layered Representa3on for Mo3on Analysis. CVPR 1993. Lecture 14-42!

Lecture 14 -! Subs3tu3ng into the brightness constancy equa3on: y a x a a y x v y a x a a y x u 6 5 4 3 2 1 ), ( ), ( + + = + + = 0 + + t y x I v I u I Affine mo3on 43

Lecture 14 -! 0 ) ( ) ( 6 5 4 3 2 1 + + + + + + t y x I y a x a a I y a x a a I Subs3tu3ng into the brightness constancy equa3on: y a x a a y x v y a x a a y x u 6 5 4 3 2 1 ), ( ), ( + + = + + = Each pixel provides 1 linear constraint in 6 unknowns [ ] 2 + + + + + + = t y x I y a x a a I y a x a a I a Err ) ( ) ( ) ( 6 5 4 3 2 1 Least squares minimiza3on: Affine mo3on 44

How do we es3mate the layers? 1. Obtain a set of ini3al affine mo3on hypotheses Divide the image into blocks and es3mate affine mo3on parameters in each block by least squares Eliminate hypotheses with high residual error Map into mo3on parameter space Perform k- means clustering on affine mo3on parameters Merge clusters that are close and retain the largest clusters to obtain a smaller set of hypotheses to describe all the mo3ons in the scene Lecture 14-45!

How do we es3mate the layers? 1. Obtain a set of ini3al affine mo3on hypotheses Divide the image into blocks and es3mate affine mo3on parameters in each block by least squares Eliminate hypotheses with high residual error Map into mo3on parameter space Perform k- means clustering on affine mo3on parameters Merge clusters that are close and retain the largest clusters to obtain a smaller set of hypotheses to describe all the mo3ons in the scene 2. Iterate un3l convergence: Assign each pixel to best hypothesis Pixels with high residual error remain unassigned Lecture 14-46!

How do we es3mate the layers? 1. Obtain a set of ini3al affine mo3on hypotheses Divide the image into blocks and es3mate affine mo3on parameters in each block by least squares Eliminate hypotheses with high residual error Map into mo3on parameter space Perform k- means clustering on affine mo3on parameters Merge clusters that are close and retain the largest clusters to obtain a smaller set of hypotheses to describe all the mo3ons in the scene Lecture 14-47!

How do we es3mate the layers? 1. Obtain a set of ini3al affine mo3on hypotheses Divide the image into blocks and es3mate affine mo3on parameters in each block by least squares Eliminate hypotheses with high residual error Map into mo3on parameter space Perform k- means clustering on affine mo3on parameters Merge clusters that are close and retain the largest clusters to obtain a smaller set of hypotheses to describe all the mo3ons in the scene 2. Iterate un3l convergence: Assign each pixel to best hypothesis Pixels with high residual error remain unassigned Perform region filtering to enforce spa3al constraints Re- es3mate affine mo3ons in each region Lecture 14-48!

Example result J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993. Lecture 14-49!

What we will learn today? Introduc3on Op3cal flow Feature tracking Applica3ons Lecture 14-50!

Uses of mo3on Tracking features Segmen3ng objects based on mo3on cues Learning dynamical models Improving video quality Mo3on stabiliza3on Super resolu3on Tracking objects Recognizing events and ac3vi3es Lecture 14-51!

Es3ma3ng 3D structure Lecture 14-52!

Segmen3ng objects based on mo3on cues Background subtrac3on A sta3c camera is observing a scene Goal: separate the sta3c background from the moving foreground Lecture 14-53!

Segmen3ng objects based on mo3on cues Mo3on segmenta3on Segment the video into mul3ple coherently moving objects S. J. Pundlik and S. T. Birchfield, Mo3on Segmenta3on at Any Speed, Proceedings of the Bri3sh Machine Vision Conference (BMVC) 2006 Lecture 14-54!

Tracking objects Z.Yin and R.Collins, "On- the- fly Object Modeling while Tracking," IEEE Computer Vision and PaIern Recogni6on (CVPR '07), Minneapolis, MN, June 2007. Lecture 14-55!

Synthesizing dynamic textures Lecture 14-56!

Super- resolu3on Example: A set of low quality images Lecture 14-57!

Super- resolu3on Each of these images looks like this: Lecture 14-58!

Super- resolu3on The recovery result: Lecture 14-59!

Recognizing events and ac3vi3es Tracker D. Ramanan, D. Forsyth, and A. Zisserman. Tracking People by Learning their Appearance. PAMI 2007. Lecture 14-60!

Recognizing events and ac3vi3es Juan Carlos Niebles, Hongcheng Wang and Li Fei- Fei, Unsupervised Learning of Human Ac9on Categories Using Spa9al- Temporal Words, (BMVC), Edinburgh, 2006. Lecture 14-61!

Recognizing events and ac3vi3es Crossing Talking Queuing Dancing jogging W. Choi & K. Shahid & S. Savarese WMC 2010 Lecture 14-62!

W. Choi, K. Shahid, S. Savarese, "What are they doing? : Collec3ve Ac3vity Classifica3on Using Spa3o- Temporal Rela3onship Among People", 9th Interna3onal Workshop on Visual Surveillance (VSWS09) in conjuc3on with ICCV 09 Lecture 14-63!

Op3cal flow without mo3on! Lecture 14-64!

What we have learned today? Introduc3on Op3cal flow Feature tracking Applica3ons Lecture 14-65!