Ask Your Question
0

How to convert vector<Point3f> in pcl

asked 2017-08-03 02:17:48 -0600

snehal gravatar image

Hello,

I have 3d points of vector<point3f> type, and i want convert it into pcl::PointCloud<pcl::pointxyz> type for visualization of 3d points. How can i convert these vector type points , can anyone suggest me?

Thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-08-03 03:49:00 -0600

berak gravatar image

updated 2017-08-03 03:51:45 -0600

you'll have to copy the points manually:

  vector<Point3f> pts = ...;
  pcl::PointCloud<pcl::PointXYZ> cloud;
  cloud.points.resize (pts.size());
   for (size_t i=0; i<pts3d.size(); i++) {
         cloud.points[i].x = pts[i].x;
         cloud.points[i].y = pts[i].y;
         cloud.points[i].z = pts[i].z;
   }
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-08-03 02:17:48 -0600

Seen: 1,619 times

Last updated: Aug 03 '17