Coloured Point cloud

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

Coloured Point cloud

yogi30
How to get a colored point cloud?
I have a 3D point cloud and RGB image.



--
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: Coloured Point cloud

shome
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>
#include<pcl/io/pcd_io.h>
#include <fstream>
#include <stdlib.h>

typedef pcl::PointXYZ PointT;
typedef pcl::PointCloud<PointT> PointCloudT;

int main(int argc, char *argv[])
{

pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in (new
pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_out (new
pcl::PointCloud<pcl::PointXYZRGB>);

pcl::io::loadPCDFile(argv[1],*cloud_in);

cloud_out->width=cloud_in->width;
cloud_out->height=cloud_in->height;

pcl::copyPointCloud(*cloud_in,*cloud_out);

int r=atoi(argv[3]); int g=atoi(argv[4]); int b=atoi(argv[5]);

for(size_t i=0;i<cloud_in->points.size();i++)
{
        cloud_out->points[i].r=r;
        cloud_out->points[i].g=g;
        cloud_out->points[i].b=b;
}

pcl::io::savePCDFileASCII (argv[2], *cloud_out);

return 0;

}



--
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: Coloured Point cloud

yogi30
So there is no need of projecting 3D point to image plane,obtaining intensity
image,adding RGB values from image captured from camera and reprojecting to
3D ?
How will i know which point in point cloud corresponds to which pixel in the
image ?



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