Sample random points from each voxel of a point cloud

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Sample random points from each voxel of a point cloud

Pramit Mallick
Hi,
I’m trying to sample fixed number of random points from each voxel of a point cloud to generate a another point cloud. More specifically I wish to randomly sample a fixed number of points from those voxels in a point cloud that contain more than a number of points.
The pcl::RandomSample picks out a fixed number of random points from the entire point cloud. However, I need to do the same for each of the voxels in the grid.
Is there a way to do this?

Thanks
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

somnath
You can try with voxel grid sampling where the points within the voxel is replaced by it's centroid.

On Thursday, January 4, 2018, Pramit Mallick <[hidden email]> wrote:
Hi,
I’m trying to sample fixed number of random points from each voxel of a point cloud to generate a another point cloud. More specifically I wish to randomly sample a fixed number of points from those voxels in a point cloud that contain more than a number of points.
The pcl::RandomSample picks out a fixed number of random points from the entire point cloud. However, I need to do the same for each of the voxels in the grid.
Is there a way to do this?

Thanks
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


--
Regards

Somnath Dutta

Wissenschaftlicher Mitarbeiter

Technische Universität Dresden

Fakultät Informatik

Lehrstuhl für Computergraphik und Visualisierung

www.inf.tu-dresden.de/cgv




_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

Pramit Mallick
Yes, but here again the voxel points are being reduced to a single point, i.e
centroid. I wish to sample a fixed number of random points though. Any clue?



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

Filip Rooms

Sounds to me a bit like what is described in PoTree as Poisson-Disk subsampling... Quote from reference below: "Poisson-disk samples can be created by a class of algorithms that are referred to as dart throwing."

See p17 and following of https://www.cg.tuwien.ac.at/research/publications/2016/SCHUETZ-2016-POT/SCHUETZ-2016-POT-thesis.pdf

Implemented this for myself, but probably also available somewhere in PCL... Anyone?

On 04-Jan-18 06:53, Pramit Mallick wrote:
Yes, but here again the voxel points are being reduced to a single point, i.e
centroid. I wish to sample a fixed number of random points though. Any clue?
--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

Kind regards,

--
BricsCAD

Filip Rooms
Software Developer

Mobile +32 (0)497 20.46.16
 

Bricsys NV • Bellevue 5/201, 9050 Gent, Belgium • +32 9 244 01 90 • www.bricsys.com


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Sample random points from each voxel of a point cloud

Richard Frank
In reply to this post by Pramit Mallick
Hi,

I’m new here, and to PCL, but it seems to me your description is a solution.

- for each voxel
     - collect  points in a container
         - generate n random indices where n is the number of points desired
            - copy indexed points to final cloud container.

This is somewhat brute force, but if you section your data you could probably parallelize this.



Rick Frank
Dominion Software, Inc.
825 Beacon Street
Newton, MA 02459
Medical, Scientific, and Industrial Software

>>
>
> Hi,
> I’m trying to sample fixed number of random points from each voxel of a point cloud to generate a another point cloud. More specifically I wish to randomly sample a fixed number of points from those voxels in a point cloud that contain more than a number of points.
> The pcl::RandomSample picks out a fixed number of random points from the entire point cloud. However, I need to do the same for each of the voxels in the grid.
> Is there a way to do this?
>
> Thanks
>
>>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

Pramit Mallick
This brute force might be possible, but I can't seem to be able to iterate
over the voxels that are generated through VoxelGrid. If this were possible,
I might be able to get each voxel as a separate point cloud, get random
sample points using RandomSample and merge all of them into a resulting
point cloud. However, I can't seem to get this to work. Any help would be
appreciated.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

Filip Rooms
In reply to this post by Richard Frank

Hey Rick,

This would correspond to one of the described sampling strategies in the thesis I mentioned previously.

A screenshot from the corresponding page where the sampling strategies are compared:

(Source: "Potree: Rendering Large Point Clouds in Web Browsers", Markus Schuetz, link posted in previous mail)


On 04-Jan-18 11:47, Richard Frank wrote:
Hi,

I’m new here, and to PCL, but it seems to me your description is a solution.

- for each voxel
     - collect  points in a container
         - generate n random indices where n is the number of points desired
            - copy indexed points to final cloud container.

This is somewhat brute force, but if you section your data you could probably parallelize this.



Rick Frank
Dominion Software, Inc.
825 Beacon Street
Newton, MA 02459
Medical, Scientific, and Industrial Software


        
Hi,
I’m trying to sample fixed number of random points from each voxel of a point cloud to generate a another point cloud. More specifically I wish to randomly sample a fixed number of points from those voxels in a point cloud that contain more than a number of points. 
The pcl::RandomSample picks out a fixed number of random points from the entire point cloud. However, I need to do the same for each of the voxels in the grid. 
Is there a way to do this?

Thanks


        
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

--
BricsCAD

Filip Rooms
Software Developer

Mobile +32 (0)497 20.46.16
 

Bricsys NV • Bellevue 5/201, 9050 Gent, Belgium • +32 9 244 01 90 • www.bricsys.com


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Sample random points from each voxel of a point cloud

Richard Frank
In reply to this post by Pramit Mallick
I wonder if VoxelGrid is the correct class to use. It seems to be oriented as a filter to downsample a point cloud.

Perhaps what’s needed is a similar class one might call RandomSampleGrid. One could use VoxelGrid as a starting point and instead of down sampling do the random sample. This creates a new filter class that could be used elsewhere.



Rick Frank
Dominion Software, Inc.
825 Beacon Street
Newton, MA 02459
Medical, Scientific, and Industrial Software

> On Jan 4, 2018, at 7:20 AM, "[hidden email]" <[hidden email]> wrote:
>
> Sample random points from each voxel of a point cloud
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Sample random points from each voxel of a point cloud

Sérgio Agostinho
In reply to this post by Filip Rooms

2018-01-04 10:05 GMT+00:00 Filip Rooms <[hidden email]>:

Implemented this for myself, but probably also available somewhere in PCL... Anyone?


I wouldn't be so sure about that. At least it's not something I read about in the past years in this mailing list. Contributions welcome :)

Cheers
Sérgio


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users