How to slice a point cloud along z axis

조회 수: 14 (최근 30일)
stefano chiappini
stefano chiappini 2022년 3월 7일
편집: Chen Xinzhuo 2023년 2월 8일
Hi, i got the following question:
i have a crown tree point cloud and i need to slice along z axis with with 10 cm thickness. Finally, i need to calculate the volume by alpha shape algorithm for each individual slice.
How to solve these problem?
Thank you so much

채택된 답변

Paola Donis Noriega
Paola Donis Noriega 2022년 4월 28일
You can slice a point cloud along the z-axis as follows:
% Use the teapot point cloud as an example.
ptCloud = pcread('teapot.ply');
% Get the point cloud z limits.
minZ = ptCloud.ZLimits(1);
maxZ = ptCloud.ZLimits(2);
% Define the thickness of each slice.
thickness = 0.1;
% Use pcplayer to visualize the point cloud slices.
player = pcplayer(ptCloud.XLimits, ptCloud.YLimits, ptCloud.ZLimits);
% Use a for loop to select each point cloud slice.
for i = minZ:thickness:maxZ
% Get the logical indices of the points in each slice.
selectedIdx = ptCloud.Location(:, 3) >= i & ...
ptCloud.Location(:, 3) < (i + thickness);
% Select the point cloud slice using the indices.
ptCloudSlice = select(ptCloud, selectedIdx);
% Visualize the slice.
view(player, ptCloudSlice)
pause(0.2)
end
  댓글 수: 5
stefano chiappini
stefano chiappini 2022년 5월 3일
Thank you so much. I have appreciated your support.
Chen Xinzhuo
Chen Xinzhuo 2023년 2월 8일
편집: Chen Xinzhuo 2023년 2월 8일
Hi Stefano,
I also encountered the same problem recently.
I have tried but still don't know how to extract each point cloud slice.
I want to ask what method you use, please.
Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by