%% 点云的配准
clc;
clear;
close all;
%% 导入数据
dataFile = fullfile(toolboxdir('vision'), 'visiondata', 'livingRoom.mat');
load(dataFile);
%% 依次将点云数据存出来
for i=1:length(livingRoomData)
pcwrite(livingRoomData{i},['house_init',num2str(i)],'PLYFormat','binary');
end
%% 参考点云数据
% Extract two consecutive point clouds and use the first point cloud as
% reference.
ptCloudRef = livingRoomData{1};
ptCloudCurrent = livingRoomData{2};
%% 显示点云
figure;
pcshow(ptCloudRef);
figure;
pcshow(ptCloudCurrent);
%% 点云的预处理
% Note that the downsampling step does not only speed up the registration,
% but can also improve the accuracy.
gridSize = 0.1;
fixed = pcdownsample(ptCloudRef, 'gridAverage', gridSize);
moving = pcdownsample(ptCloudCurrent, 'gridAverage', gridSize);
%% 确定点云之间的变换关系
% finding the rigid transformation for aligning the second point cloud with the first point cloud.
tform = pcregrigid(moving, fixed, 'Metric','pointToPlane','Extrapolate', true);
ptCloudAligned = pctransform(ptCloudCurrent,tform);
%% 点云的融合
%The overlapped region is filtered using a 1.5cm box grid filter.
%Increase the merge size to reduce the storage requirement of the
%resulting scene point cloud, and decrease the merge size to increase
%the scene resolution.
mergeSize = 0.015;
ptCloudScene = pcmerge(ptCloudRef, ptCloudAligned, mergeSize);
%% 融合后点云的显示
figure;
pcshow(ptCloudScene);
%% 多点云的融合
%To compose a larger 3-D scene, repeat the same procedure as above to process
%a sequence of point clouds. Use the first point cloud to establish the reference
%coordinate system. Transform each point cloud to the reference coordinate system.
%This transformation is a multiplication of pairwise transformations.
% Store the transformation object that accumulates the transformation.
accumTform = tform;
for i = 3:length(livingRoomData)
ptCloudCurrent = livingRoomData{i};
% 更新参考平面.
fixed = moving;
moving = pcdownsample(ptCloudCurrent, 'gridAverage', gridSize);
% ICP算法
tform = pcregrigid(moving, fixed, 'Metric','pointToPlane','Extrapolate', true);
% 变换到参考坐标系下面
accumTform = affine3d(tform.T * accumTform.T);
ptCloudAligned = pctransform(ptCloudCurrent, accumTform);
% 融合,并更新新的点云
ptCloudScene = pcmerge(ptCloudScene, ptCloudAligned, mergeSize);
end
%% 融合后点云的显示
figure;
pcshow(ptCloudScene);
pcwrite(ptCloudScene,'house','PLYFormat','binary');
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab实现多频外差模拟 上传版本.zip
共50个文件
ply:45个
png:4个
m:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 117 浏览量
2022-06-28
21:29:22
上传
评论
收藏 67.58MB ZIP 举报
温馨提示
Matlab实现多频外差模拟 上传版本.zip
资源推荐
资源详情
资源评论
收起资源包目录
Matlab实现多频外差模拟 上传版本.zip (50个子文件)
Matlab实现多频外差模拟 上传版本
house_init8.ply 3.41MB
house_init19.ply 3.22MB
house_init36.ply 3.25MB
house.ply 6.55MB
house_init37.ply 3.31MB
house_init39.ply 3.37MB
house_init4.ply 3.37MB
house_init12.ply 3.38MB
house_init6.ply 3.38MB
house_init3.ply 3.36MB
house_init27.ply 3.17MB
house_init18.ply 3.24MB
3.png 132KB
house_init28.ply 3.09MB
house_init11.ply 3.39MB
house_init40.ply 3.37MB
house_init1.ply 3.37MB
house_init30.ply 3.06MB
house_init31.ply 3.11MB
house_init42.ply 3.38MB
house_init15.ply 3.36MB
house_init43.ply 3.35MB
house_init20.ply 3.14MB
house_init21.ply 3.14MB
house_init16.ply 3.3MB
house_init5.ply 3.38MB
house_init14.ply 3.38MB
4.png 318KB
house_init23.ply 3.12MB
house_init17.ply 3.27MB
house_init35.ply 3.16MB
house_init34.ply 3.14MB
house_init7.ply 3.39MB
main.m 3KB
house_init13.ply 3.4MB
house_init22.ply 3.14MB
house_init25.ply 3.09MB
house_init10.ply 3.35MB
house_init44.ply 3.32MB
house_init2.ply 3.38MB
house_init26.ply 3.1MB
house_init24.ply 3.07MB
house_init33.ply 3.15MB
house_init9.ply 3.38MB
house_init38.ply 3.35MB
house_init29.ply 3.14MB
1.png 405KB
2.png 411KB
house_init32.ply 3.14MB
house_init41.ply 3.37MB
共 50 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7258
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功