getting error in processing eval('img=​imread(str​);');

% number of images on the training set.
M = 14;
%read and show images(jpg);
% S will store all the images
S=[];
figure(1);
for i=1:M
str = strcat('instructors/', int2str(i));
str = strcat(str, '.jpg');
eval('img=imread(str);');
img = rgb2gray(img);
img = imresize(img, [300,300]);
subplot(ceil(sqrt(M)),ceil(sqrt(M)),i)
imshow(img)
if i==3
title('Course Intructors','fontsize',14)
end
drawnow;
% save the dimensions of the image (irow, icold)
[irow, icol]=size(img);
% creates a (N1*N2) x 1 matrix and add to S
temp=reshape(img',irow*icol,1);
%S will eventually be a (N1*N2) x M matrix.
S=[S temp];
end

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by