CAMILO
GALEANO
een537

 

 

Abstract
This project required us to construct a final color image with thirteen images of different wavelengths. This was done by fitting a gaussian curve to each color channel(RGB) with the different lamda(wavelengths) values. After multiplying the original image with its corresponding sensitivity we apply an integration to get the final separate channels. The three channels combined form the final color image.

Introduction
The main goal of this project was to investigate segmentation of images based on color information. We had to use the algorithm proposed by Deng & Manjunath at the University of California at Santa Barbara. This color segmentation had to be implemented to the synthesized image from hyper-spectral satellite data.

Technical Information
To fit the Gaussian function to a set of data I used two functions integrated with Matlab. I first used the inline function, which constructs an inline function with the inputs provided. And then used the lsqcurvefit that solves non-linear least square problems.

Procedure
To begin I download the thirteen images from the internet site www.snapper.eng.miami.edu/dist. This images went from lamda 400 to 700 with an interval of twenty five. I read those images with Matlab and resized them to 512 x 512. With a smaller resolution image the computer works faster. I loaded the spectral sensitivity of the KodakDCS200 color camera. This consisted of the Blue, Green, and Red channel. Also the lamda from 400 to 700 with an interval of twenty.


LMD= [400:20:700];
RGBGreen= [0.0003 0.0004 0.0008 0.0129 0.1056 0.4805 0.9111 0.9673 0.5376 0.1313 0.0170 0.0008 0.0003 0.0002 0.0001 0.0001];
RGBBlue= [ 0.0751 0.3661 0.8320 0.9158 0.4556 0.1364 0.0228 0.0017 0.0004 0.0004 0.0004 0.0003 0.0004 0.0002 0.0002 0.0002];
RGBRed = [ 0.0004 0.0009 0.0009 0.0009 0.0007 0.0006 0.0008 0.0008 0.0023 0.0213 0.2283 0.9581 0.9165 0.3844 0.0658 0.0200];
Spectral Sensitiviy of KodakDSC200 color camera

To determine the Gaussian interpolating functions we had to find a set of coefficients to best fit the given data. We had to find the coefficients Ck of function f to best fit to Yi at Xi, when i= 1…N. To solve this I used the lsqcurvefit function. The lsqcurvefit returned the approximation to the points of the given channel. I plot this approximation for each channel. With the exception of the red channel the other two behaved as expected.


Equation to find the coefficients

The next part of the project consisted of constructing the RGB channels of a color image with the output of the KodakDCS200 camera. For each lamda I used the gaussian function and the ouput of the lsqcurvefit to get hirteen different sentivities. The thirteen sensitivities were multiplied with the thirteen images to produce the color channel. To get the final channel we integrate the function. I used the sum function integrated with matlab to do a Zero Order Integration.

The three channels were then normalized from zero to one and combined to create the final image.


Zero Order Integration formula

The last part of the project was to segment the color image. My UNIX experience made this an easy step because segwin behaved just like a UNIX program. To obtain the program was straight forward, I just download the segwin.zip file from the University of California at Santa Barbara site. In MSDOS prompt, I typed:

> segwin –i final.jpg –t 6 –o final.seg.jpg 0.9

The " -i " flag was the name of the input file. The "-t" told the software the image type, in this case JPG which was number six. And the "-o" was the name of the output file with a threshold of 0.9. The program output was the color image segmented between the different regions. In the results section you can see the final segmented image.

Results

The results of the Gaussian curve where three different plots:


Plot for the Blue Channel


Plot for the Green Channel


Plot for Red Channel. The plot was not like the others (maybe and error in the code)

The plots for the Blue and Green channels were what I expected but the Red channel was different. It had no curve that fit the points. Maybe and error in the code was the cause of it.

Before creating the final image with the three different channels I saved an image of each separate channels. This is how they look:


Blue channel


Green channel


Red channel

This three images looked alike, but I think one was lighter than the other.

This three images combined gave this result:


Final image

This was the final image without been segmented. I showed the image a little bit bigger that the others so it could be more detailed. This image was kind of purple and I think this is not the right result. I guess my red channel was the one who caused this mistake.

The segmented image with the Deng & Manjunath algorith:


Segmented Image

This result was very good. The software worked perfectly, it impressed me.

Conclusion
This project looked more complicated than the ones before, but it wasn't. This project in fact was very interesting but as well confusing. It took me a lot of time to understand the project but at the end I finish it and learned a lot. I had some troubles during the project which I overcomed. The final result was not quite what I expected but the project was finished and that is what counts. Maybe there was error in my coding or in one of the algorithms. I think the appropiate final image would have been more colorful, and easier to distinguish. Overall, the project worked and the main points were resolved.

CODE