基于CloudCompare开发的提取ISS3D关键点。

 void qLxPluginPCL::doISS3D()
{
assert(m_app);
if (!m_app)
return; const ccHObject::Container& selectedEntities = m_app->getSelectedEntities();
size_t selNum = selectedEntities.size();
if (selNum!=)
{
m_app->dispToConsole("Select only one cloud!",ccMainAppInterface::ERR_CONSOLE_MESSAGE);
return;
} ccHObject* ent = selectedEntities[];
assert(ent);
if (!ent || !ent->isA(CC_TYPES::POINT_CLOUD))
{
m_app->dispToConsole("Select a real point cloud!",ccMainAppInterface::ERR_CONSOLE_MESSAGE);
return;
} ccPointCloud* m_cc_cloud = static_cast<ccPointCloud*>(ent); //input cloud
unsigned count = m_cc_cloud->size();
bool hasNorms = m_cc_cloud->hasNormals();
CCVector3 bbMin, bbMax;
m_cc_cloud->getBoundingBox(bbMin,bbMax);
const CCVector3d& globalShift = m_cc_cloud->getGlobalShift();
double globalScale = m_cc_cloud->getGlobalScale(); ccIss3Ddlg dlg;
if (!dlg.exec())
return; double s_SalientRadius=dlg.sbSalientRadius->value();
double s_NonMaxRadius =dlg.spNonMaxRadius->value();
double s_Threshold21 = dlg.spThreshold21->value();
double s_Threshold32 = dlg.spThreshold32->value(); pcl::PointCloud<PointXYZ>::Ptr pcl_cloud (new pcl::PointCloud<PointXYZ>);
try
{
unsigned pointCount = m_cc_cloud->size();
pcl_cloud->resize(pointCount); for (unsigned i = ; i < pointCount; ++i)
{
const CCVector3* P = m_cc_cloud->getPoint(i);
pcl_cloud->at(i).x = static_cast<float>(P->x);
pcl_cloud->at(i).y = static_cast<float>(P->y);
pcl_cloud->at(i).z = static_cast<float>(P->z);
}
}
catch(...)
{
//any error (memory, etc.)
pcl_cloud.reset();
} printf("读取了data点云数据:%d\n",pcl_cloud->size()); pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ> ()); pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_out (new pcl::PointCloud<pcl::PointXYZ>); pcl::ISSKeypoint3D<pcl::PointXYZ,pcl::PointXYZ> iss_detector;
iss_detector.setSearchMethod (tree);
iss_detector.setSalientRadius(s_SalientRadius);
iss_detector.setNonMaxRadius(s_NonMaxRadius);
/*iss_detector.setSalientRadius(2.0f);
iss_detector.setNonMaxRadius(1.6f);*/
iss_detector.setInputCloud(pcl_cloud);
/*iss_detector.setThreshold21 (0.975);
iss_detector.setThreshold32 (0.975);*/
iss_detector.setThreshold21 (s_Threshold21);
iss_detector.setThreshold32 (s_Threshold32);
iss_detector.setMinNeighbors ();
iss_detector.setNumberOfThreads ();
cout<<"parameter set successful"<<endl;
iss_detector.compute(*cloud_out); int pointCount = cloud_out->size(); //static_cast<size_t>(sm_cloud ? sm_cloud->width * sm_cloud->height : 0); ccPointCloud* ccCloud =new ccPointCloud();
if (!ccCloud->reserve(static_cast<unsigned>(pointCount)))
return ;
for (size_t i = ; i < pointCount; ++i)
{
CCVector3 P(cloud_out->at(i).x,cloud_out->at(i).y,cloud_out->at(i).z);
ccCloud->addPoint(P);
}
ccCloud->setName(QString("ISS3D"));
ccColor::Rgb col = ccColor::Generator::Random();
ccCloud->setRGBColor(col);
ccCloud->showColors(true);
ccCloud->setPointSize();
ccHObject* group = ;
if (!group)
group = new ccHObject(QString("ISS3D").arg(ent->getName()));
group->addChild(ccCloud);
group->setVisible(true);
m_app->addToDB(group);
}

界面:

最新文章

  1. H TC並沒有成為下一個摩托羅拉或諾基亞。
  2. C++之路进阶——P2022
  3. python文件、数据库读写编码的问题
  4. MapReduce多表连接
  5. 站点搭建从零開始(四) server的配置
  6. WC2015 k小割(k短路+暴力+搜索)
  7. Python基础之元组
  8. 28 ArcMap 运行特别慢怎么办
  9. vue文档阅读笔记——计算属性和侦听器
  10. 关于while read line 循环中变量作用域的问题
  11. HTML学习之给div高度设置百分比不生效的问题
  12. JoyOI1940 创世纪
  13. leetcode - [7]Binary Tree Preorder Traversal
  14. C#基础篇九OOP属性结构枚举
  15. Jenkins 集成Unity3D Xcode
  16. EUI组件之TextInput
  17. Servlet不是线程安全的。
  18. senfile函数实例的运行过程截图
  19. 分布式文件系统之FastDFS
  20. 消费者用nginx做负载均衡,提供者用zookeeper自带功能实现负载均衡

热门文章

  1. hdu1272 小希的迷宫
  2. InterBase数据库迁移到MySQL(数据导入)
  3. Android -- 自定义带进度条的按钮
  4. CentOS 6.5/6.6 安装mysql 5.7 最完整版教程
  5. JavaScript的几种继承方式
  6. github提交失败并报错java.io.IOException: Authentication failed:
  7. Qweb Pdf 中添加 图片
  8. Js练笔——用循环和递归实现追踪对象深度(循环引用关系不考虑)
  9. Js中找任意对象的原型方法及改造原型
  10. [转]Oracle版本号解释