Get all points of from the point cloud, which resides on the surface of a given sphere

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

Get all points of from the point cloud, which resides on the surface of a given sphere

ravijoshi
I have a point cloud defined as the following-
pcl::PointCloud<pcl::PointXYZRGB> cloud

I have defined a sphere and center (x, y, z) and radius r is known.

I want to get all points from this point cloud, which resides on the surface
of given sphere.

A function like following-

std::vector<PointXYZRGB>
getAllSurfacePoints(pcl::PointCloud<pcl::PointXYZRGB> cloud)
{
    // here
}

Thanks a lot.



--
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: Get all points of from the point cloud, which resides on the surface of a given sphere

Wyllich
Direct approach : for loop on all your points and test

i) an equality condition if you want the points which are exactly on your
sphere
ii) a comparison between (the distance between the current point and the
sphere) and a defined threshold.

Correct me if there's an object for that.



--
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: Get all points of from the point cloud, which resides on the surface of a given sphere

Filip Rooms

A simpler formulation of version (ii) is to compute the distance to the sphere's center
and compare that with the radius within the defined threshold

Of course when the points are already in a tree (kd-tree or octree or so), you can limit your
loop over the points that are already roughly within the neighborhood of the sphere's
center point...

Kind regards,

Filip

On 25-Apr-18 22:42, Wyllich wrote:
Direct approach : for loop on all your points and test 

i) an equality condition if you want the points which are exactly on your
sphere
ii) a comparison between (the distance between the current point and the
sphere) and a defined threshold.

Correct me if there's an object for that.



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

--
BricsCAD

Filip Rooms
Software Developer


 

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
|

Re: Get all points of from the point cloud, which resides on the surface of a given sphere

ravijoshi
Thank you very much!



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