330 likes | 524 Views
Recall: Gaussian smoothing/sampling. G 1/8. G 1/4. Gaussian 1/2. Solution: filter the image, then subsample Filter size should double for each ½ size reduction. Subsampling with Gaussian smoothing. Gaussian 1/2. G 1/4. G 1/8. Image Pyramids.
E N D
Recall: Gaussian smoothing/sampling G 1/8 G 1/4 Gaussian 1/2 • Solution: filter the image, then subsample • Filter size should double for each ½ size reduction.
Subsampling with Gaussian smoothing Gaussian 1/2 G 1/4 G 1/8
Image Pyramids • Known as a Gaussian Pyramid [Burt and Adelson, 1983] • In computer graphics, a mip map [Williams, 1983] • A precursor to wavelet transform
Texture: consists of multiple size scales Original • Learn the statistics of texture to recognize it • Synthesize texture based on learned model Synthesis
A bar in the big images is a hair on the zebra’s nose; in smaller images, a stripe; in the smallest, the animal’s nose Figure from David Forsyth
Gaussian pyramid construction filter mask • Repeat • Filter • Subsample • Until minimum resolution reached • can specify desired number of levels (e.g., 3-level pyramid) • The whole pyramid is only 4/3 the size of the original image!
What does blurring take away? (recall) smoothed (5x5 Gaussian)
Boundaries! smoothed – original
Band-pass filtering • Laplacian Pyramid (subband images) • Created from Gaussian pyramid by subtraction Gaussian Pyramid
Gaussian Pyramid Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth
Laplacian Pyramid Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth
Gaussian Pyramid Laplacian Pyramid
Applications • Compression • Set “most” coefficients in Laplacian pyramid to zero • Hide secret messages in images (eg, to check youtube plagiarism) • Image Restoration • Image Blending
0 1 0 1 0 1 Application: Pyramid Blending Left pyramid blend Right pyramid
Image Blending Juxtaposition: too abrupt
+ = 1 0 1 0 Feathering Ileft Iright right left Encoding transparency I(x,y) = (aR, aG, aB, a) Iblend = left Ileft + right Iright
0 1 0 1 Affect of Window Size left right Blending window too big (compared to typical detail size) transparency, “ghosts”
0 1 0 1 Affect of Window Size Blending window too small (compared to typical detail size) transition too abrupt
Problem and solution • Problem: Usually details of many different sizes! No single size of blending window works. • Solution Laplacian Pyramid separate images into levels. Each level has details of single size range. Blend corresponding levels for the two images using windows sized to match level
0 1 Good Window Size “Optimal” Window: smooth but not ghosted Burt and Adelson (83): Choose by pyramids…
Laplacian Pyramid: Blending • General Approach: • Build Laplacian pyramids LA and LB from images A and B • Build a Gaussian pyramid GR from selected region R (black white corresponding images) • Form a combined pyramid LS from LA and LB using nodes of GR as weights: • LS(i,j) = GR(I,j,)*LA(I,j) + (1-GR(I,j))*LB(I,j) • Collapse the LS pyramid to get the final blended image
laplacian level 4 laplacian level 2 laplacian level 0 left pyramid right pyramid blended pyramid
Constructing the Laplacian Pyramid • Worked out in class. To be posted later.