【吐槽】——《点云库PCL从入门到精通》一书

目录

槽点一:生搬硬套,照抄官方教程

槽点二:书中代码未经验证运行

槽点三:使用已失效或者不存在的属性

槽点四:翻译失准,产生歧义


槽点一:生搬硬套,照抄官方教程

这本书的大部分示例代码都是照抄官方教程:Introduction — Point Cloud Library 0.0 documentation

随便摘抄一段原文:链接【How to use a KdTree to search — Point Cloud Library 0.0 documentation

A k-d tree, or k-dimensional tree, is a data structure used in computer science for organizing some number of points in a space with k dimensions. It is a binary search tree with other constraints imposed on it. K-d trees are very useful for range and nearest neighbor searches. For our purposes we will generally only be dealing with point clouds in three dimensions, so all of our k-d trees will be three-dimensional. Each level of a k-d tree splits all children along a specific dimension, using a hyperplane that is perpendicular to the corresponding axis. At the root of the tree all children will be split based on the first dimension (i.e. if the first dimension coordinate is less than the root it will be in the left-sub tree and if it is greater than the root it will obviously be in the right sub-tree). Each level down in the tree divides on the next dimension, returning to the first dimension once all others have been exhausted. The most efficient way to build a k-d tree is to use a partition method like the one Quick Sort uses to place the median point at the root and everything with a smaller one-dimensional value to the left and larger to the right. You then repeat this procedure on both the left and right sub-trees until the last trees that you are to partition are only composed of one element.

 机器翻译:

 《点云库PCL从入门到精通》书中翻译:

其中最大的槽点在于对Quick Sort的翻译:快速分类, 这里的Quick Sort应该是快速排序,就算机翻也是快速排序。

槽点二:书中代码未经验证运行

在第五章-可视化中,P116中的关于CloudViewer类的测试代码,无论是书中,还是其给出的源代码中,点云数据类型格式都是照抄官网教程上的源码:XYZRGBA,但事实上,此书提供的pcd文件:maize.pcd是XYZ格式。如果直接按照书中或者源代码中程序运行,将会产生错误:

 应改成:

	//加载点云文件到点云对象
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
	pcl::io::loadPCDFile("maize.pcd", *cloud);

可见书中代码尚未运行验证,读者应谨慎阅读此书!

槽点三:使用已失效或者不存在的属性

在书中第五章-可视化中,书中给出的源码点云库PCL从入门到精通\第五章\2 range_image_visualization\source\range_image_visualization.cpp中关于setViewerPose函数的实现:

void 
setViewerPose (pcl::visualization::PCLVisualizer& viewer, const Eigen::Affine3f& viewer_pose)
{
  Eigen::Vector3f pos_vector = viewer_pose * Eigen::Vector3f(0, 0, 0);
  Eigen::Vector3f look_at_vector = viewer_pose.rotation () * Eigen::Vector3f(0, 0, 1) + pos_vector;
  Eigen::Vector3f up_vector = viewer_pose.rotation () * Eigen::Vector3f(0, -1, 0);
  viewer.camera_.pos[0] = pos_vector[0];
  viewer.camera_.pos[1] = pos_vector[1];
  viewer.camera_.pos[2] = pos_vector[2];
  viewer.camera_.focal[0] = look_at_vector[0];
  viewer.camera_.focal[1] = look_at_vector[1];
  viewer.camera_.focal[2] = look_at_vector[2];
  viewer.camera_.view[0] = up_vector[0];
  viewer.camera_.view[1] = up_vector[1];
  viewer.camera_.view[2] = up_vector[2];
  viewer.updateCamera();
}

其中使用了在PCL1.8.1中已经不存在的属性camera_,但是此本书在开头明明说是以PCL1.8.1为教学版本。

官方教程中:关于此函数的实现:

void 
setViewerPose (pcl::visualization::PCLVisualizer& viewer, const Eigen::Affine3f& viewer_pose)
{
  Eigen::Vector3f pos_vector = viewer_pose * Eigen::Vector3f(0, 0, 0);
  Eigen::Vector3f look_at_vector = viewer_pose.rotation () * Eigen::Vector3f(0, 0, 1) + pos_vector;
  Eigen::Vector3f up_vector = viewer_pose.rotation () * Eigen::Vector3f(0, -1, 0);
  viewer.setCameraPosition (pos_vector[0], pos_vector[1], pos_vector[2],
                            look_at_vector[0], look_at_vector[1], look_at_vector[2],
                            up_vector[0], up_vector[1], up_vector[2]);
}

槽点四:翻译失准,产生歧义

第五章,P121中:

 官网的原文:PCLVisualizer — Point Cloud Library 0.0 documentation

 这两句明显是翻译错了。

官网原文中说的是下一行(next line),指的是:

viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud");

 而此书翻译成:下面的命令行(next line),会让读者误以为是:

viewer->addCoordinateSystem(1.0);

 此外,关于 can be used to place the axes at any point in the world的翻译,明明说的是这个函数可以传入坐标,指定坐标轴的位置。

没想到,直接翻译官方教程也能出书,真是刷新我的认知。

  • 39
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论
"PCL点云从入门到精通PDF"的第十二章第9节讲的是使用递归进行地面回波的识别。在点云数据中,地面回波通常是由于地面上的物体如道路、建筑等造成的。通过识别地面回波,我们可以提取出地面上的结构,有助于后续的地面分割和物体检测等任务。 递归地识别地面回波的方法是通过一系列的步骤来实现的。首先,我们需要选择一个起始点作为递归算法的输入点。通常情况下,我们可以选择点云数据中的最低点作为起始点。然后,我们通过计算输入点周围的邻居点的法线向量,来判断这些邻居点是否属于地面回波。 在递归算法中,我们通过设置一个阈值来判断邻居点的法线向量与地面法线向量之间的夹角。如果邻居点的法线向量与地面法线向量之间的夹角小于阈值,那么我们可以认为该邻居点也属于地面回波。接着,我们将该邻居点作为新的输入点,重复进行上述步骤,直到没有新的地面回波点被识别出来为止。 通过递归算法,我们可以较准确地识别出点云数据中的地面回波,并将其提取出来。这对于进行地面分割和物体检测等任务非常有帮助。同时,我们也可以根据实际应用的需要,调整递归算法中的参数和阈值,以获取更好的结果。 总结来说,"PCL点云从入门到精通PDF"的第十二章第9节介绍了一种通过递归算法进行地面回波识别的方法,可以帮助我们准确地提取出点云数据中的地面结构。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SOC罗三炮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值