Ask Your Question

# Normalized standard deviation

What is the easiest way to calculate normalized standard deviation for a certain region of an image?

edit retag close merge delete

## Comments

Don't you want to say normalized by standard deviation? see this for how to do it. You can also use normalize for normalization, but I am agraid that I am not really understanding your question. Maybe it is a normalization first (if no values, than it's between 0 and 1) and then compute meanStdDev

( 2015-01-16 02:58:37 -0600 )edit
1

In the meantime, I looked up the exact definition which I hadn't known before, that's why I asked the question. In fact, it is only a division by the squared mean.

( 2015-01-16 03:58:16 -0600 )edit

## 1 answer

Sort by ยป oldest newest most voted

you could use meanStdDev for this.

Mat m(5,5,CV_8U);
randu(m,0,100);

Rect roi(2,2,2,2);

cerr << m << endl;
cerr << m(roi) << endl;

Scalar mea,dev;
meanStdDev( m(roi), mea, dev );

cerr << mea << endl;
cerr << dev << endl;


[  6,  97,  39,  29,  97;
10,  86,  93,  76,  29;
51,  38,   7,  38,  75;
23,  18,   1,  17,   3;
53,  43,  75,  64,  48]
[  7,  38;
1,  17]
[15.75, 0, 0, 0]
[14.0601, 0, 0, 0]

more

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2015-01-16 02:39:31 -0600

Seen: 1,697 times

Last updated: Jan 16 '15