CS766---COMPUTER VISION PROJECT 1: HIGH DYNAMIC RANGE IMAGING BY (PRACHI BHADEKAR,BETSY WAYNER) DATE:09/25/2008 BETSY WAYNER: The tonemapping plugin is run on Windows with access to the gil (http://pages.cs.wisc.edu/~cs766-1/projects/hdr/HDR.zip) and FFTW libraries (http://www.fftw.org/download.html) with 3 arguments in the form tonemapping input.hdr output.jpg contrast where a contrast of 50.0 should work pretty well. The algorithm implemented was described in Fredo Durand and Julie Dorsey's Fast Bilateral Filtering for the Display of High Dynamic Range Images paper (http://pages.cs.wisc.edu/~cs766-1/projects/hdr/DurandBilateral.pdf) The basic algorithm follows: 1. An RGBA HDR image was loaded 2. The log of it's intensity was computed 3. That was filtered with a bilateral filter 4. The details were recovered from the difference between filtered intensity and the original intensity 5. A new intensity map was created from the filtered intensity and the details biased by gamma 6. The colors were recomposited 7. The image was saved as a jpg Other information on the algorithm can be found in the comment header of the tonemapping.cpp file. Betsy learned about the limitations of cameras, even digital cameras, and the limitations of general output devices, like moniters. She learned why skies very frequently get blown out in images and a possible way to remedy that. She did learn, however, just how much of a hassle that way is. She also learned what SVD was and some syntax for Matlab, as well as being introduced to a number of photo-manipulating programs that she may utilize in the future outside of classwork. Photomatix is actually pretty cool. She learned more of her way around her brand-new digital camera, though that made her miss her Nikon a bit. It's at home. Her dad still insists it belongs to him, despite clearly having given it to her during high school. Overall, she thought this was a very interesting and informative project and a topic she may want to experiment with in the future. As soon as she gets her own tripod. PRACHI BHADEKAR: Firstly,images with varying exposures are captured,by varing the shutter speed(dT) of the digital camera.This varies the exopsure(which is dE*dT),where DE are the irradiance values of the scene being captured. We used Photomatrix to create the aligned images.The aligned images were input to the algorithm implemented in MATLAB.Ideally,more than 10 pictures should be taken.I tried running the code using the images provided on the project website,which were ideal for testing purposes.I got to learn some new MATLAB sysntax and commands like hdrread,tonemap. I tried implementing it in mATLAB.The code I wrote uses the following algorithm: 1. Read the input images. 2. Re-size them to get a very small matrix for each of them,which can be used to solve the overdetermined system.If we are having aroung 12 images,then 50 pixels from each picture are sufficient to solve the system. 3. Calculate N=no. of pixels chosen from the image,and P=no.of pictures. 4. Since,the input images are colored,we need to seperate them into 3 color planes,and process each color channel seperately. 5. I prefered hdr creation using the Debevec's algorithm.The linear system we get is Ax=B.,which is solved by SVD i.e. singular value decomposition. 6. Running this algorith om each channel gives us the response function(f) and radiance map(e) for each channel. 7. This is input to the gil library using VC++ code.This is used to return the hdr image generated in .hdr format. 8. This image is read in MATLAB using 'hdrread' command.The hdr image is then tone-mapped using either a tonemap command in MATLAB or the tone mapping algorithm Betsy tried to implement. 9. The tone mapped hdr image can then be displayed on the monitor screen,since the pixel values are now converted to the display range. 10.The dispalyed hdr image is very sharp and contains a lot of detail in it,which we can clearly see. HDR image creation has applications in image rendering,image processing,graphics,animation, and even biomedical signal processing etc.The Debevec's algorithm for HDR image creation combines images of the same scene taken under different exposures,and uses a no. of pixels(around 50 minimum) from the aligned images(aligned so that each pixel position corresponds to the same scene elemnet) to solve the objective function given in his paper.This linear equation system is solved by using SVD.It was a new method of solving equations which I learnt.I did not try much with the images and the code results to determine what the appropriate value of lambda(smoothness constant in the objective function) should be.So,I have assumed it to be 1.The weighting function wij gives importance to the pixels in the middle ranmge of the display,and suppresses very low and very high values.The response function of the camera is the plot of pixel values(Z) Vs. the exposure values(dE*dT).It is non-linerar and monotonically increasing. I also studied Ward's MTB(median threshold bitmap) for image alignment,but did not get time to implement it in program.This technique converts the input image to a grayscale image first.Then,the median value of all the pixels in the image is found out,and the grayscale image is thresholded to B&W using the median as threshold.The (x_offset,y_offset) of the second image is calculted in this algorithm with respect to the first image,which gives us the image alignment offset.MTB is invariant with the exposures for the same scene.Also,it reacts less to the noise in the image,which is due to the pixel values near the median value. I also installed and played with different softwares available on the internet for image alignment,hdr creation and tone mapping.It was very interesting. A note - the original images were taken on Betsy's Canon PowerShot A470 (which is a hassle to get consistently varying shutter speeds on,) the aligned images were created in Photomatix, as were the originalHDR1.hdr, originalHDR2.hdr, and originalHDR2mapped.jpg files. The mappedhdr1.hdr, hdrshopHDR2mapped.hdr and hdrshopHDR2mapped.jpg were created in HDRShop.