您可以设置点云中每个点的RGB值来上色。以下是一个示例代码:

// Set the RGB values of the point to red float r = 255.0f; float g = 0.0f; float b = 0.0f; for (int i = 0; i < planes.size(); i++) { for (int j = 0; j < planes[i].size(); j++) { pcl::PointXYZRGB pt; pt.x = planes[i][j].x; pt.y = planes[i][j].y; pt.z = planes[i][j].z; pt.r = r; pt.g = g; pt.b = b; pts_pipeishiyan[i].insert(pt); } }

在这个示例中,我们使用pcl::PointXYZRGB结构体来存储每个点的位置和RGB颜色值。在循环中,我们将每个点的位置和RGB值设置为红色,并将其插入到相应的点集中

stdvectorPoint_set pts_pipeishiyan;		pts_pipeishiyanresizeplanessize;		for int i = 0; i planessize; i++											for int j = 0; j planesisize; j++							 Set the RGB values of the point to red				p

原文地址: https://www.cveoy.top/t/topic/cu02 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录