Incorrect formula in documenatation for meanStdDev (Bug #1477)


Added by galkin-vv - over 13 years ago. Updated about 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Alexander Shishkov % Done:

0%

Category:documentation
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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.


Associated revisions

Revision 5c10bd5b
Added by Alexander Shishkov about 13 years ago

fixed #1477

Revision a4b3aa9e
Added by Roman Donchenko over 11 years ago

Merge pull request #1477 from nzjrs:python-gethardwaresupport

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

Also available in: Atom PDF