当前位置: 首页 > news >正文

win2008 建立网站表白网址生成器

win2008 建立网站,表白网址生成器,增加网站广告位,临邑建设局官方网站文章目录 前言一、应用案例二、源码分析1.ConvexHull类2.reconstruct函数3.performReconstruction 函数4.calculateInputDimension 函数 总结 前言 本文分析一下pcl里凸包的源码。什么是凸包以及怎么求解#xff0c;可以了解一下概念。 一、应用案例 #include pcl/surfa… 文章目录 前言一、应用案例二、源码分析1.ConvexHull类2.reconstruct函数3.performReconstruction 函数4.calculateInputDimension 函数 总结 前言 本文分析一下pcl里凸包的源码。什么是凸包以及怎么求解可以了解一下概念。 一、应用案例 #include pcl/surface/convex_hull.hpcl::ConvexHullpcl::PointXYZ convex_hull;convex_hull.setInputCloud(cloud_in);//输入点云//convex_hull.setDimension(3);//设置维数当然不设置内部算法也会自己计算//pcl::PointCloudpcl::PointXYZ::Ptr hull_out(new pcl::PointCloudpcl::PointXYZ);convex_hull.reconstruct(*cloud_out);//输出凸包点convex_hull.getHullPointIndices(Indices);//输出凸包点在输入点云中的id二、源码分析 1.ConvexHull类 templatetypename PointInTclass ConvexHull : public MeshConstructionPointInT{...//构造函数中dimension_数据的维数 默认是0//x_axis_ y_axis_ z_axis_ 坐标轴三个参数也在这里确定/** \brief Empty constructor. */ConvexHull () : compute_area_ (false), total_area_ (0), total_volume_ (0), dimension_ (0), projection_angle_thresh_ (cos (0.174532925) ), qhull_flags (qhull ),x_axis_ (1.0, 0.0, 0.0), y_axis_ (0.0, 1.0, 0.0), z_axis_ (0.0, 0.0, 1.0){};...//输出凸包接口/** \brief Compute a convex hull for all points given.* \param[out] points the resultant points lying on the convex hull.*/voidreconstruct (PointCloud points);...//设置维数接口这里如果不设置具体的维数则会维数默认值是构造函数里的值0并且算法里会自行计算真实的维数void setDimension (int dimension){if ((dimension 2) || (dimension 3))dimension_ dimension;elsePCL_ERROR ([pcl::%s::setDimension] Invalid input dimension specified!\n, getClassName ().c_str ());}...//获取凸包点在输入点云中的idvoidgetHullPointIndices (pcl::PointIndices hull_point_indices) const;...}2.reconstruct函数 template typename PointInT void pcl::ConvexHullPointInT::reconstruct (PointCloud points) {points.header input_-header;//初始化这里initCompute 实际上是PCLBase这个基类的初始化函数前文有讲过这里不再赘述if (!initCompute () || input_-points.empty () || indices_-empty ()){points.points.clear ();return;}// Perform the actual surface reconstruction//这里就是真正的凸包计算接口std::vectorpcl::Vertices polygons;performReconstruction (points, polygons, false);points.width static_castuint32_t (points.points.size ());points.height 1;points.is_dense true;deinitCompute (); }3.performReconstruction 函数 对于Qhull有兴趣可以了解学习一下 3.1 什么是Qhull 3.2 怎么下载编译Qhull 3.2 Qhull官网地址 template typename PointInT void pcl::ConvexHullPointInT::performReconstruction (PointCloud hull, std::vectorpcl::Vertices polygons,bool fill_polygon_data) {//如上面所说如果没有在维度设置接口中设置维度则默认维度是0也即会执行calculateInputDimension if (dimension_ 0)calculateInputDimension ();//后面这两函数就是具体的调用哦个Ahull库来实现凸包的计算//具体怎么实现的后续有空再研究吧毕竟又涉及到另一个开源库need more time~~if (dimension_ 2)performReconstruction2D (hull, polygons, fill_polygon_data);else if (dimension_ 3)performReconstruction3D (hull, polygons, fill_polygon_data);elsePCL_ERROR ([pcl::%s::performReconstruction] Error: invalid input dimension requested: %d\n,getClassName ().c_str (),dimension_); }4.calculateInputDimension 函数 template typename PointInT void pcl::ConvexHullPointInT::calculateInputDimension () {PCL_DEBUG ([pcl::%s::calculateInputDimension] WARNING: Input dimension not specified. Automatically determining input dimension.\n, getClassName ().c_str ());//计算输入点云质心Eigen::Vector4d xyz_centroid;compute3DCentroid (*input_, *indices_, xyz_centroid);EIGEN_ALIGN16 Eigen::Matrix3d covariance_matrix;//计算每个点的协方差矩阵//这里原理就是//1.将原始点云坐标减去中心点坐标//2.再对这些数据构造协方差矩阵协方差矩阵具体构造原理看前文harris3d源码分析就不再详细分析//3.有一点要说明这个部分构造协方差矩阵的开源代码比harris3d里协方差矩阵开源代码要清晰很多computeCovarianceMatrixNormalized (*input_, *indices_, xyz_centroid, covariance_matrix);//求协方差矩阵的特征值//主法向量是协方差矩阵的最小特征值对应的特征向量EIGEN_ALIGN16 Eigen::Vector3d eigen_values;pcl::eigen33 (covariance_matrix, eigen_values);//对于二维的数据主法向量就是0或者近似于0if (std::abs (eigen_values[0]) std::numeric_limitsdouble::epsilon () || std::abs (eigen_values[0] / eigen_values[2]) 1.0e-3)dimension_ 2;elsedimension_ 3; }总结 分析了下pcl里求解凸包的整体流程有一些收获~~
http://www.hkea.cn/news/14457604/

相关文章:

  • 网站开发主要创新点网站制作怎样容易
  • 如何线下宣传网站高端终端网站设计类网站
  • 网站建设工单系统护语网站建设与管理实用教程课后答案
  • 如何创建一个网站的步骤注册装修公司要多少钱才能注册
  • 阳逻开发区网站建设中企动力做网站后有人抢注关键词
  • 自建网站外贸怎么做宜昌本地网站建设
  • 重庆交通建设集团有限公司网站wordpress手机中文版下载
  • 深圳网站建设价格多少vi企业形象设计公司
  • 快递网站建设代码郑州seo建站
  • 网站如何集成微信支付怎么做相亲网站
  • 台州网站推广技巧付费阿克苏网站建设
  • 线报网站如何做好的外贸网站建设
  • 南宁制作网站服务商贵州省建设厅二建报名网站
  • 网站建设公司是什么网站标题写什么作用是什么
  • wordpress 站内通知网页传奇发布网
  • 做脚本的网站wordpress自助评论
  • 重庆网站建站一站式服务网站开发工作怎样
  • 柳州网站建设 来宾市网站制作中英文切换网站怎么做
  • 盘锦市城乡建设厅网站wordpress rest 接口
  • 宣传类的网站有哪些站长工具综合权重查询
  • 程序员怎么做网站赚钱环保局网站建设方案
  • 成都微信网站建设推阳江建设网站
  • 网站做程序西安vi设计公司
  • 网站建设中通知一级域名与二级域名有啥区别
  • 国外免费iphone网站小程序ui界面设计
  • 家教网站模板下载郑州企业网站价格
  • 舟山市建设工程造价管理协会网站徐州建站推广
  • 龙华网站建设网站做超链接薪资多少一个月
  • php企业网站通讯录管理系统wordpress $数组
  • 网站建设完工后在什么科目核算北京网站制作服务