image restoration and realism millions of images seminar yuval rado

53
IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

Upload: grant-johnston

Post on 17-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

IMAGE RESTORATION AND REALISMMILLIONS OF IMAGES SEMINAR

YUVAL RADO

Page 2: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

2

IMAGE REALISM

•What is CG images?

•How can we tell the difference?

Page 3: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

3

TODAY’S TOPICS

• Super – Resolution

• What is it?

• How it’s done?

• Algorithm.

• Results.

• CG2REAL

• The idea behind.

• Cosegmatation.

• Color & texture transfer.

• Results.

Page 4: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

4

SUPER – RESOLUTION

• Methods for achieving high-resolution enlargements of pixel-based images.

• Estimating missing high-resolution detail that isn’t present in the original image, and which we can’t make visible by simple sharpening.

Page 5: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

5

HOW IT’S DONE?

• Using learning based approach for enlarging images.

• In a training set, the algorithm learns the fine details that correspond to different image regions seen at a low-resolution and then uses those learned relationships to predict fine details in other images.

Page 6: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

6

TRAINING SET GENERATION

Low resolution image

High resolution imageLow resolution enlargement via bilinear interpolation

High resolution high pass filter & contrast normalization

Low resolution high pass filter & contrast normalization

Page 7: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

7

LOW RESOLUTION – HIGH RESOLUTION PROBLEM

Input Patch

Closest image patches from

database

Corresponding high-resolution patches from

database

Page 8: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

8

HOW CAN WE SOLVE THIS?

• Markov Network

𝑃 (𝑋|𝑌 )= 1𝑍∏

(𝑖𝑗 )Ψ 𝑖𝑗 (𝑥 𝑖 ,𝑥 𝑗 )∏

(𝑖 )Φ𝑖 (𝑥 𝑖 , 𝑦 𝑖 ) Ψ 𝑖𝑗 (𝑥 𝑖 , 𝑥 𝑗 )=exp (− 𝑑𝑖𝑗 (𝑥 𝑖 ,𝑥 𝑗 )

2𝜎2 )

Problem: very long time to calculate, not practical.

Page 9: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

9

THE BELIEF PROPAGATION

• Not giving exact results as the Markov Network, but much faster!

• Still gives good results.

• Only three or for iterations of the algorithm is enough for getting the results we need.

Page 10: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

10

THE BELIEF PROPAGATION – CONT.

• Let be the message from node to node .

• The message contains the vectors of dimensionality of the state we estimate at node .

• is the part of the corresponds to high resolution patch .

• The rule of updating is:

• The marginal probability for each high resolution patch at node is:

Page 11: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

11

FASTEST METHOD – ONE PASS ALGORITHM

• Based on the belief propagation, there is a faster algorithm that calculates only the high resolution patch compatibilities of neighboring high resolution patches that are already selected, typically the patches above and to the left, in raster-scan order processing.

• One pass super resolution generates the missing high-frequency content of a zoomed image as a sequence of predictions from local image information.

Page 12: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

12

ONE PASS ALGORITHM – DIAGRAM

Page 13: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

13

RESULTS

• The training set pictures:

Page 14: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

14

RESULTS – CONT.

Original Image Cubic spline One pass algorithm

Page 15: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

15

RESULTS – CONT.

Cubic splineOriginal Image One pass algorithm

Page 16: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

16

RESULTS – CONT.

Page 17: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

17

RESULTS – TRAINING SET DEPENDENCY

Training set example Input image One pass algorithm

Page 18: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

18

RESULTS – FAILURE EXAMPLE

Original Image Cubic spline One pass algorithm

Page 19: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

19

CG2REAL

• Improving the Realism of Computer Generated Images using a large Collection of Photographs.

Computer Generated CG2REAL

Page 20: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

20

THE IDEA BEHIND?

• Use Computer Generated image as an input.

• Look in real photo collection for similar images.

• Mark the corresponding area in the CG image.

• Transfer the color and texture from the real image to the CG image.

• Smooth the edges.

Page 21: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

21

THE PROCESS

Page 22: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

22

FINDING SIMILAR IMAGES

• Ordering the images in pyramid.

• The key of the pyramid is a combination of two features:

• The SIFT features of each image.

• The color in each feature.

Page 23: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

23

FINDING SIFT FEATURES

1. Scale Space extrema detectiona) Construct Scale Space

b) Take Difference of Gaussians

c) Locate DoG Extrema

2. Key point localization

3. Orientation assignment

4. Build Key point Descriptors

Page 24: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

24

COSEGMATATION

• Segmenting the images from the database and the input CG image.

• Matching similar regions in all images.

• All in one step!

Page 25: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

25

COSEGMATATION – CONT.

• For each pixel we define a feature vector which is the concatenation of:

• The pixel color in L*a*b* space.

• the normalized and coordinates at .

• A binary indicator vector such that is when pixel is in the image and otherwise.

Page 26: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

26

COSEGMATATION – CONT.

• The distance between feature vectors at pixels and in images and is a weighted Euclidean distance:

• is the L*a*b* color distance between pixel in image and pixel in image .

• is spatial distance between pixels and .

• The delta function encodes the distance between the binary components of the feature vector.

Page 27: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

27

COSEGMATATION – RESULTS

Page 28: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

28

TEXTURE TRANSFER

• Done locally, by the results of the Cosegmatation.

• Rely on the similar photographs we retrieved from the database to provide us with a set of textures to help upgrade the realism of the CG image.

• Limitations: Can’t reuse the same region many times because this often leads to visual artifacts in the form of repeated regions.

• The idea behind: We align multiple shifted copies of each real image to the different regions of the CG image and transfer textures using graph-cut.

Page 29: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

29

TEXTURE TRANSFER – CONT.

• For each cosegmented part of the picture, we use cross correlation of edge maps (magnitudes of gradients) to find the real image, and the optimal shift, that best matches the CG image for that particular region.

• We repeat the process in a greedy manner until all regions in the CG image are completely covered.

• To reduce repeated textures, we only allow up to shifted copies of an image to be used for texture transfer (typically ).

• Now each pixel contains up to labels.

Page 30: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

30

TEXTURE TRANSFER – CONT.

• For each pixel we use the label assignment function to choose which label we apply in that pixel.

• The label assignment function:

Page 31: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

31

TEXTURE TRANSFER – CONT.

• is a data penalty term that measures distance between a patch around pixel in the CG image and a real image.

• is the average distance in L*a*b* space between the patch centered around pixel in the CG image and the patch centered around pixel in the image associated with label .

• is the average distance between the magnitudes of the gradients of the patches.

controls the error of transferring textures between different cosegmentation regions.

• and are normalized weights.

𝐶 (𝐿 )=∑𝑝

𝐶𝑑 (𝑝 ,𝐿 (𝑃 ) )+∑𝑝 ,𝑞

𝐶𝑖 (𝑝 ,𝑞 ,𝐿 (𝑝 ) ,𝐿 (𝑞) )

Page 32: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

32

TEXTURE TRANSFER – CONT.

• is an interaction term between two pixels and and their labels.

• M(p) is near strong edges in the CG image and near in smooth regions.

• affects the amount of texture switching that can occur. For low values of , the algorithm will prefer small patches of textures from many images and for high values of the algorithm will choose large blocks of texture from the same image.

𝐶 (𝐿 )=∑𝑝

𝐶𝑑 (𝑝 ,𝐿 (𝑃 ) )+∑𝑝 ,𝑞

𝐶𝑖 (𝑝 ,𝑞 ,𝐿 (𝑝 ) ,𝐿 (𝑞) )

Page 33: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

33

TEXTURE TRANSFER – CONT.

• After we choose the right label assignment using the function we described earlier we transfer the texture and smooth it nicely to the CG image via Poisson blending.

Page 34: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

34

COLOR TRANSFER

•Has two approaches:

•Color histogram matching.

• Local color transfer.

Page 35: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

35

COLOR HISTOGRAM MATCHING

• Works well between real images.

• Typically fails when used In matching CG images and real images.

• This happens because the histogram of CG images is very different the histogram of real. Due to less colors used in CG imaginary.

• This leads to instability in global color transfer.

Page 36: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

36

COLOR HISTOGRAM MATCHINGCG input Global histogram matching

Page 37: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

37

LOCAL COLOR TRANSFER

•How it’s done?

• Down sampling of the images.

• Computation of the color transfer offsets per region from the lower resolution images.

• smoothing and up sampling the offsets using joint bilateral up sampling.

Page 38: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

38

LOCAL COLOR TRANSFER - ALGORITHM

• In each subsampled region that we have we match two histograms:

• 1D histogram matching on the L* channel.

• 2D histogram matching on the a* and b* channels.

• Great results obtained after no more than 10 iterations of this algorithm.

Page 39: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

39

LOCAL COLOR TRANSFER - RESULTS

CG input Color model Local color transfer

Page 40: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

40

TONE TRANSFER

•Decompose the luminance channel of the CG image and one or more real images using a QMF pyramid (QMF - quadrature mirror filter).

•We apply 1D histogram matching to match the subband statistics of the CG image to the real images in every region.

Page 41: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

41

TONE TRANSFER – CONT.

• Now we model the effect of the histogram matching as a change in gain:

• is the level subband coefficient at pixel .

• is the corresponding subband coefficient after regional histogram matching

• is the gain, when it’s greater than 1 it’s amplifies the details in the subband. When it’s less than 1 it will diminish those details.

• lower subbands are not amplified beyond higher subbands and that the gain signals are smooth near zero crossings.

Page 42: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

42

TONE TRANSFER – RESULTS

CG input Tone modelLocal color an tone transfer

Close up before

Close up after

Page 43: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

43

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 44: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

44

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 45: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

45

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 46: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

46

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 47: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

47

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 48: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

48

CG2REAL – RESULTS

CG Image

CG2REAL Image

Page 49: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

49

CG2REAL – FAILURES

Page 50: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

50

CG2REAL – EVALUATION

Page 51: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

51

CG2REAL – EVALUATION

Page 52: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

52

THANK YOU FOR LISTENING

Page 53: IMAGE RESTORATION AND REALISM MILLIONS OF IMAGES SEMINAR YUVAL RADO

53

REFERENCES

• William T. Freeman, Thouis R. Jones, and Egon C. PasztorIEEE Computer Graphics and Applications 2002, Example-Based Super-Resolution.

• Johnson MK, Dale K, Avidan S, Pfister H, Freeman WT, Matusik W, CG2Real: Improving the Realism of Computer Generated Images using a Large Collection of Photographs.

• http://en.wikipedia.org/wiki/Superresolution