I have a picture
and I want to get projective transformation by shifting it back like this:
but the only result I can see is this:
and I cannot find my mistake. My code (A - picture I want to transform):
p=0.25;
a=p*rows(A);
U = @(m, n) ([1 1; 1 m; n 1; n m]);
V = @(m, n) ([1+a 1+a; 1-a m-a; n-a 1+a; n+a m-a]);
D=transform(A, U(rows(A), cols(A)),...
V(rows(A), cols(A)),...
'projective');
imshow(D)
function B=transform(A,U,V,type)
[m n] = size(A)
tform = maketform(type,U,V);
B = imtransform(A,tform,'size',[m n]);