How to change the axis/ or view in at point cloud plot. And how to remove unwanted background?

2 次查看(过去 30 天)
Hi Everybody :)
I am working with some lidar data (.txt file) which I have imported and plottet i matlab (I have attached the matlab code and the txt file I have used). I really want to change the axis/ or view when it gets plottet. Right now, the plot looks like this (se attached jpg), where I would really like to change the axis so it looks better visual. (I have tried to explain using the jpg, but if possible I would like to look at it from the front of the fence).
I also have another question for removing background and noise. So that i in the end, is only looking at the fence pattern and nothing else.
And a last thing, is there someone who can help me with saving all x,y,z points for all the scans, instead of that I only save the last x,y,z scan points in the workspace :)

回答(1 个)

Raj Bhakta
Raj Bhakta 2021-11-25
Hi Annizette,
  1. You can use the view function to change the location of your camera position in your plot. See https://www.mathworks.com/help/matlab/ref/view.html
  2. It looks like you have a threshold, what you call ceiling, in your plots that you want to hide. You can remove this data from your dataset by using:
background = x_points < -1500; % Arbitrary threshold at -1500
x_points(background == 1) = []; % This removes the points where x_points < -1500 from your dataset
y_points(background == 1) = [];
z1(background == 1) = [];
% Plot remaining x, y, and z points
Fence = [x_points(:),y_points(:),z1(:)];
pcshow(Fence);
3. To save your points per scan, put your save command at the end of your primary for loop (blocks loop). Use the save command to do this:
save(strcat(string,'.mat'),'x_points','y_points','z1');
This assumes your string value changes every iteration, so you create a new .mat file for each dataset that contains the x,y, and z points.
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Labeling, Segmentation, and Detection 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by