1 | initial version |
for a float image:
img.convertTo(img, CV_32F);
you get the mean and stdev:
Scalar m,d;
meanStdDev(img, m, d);
then you subtract the mean, and divide by stdev:
img -= m;
img /= d;
2 | No.2 Revision |
for a float image:
img.convertTo(img, CV_32F);
you get the mean and stdev:
Scalar m,d;
meanStdDev(img, m, d);
then you subtract the mean, and divide by stdev:
img -= m;
img /= d;
d; // but be careful, don't divide by zero here !