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

CloudCompare——统计滤波

目录

  • 1.统计滤波
  • 2.软件实现
  • 3.完整操作
  • 4.算法源码
  • 5.相关代码

在这里插入图片描述

本文由CSDN点云侠原创,CloudCompare——统计滤波,爬虫自重。如果你不是在点云侠的博客中看到该文章,那么此处便是不要脸的爬虫。

1.统计滤波

  算法原理见:PCL 统计滤波器。

2.软件实现

参数设置
在这里插入图片描述

3.完整操作

在这里插入图片描述

4.算法源码

ReferenceCloud* CloudSamplingTools::sorFilter(	GenericIndexedCloudPersist* inputCloud,int knn/*=6*/,double nSigma/*=1.0*/,DgmOctree* inputOctree/*=0*/,GenericProgressCallback* progressCb/*=0*/)
{if (!inputCloud || knn <= 0 || inputCloud->size() <= static_cast<unsigned>(knn)){//invalid inputassert(false);return nullptr;}DgmOctree* octree = inputOctree;if (!octree){//compute the octree if necessaryoctree = new DgmOctree(inputCloud);if (octree->build(progressCb) < 1){delete octree;return nullptr;}}//outputReferenceCloud* filteredCloud = nullptr;for (unsigned step = 0; step < 1; ++step) //fake loop for easy break{unsigned pointCount = inputCloud->size();std::vector<PointCoordinateType> meanDistances;try{meanDistances.resize(pointCount, 0);}catch (const std::bad_alloc&){//not enough memorybreak;}double avgDist = 0;double stdDev = 0;//1st step: compute the average distance to the neighbors{//additional parametersvoid* additionalParameters[] = {reinterpret_cast<void*>(&knn),reinterpret_cast<void*>(&meanDistances)};unsigned char octreeLevel = octree->findBestLevelForAGivenPopulationPerCell(knn);if (octree->executeFunctionForAllCellsAtLevel(	octreeLevel,&applySORFilterAtLevel,additionalParameters,true,progressCb,"SOR filter") == 0){//something went wrongbreak;}//deduce the average distance and std. dev.double sumDist = 0;double sumSquareDist = 0;for (unsigned i = 0; i < pointCount; ++i){sumDist += meanDistances[i];sumSquareDist += meanDistances[i] * meanDistances[i];}avgDist = sumDist / pointCount;stdDev = sqrt(std::abs(sumSquareDist / pointCount - avgDist*avgDist));}//2nd step: remove the farthest points {//deduce the max distancedouble maxDist = avgDist + nSigma * stdDev;filteredCloud = new ReferenceCloud(inputCloud);if (!filteredCloud->reserve(pointCount)){//not enough memorydelete filteredCloud;filteredCloud = nullptr;break;}for (unsigned i = 0; i < pointCount; ++i){if (meanDistances[i] <= maxDist){filteredCloud->addPointIndex(i);}}filteredCloud->resize(filteredCloud->size());}}if (!inputOctree){delete octree;octree = nullptr;}return filteredCloud;
}

5.相关代码

  • PCL 统计滤波器
  • PCL 统计滤波(C++详细过程版)
  • Open3D(C++) 统计滤波
  • Open3D 统计滤波器
  • matlab 点云统计滤波
http://www.lryc.cn/news/132754.html

相关文章:

  • nodejs+vue古诗词在线测试管理系统
  • 174-地下城游戏
  • Linux定时任务crontab
  • golang字符串切片去重
  • git如何检查和修改忽略文件和忽略规则
  • Android AppCompatActivity标题栏操作
  • 解决conda activate报错
  • FreeMarker--表达式和运算符的用法(全面/有示例)
  • 设计模式 -- 策略模式(传统面向对象与JavaScript 的对比实现)
  • 非常详细的 Ceph 介绍、原理、架构
  • js 的正则表达式(二)
  • 星际争霸之小霸王之小蜜蜂(四)--事件监听-让小蜜蜂动起来
  • Visual Studio 2022 你必须知道的实用调试技巧
  • Webgl 存储限定符attribute、gl.getAttribLocation、gl.vertexAttrib3f及其同族函数和矢量版本的介绍
  • postgresql跨库创建视图
  • FPGA时钟
  • FifthOne:计算机视觉提示和技巧
  • Oracle19c-补丁升级报错合集(一)
  • 嵌入式:ARM Day6
  • ClickHouse安装步骤
  • Android CCodec (二十) CCodec Native服务实现分析
  • Shell编程学习之while循环语句和for循环语句的应用
  • 【校招VIP】CSS校招考点之选择器优先级
  • Netty+springboot开发即时通讯系统笔记(四)终
  • java -jar 启动服务后,关闭命令窗口后服务停止
  • Android PowerManager的使用
  • 安防监控/视频集中存储/云存储平台EasyCVR v3.3增加首页告警类型
  • 7-6 统计字符出现次数
  • 美国大模型风向速报(一)为何重视提示工程?LangChain+向量数据库+开源大模型真香...
  • excel统计函数篇2之count系列