次の画像があります。
この画像から魚眼レンズの歪みを取り除きたいので、次のコードを使用しました。
[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
、それでもエラーが発生します。このエラーが発生する理由と修正方法を知っている人はいますか?