--- In

[hidden email], "mayurmatur" <mayurmatur@...> wrote:

>

> can anyone hint how to start off to write a own code for Histogram

> generation..

>

Given a 8 bit grayscale image stored in a matrix named image

unsigned int imWidth, imHeight, grayLevel;

// initialize the array to zeros

for(unsigned int i = 0; i <= 255; i++)

{

Histogram[i] = 0;

}

// calculate the histogram

for(unsigned int i = 0, j; i < imWidth; i++)

{

for(j = 0; j < imHeight; j++)

{

grayLevel = image[i,j];

Histogram[grayLevel]++;

}

}

Hope this helps,

Regards,

Denny.