# Inverse of a projective transformation doesn't work with imwarp

9 visualizaciones (últimos 30 días)
Matteo Guidi el 16 de Mzo. de 2018
Comentada: Matteo Guidi el 3 de Abr. de 2018
I have an image, and a general projective2d transformation.
imshow(I)
tform = projective2d([0.96119642,-0.44830978,-0.00025835048;0.14598410,1.6215615,6.6809996e-05;1496.0447,1046.4227,1]);
J = imwarp(I,tform);
figure
imshow(J)
I want to apply the inverse of the transformation, to get back to the original image. So I do:
tInv = invert(tform);
K = imwarp (J, tInv);
imshow(K);
Why are the results not consistent? The final image is tilted. How can I fix that?
Thanks
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Ashish Uthama el 2 de Abr. de 2018
Editada: Ashish Uthama el 2 de Abr. de 2018
Try this:
imshow(I)
tform = projective2d([0.96119642,-0.44830978,-0.00025835048;
0.14598410,1.6215615,6.6809996e-05;
1496.0447,1046.4227,1]);
[J, Jref] = imwarp(I, imref2d(size(I)),tform);
disp(Jref)
figure
imshow(J)
tInv = invert(tform);
K = imwarp (J,Jref, tInv);
imshow(K);
imref2d helps capture the full spatial location of the output image. Notice how the X/YWorldLimits are large numbers? This gets lost when you dont use spatial referencing - hence, in your post, the input you are giving the second imwarp is not strictly the mathematical output of the first imwarp call.
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Matteo Guidi el 3 de Abr. de 2018
Perfect, that was exactly what I was looking for.
Thank you very much!

Iniciar sesión para comentar.

### Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by