图像大小批量切分处理

    xiaoxiao2021-03-25  161

    %author:coplin %time:2016-10-10 %function:change the size of Image. addpath('dealImg'); addpath('Img'); ListName=dir('Img\*.jpg'); [Pm,Pn]=size(ListName); for iPm=1:1:Pm %读取文件夹所有图片循环 oriImg=imread(ListName(iPm).name); %readImg cutImg=imcrop(oriImg,[50,50,255,255]); %bi=imresize(oriImg,0.6); %bi缩放为ai的0.6倍 %endImg=imresize(cutImg,[256,256]); %把ai转成256x256的大小 iDealName=ListName(iPm).name; iDealAddress='dealImg\'; iDealAll=strcat(iDealAddress,iDealName); ID=imresize(cutImg,1); imwrite(ID,iDealAll); end code: https://github.com/cike0cop/imagereset/tree/master/imagereset
    转载请注明原文地址: https://ju.6miu.com/read-6518.html

    最新回复(0)