MATLAB Answers

J A
0

create my .mat file

Asked by J A
on 22 Apr 2019
Hello!
I saw the next tutorial: https://www.mathworks.com/videos/object-recognition-deep-learning-and-machine-learning-for-computer-vision-121144.html.
At the Demo 2 was doing with deep lerning a food detection. For this was use a .mat file.
I want to use the code for road sign detection but I don't know how to create my .mat file.
I have 25 images for input and I want to do a .mat file.
I searched on Internet and I found the following code.
%Generate mat file
srcFile = dir('..\ROAD-SIGN\*.jpg')
result = cell(1,length(srcFile))
for i = 1 : length(srcFile)
filename = strcat('...\ROAD-SIGN\',srcFile(i).name)
I = imread(filename);
%figure, imshow(I);
I = imresize(I,[273 273]);
result{i} = I;
%figure, imshow(result{i});
end
save images1.mat, result;
length(srcFile)
load('images1.mat')
for j = 1:length(srcFile)
figure, imshow(result{j});
end
%Read mat file
for j =1 :length(srcFile)
filename = strcat('...\ROAD-SIGN\',srcFile(j).name);
I = imread(filename);
a='I';
input = load('images1.mat',a);
figure, imshow(input.(a));
end
whos -file images1.mat
But it isn't working because in the main program is useing the layer attribut. In my code for a .mat file I don't have the layer attribute.
Can anyone help me with a solution, please?

  0 Comments

Sign in to comment.

0 Answers