I want to create a dataset of my own like CIFAR-10 ?

2 次查看(过去 30 天)
I want to create a dataset of my own like CIFAR-10 but not with RGB values but CEDD feature vector of image. I am creating a imageDatastore and reading the images and thier labels with following code :
imageFolder = fullfile('G:\9th Semester\Project - 2\myDataset');
imds = imageDatastore(imageFolder,'LabelSource', 'foldernames', 'IncludeSubfolders',true);
[trainingSet , testingSet] = splitEachLabel(imds , 0.8 , 'randomize');
trainingSet = shuffle(trainingSet);
testingSet = shuffle(testingSet);
data = [];
labels = char.empty(0,10);
cedd = [];
for i=1:size(trainingSet.Files)
image = readimage(trainingSet,i);
cedd = CEDD(image);
zerosCount = 0 ;
for j=1:144
if cedd(j) == 0
zerosCount=zerosCount + 1;
end
end
if zerosCount ~= 144
data(i , :) = cedd;
labels(i ,: ) = trainingSet.Labels(i);
end
end
save('train.mat' , 'data' , 'labels');
But is giving me this error. Any help will be much appreciated !
Unable to perform assignment because the size of the left side is 1-by-10 and the size of the right side is 1-by-3.
Error in dataset (line 20)
labels(i ,: ) = trainingSet.Labels(i);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by