Monday, June 22, 2009

ACTIVITY 3 Image Types and Basic Image Enhancement

There are four basic image types: truecolor, grayscale, indexed and binary. Below are examples of each of the image types. We checked the image type by looking at the bit depth in its properties when we right click the image. If the bit depth is 8 and the image is black and white, then it is a grayscale image. If the image has many colors, then it must be an indexed image. For truecolor images, their bit depth would be greater than 8. Moreover, the image is binary if the bit depth is 1.

Figure 1. Truecolor Image
http://home.earthlink.net/~richditch/images/burrowingowl20.jpg


Figure 2. Grayscale Image
http://fourier.eng.hmc.edu/e161/lectures/contrast_transform/node3.html


Figure 3. Indexed Image
http://www.creative-flow.net/tut5.gif


Figure 4. Binary Image
http://en.wikipedia.org/wiki/File:Neighborhood_watch_bw.png

Shown below in Figure 5 is a grayscale image and we want to determine the area of the apple in the image. Looking at the histogram in Figure 6, we can say that our region of interest (ROI) is well separated from its background. Therefore, we can use the programming code generated in activity 2 to calculate the area of the apple. The detailed description of the method can be found in the previous blog. Recall that it uses discrete Green's theorem for computing the area of any enclosed region. Before proceeding, we have to convert first the grayscale image into a binary image (in terms of 1's and 0's only) using the function im2bw(). The threshold value to be used in the conversion must be properly chosen to ensure that only the ROI will be in 1's (white). Looking again at the histogram of the image, we see that or ROI has pixel values ranging from ~150 to ~256. The ratio of this is 0.68, so we used 0.65 as our threshold value. Figure 7 shows the contour traced in the image, which was used in implementing Green's theorem. The area calculated by the program is 2871. We validated it by summing the 1s in the binary image and we got the same result. Therefore, we are successful in calculating the area of the apple. We have also shown in the previous blog that the method we used is accurate to about 1%. And for this, I would give myself a grade of 9. Just 9 because I was super late already in finishing this activity.

Figure 5. Grayscale image

Figure 6. Histogram of the grayscale image.

Figure 7. Contour of our ROI, i.e. apple.


I would like to thank Mr. Luis Buno III and Mr. Miguel Sison for their help..

No comments:

Post a Comment