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
Extract statistics from a point cloud
Re: Extract statistics from a point cloud
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).
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).
Daniel, CloudCompare admin
Re: Extract statistics from a point cloud
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.
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
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.
But to add more info you'll have to update the code of this function.
Daniel, CloudCompare admin
Re: Extract statistics from a point cloud
How could I do that?
Re: Extract statistics from a point cloud
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 ;).
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 ;).
Daniel, CloudCompare admin