从点云创建范围图像
如何从点云创建范围图像
本教程演示如何从点云和给定传感器位置创建范围图像。该代码创建一个浮动在观察者前面的矩形的示例点云。
代码
#include <pcl/range_image/range_image.h>
int main () {
pcl::PointCloud<pcl::PointXYZ> pointCloud;
// Generate the data
for (float y=-0.5f; y<=0.5f; y+=0.01f) {
for (float z=-0.5f; z<=0.5f; z+=0.01f) {
pcl::PointXYZ point;
point.x = 2.0f - y;
point.y = y;
point.z = z;
pointCloud.push_back(point);
}
}
pointCloud.width = pointCloud.size();
pointCloud.height = 1;
// We now want to create a range image from the above point cloud, with a 1deg angular resolution
float angularResolution = (float) ( 1.0f * (M_PI/180.0f)); // 1.0 degree in radians
float maxAngleWidth = (float) (3

订阅专栏 解锁全文
1858

被折叠的 条评论
为什么被折叠?



