我有一个图像,我已经转换成双矩阵.我想横向移动它,但我不知道该怎么做.我试图操纵位置,但事实证明我只是操纵颜色.
有没有办法可以引用像素位置,然后添加一个常量来执行移位?
使用图像处理工具箱,您可以应用空间转换:
img = imread('pout.tif');
T = maketform('affine', [1 0 0; 0 1 0; 50 100 1]); %# represents translation
img2 = imtransform(img, T, ...
'XData',[1 size(img,2)], 'YData',[1 size(img,1)]);
subplot(121), imshow(img), axis on
subplot(122), imshow(img2), axis on
Run Code Online (Sandbox Code Playgroud)
