# Normalized standard deviation

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

This forum is disabled, please visit https://forum.opencv.org

Normalized standard deviation

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

4

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]
```

Asked: **
2015-01-16 02:39:31 -0500
**

Seen: **1,619 times**

Last updated: **Jan 16 '15**

Standard deviation from discrete values

How to calculate StdDev for RGB image? [closed]

How to calculate standard deviation on image with transparency

Are there common values of standard deviation for Gaussian noise of an image?

Unclear how calibrateCamera estimates stdDeviations (perhaps wrong) [closed]

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

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`

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.