function obr2=transform(obr, matice, metoda, jas)
obr=double(obr);
[a,b,c]=size(obr);
obr2=zeros(a,b,c);

[x,y]=meshgrid( linspace(0,b,b), linspace(0,a,a) );

x2=matice(1,1)*x+matice(1,2)*y+matice(1,3);
y2=matice(2,1)*x+matice(2,2)*y+matice(2,3);

for i=1:c
obr2(:,:,i) = interp2( x,y, obr(:,:,i), x2, y2, metoda, jas );
end

end