43
Computer Vision for Visual Effects CVFX 2015

Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Computer Vision for Visual Effects

CVFX 2015

Page 2: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

2

Today's Plan

› Object Removal by Exemplar-Based Inpainting › Criminisi et al. › CVPR 2003

› Online Dictionary Learning for Sparse Coding

› Mairal et al. › ICML 2009

Page 3: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

3

Inpainting

Page 4: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

4

Photo Restoration

Page 5: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

5

Object Removal

Page 6: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

6

Automatic Digital Inpainting

[Bertalmio et al.]

Page 7: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

7

Automatic Digital Inpainting

[Bertalmio et al.]

Page 8: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

8

Page 9: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

9

The Algorithm of Bertalmio et al. › Imitating professionals › Propagation of information

› Smoothness

introduces blur in large regions

isophotes: lines of equal gray values

(Laplacian)

Page 10: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

10

Exemplar-Based Texture Synthesis

› To replicate both texture and structure

› Special attention to linear structures › Dependent on the order in which the filling proceeds › Propagation of confidence

Page 11: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

11

Isophote-Driven Image Sampling

› Find the best-match source patch › Isophote orientation is automatically preserved

Page 12: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

12

Region-Filling Algorithm

› Window size: 9x9 pixels › Greater than the largest texel or the thickest structure

› Encouraging propagation of linear structure together with texture

Page 13: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

13

Computing Patch Priorities

› Best-first › Patches which are on the continuation of strong

edges and which are surrounded by high-confidence pixels

priority = confidence term * data term

Page 14: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

14

Confidence Term

: patch

: area of

amount of reliable information surrounding the pixel p

Page 15: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

15

Intuition › "Patches that include corners and thin tendrils of the

target region will tend to be filled first, as they are surrounded by more pixels from the original image. These patches provide more reliable information against which to match. Conversely, patches at the tip of 'peninsulas' of filled pixels jutting into the target region will tend to be set aside until more of the surrounding pixels are filled in."

Page 16: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

16

Data Term

: unit vector orthogonal to the front

strength of isophotes hitting the front

Page 17: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

17

Balance between the Confidence and Data Terms

› "The data term tends to push isophotes rapidly inward, while the confidence term tends to suppress precisely this sort of incursion into the target region. As presented in the results section, this balance is handled gracefully via the mechanism of a single priority computation for all patches on the fill front."

Page 18: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

18

Initialization

Page 19: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

19

Computing Patch Priorities

› Best-first › Patches which are on the continuation of strong

edges and which are surrounded by high-confidence pixels

priority = confidence term * data term

Page 20: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

20

Propagating Texture and Structure Information

› Search in the source region for the patch most similar to

› Distance between two patches: sum of squared difference (SSD)

› CIE Lab color space

› Copy the value of each pixel-to-be-filled in from its corresponding position in › Patch-based, fast

Page 21: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

21

Updating Confidence Values

› As filling proceeds, confidence values decay › Less sure of the values of pixels near the center of the

target region

Page 22: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

22

Region Filling Algorithm

Page 23: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

23

Results

Page 24: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

24

Results

Page 25: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

25

Questions?

Page 26: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

26

Summary

› A fast method to replicate both texture and structure

› Filling the region in a right ordering linear structure preserved

› Priority = confidence term * data term

Page 27: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Further Reading

› Image Completion Using Planar Structure Guidance › Jia-Bin Huang

27

Page 28: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Sparse Representation for Color Image Restoration

› J. Mairal, M. Elad, and G. Sapiro. › IEEE Transactions on Image Processing. volume 17,

issue 1, January 2008, pages 53-69. › Online Dictionary Learning for Sparse Coding

» J. Mairal, F. Bach, J. Ponce, and G. Sapiro » ICML 2009

28

Page 29: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Principal Component Analysis (PCA)

29

Page 30: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Sparse Representation

› Dictionary learning

30

Page 31: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

L1 Norm? Sparse?

31

L2 norm L1 norm Lp norm, p<1

w1

w2

w1

w2

w1

w2

zero norm?

Page 32: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Higher Dimension

32

Page 33: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Online Dictionary Learning

33

Page 34: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

[Mairal, Elad, and Sapiro., 2008]

34

Page 35: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

[Mairal, Elad, and Sapiro., 2008]

35

Page 36: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Inpainting a 12M-pixel Image

36

[Mairal et al.]

Page 37: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Inpainting a 12M-pixel Image

37

[Mairal et al.]

Page 38: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Inpainting a 12M-pixel Image

38

[Mairal et al.]

Page 39: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Inpainting a 12M-pixel Image

39

[Mairal et al.]

Page 40: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

Conclusion

› Sparse coding, sparse representation › ICCV tutorial on sparse coding and dictionary

learning for image processing http://lear.inrialpes.fr/people/mairal/tutorial_iccv09/

› Compressive sensing http://dsp.rice.edu/cs

40

Page 41: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

41

Page 42: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

42

Goal of This Course

› Literature survey › How to solve interesting image problems › Learn mathematical modeling techniques › Come up with new ideas and find new applications

› Hands-on experience › 10+ Assignments

› Doing research › Term project

read think try create

Page 43: Computer Vision for Visual Effectsocw.nthu.edu.tw/ocw/upload/125/news/...Inpainting.pdf · › Object Removal by Exemplar-Based Inpainting › Criminisi et al. ... Region-Filling

43

Related Topics › Optimization

› Maximizing joint/conditional probabilities › Minimizing cost/error functions

› Image representations

› Markov random fields › Vector fields

› Math

› Linear algebra, numerical methods, probability