Divided interest of space (ROI) into continuous cubes
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Image Analyst
am 2 Aug. 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 Kommentare
Image Analyst
am 5 Aug. 2020
Sorry - I've never used lidar data before. I suggest you call tech support.
Siehe auch
Kategorien
Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!