我工作的结构与运动。我认为,从运动结构来看,人们会碰到MultiView几何书。这本书非常好,但我在这本书中发现了一些令人困惑的数据。在下面的代码中,有一个叫做填充点云的函数,它有两个参数pointcloud和pointcloud_RGB。我在点云三维点类型值,但我没有找到有关pointcloud_RGB在这本书中任何东西,它突然出现在这个功能,这是用来填补VEC3d rgbv。有人能帮助谁遇到这本书。结构从运动展台
void PopulatePCLPointCloud(const vector<cv::Point3d>& pointcloud,
const std::vector<cv::Vec3b>& pointcloud_RGB = std::vector<cv::Vec3b>()
)
{
cout<<"Creating point cloud...";
cloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>);
for (unsigned int i=0; i<pointcloud.size(); i++) {
// get the RGB color value for the point
cv::Vec3b rgbv(255,255,255);
if (i < pointcloud_RGB.size()) {
rgbv = pointcloud_RGB[i];
}
// check for erroneous coordinates (NaN, Inf, etc.)
if (pointcloud[i].x != pointcloud[i].x ||
pointcloud[i].y != pointcloud[i].y ||
pointcloud[i].z != pointcloud[i].z ||
#ifndef WIN32
isnan(pointcloud[i].x) ||
isnan(pointcloud[i].y) ||
isnan(pointcloud[i].z) ||
#else
_isnan(pointcloud[i].x) ||
_isnan(pointcloud[i].y) ||
_isnan(pointcloud[i].z) ||
false
)
{
continue;
}
pcl::PointXYZRGB pclp;
pclp.x = pointcloud[i].x;
pclp.y = pointcloud[i].y;
pclp.z = pointcloud[i].z;
// RGB color, needs to be represented as an integer
uint32_t rgb = ((uint32_t)rgbv[2] << 16 | (uint32_t)rgbv[1] << 8 |
(uint32_t)rgbv[0]);
pclp.rgb = *reinterpret_cast<float*>(&rgb);
cloud->push_back(pclp);
}
cloud->width = (uint32_t) cloud->points.size(); // number of points
cloud->height = 1; // a list of points, one row of data
//Create visualizer
pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer");
viewer.showCloud (cloud);
cv::waitKey(0);
return;
}
字面上,当我搜索“pcl :: PointXYZRGB”时,[第一链接](http://docs.pointclouds.org/1.7.0/structpcl_1_1_point_x_y_z_r_g_b.html)“ – CoryKramer
非常感谢您的重播。我已经点云型三维点,并在该函数也用型vec3d的pointcloud_RGB,所以我问还有什么在pointcloud_RGB,因为他们没有说什么,所以我很困惑。对不起如果我不理解你(我不擅长PCL)。 – Raj