Hi, Bob!! I have a directory of images of data and another of labels images, and I want to accumulate (data and labels) in a simple dataset, through a looping. I tried this:
%reads the directory of training images, generating vector of names
ImTR=dir(’F:\Imagens\TreinamentoRot\*.tif’); %labels
ImTO=dir(’F:\Imagens\Treinamento\*.tif’); % originals
dsTrein=dataset(); % creates empty dataset
for i=1:size(ImTO,1)
%reads original image
im=imread(ImTO(i).name);
%creates dataset without labels
dsTrein=im2feat(im,dsTrein);
%reads label image
frTrein=imread(ImTR(i).name);
%generates labels vector
LabelsTrein = reshape(frTrein,size(frTrein,1)*size(frTrein,2),1);
%joins the labels vector to the dataset
dsTreinLab=setlabels(dsTrein,LabelsTrein);
end
but, the PRTools returns me this:
??? Error using ==> im2feat
Image size and dataset object size do not match
Error in ==> classifica at 21
dsTrein=im2feat(im,dsTrein);
Can you help myself?
Thanks a lot