Unformatted text preview:

6 098 6 882 Computational Photography 1 Problem Set 2 Assigned Feb 23 2006 Due March 9 2006 Problem 1 Image Histograms Load image mountrainier jpg and use function rgb2gray to convert this RGB image to grayscale Display its histogram Perform histogram equalization You may use MATLAB functions imhist and histeq Now take image winterstorm jpg and transfer its pixel histogram to image mountrainier jpg Please submit the original image transferred image and their histograms side by side Problem 2 Steerable Pyramids 2 1 Warm up Download Simoncelli s steerable pyramid code from http www cns nyu edu eero steerpyr Please make sure that you have read the readme le and add the path matlabPyrTools and matlabPyrTools MEX1 where is the parent directory of the toolbox Try it on an image with k 3 four orientations Load image einstein jpg and set the three highest frequency bands to zero for the horizontal orientation Reconstruct the image and observe the e ect There are two functions you can call from the toolbox namely buildSpyr m constructed in spatial domain and buildSFpyr m constructed in frequency domain The reconstruction of the pyramid obtained by buildSpyr m is not perfect We shall use buildSFpyr m for the sake of better reconstruction The following sample code shows pyramid construction visualization and reconstruction 1 This path is not mandatory If MATLAB reports problems about mex files just do NOT add this path The MATLAB implementation of the functions should be good enough 6 098 6 882 Computational Photography 2 pyr pind buildSFpyr im 3 3 3 levels 4 orientation bands showSpyr pyr pind res reconSFpyr pyr pind imshow res Please do not directly manipulate pyr or pind but use the enclosed function pyrBand and setPyrBand to load and write each subband Display the pyramid of the original image Also display the new pyramid where all the horizontal sub bands are set to be zero and the corresponding reconstructed image 2 2 Coring The goal is now to perform denoising using coring Load einstein jpg Use MATLAB function randn or imnoise to synthesize AWGN additive white Gaussian noise to the original image We are going to denoise it by applying a non linearity to the high frequency bands That is for each coe cient we will apply a function f that lowers the low amplitude coe cients that are assumed to predominantly correspond to noise and preserves the high amplitude coe cients The cuto will depend on the amount of noise which will be an input to your function Rather than implementing a method from the literature we want you to experiment with coring functions Design a non linear functions that take the noise level as a parameter and given a pyramid coe cient removes low amplitude coe cients but keeps high amplitude ones That is design a function f x and apply it to each coe cient x using the variance of the AWGN as Note that this function should be di erent to the subbands at di erent levels You can also decide to take the scale as a parameter This exercise will be graded in part on your di erence with the ground truth Use 3 levels and 3 subbands to build steerable pyramid Compute PSNR Peak Signal to Noise Ratio using the provided function PSNR m higher PSNR indicates better denoising results Please give the PSNR metric and denoised image for 0 05 0 10 and 0 15 Compare your algorithm with Wiener ltering using MATLAB function wiener2 Hint you should be able to outperform wiener2 using wavelet coring but this is not required Display the noise image your denoising result and the result from wiener2 side by side Optional You may also change the number of levels and subbands to see how the performance may change 6 098 6 882 Computational Photography 3 2 3 Multiscale blending 6 882 only Use 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 and apple orange where the left side is apple and the right side is orange Load mask bmp Use Burt and Adelson s method to blend the two images on Laplacian pyramid using the appropriately smoothed and down sampled mask You can imagine that a Gaussian pyramid is built for the mask and the mask at the same level as the Laplacian pyramid is used for blending You may use MATLAB function imfilter and imresize for ltering and downsampling Display the original and new fruits side by side You may use the function buildLpyr 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 pixel and pyramid coe cient histograms on steerable pyramid for a given input texture You can try the texture images in texture zip not necessarily all of them Because they are grayscale textures you do not need to care about color Show the input and synthesized images side by side Show also the histograms from the input and synthesized Do you nd it easy to match histograms Does the histogram matching depend on the input texture Feel free to change the number of pyramid levels number of subbands and number of bins to see how these parameters may e ect the synthesis You only need to hand in the best synthesized results you obtain Problem 3 Matting Given an input image we want to extract a foreground element and the corresponding alpha matte We are given a trimap that coarsely classi es pixels as foreground background and unknown You are going to implement a natural image matting algorithm a simpli ed version of Chuang et al s CVPR 01 paper Section 3 In a nutshell you must characterize the color distribution of the foreground and background pixels and solve for the values of Fg and Bg in a Bayesian framework 6 098 6 882 Computational Photography 4 The algorithm will proceed in two steps 1 gather the color statistics from the foreground and background pixels from the trimap and model them using 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 above Gaussians Load toy jpg and trimap png In the trimap stored in trimap png you can regard intensity value I 0 95 as foreground I 0 05 as background and the rest pixels are the ambiguous area where an alpha value foreground color Fg and background color Bg need to be


View Full Document

MIT 6 098 - Problem Set 2

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 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?