从PointCloud到Mat的转换

问题描述:

假设我初始化一个点云。我想把它的RGB通道存储在opencv的Mat数据类型中。我如何做到这一点?

Let's say I initialize a point-cloud. I want to store its RGB channels in opencv's Mat data-type. How can I do that?

pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGBA>);   //Create a new cloud
pcl::io::loadPCDFile<pcl::PointXYZRGBA> ("cloud.pcd", *cloud);


我有同样的问题, !

您应首先变换坐标,使您的地平面为XOY平面。
核心API是 pcl :: getTransformationFromTwoUnitVectorsAndOrigin

You should firstly transform the coordinate so that your 'ground plane' is the X-O-Y plane. The core api is pcl::getTransformationFromTwoUnitVectorsAndOrigin

您可以查看我的

You can have a look at my question:

祝你好运!