VPGNet数据集----mat图片转成jpg

matlab代码

Path = 'C:/Users/pc.000/Desktop/scene_2/';       
imgPath=  dir([Path '2016*.']);
savedir='C:/Users/pc.000/Desktop/newfile/';
count=100;
for son = 1:length(imgPath)
    sonpath=[Path,imgPath(son).name,'/'];
    imgDir  = dir([sonpath '*.mat']); 
    for i = 1:length(imgDir)        
        count=count+1;
        img = load([sonpath, imgDir(i).name]); 
        image=img.rgb_seg_vp(:,:,1:3);
        %imagesc(image)
        imwrite(image,[savedir ,num2str(count),'.jpg']);
        disp(count)
        %pause()
    end
end

你可能感兴趣的:(随手翻)