Tuesday, November 11, 2014

progress report

Jerry Dault
Joshua Saganski
Samuel Wilson
Maxine Xiu
EECS 451 Project Progress Report
  1. Introduction
Our goal is to imitate the environment of sample photos through comparing hue, saturation, and brightness of them with those of the target photos and thus, we may scale our target photos in Red, Green, and Blue (RGB) values or Hue, Saturation and Value (HSV) values to make them look more like they were taken in the sample environment that we desire. The idea came from our dissatisfaction of photos due to uncontrollable natural lightings and limitation of image-forming devices. In this project, we use MATLAB to access photo data in RGB and HSV scale, and manipulate data by applying Fast Fourier Transform.
  1. Data processing approaches and Plots
  1. RGB scale
In the following two sets, we imported the target photos (cloudy beach in Fig.1 and sunny beach during the day in Fig.2) and the sample photos (dessert in Fig.1 and beach at night in Fig.2) photo as RGB data stored as matrices. Then we calculated the average value of each color, divided the average of the sample by the average of the target to obtain RGB gains, and multiply the gains to the corresponding colors of the target data. The first result photo is brighter and more yellow, desert-like and the second result photo is more colorful and dimmer, more night-like.
Figure 1
Figure 2
  1. FFT
For this transformation we import the two pictures as hsv images, then transform them into the frequency domain and get a transfer function that relates the values of the initial picture to the values of the final picture. Upon applying this to the original image we get a third image that is similar to the final image, but with a large amount of noise.





  1. Progress and Difficulties
We have tried a few drastically varying methods to transform an images lighting environment with a mixed amount of success. Our two most successful algorithms are defined above, but on top of these we have also tried convolving entire images with each other, decomposing images into their respective rgb layers and averaging or convolving those layers, creating kernels that we can convolve images with, and transforming the images to grayscale and using the black and white image to find transfer functions.

We have had some difficulties with data representation in matlab. For example, we had trouble in displaying the inverse fourier transform of our data, which we later found out was due to the fact that we need to typecast the ifft to the uint8 format for the imshow command to work properly. The fourier transform of images does not work quite as intuitively for images as it does for audio files, as shown by the grainy image above.

  1. Things that We Have Learned

Through our experiments we have learned a lot about how images can be represented in matlab. We have worked with rgb, hsv, and grayscale format to determine which form is easiest to work with and which ones lead to the best results. We have also learned about 3 dimensional matrix representation in matlab and how we need to manipulate them to be able to use some standard matlab functions without error.