This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Programming Using C Homework 6 1. In this problem we will extend the histogram introduced in previous home- works to a three dimensional histogram and apply it to compute the his- togram of a color image. An image is represented on a computer essentially as a matrix in which each element has three values representing the intensity of three compo- nent colors whose combination makes the color of the pixel: red, green and blue. Each value is between 0 and 255, in other words, a byte or an unsigned character. Since in computers quantities are preferred if they are powers of 2, another value, called the alpha channel, is stored next to the three color components and it is sometimes used for image blending, but we will not use it in computing the histogram. A histogram of a color image is a three dimensional array H , in which H [ i ][ j ][ k ] is a bin which counts the number of pixels whose red component has value i , the green component has value j and the blue component has value k . In the same way as we did with the unidimensional histogram, we can make the 3D histogram more general by assigning a range of values to one bin, instead of having just one value per bin. For example, if the number of bins per each component color is 4, the range for each component color has 64 values, so that H  is a counter of how...
View Full Document
This note was uploaded on 01/14/2012 for the course CGS 3460 taught by Professor Staff during the Summer '08 term at University of Florida.
- Summer '08