meanStdDev[1]
Calculates a mean and standard deviation of array elements.
- C++: void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
- Python: cv2.meanStdDev(src[, mean[, stddev[, mask]]]) → mean, stddev
- C: void cvAvgSdv(const CvArr* arr, CvScalar* mean, CvScalar* std_dev, const CvArr* mask=NULL )
- Python: cv.AvgSdv(arr, mask=None) -> (mean, stdDev)
Parameters:
- src – input array that should have from 1 to 4 channels so that the results can be stored in Scalar_‘s.
- mean – output parameter: calculated mean value.
- stddev – output parameter: calculateded standard deviation.
- mask – optional operation mask.
The function meanStdDev calculates the mean and the standard deviation M of array elements independently for each channel and returns it via the output parameters:
When all the mask elements are 0’s, the functions return mean=stddev=Scalar::all(0) .
Note
The calculated standard deviation is only the diagonal of the complete normalized covariance matrix. If the full matrix is needed, you can reshape the multi-channel array M x N to the single-channel array M*N xmtx.channels() (only possible when the matrix is continuous) and then pass the matrix to calcCovarMatrix() .
See also
countNonZero(), mean(), norm(), minMaxLoc(), calcCovarMatrix()
-----------------------------------------------------------------------
confidence interval (CI)[4]
If you know the standard deviation for a population, then you can calculate a confidence interval (CI) for the mean, or average, of that population. When a statistical characteristic that’s being measured (such as income, IQ, price, height, quantity, or weight) is numerical, most people want to estimate the mean (average) value for the population. You estimate the population mean,
by using a sample mean,
plus or minus a margin of error. The result is called a confidence interval for the population mean,
When the population standard deviation is known, the formula for a confidence interval (CI) for a population mean is
deviation, n is the sample size, and z* represents the appropriate z*-value from the standard normal distribution for your desired confidence level.
z*-values for Various Confidence Levels
Confidence Level
z*-value
參考資料
2. opencv 3.0 求均值 标准差 mean MeanStdDev
4. How to Calculate a Confidence Interval for a Population Mean When You Know Its Standard Deviation
留言列表