Here is the my snippet of code;
Npp8u * imageHost;
typedef unsigned char Npp8u;
...
for (int i=0;i<nHeight;++i)
{
for (int j=0;j<nWidth;++j)
{
printf("number_befre : %u\n",imageHost[i*nWidth+j] );
imageHost[i*nWidth+j] = imageHost[i*nWidth+j]-Npp8u(min);
imageHost[i*nWidth+j] = imageHost[i*nWidth+j]/(max-min);
printf("number : %u\n",imageHost[i*nWidth+j] );
}
}
...
Some values are assigned to max = 202
and min = 0
and extracted from imageHost. I rectified it with debugging but the content of the imageHost
is 0 for whole elements. What can I do more to make these statements work with reasonable precision? Is this about the restriction of the data type that I used?