Closed NeilGatenby closed 10 months ago
https://github.com/PointCloudLibrary/pcl/blob/0e4683a4f602447b1b7278abe98d9696e8027ce1/filters/src/statistical_outlier_removal.cpp#L247
Maybe I'm not seeing this right, but surely this should be ... variance = (sq_sum - mean * mean) / (static_cast<double>(valid_distances) - 1);
variance = (sq_sum - mean * mean) / (static_cast<double>(valid_distances) - 1);
(odd casts aside)
It's missing a 1 / valid_distances, isn't it?
1 / valid_distances
Best wishes N
I take it back ; I'm an idiot
No worries, happens to everyone :smile: I think this is taken from https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Na%C3%AFve_algorithm
https://github.com/PointCloudLibrary/pcl/blob/0e4683a4f602447b1b7278abe98d9696e8027ce1/filters/src/statistical_outlier_removal.cpp#L247
Maybe I'm not seeing this right, but surely this should be ...
variance = (sq_sum - mean * mean) / (static_cast<double>(valid_distances) - 1);
(odd casts aside)
It's missing a
1 / valid_distances
, isn't it?Best wishes N