Effacer les filtres
Effacer les filtres

fit cuboid for for sequence of pcd data

2 vues (au cours des 30 derniers jours)
Pavan Kumar B N
Pavan Kumar B N le 21 Juin 2021
Commenté : Elad Kivelevitch le 22 Juin 2021
Hello All,
I am using this openExample('lidar/CuboidModelExample') example for fitting cuboid to non-ground objects. Can anyone please advice how to use it for a pcap file (streaming data)?
fileName = 'test.pcap';
deviceModel = 'VLP16';
veloReader = velodyneFileReader(fileName, deviceModel);
% Read a scan of lidar data
ptCloud = readFrame(veloReader) %#ok<NOPTS>
roi = [0 40 -20 30 -7 7];
in = findPointsInROI(ptCloud,roi);
ptCloudIn = select(ptCloud,in);
hcluster = figure;
panel = uipanel('Parent',hcluster,'BackgroundColor',[0 0 0]);
ax = axes('Parent',panel,'Color',[0 0 0]);
pcshow(ptCloudIn,'MarkerSize',30,'Parent',ax)
title('Input Point Cloud')
maxDistance = 0.3;
referenceVector = [0 0 1];
[~,inliers,outliers] = pcfitplane(ptCloudIn,maxDistance,referenceVector);
ptCloudWithoutGround = select(ptCloudIn,outliers,'OutputSize','full');
hSegment = figure;
panel = uipanel('Parent',hSegment,'BackgroundColor',[0 0 0]);
ax = axes('Parent',panel,'Color',[0 0 0]);
pcshowpair(ptCloudIn,ptCloudWithoutGround,'Parent',ax)
legend('Ground Region','Non-Ground Region','TextColor', [1 1 1])
title('Segmented Ground Plane')
distThreshold = 1;
[labels,numClusters] = pcsegdist(ptCloudWithoutGround,distThreshold);
labelColorIndex = labels;
hCuboid = figure;
panel = uipanel('Parent',hCuboid,'BackgroundColor',[0 0 0]);
ax = axes('Parent',panel,'Color',[0 0 0]);
pcshow(ptCloudIn.Location,labelColorIndex,'Parent',ax)
title('Fitting Bounding Boxes')
hold on
for i = 1:numClusters
idx = find(labels == i);
model = pcfitcuboid(ptCloudWithoutGround,idx);
plot(model)
end
  1 commentaire
Elad Kivelevitch
Elad Kivelevitch le 22 Juin 2021
Removed Sensor Fusion and Tracking Toolbox from the list of products as it is not relevant.
For your informatio the example (and all lidar processing) is from Lidar Toolbox.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Preprocessing 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