【发布时间】:2015-07-10 16:42:13
【问题描述】:
我想将图像保存到文件夹中。我尝试了下面给出的代码
[Ilabel num] = bwlabel(If);
disp(num);
Iprops = regionprops(Ilabel);
Ibox = [Iprops.BoundingBox];
Ibox = reshape(Ibox,[4 83]);
figure,imshow(Ibox);
for n=1:num
[r,c] = find(Ilabel==n);
% Extract letter
n1=Iout(min(r):max(r),min(c):max(c));
% Resize letter (same size of template)
img_r=imresize(n1,[42 24]);
%figure,imshow(n1);
%Uncomment line below to see letters one by one
%imshow(img_r);pause(0.5)
imwrite(img_r,['H:\\mainproject\\codes\\images\\test0.jpg' ]);
end
但只有最后一个字母保存在文件夹中。我不知道它在哪里出错。我尝试了很多但我没有得到它。请帮助我并提前感谢
【问题讨论】:
标签: matlab