Clear Filters
Clear Filters

I was trying to implement aerial semantic segmentation but I am facing issue in blocekPointCloud sentence of bpc = blockedPoi​ntCloud(fs​,blocksize​);

1 view (last 30 days)
dataFolder = fullfile(tempdir,'DALES');
trainDataFolder = fullfile(dataFolder,'dales_las','train');
testDataFolder = fullfile(dataFolder,'dales_las','test');
lasReader = lasFileReader(fullfile(trainDataFolder,'5080_54435.las'));
[pc,attr] = readPointCloud(lasReader,'Attributes','Classification');
labels = attr.Classification;
% Select only labeled data.
pc = select(pc,labels~=0);
labels = labels(labels~=0);
classNames = [
"ground"
"vegetation"
"cars"
"trucks"
"powerlines"
"fences"
"poles"
"buildings"
];
figure;
ax = pcshow(pc.Location,labels);
helperLabelColorbar(ax,classNames);
title("Point Cloud with Overlaid Semantic Labels");
blocksize = [51 51 Inf];
fs = matlab.io.datastore.FileSet(trainDataFolder);
bpc = blockedPointCloud(fs,blocksize);
numClasses = numel(classNames);
[weights,maxLabel,maxWeight] = helperCalculateClassWeights(fs,numClasses);
ldsTrain = blockedPointCloudDatastore(bpc);
labelIDs = 1 : numClasses;
ptcld = preview(ldsTrain);
figure;
pcshow(ptcld.Location);
title("Cropped Point Cloud");
ABOVE IS THE CODE AND FOLLOWING ARE THE ERRORS .KINDLY HELP TO ME RESOVE THIS ISSUE BECAUSE ITS NOT DISPLAYING THE DESIRED OUTPUT WHICH IS CROPPED POINT CLOUD .
  1 Comment
Vamsi Krishna Bandaru
Vamsi Krishna Bandaru on 24 Aug 2023
I am not an expert, but from my understanding its reading a windows shortcut file, namely 'train - Shortcut.lnk' . remove that shortcut from the folder and try again

Sign in to comment.

Answers (1)

Sanjana
Sanjana on 27 Oct 2023
Hi Shailja,
I understand that you are facing an issue with creating “blockedPointCloudObject”. As per the documentation, the Point Cloud data Sources provided to the “blockedPointCloudObject” should be of “.LAS ” or “.LAZ” format, so because of the presence of “.lnk” in the fileSet Object, you are facing the above issue. To resolve the issue, remove the “.lnk” file from the source files folder.
Please refer to the following documentation for further information,
Hope this helps!
Regards,
Sanjana

Community Treasure Hunt

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

Start Hunting!