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

做购物网站开发价格合肥新房在售楼盘

做购物网站开发价格,合肥新房在售楼盘,网站建设都有什么类型,新手怎样学校做网站RANSAC原理#xff1a;略。 其他博客大多都是介绍拟合单条直线或平面的代码案例#xff0c;本文介绍如何拟合多条直线或平面#xff0c;其实是在单个拟合的基础上接着拟合#xff0c;以此类推。 注意#xff1a;步骤中的直线模型是每次随机在点云中取点计算的。 步骤…RANSAC原理略。 其他博客大多都是介绍拟合单条直线或平面的代码案例本文介绍如何拟合多条直线或平面其实是在单个拟合的基础上接着拟合以此类推。 注意步骤中的直线模型是每次随机在点云中取点计算的。 步骤 1.根据所设参数点到直线模型的最大距离把点云分为了内点和外点对内点进行直线拟合得到第一次拟合的直线 2.提取上一步的外点按照步骤1再次进行内点和外点的划分对内点拟合直线得到第二次拟合的直线并将直线点云叠加到步骤1得到的直线点云中 3.设置循环终止的条件重复步骤1-2最终拟合出点云中所有直线。 多平面拟合的思想如出一辙概不赘述。 1.RANSAC拟合点云所有直线 //RANSAC拟合多条直线 pcl::PointCloudpcl::PointXYZ::Ptr LineFitting(pcl::PointCloudpcl::PointXYZ::Ptr cloud) {//内点点云合并pcl::PointCloudpcl::PointXYZ::Ptr cloud_lines(new pcl::PointCloudpcl::PointXYZ());while (cloud-size() 20)//循环条件{pcl::SampleConsensusModelLinepcl::PointXYZ::Ptr model_line(new pcl::SampleConsensusModelLinepcl::PointXYZ(cloud));pcl::RandomSampleConsensuspcl::PointXYZ ransac(model_line);ransac.setDistanceThreshold(0.05); //内点到模型的最大距离ransac.setMaxIterations(100); //最大迭代次数ransac.computeModel(); //直线拟合//根据索引提取内点std::vectorint inliers;ransac.getInliers(inliers);pcl::PointCloudpcl::PointXYZ::Ptr cloud_line(new pcl::PointCloudpcl::PointXYZ());pcl::copyPointCloudpcl::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::PointCloudpcl::PointXYZ::Ptr outliers(new pcl::PointCloudpcl::PointXYZ);pcl::PointIndices::Ptr inliersPtr(new pcl::PointIndices);inliersPtr-indices inliers;pcl::ExtractIndicespcl::PointXYZ extract;extract.setInputCloud(cloud);extract.setIndices(inliersPtr);extract.setNegative(true); // 设置为true表示提取外点extract.filter(*outliers);//pcl::io::savePCDFile(C:/pclpoint/data/cp1_lineoutstr.pcd, *outliers);//cout outliers-size() endl;cloud-clear();*cloud *outliers;}return cloud_lines; }2.RANSAC拟合点云所有平面 pcl::PointCloudpcl::PointXYZ::Ptr planeFitting(pcl::PointCloudpcl::PointXYZ::Ptr cloud) {//内点点云合并pcl::PointCloudpcl::PointXYZ::Ptr cloud_planes(new pcl::PointCloudpcl::PointXYZ());while (cloud-size() 100)//循环条件{//--------------------------RANSAC拟合平面--------------------------pcl::SampleConsensusModelPlanepcl::PointXYZ::Ptr model_plane(new pcl::SampleConsensusModelPlanepcl::PointXYZ(cloud));pcl::RandomSampleConsensuspcl::PointXYZ ransac(model_plane);ransac.setDistanceThreshold(0.01); //设置距离阈值与平面距离小于0.1的点作为内点//ransac.setMaxIterations(100); //最大迭代次数ransac.computeModel(); //执行模型估计//-------------------------根据索引提取内点--------------------------pcl::PointCloudpcl::PointXYZ::Ptr cloud_plane(new pcl::PointCloudpcl::PointXYZ);std::vectorint inplanes; //存储内点索引的容器ransac.getInliers(inplanes); //提取内点索引pcl::copyPointCloudpcl::PointXYZ(*cloud, inplanes, *cloud_plane);//若内点尺寸过小不用继续拟合跳出循环if (cloud_plane-width * cloud_plane-height 100) {break;}*cloud_planes *cloud_planes *cloud_plane;//提取外点pcl::PointCloudpcl::PointXYZ::Ptr outplanes(new pcl::PointCloudpcl::PointXYZ);pcl::PointIndices::Ptr inplanePtr(new pcl::PointIndices);inplanePtr-indices inplanes;pcl::ExtractIndicespcl::PointXYZ extract;extract.setInputCloud(cloud);extract.setIndices(inplanePtr);extract.setNegative(true); // 设置为true表示提取外点extract.filter(*outplanes);//pcl::io::savePCDFile(C:/pclpoint/data/cp1_lineoutstr.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://www.dnsts.com.cn/news/59778.html

相关文章:

  • 国外设计网站pinterest设计网址中建西部建设西南有限公司网站
  • 不需要验证码的注册网站旅游网站首页模板
  • wordpress 防刷新网站性能优化
  • 网站构成有口碑的app制作
  • 电子烟网站设计专业的龙岗网站建设
  • 网站上的通话功能怎么做宁波网站建设
  • 这个网站的建设流程网站备案完成后不解析
  • 用vue做网站的实例网站建设接活
  • 青岛网站制作计划济南建设工程备案网站
  • 小程序免费制作平台有哪些seo到底是做什么的
  • 网站的分类有哪些内容百度推广登录网址
  • 网站彩票怎么做长沙装修公司前十强
  • 目前网页设计工资多少自己的网站怎么做关键词优化
  • 乐清做网站公司哪家好优良的定制网站建设
  • 满山红厦门网站建设优化大师app下载
  • 网站备案成功造价材料价格信息网
  • 建设网站需要准备什么资料班级网站布局
  • 网站设计评价免费网站重生做军嫂
  • 做网站容易学吗电子商务毕业设计 网站建设
  • 大企业网站建设花瓣网是仿国外那个网站做的
  • 网站怎么收费手机端网站建设的费用清单
  • 惠城营销网站制作网络营销就是
  • 上线了做网站价格贵网页传奇游戏黑屏怎么解决
  • 网站开发公司会计科目wordpress 解析插件
  • 新乡建设网站昆明出入最新规定
  • 河北商城网站建设价格低网店分销系统
  • 做网站怎么加水平线网络营销的特点不包括什么
  • 建一个网站素材哪里来wordpress不能分类
  • 合肥花境建设网站给大家推荐免费视频服务器
  • 铁法能源公司网站网站底部导航菜单