Ask Your Question

Revision history [back]

No I don't think so. You can do like that :

{
Mat x = imread("f:/lib/opencv/samples/data/lena.jpg", IMREAD_COLOR);

Mat m,s;
x.convertTo(x,CV_32F);
meanStdDev(x, m, s);
vector<Mat> xc;
split(x, xc);
for (int i = 0; i<xc.size(); i++)
{
    cout << m.at<double>(i, 0) << "\t" << s.at<double>(i, 0) << "\n";
    xc[i] = (xc[i]- m.at<double>(i, 0)) / s.at<double>(i,0);
}
merge(xc,x);
meanStdDev(x, m, s);
for (int i = 0; i<m.rows; i++)
    cout<< m.at<double>(i,0)<<"\t"<< s.at<double>(i,0)<<"\n";

}