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

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

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

CS6670: Computer Vision

Motion in 2D image sequences

VC 11/12 T11 Optical Flow

CS 4495 Computer Vision Motion and Optic Flow

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

Feature Tracking and Optical Flow

Lecture 16: Computer Vision

Feature Tracking and Optical Flow

Lecture 16: Computer Vision

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

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

EE795: Computer Vision and Intelligent Systems

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

Peripheral drift illusion

Dense Image-based Motion Estimation Algorithms & Optical Flow

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

EE795: Computer Vision and Intelligent Systems

Capturing, Modeling, Rendering 3D Structures

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

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

Multi-stable Perception. Necker Cube

COMPUTER VISION > OPTICAL FLOW UTRECHT UNIVERSITY RONALD POPPE

Optical flow and tracking

Comparison between Motion Analysis and Stereo

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

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

Computer Vision Lecture 20

Computer Vision Lecture 20

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

EECS 556 Image Processing W 09

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

Lecture 20: Tracking. Tuesday, Nov 27

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

Local Gradient, Global Matching, Piecewise-Smooth Optical Flow

Marcel Worring Intelligent Sensory Information Systems

Optical Flow Estimation

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

Computer Vision Lecture 20

Notes 9: Optical Flow

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

CS-465 Computer Vision

Optic Flow and Motion Detection

CS664 Lecture #18: Motion

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

Horn-Schunck and Lucas Kanade 1

Colour Segmentation-based Computation of Dense Optical Flow with Application to Video Object Segmentation

Motion estimation. Lihi Zelnik-Manor

Edge and corner detection

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

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

ECE Digital Image Processing and Introduction to Computer Vision

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

Comparison Between The Optical Flow Computational Techniques

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

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

Computer Vision II Lecture 4

Displacement estimation

Local Feature Detectors

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

Robust Camera Pan and Zoom Change Detection Using Optical Flow

Computer Vision for HCI. Motion. Motion

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

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

Mixture Models and EM

Coarse-to-fine image registration

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Representing Moving Images with Layers. J. Y. Wang and E. H. Adelson MIT Media Lab

CSE 252A Computer Vision Homework 3 Instructor: Ben Ochoa Due : Monday, November 21, 2016, 11:59 PM

Adaptive Multi-Stage 2D Image Motion Field Estimation

Searching Video Collections:Part I

CS201: Computer Vision Introduction to Tracking

Chaplin, Modern Times, 1936

CS231A Section 6: Problem Set 3

Digital Image Processing COSC 6380/4393

CPSC 425: Computer Vision

Visual Tracking (1) Pixel-intensity-based methods

Final Exam Study Guide

LOCAL-GLOBAL OPTICAL FLOW FOR IMAGE REGISTRATION

The Template Update Problem

Optic Flow and Basics Towards Horn-Schunck 1

CSCI 1290: Comp Photo

Robert Collins CSE598G. Intro to Template Matching and the Lucas-Kanade Method

Module 7 VIDEO CODING AND MOTION ESTIMATION

Feature Based Registration - Image Alignment

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

Feature Detectors and Descriptors: Corners, Lines, etc.

Introduction to Computer Vision

The Lucas & Kanade Algorithm

Chapter 3 Image Registration. Chapter 3 Image Registration

Global Flow Estimation. Lecture 9

Optical flow. Cordelia Schmid

Announcements. Computer Vision I. Motion Field Equation. Revisiting the small motion assumption. Visual Tracking. CSE252A Lecture 19.

Multimedia Retrieval Ch 5 Image Processing. Anne Ylinen

Global Flow Estimation. Lecture 9

Motion Estimation (II) Ce Liu Microsoft Research New England

Applications. Foreground / background segmentation Finding skin-colored regions. Finding the moving objects. Intelligent scissors

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

Classification and Detection in Images. D.A. Forsyth

Transcription:

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

Why estimate motion? We live in a 4-D world Wide applications Object Tracking Camera Stabilization Image Mosaics 3D Shape Reconstruction (SFM) Special Effects (Match Move) 2

Optical flow 3

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

Optical flow constraints (grayscale images) Let s look at these constraints more closely brightness constancy: Q: what s the equation? H(x, y) = I(x+u, y+v) small motion: (u and v are less than 1 pixel) suppose we take the Taylor series expansion of I: 5

Optical flow equation Combining these two equations The x-component of the gradient vector. What is I t? The time derivative of the image at (x,y) How do we calculate it? 6

Optical flow equation Q: how many unknowns and equations per pixel? 1 equation, but 2 unknowns (u and v) 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 7

Aperture problem 8

Aperture problem 9

Solving the aperture problem Basic idea: assume motion field is smooth Lukas & Kanade: assume locally constant motion pretend the pixel s neighbors have the same (u,v) If we use a 5x5 window, that gives us 25 equations per pixel! Many other methods exist. Here s an overview: Barron, J.L., Fleet, D.J., and Beauchemin, S, Performance of optical flow techniques, International Journal of Computer Vision, 12(1):43-77, 1994. 10

Lukas-Kanade flow 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! 11

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! 12

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) 13

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) 14

Edges cause problems large gradients, all the same large λ 1, small λ 2 15

Low texture regions don t work gradients have small magnitude smallλ 1, small λ 2 16

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

Errors in Lukas-Kanade What are the potential causes of errors in this procedure? Suppose A T A is easily invertible Suppose there is not much noise in the image When our assumptions are violated Brightness constancy is not satisfied The motion is not small A point does not move like its neighbors window size is too large what is the ideal window size? 18

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? 19

Reduce the resolution! 20

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

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

A Few Details Top Level Apply L-K to get a flow field representing the flow from the first frame to the second frame. Apply this flow field to warp the first frame toward the second frame. Rerun L-K on the new warped image to get a flow field from it to the second frame. Repeat till convergence. Next Level Etc. Upsample the flow field to the next level as the first guess of the flow at that level. Apply this flow field to warp the first frame toward the second frame. Rerun L-K and warping till convergence as above. 23

The Flower Garden Video What should the optical flow be? 24

Robust Visual Motion Analysis: Piecewise-Smooth Optical Flow Ming Ye Electrical Engineering University of Washington 25

Structure From Motion Rigid scene + camera translation Estimated horizontal motion Depth map 26

Scene Dynamics Understanding Brighter pixels => larger speeds. Surveillance Event analysis Video compression Estimated horizontal motion Motion boundaries are smooth. Motion smoothness 27

Target Detection and Tracking A tiny airplane --- only observable by its distinct motion Tracking results 28

Problem Statement Assuming only brightness conservation and piecewise-smooth motion, find the optical flow to best describe the intensity change in three frames. 29

Approach: Matching-Based Global Optimization Step 1. Robust local gradient-based method for high-quality initial flow estimate. Step 2. Global gradient-based method to improve the flow-field coherence. Step 3. Global matching that minimizes energy by a greedy approach. 30

Global Energy Design Global energy E = EB ( Vs ) + ES ( Vs ) all sites s V S is the optical flow field. E B is the brightness error. E S is the smoothness error. I is the current frame, and I - and I + are prev & next frame. I - (V s ) is the warped intensity in prev frame. E B measures the minimum brightness difference between I - (V s )-I s and I + (V s )-I s ) I - I I + E S is the flow smoothness error in a neighborhood about pixel s. E S ( V i ) = 1 8 n N 8 s ρ( V s V n, σ S s ) 31

I Overall Algorithm I 0 I p P 1 Level p Level p-1 Image pyramid I p p V 0 warp p I w Calculate gradients p I w Local OFC V V p 0 Global OFC p V 1 p V 1 Global matching p V 2 Projection p 1 0,σ, σ B i S i 32

Advantages Best of Everything Local OFC High-quality initial flow estimates Robust local scale estimates Global OFC Improve flow smoothness Global Matching The optimal formulation Correct errors caused by poor gradient quality and hierarchical process Results: fast convergence, high accuracy, simultaneous motion boundary detection 33

Experiments Experiments were run on several standard test videos. Estimates of optical flow were made for the middle frame of every three. The results were compared with the Black and Anandan algorithm. 34

TS: Translating Squares Homebrew, ideal setting, test performance upper bound 64x64, 1pixel/frame Groundtruth (cropped), Our estimate looks the same 35

TS: Flow Estimate Plots LS BA S1 (S2 is close) S3 looks the same as the groundtruth. S1, S2, S3: results from our Step I, II, III (final) 36

TT: Translating Tree 150x150 (Barron 94) e e (pix) e(pix) (o ) BA 2.60 0.128 0.0724 S3 0.248 0.0167 0.00984 BA S3 e: error in pixels, cdf: culmulative distribution function for all pixels 37

DT: Diverging Tree 150x150 (Barron 94) e ( o ) e (pix) e(pix) BA 6.36 0.182 0.114 S3 2.60 0.0813 0.0507 BA S3 38

YOS: Yosemite Fly-Through 316x252 (Barron, cloud excluded) e ( o ) e (pix) e(pix) BA S3 BA 2.71 0.185 0.118 S3 1.92 0.120 0.0776 39

TAXI: Hamburg Taxi 256x190, (Barron 94) max speed 3.0 pix/frame LMS BA Ours Error map Smoothness error 40

Traffic 512x512 (Nagel) max speed: 6.0 pix/frame BA Ours Error map Smoothness error 41

Pepsi Can 201x201 (Black) Max speed: 2pix/frame Ours BA Smoothness error 42

FG: Flower Garden 360x240 (Black) Max speed: 7pix/frame BA LMS Ours Error map Smoothness error 43

MPEG Motion Compression Some frames are encoded in terms of others. Independent frame encoded as a still image using JPEG Predicted frame encoded via flow vectors relative to the independent frame and difference image. Between frame encoded using flow vectors and independent and predicted frame. 44

MPEG compression method F1 is independent. F4 is predicted. F2 and F3 are between. Each block of I is matched to its closest match in P and represented by a motion vector and a block difference image. Frames B1 and B2 between I and P are represented by two motion vectors per block referring to blocks in F1 and F4. 45

Example of compression Assume frames are 512 x 512 bytes, or 32 x 32 blocks of size 16 x 16 pixels. Frame A is ¼ megabytes = 250,000 bytes before JPEG Frame B uses 32 x 32 =1024 motion vectors, or 2048 bytes only if delx and dely are represented as 1 byte integers. 46

Segmenting videos Build video segment database Scene change is a change of environment: newsroom to street Shot change is a change of camera view of same scene Camera pan and zoom, as before Fade, dissolve, wipe are used for transitions 47

Scene change 48

Detect via histogram change (Top) gray level histogram of intensities from frame 1 in newsroom. (Middle) histogram of intensities from frame 2 in newsroom. (Bottom) histogram of intensities from street scene. Histograms change less with pan and zoom of same scene. 49

Daniel Gatica Perez s work on describing video content 50

Our problem: Finding Video Structure Video Structure: hierarchical description of visual content Table of Contents From thousands of raw frames to video events 51

Hierarchical Structure in Video: Extensive Operators Video Sequence Scenes: Semantic Concept. Fair to use? Clusters: Collection of temporally adjacent/visually similar shots Shots: Consecutive frames recorded from a single camera Sequence Scene Cluster Shot Frame 52

Daniel s Approach VIDEO SEQUENCE TEMPORAL PARTITION GENERATION VIDEO SHOT FEATURE EXTRACTION PROBABILISTIC HIERARCHICAL CLUSTERING CONSTRUCTION OF VIDEO SEGMENT TREE 53

Video Structuring Results (I) 35 shots 9 clusters detected 54

Video Structuring Results (II) 12 shots 4 clusters 55

Tree-based Video Representation 56