[MATLAB point cloud processing] Merging of point clouds

pcmerge(ptCloudA,ptCloudB,gridStep) Merge two point clouds and perform voxel downsampling
Voxel downsampling: reduce point cloud data and concentrate the number of point clouds. Reference link Point cloud voxel downsampling ❤️ (Voxel centroid | Voxel center)
Point cloud filtering - voxel grid filter
Voxel grid filter:
The concept of voxel is similar to pixel, and pixels are two-dimensional one by one Points, and voxels are three-dimensional small spaces. Create a 3D voxel grid on the input point cloud data (think of the voxel grid as a tiny 3D small space in a set of spaces). Then, within each voxel, all existing points will be approximated with their centroids or centers. Substituting the voxel's centroid is slower than directly replacing them with the voxel's center, but it preserves the macroscopic geometry more accurately.

program:

%点云的合并
% pcmerge(ptCloudA,ptCloudB,gridStep)合并两个点云,并进行体素下采样
clc;clear all;close all;

%读取两个点云
ptCloudA = pcread('E:\程序库\点云\规则点云\1.pcd');
ptCloudB = pcread('E:\程序库\点云\规则点云\2.pcd');
%点云的合并
ptCloudC=pcmerge(ptCloudA,ptCloudB,0.001);%设置体素滤波器的边长为0.001m

%可视化
figure;
subplot(221);pcshow(ptCloudA);title('ptCloudA');
subplot(222);pcshow(ptCloudB);title('ptCloudB');
subplot(2,2,[3,4]);pcshow(ptCloudC);title('ptCloudC');

operation result:

insert image description here

Guess you like

Origin blog.csdn.net/weixin_44769034/article/details/129780491