Page 1 of 1

Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 8:00 am
by Nico
Hi there,

Can anyone tell me how can i extract basic statistics (point count, sum, mean, median, stddev, min, max) of a point cloud ?

Is there a tool or something like that (code) ?

Thanks

Re: Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 8:40 am
by daniel
You can get some statistics with the somehow hidden 'Tools > Sand-box > Export cloud(s) info' method (creates a CSV file for all selected clouds with the name, number of points, and barycenter coordinates (what you call 'mean'?). The min and max values correspond to the cloud bounding-box (see the cloud properties).

Otherwise, for each scalar field, you can read the min and max values in the SF section of the cloud properties. You can also get the mean and std. dev. with the 'Edit > SF > Compute Stat. params'. You can't get the median through the GUI.

Through the API it is of course possible to access to everything (and computing the median should be quite easy).

Re: Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 9:37 am
by Nico
Thanks for the answer.

The problem is that I have hundreds of small point clouds (aprox 400) from which I want to obtain this data. By clicking every single point cloud and writing down all the values will take a quite a bit of time.

I was thinking, there may exist a tool for that.

Re: Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 9:40 am
by daniel
Well, the 'Export cloud(s) info' works with all selected clouds.

But to add more info you'll have to update the code of this function.

Re: Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 10:48 am
by Nico
How could I do that?

Re: Extract statistics from a point cloud

Posted: Thu Sep 29, 2016 10:57 am
by daniel
See the 'MainWindow::doActionExportCloudsInfo()' method:
https://github.com/cloudcompare/trunk/b ... .cpp#L8348

The method is pretty straightforward. Of course you'll have to tinker a little to save the pieces of info you need (and of course you'll need to compile CC yourself ;).