GIMP-ML/gimp-plugins/pytorch-SRResNet/data/modcrop.m
2020-04-27 10:02:33 +05:30

13 lines
267 B
Matlab
Executable File

function imgs = modcrop(imgs, modulo)
if size(imgs,3)==1
sz = size(imgs);
sz = sz - mod(sz, modulo);
imgs = imgs(1:sz(1), 1:sz(2));
else
tmpsz = size(imgs);
sz = tmpsz(1:2);
sz = sz - mod(sz, modulo);
imgs = imgs(1:sz(1), 1:sz(2),:);
end