Divided interest of space (ROI) into continuous cubes
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2020년 8월 2일
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
Image Analyst
2020년 8월 5일
Sorry - I've never used lidar data before. I suggest you call tech support.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!