Unformatted text preview:

6.098/6.882 Computational Photography 1Problem Set 3Assigned: March 9, 2006Due: March 23, 2006Problem 1 (Optional) Multiple-Exposure HDR ImagesEven though this problem is optional, we recommend you to go throughthe capturing process and create your own HDR image. This can be done ingroups of up to three people. Please identify your collaborators.Use HDRShop to combine multiple exposures. Get HDRShop fromhttp://gl.ict.usc.edu/HDRShop/. Use v1 (free). For Linux and Mac OS users, youcan download Photoshphere fromhttp://www.anyhere.com/.Calibrate the camera response curveYou need many pictures for this job (e.g. 10 every 1/3 stop).• Use manual mode (M).• Set small aperture.• Vary shutter speed in 1/3 stops, that is, one step at a time (e.g. from1/10 to 1/13 to 1/16 to 20, etc.) Take maybe 10 images from underex-posed to overexposed. Avoid moving the camera when you change theshutter speed. Of course, use the tripod.• Save images on computer and go to HDRShop.• Go to menu Create−>Calibrate camera curve.• Select image sequence (you might need to select them in small groups).• Indicate increment between images (click on 1/3 F-stop).• Click Go.• When the curve looks nice, press stop and save curve.6.098/6.882 Computational Photography 2Use the bracketing mode on the camera to take a sequence of 3picturesFind a scene with high contrast. A good example is a scene with bothindoor and outdoor parts. Check that the scene is too contrasted by takinga picture and checking on the back LCD that part of it is under- or over-exposed.On a Nikon, Press BKT (top left) and rotate the back dial to set it on.Put the top-left dial on ”C” (continuous) so that when you keep the shutterpressed, it takes the series of 3 pictures. On a Canon, you need to go some-where in the menu. Use a remote shutter release to avoid camera shake ifpossible.Assemble a high-dynamic-range image using HDRShop• Create−>Assemble HDR from image sequence.• Load images, indicate increment (e.g. 3 stops).• Change camera response curve (custom curve, Browse to select yournew curve).• Press generate Images.• Play with the view menu, in particular with exposure.• Save as .hdrProblem 2 Tone Mapping Using the Bilateral FilterWe now want to reduce the dynamic range of our image to display it ona low-dynamic range device. For this, you will implement a simplified (read:slow) version of Durand and Dorsey’s 2002 algorithm. This algorithm onlymodifies the luminance of an image: it reduces the contrast of the large-scalevariation of luminance but preserves local detail. For this, it decomposesthe luminance image into a large-scale (a.k.a. base) layer and a detail layerusing the bilateral filter. All computation on luminance is performed in thelog domain.The bilateral filter blurs an image except across strong edges. For eachpixel, the output is a weighted average of the neighboring pixels where the6.098/6.882 Computational Photography 3weight depends on both the spatial distance and the intensity difference:Js=1k(s)p∈Nsexp{−(p − s)22σ2d} exp{−(Ip− Is)22σ2r}Ipwhere k(s) is a normalization termk(s)=p∈Nsexp{−(p − s)22σ2d} exp{−(Ip− Is)22σ2r}.Nsis the neighborhood of s. s and p are both coordinates of image lat-tice. So there are three parameters for bilateral filtering, the half size of theneighborhood w (the neighborhood is (2w +1)× (2w + 1)), spatial standarddeviation σdand range standard deviation σr.Here is the pseudo code of applying bilateral filtering for tone mapping.input intensity= 1/61*(R*20+G*40+B)r=R/(input intensity), g=G/input intensity, B=B/input intensitylog(base)=Bilateral(log(input intensity))log(detail)=log(input intensity)-log(base)compressfactor=log(output range)/(max(log(base))-min(log(base)));log_offset=-max(log(base))*compressfactor;log (output intensity)=log(base)*compressionfactor+log_offset+log(detail)R output = r*exp(log(output intensity)), etc.The main parameter of this code is output range, which depends the amountof remaining large-scale contrast that you want in the output. A value of 10to 30 works well.(a) Write a MATLAB function Im=imbltflt(im,wsize,sigma_d,sigma_r)to implement bilateral filtering. Argument im is the input image. Pa-rameterwsize, sigma_d and sigma_r correspond to w, σdand σrin theabove equations. Try to avoid writing four loops. Two loops (over im-age coordinate) are OK. Load imageeinstein.jpg,addAWGNwithσ =0.05 (as you did in ps2), and apply bilateral filter to denoise thenoise contaminated image. Use parameter w =5,σd=2,σr=0.12.Display the noisy image and denoised image.(b) Load HDR imagevinesunset.hdr using the enclosed MATLAB coderead_rle_rgbe.m (from http://www.cis.rit.edu/mcsl/icam/hdr/). Im-plement tone mapping using Gaussian filtering,fspecial(’gaussian’,21,8),6.098/6.882 Computational Photography 4instead of bilateral filtering. Set output range to be 30. Display theLDR image. Do you see any artifacts?(c) Now replace the Gaussian filter with the bilateral filter. Set the para-meter w =10,σd=8,σr=0.2. Display the LDR image. Do the haloartifacts disappear? Compare the result with (b).(d) (Extra credit) Implement the uncertainty “fix”; implement fast bilat-eral filtering; implement the trilateral filterProblem 3 Poisson Image EditingYour goal is to create a photomontage by pasting an image region ontoa new background using Poisson image editing. Please read P´erez et al’sSIGGRAPH 2003 paper “Poisson Image Editing”. Focus on Section 2 and3.1. Implement the algorithm from Equation (7) to (11).The main task of Poisson image editing is to solve the huge linear systemAx = b in Equation (7). You can explicitly represent A using sparse matrices,and solve it using MATLAB command\. This method should work for theprovided examples, but cannot scale up for big masks. We do not recommendthis approach, though it is fine for you to use it.We recommend conjugate gradient (CG) approach. The basic idea of con-jugate gradient method is that the solution to Ax =b can be represented by aset of vectors, and these vectors are Aorthogonalbetween one and another.It is mandatory that matrix A is positive definite. In energy minimizationproblems A is always semi-positive definite. In our problem matrix A is thesecond-order derivative matrix which is positive definite.There are two reasons that (preconditioned) conjugate gradient method isfavored in image processing/editing• For image processing


View Full Document

MIT 6 098 - Problem Set #3

Download Problem Set #3
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 #3 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 #3 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?