image warp

1 次查看(过去 30 天)
Rovina
Rovina 2012-2-10
hello , I have 2 RGB images
A= imread('fig146.png'); B= imread('fig147.png');
I take only green component of these images G1=A(:,:,2);% 9x15 size G2=B(:,:,2);% 9x15 size [m n]=size(G2);
I compute lucas kanade method and get velocity vector Vx and Vy , which are 6x12 matrices each. Now i need to warp G2 and get G2b which must be 9x15 size my code is as follows-
G2b=G2; for i=2:m-2 for j=2:n-2 X= j+Vy(i-1,j-1); Y= i+Vx(i-1,j-1); X(X < 1) = 1; X(X > n) = n; Y(Y < 1) = 1; Y(Y > m) = m; G2b(i,j)=G2(round(Y),round(X)); end end
I have scanned image fully here which is not so gud practice. Can i get some better code than this above ? provide me any code using matlab functions warp ,interp2 to warp G2 and get G2b .

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by