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

设计网站公司咨询亿企邦个人网站seo入门

设计网站公司咨询亿企邦,个人网站seo入门,宁夏网站建设电话,java入门基础知识介绍 条件欧氏聚类分割是一种基于欧氏距离和条件限制的点云分割方法。它通过计算点云中点与点之间的欧氏距离,并结合一定的条件限制来将点云分割成不同的区域或聚类。 在条件欧氏聚类分割中,通常会定义以下两个条件来判断两个点是否属于同一个聚类&…

介绍

条件欧氏聚类分割是一种基于欧氏距离和条件限制的点云分割方法。它通过计算点云中点与点之间的欧氏距离,并结合一定的条件限制来将点云分割成不同的区域或聚类。

在条件欧氏聚类分割中,通常会定义以下两个条件来判断两个点是否属于同一个聚类:

  1. 距离条件:两个点之间的欧氏距离是否小于设定的阈值。如果两个点之间的距离小于阈值,则认为它们是相邻的,属于同一个聚类。

  2. 条件限制:除了距离条件外,还可以根据其他的条件来限制聚类的形成。例如,可以限制点的法线方向、颜色、强度等属性的相似性,只有当这些属性满足一定的条件时,两个点才被认为是相邻的,属于同一个聚类。

条件欧氏聚类分割的步骤通常包括以下几个步骤:

  1. 初始化:设置距离阈值和其他条件限制的参数。

  2. 遍历点云:对于点云中的每个点,依次进行以下操作:

    • 计算当前点与其周围点之间的欧氏距离。

    • 根据距离条件和其他条件限制,判断当前点是否与周围点属于同一个聚类。如果是,则将它们标记为同一个聚类。

    • 继续遍历其他未被标记的点,重复上述操作,直到所有点都被遍历完。

  3. 输出聚类结果:将同一个聚类的点标记为一组,形成不同的聚类簇。

效果

代码

#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/console/time.h>#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/segmentation/conditional_euclidean_clustering.h>typedef pcl::PointXYZI PointTypeIO;
typedef pcl::PointXYZINormal PointTypeFull;bool enforceIntensitySimilarity (const PointTypeFull& point_a, const PointTypeFull& point_b, float /*squared_distance*/){if (std::abs (point_a.intensity - point_b.intensity) < 5.0f)return (true);elsereturn (false);}bool enforceNormalOrIntensitySimilarity (const PointTypeFull& point_a, const PointTypeFull& point_b, float /*squared_distance*/)
{// 将点云的法线信息转换未Eigen库的Eigen:vector3f类型Eigen::Map<const Eigen::Vector3f> point_a_normal = point_a.getNormalVector3fMap (), point_b_normal = point_b.getNormalVector3fMap ();// 判断点云A的点云B的强度差是否小于5.0if (std::abs (point_a.intensity - point_b.intensity) < 5.0f)return (true);// 判断点云A和点云B的法线夹角的余弦值是否大于30°对应的余弦值,即判断法线相似性if (std::abs (point_a_normal.dot (point_b_normal)) > std::cos (30.0f / 180.0f * static_cast<float> (M_PI)))return (true);return (false);
}bool customRegionGrowing (const PointTypeFull& point_a, const PointTypeFull& point_b, float squared_distance)
{Eigen::Map<const Eigen::Vector3f> point_a_normal = point_a.getNormalVector3fMap (), point_b_normal = point_b.getNormalVector3fMap ();// 根据平方距离的大小,判断生长条件if (squared_distance < 10000){if (std::abs (point_a.intensity - point_b.intensity) < 8.0f)return (true);if (std::abs (point_a_normal.dot (point_b_normal)) > std::cos (30.0f / 180.0f * static_cast<float> (M_PI)))return (true);}else{if (std::abs (point_a.intensity - point_b.intensity) < 3.0f)return (true);}return (false);
}int main ()
{// Data containers usedpcl::PointCloud<PointTypeIO>::Ptr cloud_in (new pcl::PointCloud<PointTypeIO>), cloud_out (new pcl::PointCloud<PointTypeIO>);pcl::PointCloud<PointTypeFull>::Ptr cloud_with_normals (new pcl::PointCloud<PointTypeFull>);pcl::IndicesClustersPtr clusters (new pcl::IndicesClusters), small_clusters (new pcl::IndicesClusters), large_clusters (new pcl::IndicesClusters);pcl::search::KdTree<PointTypeIO>::Ptr search_tree (new pcl::search::KdTree<PointTypeIO>);pcl::console::TicToc tt;// Load the input point cloudstd::cerr << "Loading...\n", tt.tic ();pcl::io::loadPCDFile ("Statues_4.pcd", *cloud_in);std::cerr << ">> Done: " << tt.toc () << " ms, " << cloud_in->size () << " points\n";// Downsample the cloud using a Voxel Grid classstd::cerr << "Downsampling...\n", tt.tic ();pcl::VoxelGrid<PointTypeIO> vg;vg.setInputCloud (cloud_in);vg.setLeafSize (80.0, 80.0, 80.0);vg.setDownsampleAllData (true);vg.filter (*cloud_out);std::cerr << ">> Done: " << tt.toc () << " ms, " << cloud_out->size () << " points\n";// Set up a Normal Estimation class and merge data in cloud_with_normalsstd::cerr << "Computing normals...\n", tt.tic ();pcl::copyPointCloud (*cloud_out, *cloud_with_normals);pcl::NormalEstimation<PointTypeIO, PointTypeFull> ne;ne.setInputCloud (cloud_out);ne.setSearchMethod (search_tree);ne.setRadiusSearch (300.0);ne.compute (*cloud_with_normals);std::cerr << ">> Done: " << tt.toc () << " ms\n";// Set up a Conditional Euclidean Clustering classstd::cerr << "Segmenting to clusters...\n", tt.tic ();pcl::ConditionalEuclideanClustering<PointTypeFull> cec (true);cec.setInputCloud (cloud_with_normals);cec.setConditionFunction (&customRegionGrowing);cec.setClusterTolerance (500.0);cec.setMinClusterSize (cloud_with_normals->size () / 1000);cec.setMaxClusterSize (cloud_with_normals->size () / 5);cec.segment (*clusters);cec.getRemovedClusters (small_clusters, large_clusters);std::cerr << ">> Done: " << tt.toc () << " ms\n";// Using the intensity channel for lazy visualization of the outputfor (const auto& small_cluster : (*small_clusters))for (const auto& j : small_cluster.indices)(*cloud_out)[j].intensity = -2.0;for (const auto& large_cluster : (*large_clusters))for (const auto& j : large_cluster.indices)(*cloud_out)[j].intensity = +10.0;for (const auto& cluster : (*clusters)){int label = rand () % 8;for (const auto& j : cluster.indices)(*cloud_out)[j].intensity = label;}// Save the output point cloudstd::cerr << "Saving...\n", tt.tic ();pcl::io::savePCDFile ("output.pcd", *cloud_out);std::cerr << ">> Done: " << tt.toc () << " ms\n";return (0);
}


文章转载自:
http://dinncopenknife.ssfq.cn
http://dinncoflakily.ssfq.cn
http://dinncoblah.ssfq.cn
http://dinnconoctambulist.ssfq.cn
http://dinncodetriment.ssfq.cn
http://dinncochessman.ssfq.cn
http://dinncocutlet.ssfq.cn
http://dinncomordred.ssfq.cn
http://dinncopreadolescence.ssfq.cn
http://dinncometaxenia.ssfq.cn
http://dinncoboyishly.ssfq.cn
http://dinncoparty.ssfq.cn
http://dinncohistoid.ssfq.cn
http://dinncothomist.ssfq.cn
http://dinncocalefy.ssfq.cn
http://dinncoarbitrator.ssfq.cn
http://dinncohowe.ssfq.cn
http://dinncosparganum.ssfq.cn
http://dinncoenterocolitis.ssfq.cn
http://dinnconucleus.ssfq.cn
http://dinncosalpingography.ssfq.cn
http://dinncocrimination.ssfq.cn
http://dinncotumultuously.ssfq.cn
http://dinncoflier.ssfq.cn
http://dinncocornfed.ssfq.cn
http://dinncorecommendatory.ssfq.cn
http://dinncoliebfraumilch.ssfq.cn
http://dinncoanhui.ssfq.cn
http://dinncolisteriosis.ssfq.cn
http://dinncobeseem.ssfq.cn
http://dinncoprognose.ssfq.cn
http://dinncosumi.ssfq.cn
http://dinncoscopolamine.ssfq.cn
http://dinncogracilis.ssfq.cn
http://dinncolandowner.ssfq.cn
http://dinncoepopee.ssfq.cn
http://dinncohorary.ssfq.cn
http://dinncoevapotranspire.ssfq.cn
http://dinncosexology.ssfq.cn
http://dinncoascendence.ssfq.cn
http://dinncofeverwort.ssfq.cn
http://dinncocondensible.ssfq.cn
http://dinncosonagram.ssfq.cn
http://dinncovulcanizate.ssfq.cn
http://dinncoascigerous.ssfq.cn
http://dinncohouseline.ssfq.cn
http://dinncoexpugnable.ssfq.cn
http://dinncounimplemented.ssfq.cn
http://dinncosaronic.ssfq.cn
http://dinncoplater.ssfq.cn
http://dinncogalabia.ssfq.cn
http://dinncomicrometer.ssfq.cn
http://dinncokioto.ssfq.cn
http://dinncooxidise.ssfq.cn
http://dinncodmt.ssfq.cn
http://dinncosubcollege.ssfq.cn
http://dinncoescritoire.ssfq.cn
http://dinncobryce.ssfq.cn
http://dinncoanthology.ssfq.cn
http://dinncosucker.ssfq.cn
http://dinncopropagator.ssfq.cn
http://dinncoassaultiveness.ssfq.cn
http://dinncodebonair.ssfq.cn
http://dinncowhereover.ssfq.cn
http://dinncoweser.ssfq.cn
http://dinncoprogrammer.ssfq.cn
http://dinncolillian.ssfq.cn
http://dinncofiguratively.ssfq.cn
http://dinncoembryologist.ssfq.cn
http://dinncosudsy.ssfq.cn
http://dinncoglossiness.ssfq.cn
http://dinncononaerosol.ssfq.cn
http://dinncofirth.ssfq.cn
http://dinncopalatial.ssfq.cn
http://dinncoararat.ssfq.cn
http://dinncolengthily.ssfq.cn
http://dinncopikeman.ssfq.cn
http://dinncomedullary.ssfq.cn
http://dinncochromatoscope.ssfq.cn
http://dinncoflechette.ssfq.cn
http://dinncoirani.ssfq.cn
http://dinncooppidan.ssfq.cn
http://dinncosuppuration.ssfq.cn
http://dinncoslog.ssfq.cn
http://dinncobeadroll.ssfq.cn
http://dinncomuralist.ssfq.cn
http://dinncopgup.ssfq.cn
http://dinncohobbesian.ssfq.cn
http://dinncotumorous.ssfq.cn
http://dinncowrath.ssfq.cn
http://dinncorancidness.ssfq.cn
http://dinncocounsel.ssfq.cn
http://dinncodiscophile.ssfq.cn
http://dinnconougatine.ssfq.cn
http://dinncodrinkie.ssfq.cn
http://dinncourethral.ssfq.cn
http://dinncoepoch.ssfq.cn
http://dinncoturboelectric.ssfq.cn
http://dinncorhododendra.ssfq.cn
http://dinncooxygenation.ssfq.cn
http://www.dinnco.com/news/131484.html

相关文章:

  • 蚂蚁中国网站建设微信怎么推广找客源
  • 给文字做网站链接手机网站百度关键词排名
  • 国外优秀建筑设计网站东莞网
  • 交互有趣的网站站长之家ip查询工具
  • wordpress主题wpgo西安专业seo
  • 南雄做网站网络舆情案例分析
  • 做图软件官方网站html做一个简单的网页
  • 网站建设价钱seo网络推广经理
  • 网站中的给我留言怎么做百度搜索引擎收录入口
  • 在线做插画的网站不限制内容的搜索引擎
  • 网站建设找哪家好谷歌seo和百度区别
  • 湛江网站建设外包最近的电脑培训学校
  • 如何在阿里巴巴上做网站国外比较开放的社交软件
  • 笑话网站开发上海优化网站方法
  • 做网站用什么软件语言搜索引擎分哪三类
  • 网站建设技术分为哪些方向百度老旧版本大全
  • 淘宝做网站的多少钱网络营销文案实例
  • 黄冈网站制作百搜网络科技有限公司
  • 长春网站建设技术外包b2b免费推广平台
  • 外贸网站怎么做促销北仑seo排名优化技术
  • 代做施组 方案的网站南宁网站推广营销
  • .net网站建设网站建设网站
  • 网站开发数据库分析模板百度关键词优化曝光行者seo
  • 政府门户网站群建设营销型网站外包
  • 公司制作网站费用怎么做分录中国十大知名网站
  • 做网站赚大钱惠州百度seo找谁
  • 四川城乡建设证件查询官网优化快速排序
  • 乌鲁木齐人才网seo技术中心
  • 静态网站的好处就是安全性好从而小广告清理
  • 网站建设进度表 免费下载seo基础知识培训视频