killaz4life
asked on
Histogram equalization
Hi there,
I have been having alot of trouble trying to make the histogramn equalization work in c++ and this laplacian smoothing is not working at all with me.
My program only enhances gray scale currently so im not involved with any rgb being stored and I am sending to my functions the array image2D[row][col] that contains the pixel values.
Thankyou
I have been having alot of trouble trying to make the histogramn equalization work in c++ and this laplacian smoothing is not working at all with me.
My program only enhances gray scale currently so im not involved with any rgb being stored and I am sending to my functions the array image2D[row][col] that contains the pixel values.
Thankyou
Can you tell us the exact problem you have, as well as the relevant code you have ?
ASKER
void CImgProcess::histogramEqua lisation()
{
for(int r=0;r<ROW;r++)
for(int c=0;c<COL;c++)
{
double value=image2D[r][c]; value = value/255;
value=value*255/(ROW*COL);
image2D_Buffer[r][c]=(unsi gned char)value;
}
}
{
for(int r=0;r<ROW;r++)
for(int c=0;c<COL;c++)
{
double value=image2D[r][c]; value = value/255;
value=value*255/(ROW*COL);
image2D_Buffer[r][c]=(unsi
}
}
>> value=value*255/(ROW*COL);
What do you intend to do here ?
In general value will end up to be 0 in most cases. I'm sure that's not what you want.
What do you intend to do here ?
In general value will end up to be 0 in most cases. I'm sure that's not what you want.
ASKER
What should i do then?? Help me with the function, what I do wrong??
As i asked : what do you want do do ?
ASKER
I want to do histogram equalization thas what I want to do! Ok I get rid of value=value/256;
I really hope u know what histogram equalization is.
I really hope u know what histogram equalization is.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And here's a nice link explaining the process :
http://www.generation5.org/content/2004/histogramEqualization.asp
btw, I didn't test the code, so you'll have to do that before assuming it's 100% correct !!
http://www.generation5.org/content/2004/histogramEqualization.asp
btw, I didn't test the code, so you'll have to do that before assuming it's 100% correct !!
ASKER
I just tested the code you gave me, there some reason I only see blocks rather than image enhancement. Could it be possible the int is doing any effect?
What do you mean by "blocks" ?
The code I gave was not tested, and was written from my head ... so there could be errors present ... It was meant to give you an idea about the code rather than to use it as is.
In any wase, the big lines should be ok. You might want to check the intermediate outputs to see if the result is as expected.
Try it on an image you know should be enhanced by this process (eg. the ones on the site i referred to earlier).
The code I gave was not tested, and was written from my head ... so there could be errors present ... It was meant to give you an idea about the code rather than to use it as is.
In any wase, the big lines should be ok. You might want to check the intermediate outputs to see if the result is as expected.
Try it on an image you know should be enhanced by this process (eg. the ones on the site i referred to earlier).