Unformatted text preview:

6.098/6.882 Computational Photography 1Problem Set 2Assigned: Feb 23, 2006Due: March 9, 2006Problem 1 Image HistogramsLoad image mountrainier.jpg and use function rgb2gray to convert thisRGB image to grayscale. Display its histogram. Perform histogram equal-ization. You may use MATLAB functions imhist and histeq.Now take image winterstorm.jpg and transfer its pixel histogram to im-age mountrainier.jpg.Please submit the original image, transferred image, and their histogramsside by side.Problem 2 Steerable Pyramids2.1 Warm upDownload Simoncelli’s steerable pyramid code from http://www.cns.nyu.edu/~eero/steerpyr/. Please make sure that you have read the readme fileand add the path../matlabPyrTools and ../matlabPyrTools/MEX1where ..is the parent directory of the toolbox. Try it on an image with k=3 (fourorientations). Load imageeinstein.jpg and set the three highest frequencybands to zero for the horizontal orientation. Reconstruct the image andobserve the effect.There are two functions you can call from the toolbox, namelybuildSpyr.mconstructed in spatial domain, and buildSFpyr.m constructed in frequencydomain. The reconstruction of the pyramid obtained bybuildSpyr.m is notperfect. We shall usebuildSFpyr.m for the sake of better reconstruction.The following sample code shows pyramid construction, visualization andreconstruction:1This path is not mandatory. If MATLAB reports problems about mex files just doNOT add this path. The MATLAB implementation of the functions should be goodenough.6.098/6.882 Computational Photography 2[pyr,pind] = buildSFpyr(im,3,3); % 3 levels, 4 orientation bandsshowSpyr(pyr,pind);res = reconSFpyr(pyr,pind);imshow(res);Please do not directly manipulate pyr or pind, but use the enclosed func-tionpyrBand and setPyrBand to load and write each subband.Display the pyramid of the original image. Also display the new pyramidwhere all the horizontal sub-bands are set to be zero, and the correspondingreconstructed image.2.2 CoringThe goal is now to perform denoising using coring. Load einstein.jpg.Use MATLAB functionrandn or imnoise to synthesize AWGN (additivewhite Gaussian noise) to the original image. We are going to denoise itby applying a non-linearity to the high-frequency bands. That is, for eachcoefficient we will apply a function f that lowers the low-amplitude coefficients(that are assumed to predominantly correspond to noise) and preserves thehigh-amplitude coefficients. The cutoff will depend on the amount of noise,which will be an input to your function. Rather than implementing a methodfrom the literature, we want you to experiment with coring functions. De-sign a non-linear functions that take the noise level as a parameter, and,given a pyramid coefficient, removes low-amplitude coefficients but keepshigh-amplitude ones. That is, design a function f (x; σ) and apply it to eachcoefficient x using the variance of the AWGN as σ. Note that this functionshould be different to the subbands at different levels. You can also decideto take the scale as a parameter. This exercise will be graded in part on yourdifference with the ground truth.Use 3 levels and 3 subbands to build steerable pyramid. Compute PSNR(Peak Signal-to-Noise Ratio) using the provided functionPSNR.m (higherPSNR indicates better denoising results). Please give the PSNR metric anddenoised image for σ =0.05, 0.10 and 0.15. Compare your algorithm withWiener filtering, using MATLAB functionwiener2. Hint: you should be ableto outperformwiener2 using wavelet coring, but this is not required. Displaythe noise image, your denoising result, and the result fromwiener2 side byside. (Optional) You may also change the number of levels and subbands tosee how the performance may change.6.098/6.882 Computational Photography 32.3 Multiscale blending – 6.882 onlyUse the provided orange.jpg and apple.jpg to generate two “new” fruits:orange-apple, where the left side is orange and the right side is apple, andapple-orange, where the left side is apple and the right side is orange. Loadmask.bmp. Use Burt and Adelson’s method to blend the two images on Lapla-cian pyramid using the appropriately smoothed and down-sampled mask.You can imagine that a Gaussian pyramid is built for the mask and themask at the same level as the Laplacian pyramid is used for blending. Youmay use MATLAB functionimfilter and imresize for filtering and down-sampling. Display the original and “new” fruits side by side. You may usethe functionbuildLpyr and reconLpyr in the toolbox.(Extra credit) Create a fun photomontage based on this principle, (e.g.eye in the hand in the original Burt and Adelson paper).2.4 Heeger and Bergen (Extra credit)Implement the pyramid texture synthesis by Heeger and Bergen [1995].Write a MATLAB function to synthesize a new texture by matching the pixeland pyramid coefficient histograms on steerable pyramid for a given inputtexture. You can try the texture images intexture.zip (not necessarily allof them). Because they are grayscale textures you do not need to care aboutcolor. Show the input and synthesized images side by side. Show also thehistograms from the input and synthesized. Do you find it easy to matchhistograms? Does the histogram matching depend on the input texture?Feel free to change the number of pyramid levels, number of subbands, andnumber of bins to see how these parameters may effect the synthesis. Youonly need to hand in the best synthesized results you obtain.Problem 3 MattingGiven an input image, we want to extract a foreground element and thecorresponding alpha matte. We are given a trimap that coarsely classifiespixels as foreground, background, and unknown. You are going to implementa natural image matting algorithm, a simplified version of Chuang et al’sCVPR’01 paper (Section 3). In a nutshell, you must characterize the colordistribution of the foreground and background pixels and solve for the valuesof α, Fgand Bgin a Bayesian framework.6.098/6.882 Computational Photography 4The algorithm will proceed in two steps: 1. gather the color statisticsfrom the foreground and background pixels from the trimap and model themusing Gaussians in RGB space. 2. For each pixel in the unknown region,compute the foreground and background color as well as the alpha. For this,we will solve an MAP (maximum a posteriori) problem based on the aboveGaussians.Loadtoy.jpg and trimap.png. In the trimap, stored in trimap.png,youcan regard intensity value I>0.95 as foreground,


View Full Document

MIT 6 098 - Problem Set 2

Download Problem Set 2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Problem Set 2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Problem Set 2 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?