Skip to content

Fix genericity of computeNodeStatistics that couldn't compute stats p…#17719

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
pemmanuelviel:pev--fix-computeNodeStatistics-genericity
Jul 4, 2020
Merged

Fix genericity of computeNodeStatistics that couldn't compute stats p…#17719
opencv-pushbot merged 1 commit intoopencv:3.4from
pemmanuelviel:pev--fix-computeNodeStatistics-genericity

Conversation

@pemmanuelviel
Copy link
Copy Markdown
Contributor

@pemmanuelviel pemmanuelviel commented Jul 1, 2020

…roperly on sub-nodes

test_module_force=flann

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@pemmanuelviel
Copy link
Copy Markdown
Contributor Author

The indice_length argument of computeNodeStatistics() is the number of points of the cluster (the node).
We compute the mean and variance by accumulating values of these indice_length points. But when we devide by the number of points, instead of indice_length we where using size_ that is actually the value of the total number of points of the dataset, and not just of the node.
As this method is currently used only for the top node before starting to divide the dataset, it works fine. But if we want to use it for sub-nodes, results will be wrong.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution 👍

@opencv-pushbot opencv-pushbot merged commit 8f5b453 into opencv:3.4 Jul 4, 2020
@pemmanuelviel pemmanuelviel deleted the pev--fix-computeNodeStatistics-genericity branch July 5, 2020 11:38
@alalek alalek mentioned this pull request Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants