matlab2013怎么截图,Matlab截图小工具

代码:

%%

%img_path:图像所在文件夹

%save_path:裁剪后的图像保存文件夹

%双击左键不截图,跳到下一张

%%

img_path='E:\image\';

save_path='E:\image\';

name_beg=0;%截取的图像保存名字从0开始

Files = dir(img_path);

for j=1:length(Files)

if strcmp(Files(j).name,'.') || strcmp(Files(j).name,'..') || ~strcmp(Files(j).name(end-3:end),'.jpg')

continue;

end

I=imread(strcat(img_path,Files(j).name));

imshow(I);

[x,y] = ginput(2);

if x(1)==x(2) && y(1)==y(2)

continue;

end

rect=[x(1),y(1),x(2)-x(1),y(2)-y(1)];

J=imcrop(I,rect);

name=strcat(num2str(name_beg),'.jpg');

imwrite(J,strcat(save_path,name));

name_beg=name_beg+1;

end (默认图像为jpg格式,可修改)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值