Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Error using imwarp (line 33)

1 Ansicht (letzte 30 Tage)
Adam
Adam am 3 Nov. 2013
Geschlossen: Image Analyst am 5 Nov. 2013
I have tried to use imwarp function simply on example from documentation - Apply Horizontal Shear to Image. But it is still returning me: Error using imwarp (line 33), Invalid input transformation. What I am doing wrong? I have Matlab 2013a.
close all, clear all;
I = imread('cameraman.tif');
tform = affine2d([1 0 0; .5 1 0; 0 0 1]);
J = imwarp(I,tform);
figure, imshow(I), figure, imshow(J)

Antworten (3)

Image Analyst
Image Analyst am 3 Nov. 2013
I have R2013a and I copied and pasted your code and it worked fine. Attach your file. You didn't give all your code because imwarp() is not on line 33 like your partial error message says, so you obviously neglected to give all your code. Also you forgot to give the error message. Like far too many people, you snipped out a small part of the error message and didn't give use ALL the red text that you have. Not sure why you did that but make it easy for us to help you by giving us all the information that you have, not just part of it.

Alex Taylor
Alex Taylor am 3 Nov. 2013
In addition to the error message, can you please provide the output of:
which -all affine2d

Adam
Adam am 5 Nov. 2013
Sorry for the late reply. Imwarp function already works. Actually I don't know what is the cause but if I will add all the projects in my Matlab folder to path and I will call the imwarp function, it returns me an error:
>> TestImwarp
Error using imwarp (line 33)
Invalid input transformation
Error in TestImwarp (line 3)
J = imwarp(I,tform);
>> which -all affine2d
C:\Program Files\MATLAB\R2013b\toolbox\images\images\affine2d.m % affine2d constructor
But if I will add to path only the subfolder including TestImwarp.m script, it works. Probably it will be some silly cause which is not connected with imwarp function.
  3 Kommentare
Adam
Adam am 5 Nov. 2013
I = imread('cameraman.tif');
tform = affine2d([1 0 0; .5 1 0; 0 0 1]);
J = imwarp(I,tform);
figure, imshow(I), figure, imshow(J)
Like mentioned in question.
Adam
Adam am 5 Nov. 2013
I figured out that one subfolder with my previous project somehow affects the functionality of imwarp(). But for me is not necessarily to resolve the question why so I would like to close this topic.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by