Does imtranslate do subpixel shifts ?

18 ビュー (過去 30 日間)
raheem mian
raheem mian 2020 年 2 月 11 日
回答済み: Jyothis Gireesh 2020 年 2 月 14 日
x = randi(256,200,200);
y = imtransalte(x,[-20.5 10.3]);
I know that you can specify a decimal when using imtranslate,
but will it actually translate by 10.3 or will it take the nearest integer value when translating ?

回答 (1 件)

Jyothis Gireesh
Jyothis Gireesh 2020 年 2 月 14 日
Here a few pointers which may be able to help you:
  • For every pixel position in the output, the algorithm tries to find the corresponding position in the input image. For subpixel shifts, such a pixel position may not exist. In such cases we use interpolation techniques to find the intensity value. In the case of ‘imtranslate’ there are techniques available: ‘cubic’, ‘linear’ and ‘nearest’.
  • For ‘cubic’and ‘linear’, the intensity value is calculated as a function of the neighboring values. In this case it may not considered as a rounding-off process.
  • But for ‘nearest’ method, the translation may be considered as being approximated to the nearest full pixel increment.
Hope this helps!!

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by