當前位置:編程學習大全網 - 網站源碼 - imtransform函數怎麽用

imtransform函數怎麽用

在matlab中,簡單的變換可以直接用單個函數實現。圖像縮放使用:

g = imresize(f, scale);

g = imresize(f, [ROW COL]);

圖像旋轉使用:

g = imrotate(f, angle);

圖像剪切使用:

g = imcrop(f, [X, Y, WIDTH, HEIGHT]);

在matlab中使用imtransform實現圖像的空間變換。語法是

g = imtransform(f, tform, interp);

其中,interp可以是'nearest','bilinear'或者'bicubic'。

比如:

f = chekerboard(50);

s = 0.8;

theta = pi/6;

T = [s*cos(theta) s*sin(theta) 0;-s*sin(theta) s*cos(theta) 0;0 0 1];

tform = maketform('affine', T);

g = imtransform(f, tform);

  • 上一篇:用PHP 編寫支持高並發的網站,需要做什麽處理
  • 下一篇:html5表單數據如何獲得
  • copyright 2024編程學習大全網