Divided interest of space (ROI) into continuous cubes

2 vues (au cours des 30 derniers jours)
Ehsan Shooshtari
Ehsan Shooshtari le 2 Août 2020
Commenté : Ehsan Shooshtari le 5 Août 2020
Hello
Dear Friends
I have a Lider result consist of X, Y, Z in matlab file and for each cell/frame I want to divide the region of interest (ROI) space (X: -150m to 150m; Y:-100m to 100m; Z: -15m to 15m) into continuous cubes (0.1m cube length) and calculate the point density in each cube.
clc
close all
fileDir = 'D:\Examps'; % the target data directory
%outfile = 'D:\XYZ_14000.csv';
fid=fopen(outfile,'w');
d=dir(fullfile(fileDir,'*.csv')); % dir() struct of *.csv files in directory
N=numel(d); % total number files found
for i = 1:N % iterate over them...
XYZ=readmatrix(fullfile(fileDir,d(i).name),'NumHeaderLines',1);
data=XYZ(:,1:3); % select the three columns only
fmt=[repmat('%f,',1,numel(data)-1) '%f\n'];
fprintf(fid,fmt,data);
X=XYZ(1:4,1);
Y=XYZ(1:4,2);
Z=XYZ(1:4,3);
% if -100<=X<=100
% X=Xlimit
%else X'='0
end
fid=fclose(fid);
Thanks

Réponses (1)

Image Analyst
Image Analyst le 2 Août 2020
Description
labels = segmentLidarData(ptCloud,distThreshold) segments organized 3-D range data ptCloud into clusters. The function assigns an integer cluster label to each point in the point cloud and returns the cluster label of all points in labels.
The function groups two neighboring points into the same cluster if their Euclidean distance is less than distThreshold or if the angle between the sensor and two neighboring points is at least 5 degrees.
  4 commentaires
Image Analyst
Image Analyst le 5 Août 2020
Sorry - I've never used lidar data before. I suggest you call tech support.
Ehsan Shooshtari
Ehsan Shooshtari le 5 Août 2020
Thanks for let me know, by the way this script is too simple for you, if you run it. Just Lider data exchange to the cordinator X,Y,Z and I want to focus on some special object with remove the background.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by