>> how to calculate the histogram (HSV nad RGB)
Calculating the histogram is relatively straightforward. For each color component (for example R, G and B), you keep a separate histogram. A histogram consists of a counter for each of the possible values of that color component (for example 256 counters, one for each of the values 0 through 255).
Then you just go through all the pixels in the image, extract the separate components (for example R, G and B), and increment the appropriate counter by 1 for each of the components.
When you've processed the whole image, you have 3 histograms, one for each of the color components.
Main Topics
Browse All Topics





by: pgnatyukPosted on 2009-07-19 at 20:40:53ID: 24892306
If you can draw this image - you already have the RGB. The image, if it's ready to be drawn on the screen, it is the DIB section that has the bitarray - this is RGB. In worst case you can use GetPixel.
But here is another way (HSV->RGB): http://www.nunosantos.net/ ?p=114
Here is RGB->HSV: http://www.deadbeef.com/in dex.php/co nverting_r gb_to_hsv_ in_c
or here: http://www.programmersheav en.com/dow nload/1521 8/download .aspx
Here is the theory: http://en.wikipedia.org/wi ki/HSL_and _HSV