计算点与点之间的距离的平局距离

double
computeCloudResolution (const pcl::PointCloud<PointType>::ConstPtr &cloud)
{
double res = 0.0;
int n_points = ;
int nres;
std::vector<int> indices ();
std::vector<float> sqr_distances ();
pcl::search::KdTree<PointType> tree;
tree.setInputCloud (cloud); for (size_t i = ; i < cloud->size (); ++i)
{
if (! pcl_isfinite ((*cloud)[i].x))
{
continue;
}
//Considering the second neighbor since the first is the point itself.
nres = tree.nearestKSearch (i, , indices, sqr_distances);
if (nres == )
{
res += sqrt (sqr_distances[]);
++n_points;
}
}
if (n_points != )
{
res /= n_points;
}
return res;
}

PCL中

对于 pcl::UniformSampling函数在PCL1.7版本里  该函数放在keypoints
用法如下:
pcl::PointCloud<int> keypointIndices;
filter.compute(keypointIndices);
pcl::copyPointCloud(*cloud,keypointIndices.points, *filteredCloud); 之后在PCL1.8版本里就将该函数放在filters模块里。并在keypoints模块里也包含了这个头文件
#warning UniformSampling is not a Keypoint anymore, use <pcl/filters/uniform_sampling.h> instead.
这是keypoints模块下的说明
用法是:
PointCloud<PointXYZ> output_;
 filter.filter (output_);

最新文章

  1. js判断游览器是移动端还是PC端
  2. Salesforce select字段的多少对性能影响巨大
  3. 最简单的视音频播放示例6:OpenGL播放YUV420P(通过Texture,使用Shader)
  4. wxWidgets Tutorial
  5. mac os 常用终端软件工具
  6. 最简单的基于FFmpeg的移动端例子:IOS 视频解码器-保存
  7. 【宽搜】BAPC2014 J Jury Jeopardy (Codeforces GYM 100526)
  8. 【java】基于Tomcat的WebSocket转帖 + 自己理解
  9. CreateLiveCMSV4.0 漏洞,无需后台Get shell
  10. HDU 5067-Harry And Dig Machine(DFS)
  11. iOS之即时通讯相关理解
  12. django获取某一个字段的列表,values/values_list/flat
  13. 如何获取fragment里的控件
  14. RabbitMQ-从基础到实战(3)— 消息的交换
  15. 006. SSO 单点登录(同域SSO/跨域SSO)
  16. cumprod、prod函数
  17. 导出python的环境
  18. javasscript基础
  19. 在 Visual Studio 2010 中配置SharpPcap
  20. tap news:week5 0.0 create react app

热门文章

  1. shell 安装使用VIM
  2. 10,EasyNetQ-发布确认
  3. php 允许浏览器跨域访问web服务端的解决方案
  4. 用单片机控制LED灯(项目)
  5. Process多进程的创建方法
  6. 使用TVTK库创建一个矩形视图
  7. C++ 指针悬挂和赋值操作符的重载,拷贝构造函数实现
  8. NOIP 2000 乘积最大
  9. Java表达式转型规则
  10. 在Windows系统配置Jekyll