Recall: Gaussian smoothing/sampling G 1/4 G 1/8 Gaussian 1/2 Solution: filter the image, then subsample Filter size should double for each ½ size reduction.
Subsampling with Gaussian smoothing G 1/4G 1/8Gaussian 1/2
Image Pyramids Known as a Gaussian Pyramid [Burt and Adelson, 1983] In computer graphics, a mip map [Williams, 1983] A precursor to wavelet transform
Motivations
Boundaries occur at different scales
Texture: consists of multiple size scales Synthesis Learn the statistics of texture to recognize it Synthesize texture based on learned model Original
Example: Image Blending
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) original
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
Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth Gaussian Pyramid
Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth Laplacian Pyramid
Laplacian Pyramid Gaussian 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
Application: Pyramid Blending Left pyramidRight pyramidblend
Image Blending Juxtaposition: too abrupt
Feathering = Encoding transparency I(x,y) = ( R, G, B, ) I blend = left I left + right I right I left I right left right
Affect of Window Size 0 1 left right 0 1 Blending window too big (compared to typical detail size) transparency, “ghosts”
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
Good Window Size 0 1 “Optimal” Window: smooth but not ghosted Burt and Adelson (83): Choose by pyramids…
Pyramid Blending
Pyramid Blending (Color)
Laplacian Pyramid: Blending General Approach: 1.Build Laplacian pyramids LA and LB from images A and B 2.Build a Gaussian pyramid GR from selected region R (black white corresponding images) 3.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) 4.Collapse the LS pyramid to get the final blended image
laplacian level 4 laplacian level 2 laplacian level 0 left pyramidright pyramidblended pyramid
Blending Regions
Constructing the Laplacian Pyramid Worked out in class. To be posted later.