截图保存 matlab

file=dir(\’D:\Program Files\MATLAB\R2014a\bin\MyPro\OCR\图像中时间识别\\’)
for i=3:length(file)
path= strcat(\’D:\Program Files\MATLAB\R2014a\bin\MyPro\OCR\图像中时间识别\\’,file(i).name);
I=imread(path);
imshow(I);
[x,y,c]=ginput(2);
if c==1
BB=imcrop(I,[min(x(1),x(2)),min(y(1),y(2)),abs(x(2)-x(1)),abs(y(2)-y(1))]);
%axes(handles.axes2); %你的截图放在GUI中的axes2中
imshow(BB);
path= strcat(\’D:\Program Files\MATLAB\R2014a\bin\MyPro\OCR\pre_image\\’,file(i).name);
imwrite(BB,path);
end
end

版权声明:本文为Wanggcong原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Wanggcong/p/4791508.html