通过matlab手册学习点云实例

本人初次接触matlab学习点云处理工作,现根据matlab自带的实例整理了一些常用的函数,以供将来的算法学习。
matlab2020a

pcbin_空间bin点云点

bins = pcbin(ptCloud,numBins)
bins =pcbin(ptCloud,numBins,spatialLimits)
[bins,binLocations] = pcbin()

从点云构建占用网格
openExample('vision/BuildOccupancyGridFromPointCloudExample')

从点云中构建鸟瞰密度网格
openExample('vision/BuildBirdsEyeViewDensityGridFromPointCloudExample')

pcdenoise_去噪

ptCloudOut = pcdenoise(ptCloudIn)
[ptCloudOut,inlierIndices,outlierIndices] = pcdenoise(ptCloudIn)
[ptCloudOut,___] = pcdenoise(___Name,Value)

从嘈杂点云中移除异常值
openExample('vision/RemoveOutliersFromNoisyPointCloudExample')

pcdownsample_降采样

ptCloudOut = pcdownsample(ptCloudIn,‘random’,percentage)
ptCloudOut = pcdownsample(ptCloudIn,‘gridAverage’,gridStep)
ptCloudOut = pcdownsample(ptCloudIn,‘nonuniformGridSample’,maxNumPoints)

使用盒式网格过滤器对点云进行下采样
openExample('vision/DownsampleAPointCloudWithBoxGridFilterExample')

从点云中删除冗余点
openExample('vision/RemoveRedundantPointsFromPointCloudExample')

pcnormals_估计点云的法线

normals = pcnormals(ptCloud)
normals = pcnormals(ptCloud,k)

点云的估计法线
openExample('vision/EstimateNormalsOfPointCloudExample')

pcmerge_合并点云

ptCloudOut = pcmerge(ptCloudA,ptCloudB,gridStep)

使用方格滤镜合并两个相同的点云
openExample('vision/MergeTwoIdenticalPointCloudsWithBoxGridFilterExample')

pcsegdist_基于欧几里得距离将点云分割成群组

labels = pcsegdist(ptCloud,minDistance)
[labels,numClusters] = pcsegdist(ptCloud,minDistance)

基于欧氏距离的聚类点云
openExample('vision/ClusterSphericalPointCloudBasedOnEuclideanDistanceExample')

基于欧氏距离的集群激光雷达点云技术

openExample('vision/ClusterLidarPointCloudBasedOnEuclideanDistanceExample')

segmentLidarData_将有组织的3-D范围数据分割为聚类

labels = segmentLidarData(ptCloud,distThreshold)
labels = segmentLidarData(ptCloud,distThreshold,angleThreshold)
[labels,numClusters] = segmentLidarData(___)

集群组织的合成激光雷达数据
openExample('vision/ClusterOrganizedSyntheticLidarDataExample')

集群组织的激光雷达点云
openExample('vision/ClusterOrganizedLidarPointCloudExample')

segmentGroundFromLidarData_从组织的激光雷达数据中分割地面点

groundPtsIdx = segmentGroundFromLidarData(ptCloud)
groundPtsIdx = segmentGroundFromLidarData(ptCloud,Name,Value)

对有组织的激光雷达数据进行分割和绘图
openExample('vision/FindGroundPointsFromOrganizedPointCloudExample')

使用PCAP文件对地面平面进行分割和绘制
openExample('vision/FindGroundFromPointCloudsPCAPFileExample')

findNearestNeighbors_在点云中查找点的最近邻居

[indices,dists] = findNearestNeighbors(ptCloud,point,K)
[indices,dists] = findNearestNeighbors(ptCloud,point,K,camMatrix)
[indices,dists] = findNearestNeighbors(___,Name,Value)

在点云中找到K-最近点领域
openExample('vision/FindKNearestNeighborsExample')

在有组织的点云中找到K-最近点领域
openExample('vision/FindKNearestInOrganizedPointCloudExample')

findNeighborslnRadius_在点云中找到点半径内的邻居

[indices,dists] = findNeighborsInRadius(ptCloud,point,radius)
[indices,dists] = findNeighborsInRadius(ptCloud,point,radius,camMatrix)
[indices,dists] = findNeighborsInRadius(___,Name,Value)

查找点云径向邻居
openExample('vision/FindNeighborsWithinRadiusOfAPointExample')

在有组织的点云中找到径向邻居
openExample('vision/FindRadialNeighborsInOrganizedPointCloudExample')

findPointsROI_在点云中查找感兴趣区域内的点

indices = findPointsInROI(ptCloud,roi)
indices = findpointsInROI(ptCloud,roi,camMatrix)

在长方体ROI点寻找点云openExample('vision/FindPointsWithinCuboidExample')

在长方体ROI组织点寻找点云
openExample('vision/FindCuboidInOrganizedPointCloudExample')

removeInvalidPoints_从点云中删除无效点

[ptCloudOut,indices] = removeInvalidPoints(ptCloud)
从点云中删除无效点
openExample(‘vision/RemoveInfinitevaluedPointsFromAPointCloudExample’)

createPoseGraph_创建姿势图

G = createPoseGraph(vSet)

创建点云视图集姿态图形
openExample('vision/CreatePoseGraphFromPointCloudViewSetExample')

optimizePoses_使用相对姿态约束优化绝对姿态

vSetOptim = optimizePoses(vSet)
vSetOptim = optimizePoses(vSet,Name,Value)

openExample('vision/CreateAndOptimizeAPoseGraphExample')

pctransform_变换3D点云

ptCloudOut = pctransform(ptCloudIn,tform)
ptCloudOut = pctransform(ptCloudIn,D)

旋转3d点云使用刚体变换
openExample('vision/Rotate3DPointCloudUsingRigidTransformationExample')

3d点云的仿射变换
openExample('vision/Rotate3DPointCloudExample')

使用位移场点云转换
openExample('vision/PointCloudTransformationUsingDisplacementFieldExample')

Pcregistericp_使用ICP算法注册两点云

tform = pcregistericp(moving,fixed)
[tform,movingReg] = pcregistericp(moving,fixed)
[___,rmse] = pcregistericp(moving,fixed)
[___] = pcregistericp(moving,fixed,Name,Value)

使用ICP算法对齐两个点云
openExample('vision/AlignTwoPointCloudsUsingICPAlgorithmExample')

Pcregistercpd_使用CPD算法注册两点云

tform = pcregistercpd(moving,fixed)
[tform,movingReg] = pcregistercpd(moving,fixed)
[___,rmse] = pcregistercpd(moving,fixed)
[___] = pcregistercpd(moving,fixed,Name,Value)

使用cpd算法对齐两个点云
openExample('vision/AlignTwoPointCloudsUsingCPDAlgorithmExample')

Pcregisterndt_使用NDT算法注册两点云

tform = pcregisterndt(moving,fixed,gridStep)
[tform,movingReg] = pcregisterndt(moving,fixed,gridStep)
[___,rmse] = pcregisterndt(moving,fixed,gridStep)
[___] = pcregisterndt(moving,fixed,gridStep,Name,Value)

使用ndt算法对齐两个点云
openExample('vision/AlignTwoPointCloudsUsingNDTAlgorithmExample')

Rigid3d_3-D刚性几何变换

tform = rigid3d
tform = rigid3d(t)
tform = rigid3d(rot,trans)

与定义的平移和旋转生成刚性3-d对象
openExample('vision/ConstructARigid3DObjectThatDefinesTranslationAndRotationExample')

pcfitcylinder_使圆柱适合3D点云

model = pcfitcylinder(ptCloudIn,maxDistance)
model = pcfitcylinder(ptCloudIn,maxDistance,referenceVector)
model = pcfitcylinder(ptCloudIn,maxDistance,referenceVector,maxAngularDistance)
[model,inlierIndices,outlierIndices] = pcfitcylinder(ptCloudIn,maxDistance)
[___,meanError] = pcfitcylinder(ptCloudIn,maxDistance)
[___] = pcfitcylinder(___,Name,Value)

点云中提取圆柱
openExample('vision/DetectACylinderFromPointCloudExample')

检测圆柱的点云
openExample('vision/DetectCylinderInPointCloudExample')

Pcfitplane_使平面适合3D点云

model = pcfitplane(ptCloudIn,maxDistance)
model = pcfitplane(ptCloudIn,maxDistance,referenceVector)
model = pcfitplane(ptCloudIn,maxDistance,referenceVector,maxAngularDistance)
[model,inlierIndices,outlierIndices] = pcfitplane(ptCloudIn,maxDistance)
[___,meanError] = pcfitplane(ptCloudIn,maxDistance)
[___] = pcfitplane(ptCloudIn,maxDistance,Name,Value)

点云检测多个平面
openExample('vision/DetectMultiplePlanesFromPointCloudExample')

pcfitsphere_使球体适合3D点云

model = pcfitsphere(ptCloudIn,maxDistance)
[model,inlierIndices,outlierIndices] = pcfitsphere(ptCloudIn,maxDistance)
[___,meanError] = pcfitsphere(ptCloudIn,maxDistance)
[___] = pcfitsphere(___,Name,Value)

点云检测球
openExample('vision/DetectSpherePointCloudExample')

fitPolynomialRANSAC_使用RANSAC将多项式拟合为点

P = fitPolynomialRANSAC(xyPoints,N,maxDistance)
[P,inlierIdx] = fitPolynomialRANSAC(___)
[___] = fitPolynomialRANSAC(___,Name,Value)

符合抛物线噪声数据使用RANSAC

Ransac_使模型适合嘈杂的数据

[model,inlierIdx] = ransac(data,fitFcn,distFcn,sampleSize,maxDistance)
[___] = ransac(___,Name,Value)

拟合线2d点使用最小二乘和RANSAC算法
openExample('vision/FitLineTo2DPointsUsingLeastSquaresAndRANSACAlgorithmsExample')

cylinderModel class_用于存储参数圆柱模型的对象

model = cylinderModel(params)

planeModel_用于存储参数平面模型的对象

model = planeModel(Parameters)

sphereModel class_用于存储参数球模型的对象

model = sphereModel(params)

Pcread_从PLY或PCD文件读取3-D点云

ptCloud = pcread(filename)

openExample('vision/ReadAPointCloudFromAPLYFileExample')

Pcwrite_将3-D点云写入PLY或PCD文件

pcwrite(ptCloud,filename)
pcwrite(ptCloud,filename,‘Encoding’,encodingType)

Ply
openExample('vision/WriteA3DPointCloudToAPLYFileExample')
Pcd
openExample('vision/Write3DOrganizedPointCloudToPCDFileExample')

Pcfromkinect_Windows版Kinect的点云

ptCloud = pcfromkinect(depthDevice,depthImage)
ptCloud = pcfromkinect(depthDevice,depthImage,colorImage)
ptCloud = pcfromkinect(depthDevice,depthImage,colorImage,alignment)

velodyneFileReader_从Velodyne PCAP文件读取点云数据

veloReader = velodyneFileReader(fileName,deviceModel)
veloReader = velodyneFileReader(fileName,deviceModel,‘CalibrationFile’,calibFile)

openExample('vision/DisplayPointCloudsFromVelodynePCAPFileExample')

Pcshow_绘制3-D点云

pcshow(ptCloud)
pcshow(xyzPoints)
pcshow(xyzPoints,color)
pcshow(xyzPoints,colorMap)
pcshow(filename)
pcshow(___,Name,Value)
ax = pcshow(___)

绘制球面点云与纹理映射
openExample('vision/PlotColorSphericalPointCloudExample')

Pcshowpair_可视化两点云之间的差异

pcshowpair(ptCloudA,ptCloudB)
pcshowpair(ptCloudA,ptCloudB,Name,Value)
ax = pcshowpair(___)

可视化两个点云之间的区别
openExample('vision/VisualizeDifferenceBetweenTwoPointCloudsExample')

Pcplayer_可视化流式3-D点云数据

player = pcplayer(xlimits,ylimits,zlimits)
player = pcplayer(xlimits,ylimits,zlimits,Name,Value)

openExample('vision/VisualizeDifferenceBetweenTwoPointCloudsExample')

Pcviewset_管理基于点云的视觉里程表和SLAM的数据

vSet = pcviewset

使用点云登记进行雷达测程
openExample('vision/LidarOdometryUsingPointCloudRegistrationExample')

pointCloud_ 用于存储3-D点云的对象

ptCloud = pointCloud(xyzPoints)
ptCloud = pointCloud(xyzPoints,Name,Value)

openExample('vision/CreatePointCloudObjectAndInspectPropertiesExample')

你可能感兴趣的:(matlab点云处理)