我有以下图像:
我想从这张图片中去除鱼眼镜头失真,所以我使用了以下代码:
[X,map] = imread('Foam_Image.jpg'); % Read the indexed image
options = [size(X,1) size(X,2) 1]; % An array containing the columns, rows and exponent
tf = maketform('custom',2,2,[],... % Make the transformation structure
@fisheye_inverse,options);
newImage = imtransform(X,tf);
imshow(newImage); % show image
但我收到以下错误:
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{:});
我也使用imwarp
了代替imtransform
,但我仍然得到一个错误。任何人都知道为什么我会收到此错误以及如何解决它?