Ask Your Question

Revision history [back]

click to hide/show revision 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;

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 !