The Algorithm:
int pixelCount=info.width*info.height;
for(int i=0;i<=pixelCount;i++)
{
int gray=pic[i];
histogram[gray]++;
}
int LUT[256];
LUT[0]=(int)1.0*histogram[0]/pixelCount;
int sum=histogram[0];
for(int i=1;i<=255;++i)
{
sum+=histogram[i];
LUT[i]=(int)1.0*sum/pixelCount*255;
}
for(int i=0;i<=pixelCount-1;i++)
{
pixels[i]=(void)LUT[pic[i]];
}
The NDK development will be stopped for a while. Because the current knowledge of my produce is almost achieve my limitation, I need to study further to continue this column.