0

I have a data set of pictures and their associated ground truth maps and i am trying to create data stores for both of these, this is the code i am trying:

% Update the dataset directory to the directory where your daffodil images and labels are stored

dataSetDir = 'daffodilSeg';

% Update the class names and label IDs for daffodil and background

classNames = ["daffodil", "background"];

labelIDs = [255, 0];

% Update the image and label directories

imageDir = fullfile(dataSetDir, 'ImagesRsz256');

labelDir = fullfile(dataSetDir, 'LabelsRsz256');

% Create an imageDatastore for the images

imds = imageDatastore(imageDir);

% Create a pixelLabelDatastore for the labeled data

pxds = pixelLabelDatastore(labelDir, classNames, labelIDs);

and i am getting this error,


Array formation and parentheses-style indexing with objects of class

'matlab.io.datastore.ImageDatastore' is not allowed. Use objects of class

'matlab.io.datastore.ImageDatastore' only as scalars or use a cell array.

Error in testing (line 13)

imds = imageDatastore(imageDir);
  • Did you create an object `imageDatastore`? Do `which imageDatastore` to find out what object or function this is. – Cris Luengo May 16 '23 at 18:47

0 Answers0