Incorrect formula in documenatation for meanStdDev (Bug #1477)
Description
The formula specified in source:trunk/opencv/modules/core/doc/operations_on_arrays.rst for computed standard deviation is
1:math:@stddev_c = \sqrt{\sum_{I:mask(I) != 0}(src(I)_c - mean_c)^2}@
This formula is not correct: normalization by number of nonzero elements is required. Indeed, in the source:trunk/opencv/modules/core/src/stat.cpp stddev is calculated as
std::sqrt(std::max(sq[k]*scale - s[k]*s[k], 0.));
I think the misleading formula should be changed to
1:math:@stddev_c = \sqrt{\frac{\sum_{I:mask(I) != 0}(src(I)_c - mean_c)^2}{N}}@
where N is already defined in documentation.
History
Updated by Alexander Shishkov about 13 years ago
- Status deleted (
Open) - Target version set to 2.4.0
- Assignee set to Alexander Shishkov
Updated by Alexander Shishkov about 13 years ago
- Description changed from The formula specified in source:trunk/opencv/modules/core/doc/operations_on_a... to The formula specified in source:trunk/opencv/modules/core/doc/operations_on_a... More
Updated by Alexander Shishkov about 13 years ago
Thanks! It's fixed in trunk, see http://opencv.itseez.com/trunk/modules/core/doc/operations_on_arrays.html#meanstddev
- Status set to Done