[SLAM]2D激光线特征提取
1.个人资源索引2.SLAM学习笔记(1)基本概念3.SLAM学习笔记(2)SLAM算法4.[ROS]2 尝试编译OrbSLAM5.[ROS]1 小乌龟6.SLAM最近的工作7.SLAM学习笔记(3)相关概念
8.[SLAM]2D激光线特征提取
9.[SLAM] GMapping SLAM源码阅读(草稿)10.[QGLViewer]First Demo11.SLAM数据集12.[SLAM]2D激光扫描匹配方法13.[g2o]一个备忘14.[ROS] slam_gmapping15.[ROS]3 Linux编程练习16.Linux学习和ROS安装(1)17.小豆包的学习之旅:机器人定位18.小豆包的学习之旅:传感器观测模型19.Kinect2.0相机标定20.小豆包的学习之旅:里程计运动模型21.小豆包的学习之旅:入门篇22.Kinect2.0点云数据获取23.[硬件]Robot运动控制24.[硬件]Urg_viewer数据读取25.[硬件]三维点云数据获取26.Kinect2.0获取数据27.ndt histogram_direction28.rplidar & hector slam without odometry29.rplidar测试30.[原创]NDT方法在SLAM中的应用31.[SLAM]Karto SLAM算法学习(草稿)32.ROS学习备忘33.[ROS]激光驱动安装34.OrbSLAM2采集点云数据35.Cartographer源码阅读(8):imu_tracker36.[硬件]点云数据采集237.Cartographer源码阅读(9):图优化的前端——闭环检测38.Cartographer源码阅读(7):轨迹推算和位姿推算的原理39.Ethzasl MSF源码阅读(3):MSF_Core和PoseMeasurement40.Ethzasl MSF源码阅读(2):百川汇海41.Ethzasl MSF源码阅读(1):程序入口和主题订阅42.Cartographer源码阅读(6):LocalTrajectoryBuilder和PoseExtrapolator43.Cartographer源码阅读(5):PoseGraph位姿图44.Cartographer源码阅读(4):Node和MapBuilder对象245.Cartographer源码阅读(3):程序逻辑结构46.Cartographer源码阅读(2):Node和MapBuilder对象47.Cartographer源码阅读(1):程序入口48.实时Cartographer测试(1) - rplidar49.Cartographer安装50.ROS安装(2)51.[ROS]一些传感器数据读取融合问题的思考52.小豆包的学习之旅:占用概率栅格地图和cost-map53.小豆包的学习之旅:开发记录54.[概述]移动机器人自主探索55.MRPT编译Nguyen, V., et al. (2007)."A comparison of line extraction algorithms using 2D range data for indoor mobile robotics." Autonomous Robots 23(2): 97-111.
论文提出了6中从二维激光扫描数据中提取线段的方法
1.分割合并算法
有的时候十分烦那些斜着的连线,实际不是想要的。
2.回归方法
先聚类,再回归
3.累积、区域生长算法
感觉对噪声数据真的没办法了,窝成一团的点,提取的线十分破碎而且乱...

1 function [ lineSegCoord ] = extractLineSegment( model,normals,intervalPts,normalDelta,dThreshold) 2 %EXTRACTLINESEGMENT Summary of this function goes here 3 % Detailed explanation goes here 4 if (nargin == 0) || isempty(model) 5 lineSegCoord = []; 6 return; 7 end; 8 ns = createns(model','NSMethod','kdtree') 9 pts=size(model,2); 10 if (nargin == 3) 11 normalDelta=0.9; 12 dThreshold=0.5; 13 end 14 if isempty(normals) 15 normals=zeros(2,pts); 16 for nor=1:pts 17 [idx, dist] = knnsearch(ns,model(:,nor)','k',2); 18 data=model(:,idx); 19 men=mean(data,2); 20 rep= repmat(men,1,size(data,2)); 21 data = data - rep; 22 % Compute the MxM covariance matrix A 23 A = cov(data'); 24 % Compute the eigenvector of A 25 [V, LAMBDA] = eig(A); 26 % Find the eigenvector corresponding to the minimum eigenvalue in A 27 % This should always be the first column, but check just in case 28 [~,idx] = min(diag(LAMBDA)); 29 % Normalize 30 V = V(:,idx)./norm(V(:,idx)); 31 %定向 32 normals(:,nor)=V; 33 end 34 end 35 36 lineSeg=[1;1]; 37 newLineIdx=1; 38 for j=2:pts-1 39 current=model(:,j); 40 pre=model(:,j-1); 41 next=model(:,j+1); 42 curNormal=normals(:,j); 43 preNormal=normals(:,j-1); 44 nextNormal=normals(:,j+1); 45 [d,vPt]=Dist2D_Point_to_Line(current,pre,next); 46 dis=norm(current-pre); 47 delta=dot(curNormal,preNormal)/(norm(curNormal)*norm(preNormal)); 48 if(delta>normalDelta&& d<dThreshold) %注意两个阈值 49 lineSeg(2,newLineIdx)=lineSeg(2,newLineIdx)+1;%点数 50 else 51 newLineIdx=newLineIdx+1; 52 lineSeg=[lineSeg [1; 1]]; 53 lineSeg(1,newLineIdx)=lineSeg(1,newLineIdx-1)+ lineSeg(2,newLineIdx-1);%起始点索引 54 end 55 end 56 indexLs=1; 57 lineSegCoord=[]; 58 for k=1:size(lineSeg,2) 59 from=lineSeg(1,k); 60 to=from+lineSeg(2,k)-1; 61 if(lineSeg(2,k) > intervalPts) 62 try 63 pts= model(:,(from:to)); 64 coef1 = polyfit(pts(1,:),pts(2,:),1); 65 k2 = coef1(1); 66 b2 = coef1(2); 67 coef2 = robustfit(pts(1,:),pts(2,:),'welsch'); 68 k2 = coef2(2); 69 b2 = coef2(1); 70 ML = true; 71 catch 72 ML = false; 73 end; 74 [D,fPb]= Dist2D_Point_to_Line(model(:,from),[0 b2]',[1 k2+b2]'); 75 [D,tPb]= Dist2D_Point_to_Line(model(:,to),[0 b2]',[1 k2+b2]'); 76 interval=abs(model(1,from) -model(1,to)); 77 if(interval>0.05) 78 x = linspace(fPb(1) ,tPb(1), 5); 79 if ML 80 y_ML = k2*x +b2; 81 lineSegCoord=[lineSegCoord [fPb(1) fPb(2) tPb(1) tPb(2)]']; 82 plot(x, y_ML, 'b-', 'LineWidth', 1); 83 end; 84 else 85 y = linspace(fPb(2) ,tPb(2), 5); 86 if ML 87 x_ML =(y-b2)/k2; 88 lineSegCoord=[lineSegCoord [fPb(1) fPb(2) tPb(1) tPb(2)]']; 89 plot(x_ML, y, 'b-', 'LineWidth', 1); 90 end; 91 end; 92 % try 93 % tmpPts= model(:,(from:to)); 94 % Theta_ML = estimate_line_ML(tmpPts,[], sigma, 0); 95 % ML = true; 96 % catch 97 % % probably the optimization toolbox is not installed 98 % ML = false; 99 % end; 100 % interval=abs(model(1,from) -model(1,to)); 101 % if(interval>10) 102 % x = linspace(model(1,from) ,model(1,to), 5); 103 % if ML 104 % y_ML = -Theta_ML(1)/Theta_ML(2)*x - Theta_ML(3)/Theta_ML(2); 105 % lineSegCoord=[lineSegCoord [x(1) y_ML(1) x(5) y_ML(5)]']; 106 % plot(x, y_ML, 'b-', 'LineWidth', 1); 107 % end; 108 % else 109 % y = linspace(model(2,from) ,model(2,to), 5); 110 % if ML 111 % x_ML = -Theta_ML(2)/Theta_ML(1)*y - Theta_ML(3)/Theta_ML(1); 112 % lineSegCoord=[lineSegCoord [x_ML(1) y(1) x_ML(5) y(5)]']; 113 % plot(x_ML, y, 'b-', 'LineWidth', 1); 114 % end; 115 % end; 116 end 117 end 118 end
4.Ransac方法
5.霍夫变换方法
6.EM方法
作者:太一吾鱼水
文章未经说明均属原创,学习笔记可能有大段的引用,一般会注明参考文献。
欢迎大家留言交流,转载请注明出处。
合集:
SLAM
分类:
Robot & SLAM
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· Vue3状态管理终极指南:Pinia保姆级教程
2014-07-16 [SharpDevelop]程序入口
2014-07-16 [SharpDevelop]菜单状态更新