1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides...
-
date post
21-Dec-2015 -
Category
Documents
-
view
219 -
download
0
Transcript of 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides...
![Page 1: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/1.jpg)
1
Optical Flow Estimation
Slides by Yael Pritch, taken from the image processing course
Many slides from Alexei Efros ans Steve Seitz
![Page 2: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/2.jpg)
2
Problem Definition: Optical Flow
How to estimate pixel motion from image H to image I?
Why is it useful• Depth (3D) reconstruction• Motion detection - tracking moving objects• Compression• Mosaics• And more…
![Page 3: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/3.jpg)
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
![Page 4: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/4.jpg)
4
Motion estimation: Optical flow
Goal: estimate the motion of each pixel
![Page 5: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/5.jpg)
5
Classes of Techniques
Feature-based methods• Extract visual features (corners, textured areas) and track
them over multiple frames– Sparse motion fields, but possibly robust tracking– Suitable especially when image motion is large (10-s of pixels)
Direct-methods• Directly recover image motion from spatio-temporal image
brightness variations– Motion vectors directly recovered without an intermediate feature
extraction step– Dense motion fields, but more sensitive to appearance variations– Suitable for video and when image motion is small (< 10 pixels)
![Page 6: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/6.jpg)
6
Optical flow constraints (grayscale images)
Let’s take a closer look at these constraints:• brightness constancy: Q: what’s the equation?
• small motion: (u and v are less than 1 pixel)– suppose we take the Taylor series expansion of I:
![Page 7: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/7.jpg)
7
Optical flow equationCombining these two equations
In the limit, as u and v go to zero, this approximation is good
![Page 8: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/8.jpg)
8
Optical flow equation
Q: How many equations and how many unknowns do we have per pixel?
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
This explains the Barber Pole illusionhttp://www.sandlotscience.com/Ambiguous/barberpole.htm
![Page 9: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/9.jpg)
9
Getting more EquationsHow 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: assume the pixel’s neighbors have the same (u,v)
» If we use a 5x5 window, this gives us 25 equations per pixel!
![Page 10: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/10.jpg)
10
Lukas-Kanade flowWe have over constrained equation set:
• The summations are over all pixels in the K x K window• This technique was first proposed by Lukas & Kanade (1981)
Solution: solve least squares problem• minimum least squares solution given by solution (in d) of:
![Page 11: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/11.jpg)
11
When can we solve this ?
• Optimal (u, v) satisfies Lucas-Kanade equation
When is This Solvable?• ATA should be invertible • The eigenvalues of ATA should not be too small (noise)• ATA should be well-conditioned
– 1/ 2 should not be too large (1 = larger eigenvalue)
ATA is invertible when there is no aperture problem
![Page 12: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/12.jpg)
12
The Aperture Problem
![Page 13: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/13.jpg)
13
The Aperture Problem
![Page 14: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/14.jpg)
14
The Aperture Problem
![Page 15: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/15.jpg)
15
The Aperture Problem
TIIMLet
• Algorithm: At each pixel compute by solving
• M is singular if all gradient vectors point in the same direction• e.g., along an edge• of course, trivially singular if the summation is over a single pixel or if there is no texture• i.e., only normal flow is available (aperture problem)
• Corners and textured areas are OK
and
ty
tx
II
IIb
U bMU
![Page 16: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/16.jpg)
16
Local Patch Analysis
![Page 17: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/17.jpg)
17
Edge
– large gradients, all the same
– large1, small 2
![Page 18: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/18.jpg)
18
Low texture region
– gradients have small magnitude
– small1, small 2
![Page 19: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/19.jpg)
19
High textured region
– gradients are different, large magnitudes
– large1, large 2
![Page 20: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/20.jpg)
20
ObservationThis is a two image problem BUT
• Can measure sensitivity/uncertainty 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...
![Page 21: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/21.jpg)
21
Errors in Lukas-KanadeWhat are the potential causes of errors in this procedure?
• Suppose ATA 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?
![Page 22: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/22.jpg)
22
Iterative RefinementIterative Lukas-Kanade Algorithm
1. Estimate velocity at each pixel by solving Lucas-Kanade equations
2. Warp H towards I using the estimated flow field- use image warping techniques (easier said than done)
3. Repeat until convergence
![Page 23: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/23.jpg)
23
Optical Flow: Iterative Estimation
xx0
Initial guess:
Estimate:
estimate update
(using d for displacement here instead of u)
![Page 24: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/24.jpg)
24
Optical Flow: Iterative Estimation
xx0
estimate update
Initial guess:
Estimate:
![Page 25: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/25.jpg)
25
Optical Flow: Iterative Estimation
xx0
Initial guess:
Estimate:
Initial guess:
Estimate:
estimate update
![Page 26: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/26.jpg)
26
Optical Flow: Iterative Estimation
xx0
![Page 27: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/27.jpg)
27
Optical Flow: Iterative EstimationSome Implementation Issues:
• Warp one image, take derivatives of the other so you don’t need to re-compute the gradient after each iteration.
• Often useful to low-pass filter the images before motion estimation (for better derivative estimation, and linear approximations to image intensity)
![Page 28: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/28.jpg)
29
Revisiting the small motion assumption
Is this motion small enough?• Probably not—it’s much larger than one pixel (2nd order terms dominate)
• How might we solve this problem?
![Page 29: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/29.jpg)
30
Reduce the resolution!
![Page 30: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/30.jpg)
31
image Iimage H
Gaussian pyramid of image H Gaussian pyramid of image I
image Iimage H u=10 pixels
u=5 pixels
u=2.5 pixels
u=1.25 pixels
Coarse-to-fine optical flow estimation
![Page 31: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/31.jpg)
32
image Iimage J
Gaussian pyramid of image H Gaussian pyramid of image I
image Iimage H
Coarse-to-fine optical flow estimation
run iterative L-K
run iterative L-K
warp & upsample
.
.
.
![Page 32: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/32.jpg)
33
Multi-resolution Lucas Kanade AlgorithmCompute Iterative LK at highest level•For Each Level i
•Take flow u(i-1), v(i-1) from level i-1
•Upsample the flow to create u*(i), v*(i) matrices of twice resolution for level i.
•Multiply u*(i), v*(i) by 2
•Compute It from a block displaced by u*(i), v*(i)
•Apply LK to get u’(i), v’(i) (the correction in flow)
•Add corrections u’(i), v’(i) to obtain the flow u(i), v(i) at the ith level, i.e., u(i)=u*(i)+u’(i), v(i)=v*(i)+v’(i)
![Page 33: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/33.jpg)
34
Optical Flow: Iterative EstimationSome Implementation Issues:
• Warping is not easy (ensure that errors in warping are smaller than the estimate refinement)
• Warp one image, take derivatives of the other so you don’t need to re-compute the gradient after each iteration.
• Often useful to low-pass filter the images before motion estimation (for better derivative estimation, and linear approximations to image intensity)
![Page 34: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/34.jpg)
35
Optical Flow Results
![Page 35: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/35.jpg)
36
Optical Flow Results
![Page 36: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/36.jpg)
37
Optical flow Results
![Page 37: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/37.jpg)
38
More slides
![Page 38: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/38.jpg)
39
Image Warping
![Page 39: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/39.jpg)
40
Image Warping
image filtering: change range of imageg(x) = h(f(x))
image warping: change domain of imageg(x) = f(h(x))
f
x
hf
x
f
x
hf
x
![Page 40: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/40.jpg)
41
Image Warping
image filtering: change range of imageg(x) = h(f(x))
image warping: change domain of imageg(x) = f(h(x))
h
h
f
f g
g
![Page 41: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/41.jpg)
42
Parametric (global) warpingExamples of parametric warps:
translation rotation aspect
affineperspective
cylindrical
![Page 42: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/42.jpg)
44
Image WarpingGiven a coordinate transform x’ = h(x) and a source
image f(x), how do we compute a transformed image g(x’) = f(h(x))?
f(x) g(x’)x x’
h(x)
![Page 43: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/43.jpg)
45
Forward WarpingSend each pixel f(x) to its corresponding location x’ =
h(x) in g(x’)
f(x) g(x’)x x’
h(x)
• What if pixel lands “between” two pixels?
![Page 44: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/44.jpg)
46
Forward WarpingSend each pixel f(x) to its corresponding location x’ =
h(x) in g(x’)
f(x) g(x’)x x’
h(x)
• What if pixel lands “between” two pixels?• Answer: add “contribution” to several pixels,
normalize later (splatting)
![Page 45: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/45.jpg)
47
Inverse WarpingGet each pixel g(x’) from its corresponding location x =
h-1(x’) in f(x)
f(x) g(x’)x x’
h-1(x’)
• What if pixel comes from “between” two pixels?
![Page 46: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/46.jpg)
48
Inverse WarpingGet each pixel g(x’) from its corresponding location x =
h-1(x’) in f(x)
• What if pixel comes from “between” two pixels?• Answer: resample color value from
interpolated (prefiltered) source image
f(x) g(x’)x x’
![Page 47: 1 Optical Flow Estimation Slides by Yael Pritch, taken from the image processing course Many slides from Alexei Efros ans Steve Seitz.](https://reader036.fdocuments.in/reader036/viewer/2022062516/56649d625503460f94a44ca9/html5/thumbnails/47.jpg)
49
InterpolationPossible interpolation filters:
• nearest neighbor• bilinear• bicubic (interpolating)• sinc / FIR
Needed to prevent “jaggies” and “texture crawl” (see demo)