CS4495/6495 Introduction to Computer Vision 6B-L3 Hierarchical LK - - PowerPoint PPT Presentation

cs4495 6495
SMART_READER_LITE
LIVE PREVIEW

CS4495/6495 Introduction to Computer Vision 6B-L3 Hierarchical LK - - PowerPoint PPT Presentation

CS4495/6495 Introduction to Computer Vision 6B-L3 Hierarchical LK Revisiting the small motion assumption Is this motion small enough? Probably not much larger than one pixel How might we solve this problem? Garden image


slide-1
SLIDE 1

6B-L3 Hierarchical LK

CS4495/6495 Introduction to Computer Vision

slide-2
SLIDE 2

Revisiting the small motion assumption

  • Is this motion small

enough?

  • Probably not – much

larger than one pixel

  • How might we solve

this problem?

Garden image sequence #1

slide-3
SLIDE 3

Revisiting the small motion assumption

  • Is this motion small

enough?

  • Probably not – much

larger than one pixel

  • How might we solve

this problem?

Garden image sequence #2

slide-4
SLIDE 4

Optical Flow: Aliasing

nearest match is correct (no aliasing) nearest match is incorrect (aliasing)

To overcome aliasing: coarse-to-fine estimation

actual shift estimated shift

slide-5
SLIDE 5

Reduce the resolution!

slide-6
SLIDE 6

image 2 image 1

Gaussian pyramid of image 1 Gaussian pyramid of image 2

image 2 image 1 u=10 pixels u=5 pixels u=2.5 pixels u=1.25 pixels

slide-7
SLIDE 7

run iterative L-K run iterative L-K warp & upsample

. . .

Gaussian pyramid of image 1 Gaussian pyramid of image 2

image 1 image 2

slide-8
SLIDE 8

Optical Flow Results

*From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-9
SLIDE 9

Optical Flow Results

*From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-10
SLIDE 10

Detour: Multi-scale analysis, image pyramids

slide-11
SLIDE 11

Throw away every other row and column to create a 1/2 size image: image sub-sampling

1/4 1/8

  • S. Seitz
slide-12
SLIDE 12

Bad image sub-sampling

1/4 (2x zoom) 1/8 (4x zoom)

Aliasing! What do we do?

1/2

  • S. Seitz
slide-13
SLIDE 13

G 1/4 G 1/8 Gaussian 1/2

Solution: Filter the image, then subsample

  • S. Seitz
slide-14
SLIDE 14

Subsampling with Gaussian pre-filtering

G 1/4 G 1/8 Gaussian 1/2

  • S. Seitz
slide-15
SLIDE 15

Image Pyramids

Known as a Gaussian Pyramid [Burt and Adelson, 1983]

slide-16
SLIDE 16

“Band-pass” filtering

Gaussian Pyramid (low-pass images) These are “bandpass” images (almost). Laplacian Pyramid (subband images)

slide-17
SLIDE 17

Laplacian Pyramid

How can we reconstruct (collapse) this pyramid into the original image?

Need this! Original image

slide-18
SLIDE 18

Laplacian Pyramid

How can we reconstruct (collapse) this pyramid into the original image?

Need this! Original image

slide-19
SLIDE 19

Need Gk to reconstruct Reduce Expand

slide-20
SLIDE 20

Reduce and Expand

Reduce

Apply “5-tap” (1 4 6 4 1)/16 separable filter to make reduced image.

slide-21
SLIDE 21

Reduce and Expand

Expand

Apply different “3-tap” separable filters for even and

  • dd pixels to make expanded

image...

Reduce

Apply “5-tap” (1 4 6 4 1)/16 separable filter to make reduced image.

slide-22
SLIDE 22

Apply different “3-tap” separable filters for even and

  • dd pixels to make expanded image.

Odd Even

Coarser Finer

slide-23
SLIDE 23
slide-24
SLIDE 24

L0 L2 L4 Reconstructed

slide-25
SLIDE 25

Applying pyramids to LK

slide-26
SLIDE 26

Reduce Reduce Reduce Reduce

L K L K L K

War p

Warp

War p

x2 Expand x2

Expand Final <u(x,y), v(x,y)>

x2

Expand

slide-27
SLIDE 27

Hierarchical LK

  • 1. Compute Iterative LK at level K
  • 2. Initialize 𝑣𝐿+1, 𝑤𝐿+1 = 0 at size of level K+1
slide-28
SLIDE 28
  • 3. For Each Level i from K to 0
  • Upsample (EXPAND) 𝑣𝑗+1, 𝑤𝑗+1 to create 𝑣𝑗

𝑞, 𝑤𝑗 𝑞 flow

fields of now twice resolution as level i+1

  • Multiply 𝑣𝑗

𝑞, 𝑤𝑗 𝑞 by 2 to get predicted flow

  • Warp level 𝑗 Gaussian version of 𝐽2 according to

predicted flow to create 𝐽2′

slide-29
SLIDE 29
  • 3. For Each Level i from K to 0
  • Apply LK between 𝐽2′ and level 𝑗 Gaussian version of

𝐽1 to get 𝑣𝑗

𝜀, 𝑤𝑗 𝜀 (the correction in flow)

Add corrections to obtain the flow 𝑣𝑗, 𝑤𝑗 at i th level, i.e., 𝑣𝑗 = 𝑣𝑗

𝑞 + 𝑣𝑗 𝜀

𝑤𝑗 = 𝑤𝑗

𝑞 + 𝑤𝑗 𝜀

slide-30
SLIDE 30

*From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Optical Flow Results

slide-31
SLIDE 31

Optical Flow Results

*From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-32
SLIDE 32

Sparse LK

  • The Lucas-Kanade algorithm described gives a

dense field, (𝑣, 𝑤) everywhere.

  • But we said that we only want to solve LK

where the eigenvalues are well behaved.

slide-33
SLIDE 33

Sparse LK

  • “Sparse LK” is basically just that: hierarchical

applied to good feature locaitons.

  • OpenCV LK used to be dense – then became

sparse!

slide-34
SLIDE 34

Start with something similar to Lucas-Kanade

+ gradient constancy + energy minimization with smoothing term

Large displacement optical flow Brox et al., CVPR 2009

+ region matching + keypoint matching (long- range)