0

I got an error when trying to run the imtransform() line in my code. I got:

Error using imtransform>parse_inputs (line 438)
XData and YData could not be automatically determined.
Try specifying XData and YData explicitly in the call to
IMTRANSFORM.

Error in imtransform (line 265)
args = parse_inputs(varargin{:});

Error in main (line 9)
newImage = imtransform(rgbImage,tf);  %# Transform the image

I used the function tf = maketform() to generate the transformation itself. So, in order to figure out what wrong with my code i simplified as much as I can the function:

function U = fisheye_inverse(X)
   U = X;
end

and my code looked like this:

rgbImage = imread('IMG-20150622-WA0046.jpg');  %# Read the image
tf = maketform('custom',2,2,[],...    %# Make the transformation structure
           @fisheye_inverse,options);
newImage = imtransform(rgbImage,tf);  %# Transform the image
imshow(newImage); 

and still the code yell at me this error again. I looked at a similar problem Here that posted here in the past, but no one answer the question in the end.

Thanks in advance, Gal :)

Community
  • 1
  • 1
GalaG
  • 23
  • 5
  • Why doesn't the answer on the other link explain it to you? Seems clear to me. You need to specify `XData` and `YData`, because the code can't work it out automatically (probably because you are using a custom transform). – nkjt Jul 13 '15 at 09:59
  • possible duplicate of [Error in removing the fisheye lens distortion of an image in Matlab](http://stackoverflow.com/questions/31115164/error-in-removing-the-fisheye-lens-distortion-of-an-image-in-matlab) – nkjt Jul 13 '15 at 09:59
  • first, thanks for your comments. Second, i didn't mention it in my later message (my bad, sorry), but when i specify the Xdata and Ydata i get also an error message: _Error using moveRight_ _Too many input arguments_ so i still don't know how to solve this. my code look like this: – GalaG Jul 13 '15 at 19:25
  • _newImage = imtransform(rgbImage,tf,'XData',[1 size(rgbImage,1)], 'YData',[1 size(rgbImage,2)])_ (Sorry for the second comment but the edit button dont let me edit) – GalaG Jul 13 '15 at 19:32
  • Use `dbstop if error` and figure out where and how `moveRight` is being called. Also, you might not be able to edit your comment but you should be able to edit your question at any time. – nkjt Jul 14 '15 at 15:40

0 Answers0