Divided interest of space (ROI) into continuous cubes

3 ビュー (過去 30 日間)
Ehsan Shooshtari
Ehsan Shooshtari 2020 年 8 月 2 日
コメント済み: Ehsan Shooshtari 2020 年 8 月 5 日
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

回答 (1 件)

Image Analyst
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
Image Analyst 2020 年 8 月 5 日
Sorry - I've never used lidar data before. I suggest you call tech support.
Ehsan Shooshtari
Ehsan Shooshtari 2020 年 8 月 5 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by