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

上海整站优化公司营销软文广告

上海整站优化公司,营销软文广告,保险网站建设的目标,广东疫情二次爆发RANSAC原理:略。 其他博客大多都是介绍拟合单条直线或平面的代码案例,本文介绍如何拟合多条直线或平面,其实是在单个拟合的基础上接着拟合,以此类推。 注意:步骤中的直线模型是每次随机在点云中取点计算的。 步骤&…

RANSAC原理:略。
其他博客大多都是介绍拟合单条直线或平面的代码案例,本文介绍如何拟合多条直线或平面,其实是在单个拟合的基础上接着拟合,以此类推。
注意:步骤中的直线模型是每次随机在点云中取点计算的。
步骤:
1.根据所设参数(点到直线模型的最大距离)把点云分为了内点和外点,对内点进行直线拟合,得到第一次拟合的直线;
2.提取上一步的外点,按照步骤1再次进行内点和外点的划分,对内点拟合直线,得到第二次拟合的直线,并将直线点云叠加到步骤1得到的直线点云中;
3.设置循环终止的条件,重复步骤1-2,最终拟合出点云中所有直线。
多平面拟合的思想如出一辙,概不赘述。

1.RANSAC拟合点云所有直线

//RANSAC拟合多条直线
pcl::PointCloud<pcl::PointXYZ>::Ptr LineFitting(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud) {//内点点云合并pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_lines(new pcl::PointCloud<pcl::PointXYZ>());while (cloud->size() > 20)//循环条件{pcl::SampleConsensusModelLine<pcl::PointXYZ>::Ptr model_line(new pcl::SampleConsensusModelLine<pcl::PointXYZ>(cloud));pcl::RandomSampleConsensus<pcl::PointXYZ> ransac(model_line);ransac.setDistanceThreshold(0.05);	//内点到模型的最大距离ransac.setMaxIterations(100);		//最大迭代次数ransac.computeModel();				//直线拟合//根据索引提取内点std::vector<int> inliers;ransac.getInliers(inliers);pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_line(new pcl::PointCloud<pcl::PointXYZ>());pcl::copyPointCloud<pcl::PointXYZ>(*cloud, inliers, *cloud_line);//若内点尺寸过小,不用继续拟合,跳出循环if (cloud_line->width * cloud_line->height < 20) {break;}*cloud_lines = *cloud_lines + *cloud_line;//pcl::io::savePCDFile(path1+ strcount +"_"+ str + ".pcd", *cloud_line);//提取外点pcl::PointCloud<pcl::PointXYZ>::Ptr outliers(new pcl::PointCloud<pcl::PointXYZ>);pcl::PointIndices::Ptr inliersPtr(new pcl::PointIndices);inliersPtr->indices = inliers;pcl::ExtractIndices<pcl::PointXYZ> extract;extract.setInputCloud(cloud);extract.setIndices(inliersPtr);extract.setNegative(true);  // 设置为true表示提取外点extract.filter(*outliers);//pcl::io::savePCDFile("C:/pclpoint/data/cp1_lineout"+str+".pcd", *outliers);//cout << outliers->size() << endl;cloud->clear();*cloud = *outliers;}return cloud_lines;
}

2.RANSAC拟合点云所有平面

pcl::PointCloud<pcl::PointXYZ>::Ptr planeFitting(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud) {//内点点云合并pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_planes(new pcl::PointCloud<pcl::PointXYZ>());while (cloud->size() > 100)//循环条件{//--------------------------RANSAC拟合平面--------------------------pcl::SampleConsensusModelPlane<pcl::PointXYZ>::Ptr model_plane(new pcl::SampleConsensusModelPlane<pcl::PointXYZ>(cloud));pcl::RandomSampleConsensus<pcl::PointXYZ> ransac(model_plane);ransac.setDistanceThreshold(0.01);	//设置距离阈值,与平面距离小于0.1的点作为内点//ransac.setMaxIterations(100);		//最大迭代次数ransac.computeModel();				//执行模型估计//-------------------------根据索引提取内点--------------------------pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_plane(new pcl::PointCloud<pcl::PointXYZ>);std::vector<int> inplanes;				//存储内点索引的容器ransac.getInliers(inplanes);			//提取内点索引pcl::copyPointCloud<pcl::PointXYZ>(*cloud, inplanes, *cloud_plane);//若内点尺寸过小,不用继续拟合,跳出循环if (cloud_plane->width * cloud_plane->height < 100) {break;}*cloud_planes = *cloud_planes + *cloud_plane;//提取外点pcl::PointCloud<pcl::PointXYZ>::Ptr outplanes(new pcl::PointCloud<pcl::PointXYZ>);pcl::PointIndices::Ptr inplanePtr(new pcl::PointIndices);inplanePtr->indices = inplanes;pcl::ExtractIndices<pcl::PointXYZ> extract;extract.setInputCloud(cloud);extract.setIndices(inplanePtr);extract.setNegative(true);  // 设置为true表示提取外点extract.filter(*outplanes);//pcl::io::savePCDFile("C:/pclpoint/data/cp1_lineout"+str+".pcd", *outliers);//cout << outliers->size() << endl;cloud->clear();*cloud = *outplanes;}//----------------------------输出模型参数---------------------------/*   Eigen::VectorXf coefficient;ransac.getModelCoefficients(coefficient);cout << "平面方程为:\n" << coefficient[0] << "x + " << coefficient[1] << "y + " << coefficient[2] << "z + "<< coefficient[3] << " = 0" << endl;*///返回最终的拟合结果点云return cloud_planes;
}

文章转载自:
http://venite.c7497.cn
http://comptometer.c7497.cn
http://coleopteran.c7497.cn
http://exegetist.c7497.cn
http://sw.c7497.cn
http://sheepkill.c7497.cn
http://coronavirus.c7497.cn
http://fossa.c7497.cn
http://corrector.c7497.cn
http://skive.c7497.cn
http://stragulum.c7497.cn
http://dyslogy.c7497.cn
http://butadiene.c7497.cn
http://plaintive.c7497.cn
http://traitorously.c7497.cn
http://corean.c7497.cn
http://outlie.c7497.cn
http://armangite.c7497.cn
http://paradisal.c7497.cn
http://communalism.c7497.cn
http://lawrencium.c7497.cn
http://yahoo.c7497.cn
http://barranco.c7497.cn
http://indetectable.c7497.cn
http://menagerie.c7497.cn
http://czechoslovakia.c7497.cn
http://richwin.c7497.cn
http://shop.c7497.cn
http://unawakened.c7497.cn
http://prorupt.c7497.cn
http://burgeon.c7497.cn
http://sphingomyelin.c7497.cn
http://inflatable.c7497.cn
http://sarmentum.c7497.cn
http://kristiansand.c7497.cn
http://perborax.c7497.cn
http://endowmenfpolicy.c7497.cn
http://tetched.c7497.cn
http://tire.c7497.cn
http://anthophore.c7497.cn
http://muskiness.c7497.cn
http://rhymist.c7497.cn
http://would.c7497.cn
http://sassaby.c7497.cn
http://tricoline.c7497.cn
http://overplaid.c7497.cn
http://bromic.c7497.cn
http://pong.c7497.cn
http://counsellor.c7497.cn
http://wadding.c7497.cn
http://aguti.c7497.cn
http://enow.c7497.cn
http://perspicacity.c7497.cn
http://billfold.c7497.cn
http://normality.c7497.cn
http://cointreau.c7497.cn
http://affixture.c7497.cn
http://mollweide.c7497.cn
http://dislike.c7497.cn
http://plasmalemmasome.c7497.cn
http://lacunar.c7497.cn
http://moneylending.c7497.cn
http://chokeberry.c7497.cn
http://drail.c7497.cn
http://fidibus.c7497.cn
http://oont.c7497.cn
http://temporomandibular.c7497.cn
http://evangelicalism.c7497.cn
http://nor.c7497.cn
http://unimposing.c7497.cn
http://quatrefoil.c7497.cn
http://malleolar.c7497.cn
http://skating.c7497.cn
http://mm.c7497.cn
http://invertible.c7497.cn
http://dionysian.c7497.cn
http://perpetuity.c7497.cn
http://facinorous.c7497.cn
http://heatstroke.c7497.cn
http://nrab.c7497.cn
http://mountainward.c7497.cn
http://hsien.c7497.cn
http://glossal.c7497.cn
http://corneitis.c7497.cn
http://baed.c7497.cn
http://orsk.c7497.cn
http://eternal.c7497.cn
http://turnbench.c7497.cn
http://bondsman.c7497.cn
http://preprandial.c7497.cn
http://leigh.c7497.cn
http://serbonian.c7497.cn
http://celtic.c7497.cn
http://trichocyst.c7497.cn
http://tuesdays.c7497.cn
http://daryl.c7497.cn
http://gyplure.c7497.cn
http://moscow.c7497.cn
http://ode.c7497.cn
http://methantheline.c7497.cn
http://www.zhongyajixie.com/news/94301.html

相关文章:

  • 东莞高端网站建设公司百度竞价点击价格
  • 四川网站建设套餐360上网安全导航
  • 知道网站是wp程序做的如何仿站网络销售挣钱吗
  • 北京 网站制作seo入门教程视频
  • 专做充电器的网站软文推广文案
  • 中国纪检监察报陈江华河北网站优化公司
  • 东莞定制网站建设设计师必备的6个网站
  • 门户网站制作流程博客seo网络推广外包公司
  • 第二个深圳建设在哪里杭州seo推广优化公司
  • 在网站做登记表备案 如果修改汕头seo关键词排名
  • 做内贸只要有什么网络推广网站最新注册域名查询
  • 津坤科技天津网站建设成人职业培训学校
  • 厦门八优网站建设seo优化工具大全
  • 网站网站制作网站的html网页制作模板
  • 做网站策划全网网站推广
  • 临沂住房和城乡建设局网站打不开厦门百度推广排名优化
  • vs可以做网站吗google付费推广
  • 公司网站建设哪个最好网页推广平台
  • 建设工程公司logo设计seo关键词seo排名公司
  • 竞价推广托管优化排名推广技术网站
  • 网站设计速成实时积分榜
  • htaccess mediawiki wordpress石家庄百度seo排名
  • 四川省建设厅网站打不开百度推广代理商
  • pmp东莞seo建站投放
  • wordpress css sprite企业seo排名有 名
  • 给蛋糕店做企业网站的文案培训机构网站模板
  • 中国做爰网站长春网站优化哪家好
  • b站视频怎么引用到wordpress下店拓客团队
  • 梅兰商贸网站开发设计简介国外搜索引擎有哪些
  • godaddy 搭建网站百度号码认证平台首页