资源简介
BoundaryEstimation测试代码,有比较详细的注释。另外是附加了相关算法的一篇文献,对于理解这个函数比较有帮助

代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define M_PI 3.14159
int main()
{
pcl::PointCloud::Ptr cloud(new pcl::PointCloud);
// if (pcl::io::loadPCDFile(“/home/yxg/pcl/pcd/mid.pcd“*cloud) == -1)
if (pcl::io::loadPCDFile(“E:\\program_study\\C++\\pcd_data\\table_scene_lms400.pcd“ *cloud) == -1)
{
PCL_ERROR(“COULD NOT READ FILE mid.pcl \n“);
return (-1);
}
std::cout << “points sieze is:“ << cloud->size() << std::endl;
pcl::PointCloud::Ptr normals(new pcl::PointCloud);
pcl::PointCloud boundaries;
pcl::BoundaryEstimation est;
pcl::search::KdTree::Ptr tree(new pcl::search::KdTree());
/*
pcl::KdTreeFLANN kdtree; //创建一个快速k近邻查询查询的时候若该点在点云中,则第一个近邻点是其本身
kdtree.setInputCloud(cloud);
int k =2;
float everagedistance =0;
for (int i =0; i < cloud->size()/2;i++)
{
vector nnh ;
vector squaredistance;
// pcl::PointXYZ p;
// p = cloud->points[i];
kdtree.nearestKSearch(cloud->points[i]knnhsquaredistance);
everagedistance += sqrt(squaredistance[1]);
// cout< }
everagedistance = everagedistance/(cloud->size()/2);
cout<<“everage distance is : “<
*/
pcl::NormalEstimation normEst; //其中pcl::PointXYZ表示输入类型数据,pcl::Normal表示输出类型且pcl::Normal前三项是法向,最后一项是曲率
normEst.setInputCloud(cloud);
normEst.setSearchMethod(tree);
// normEst.setRadiusSearch(2); //法向估计的半径
normEst.setKSearch(9); //法向估计的点数
normEst.compute(*normals);
cout << “normal size is “ << normals->size() << endl;
//normal_est.setViewPoint(000); //这个应该会使法向一致
est.setInputCloud(cloud);
est.setInputNormals(normals);
est.setAngleThreshold(M_PI/1.2 );//默认是M_PI/2
// est.setSearchMethod (pcl::search::KdTree::Ptr (new pcl::search::KdTree));
est.setSearchMethod(tree);
est.setKSearch(30); //一般这里的数值越高,最终边界识别的精度越好
// est.setRadiusSearch(everagedistance); //搜索半径
est.compute(boundaries);
// pcl::PointCloud boundPoints;
pcl::PointCloud::Ptr boundPoints(new pcl::PointCloud);
pcl::PointCloud noBoundPoints;
int countBoundaries = 0;
for (int i = 0; isize(); i++){
uint8_t x = (boundaries.points[i].boundary_point);
int a = static_cast(x); //该函数的功能是强制类型转换
if (a == 1)
{
// boundPoints.push_back(cloud->points[i]);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4588 2018-01-02 19:27 新建文件夹\PCL_BoundaryPoint.cpp
文件 295165 2015-10-13 18:59 新建文件夹\散乱数据点云边界特征自动提取算法.pdf
目录 0 2018-01-02 20:46 新建文件夹\
相关资源
- 汉印A300 CPCL协议 android 热敏打印app(
- 超级场景清理器(SPCleaner)v1.0免费版
- Continuum of positive solutions for discrete &
-
An improved momentum exchanged-ba
sed immers - Existence of positive solutions for some singu
- Existence of positive solutions for singular h
- httpclient4.3工具类
- SfM稀疏三维点云重建--完整工程文件
- 全面的点云库PCL学习教程
- CPCL查看器.rar
- The Physique Difference of Boundary Energy be
- Linux ntpclient代码
- 点云库PCL学习教程 完整版
- china-boundary-gis.zip中国边界经纬度点集
- 中英文PCL5语言参考手册_11086676.zip
- stm32f4+w5500+tcpclient/server源码
- PC-lint 9 + 中文手册
- FTPclinet客户端
- PCL点云库SACSegmentation用法demo
- 小兔子pcd点云数据pcl官方案例1)
- PCL5编程指南中文版
- osg显示点云
- 利用PCL,OpenCV求取点云的体积
- pcl5语言详细介绍
- httpclient-4.5.3 api 中文版
- stm32 lwip DNS DHCP ucosIII TCP Client 原创程
- HttpClient异步请求
- pcl点云模型
- HanV1.0.rar
-
OPCli
nk8
评论
共有 条评论