FUNCTION REFERENCE

imtranslate

Translate an image.

Translate an image.

Syntax

B = imtranslate(A, [tx ty])

Syntax

B = imtranslate(A, [tx ty], method, 'FillValues', v)

Positive tx moves the image right and positive ty moves it down: B(r, c) = A(r - ty, c - tx). Fractional shifts use bilinear interpolation (default; 'nearest' rounds the position); pixels from outside the image take FillValues (default 0) and bilinear samples next to the border blend with it. The output keeps the input size and class. Works on 2-D and M-by-N-by-C arrays.

Example

imtranslate([1 2 3; 4 5 6; 7 8 9], [1 0])   % [0 1 2; 0 4 5; 0 7 8]

Example

imtranslate([2 4 8], [0.5 0])   % [1 3 6]

Differences from MATLAB: 'bicubic', OutputView 'full', three-element translations and per-channel fill values are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.