How to add new points to an existing cloud?

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

How to add new points to an existing cloud?

DungeonMaster
Hi there again. This maybe an obvious question but I don't find such examples
at the Internet yet (still searching).

I am working on task similar to  this tutorial
<http://pointclouds.org/documentation/tutorials/extract_indices.php#extract-indices>  
but I wonder if I can not to create a new cloud for each detected plane but
just add them all in one cloud. My intuition tells me that this is quite
simple to achieve. Any small code examples would be great.

Thanks.



--
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: How to add new points to an existing cloud?

Sérgio Agostinho
Here's two quick ways.

1 - If you want to add individual points, use the push_back operator.

PointXYZ point;

PointCloud<PointXYZ> cloud;

cloud.push_back (point); //if your cloud is organized, this will break
it. For your use case it should not be


2- Make a new point cloud out of 2 other clouds

PointCloud<PointXYZ> cloudA, cloudB, cloudC;

cloudC = cloudA + cloudB;


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