⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 immove.m

📁 image thresholding otsu method
💻 M
字号:
function im2 = immove(im, xdir, ydir)

%
% Warning: xdir and ydir are reversed
% (they refer to the rows and columns respectively)
%


xs = size(im,1);
ys = size(im,2);
zs = size(im,3);

im2 = zeros(xs, ys, zs);

x = xs - abs(xdir) -1;
y = ys - abs(ydir) -1;

if (xdir <= 0)
    stx = 1;
    stx2 = -xdir+1;
else
    stx = xdir+1;
    stx2 = 1;
end

if (ydir <= 0)
    sty = 1;
    sty2 = -ydir+1;
else
    sty = ydir+1;
    sty2 = 1;
end


im2(stx:stx+x,sty:sty+y,:) = im(stx2:stx2+x,sty2:sty2+y,:);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -