How to edit the label Definitions of data labelled using lidar labeller app

3 views (last 30 days)
while trying to edit the label definition i used this code:
% Extract data from old ground truth.
dataSource = gTruth.DataSource;
labelDefs = gTruth.LabelDefinitions;
labelData = gTruth.LabelData;
% Replace oldName with newName
oldName = 'Pedestrian'; newName = 'Pedestrain';
labelDefs.Name = strrep(labelDefs.Name, oldName, newName);
labelData.Properties.VariableNames = strrep(labelData.Properties.VariableNames, oldName, newName);
% Create new groundTruth object
newGTruth = groundTruth(dataSource, labelDefs, labelData);
But got this error:
Error using groundTruth
Expected input to be one of these types:
groundTruthDataSource
Instead its type was vision.labeler.loading.PointCloudSequenceSource.
validateattributes(dataSource, {'groundTruthDataSource'},...
dataSource = validateDataSource(this, dataSource);
this.DataSource = dataSource;
how to resolve it.
  1 Comment
Manikanta Aditya
Manikanta Aditya on 8 Apr 2024
The error message indicates that the dataSource you’re trying to use to create a new groundTruth object is of type 'vision.labeler.loading.PointCloudSequenceSource', but it expects a 'groundTruthDataSource'.
The 'groundTruth' function in MATLAB expects the 'dataSource' to be an instance of 'groundTruthDataSource' or a cell array of file names. If your data source is a point cloud sequence, you might need to convert it to a format that groundTruth can accept.
Here’s a general way to create a 'groundTruthDataSource':
% Create a fileDatastore object
fds = fileDatastore(location, 'ReadFcn', @load, 'FileExtensions', '.mat');
% Create a groundTruthDataSource object
gTruthDataSource = groundTruthDataSource(fds);
Replace location with the location of your data files. The @load function is used to read the data files, and .mat is the file extension of the data files.

Sign in to comment.

Answers (0)

Categories

Find more on Labeling, Segmentation, and Detection in Help Center and File Exchange

Tags

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!