Mobile Computer Vision: Optical Flow and Tracking
Mobile Computer Vision: Optical Flow and Tracking
Lecture 7
Optical flow and tracking
- Introduction
- Optical flow & KLT tracker
- Motion segmentation
• Fast and Robust Multiframe Super Resolution, Sina Farsiu, M. Dirk Robinson, Michael Elad, and Peyman Milanfar, EEE TRANSACTIONS ON
IMAGE PROCESSING, VOL. 13, NO. 10, OCTOBER 2004
4
Super-resolution
5
Super-resolution
6
Visual SLAM
https://www.youtube.com/watch?v=YAszeOaInUM
Suha Kwak, Taegyu Lim, Woonhyun Nam, Bohyung Han, Joon Hee Han: Generalized background subtraction based on hybrid inference by belief propagation and Bayesian filtering. ICCV 2011
Segmenting objects based on
motion cues
• Motion segmentation
– Segment the video into multiple coherently moving objects
OpenCV's face tracker uses an algorithm called Camshift (based on the meanshift algorithm)
http://www.youtube.com/watch?v=HTk_UwAYzVk
Tracking objects
Object Tracking by Oversampling Local Features. Del Bimbo, and F. Pernici, IEEE Transaction On Pattern Analisys And Machine
Intelligence, 2014
• Use Scale Invariant Feature Transform (SIFT) when applied to (flat) objects
http://www.micc.unifi.it/pernici/#alien
DOWNLOAD http://www.micc.unifi.it/pernici/
Tracking objects
Tracking objectsReal-Time Facial Feature Tracking on a Mobile Device
P. A. Tresadern, M. C. Ionita, T. F. Cootes in IJCV (2012)
Joint tracking and 3D localization
"Server-side object recognition and client-side object tracking for mobile augmented reality", Stephan
Gammeter , Alexander Gassmann, Lukas Bossard, Till Quack, and Luc Van Gool, CVPR-W, 2010
Tracking body parts
Cascaded Models for Articulated Pose Estimation, B Sapp, A Toshev, B
Taskar, Computer Vision–ECCV 2010, 406-420
Juan Carlos Niebles, Hongcheng Wang and Li Fei-Fei, Unsupervised Learning of Human Action
Categories Using Spatial-Temporal Words, (BMVC), Edinburgh, 2006.
Recognizing group activities
Crossing – Talking – Queuing – Dancing – jogging
• Optical flow
– Recover image motion at each pixel from spatio-temporal
image brightness variations (optical flow)
• Feature-tracking
– Extract visual features (corners, textured areas) and
“track” them over multiple frames
Optical flow
Vector field function of the spatio-temporal image brightness variations
Picture courtesy of Selim Temizer - Learning and Intelligent Systems (LIS) Group, MIT
Optical flow
Vector field function of the spatio-temporal image brightness variations
http://www.youtube.com/watch?v=JlLkkom6tWw
Optical flow
I(x,y,t–1) I(x,y,t)
I(x,y,t–1) I(x,y,t)
I ( x u , y u , t ) I ( x, y, t 1) I x u ( x, y ) I y v( x, y ) I t
I ( x u , y u , t ) I ( x, y, t 1) I x u ( x, y ) I y v( x, y ) I t
Hence, I x u I y v I t 0 I u v I t 0
T
The brightness constancy constraint
Can we use this equation to recover image motion (u,v) at
each pixel?
I u v I t 0
T
M=
1
Low-texture region
gradient
T
This equation I u ' v' 0
is always satisfied when (u’, v’ ) is
perpendicular to the image (u’,v’)
gradient
edge
The barber pole illusion
http://en.wikipedia.org/wiki/Barberpole_illusion
Aperture problem cont’d
39
* From Marc Pollefeys COMP 256 2003
Motion estimation techniques
Optical flow
• Recover image motion at each pixel from spatio-temporal
image brightness variations (optical flow)
Feature-tracking
• Extract visual features (corners, textured areas) and
“track” them over multiple frames
• Implemented in Open CV
Tracking features
u=1.25 pixels
u=2.5 pixels
u=5 pixels
image H
1 u=10 pixels image
image I2
run L-K
run L-K
.
.
.
image J1 image
image I2
• http://www.ces.clemson.edu/~stb/klt/
• OpenCV
* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003
Recap
• Key assumptions (Errors in Lucas-Kanade)
a6
a2
a3
a1
How do we estimate the layers?
1. 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
a3
a1
Example result
J. Wang and E. Adelson. Layered Representation for Motion Analysis. CVPR 1993.
CS231M · Mobile Computer Vision
Next lecture:
Neural networks and decision trees
for machine vision