Error using imread>parse_inputs (line 457) The filename or url argument must be a string. Error in imread (line 316) [filename, fmt_s, extraArgs] = parse_inpu​ts(varargi​n{:});

18 ビュー (過去 30 日間)
vani shree
vani shree 2017 年 4 月 19 日
回答済み: Ahmed 2023 年 2 月 1 日
sir im getting error like this in my sift.m function file please rectify this error
"Error in imread (line 316) [filename, fmt_s, extraArgs] = parse_inputs(varargin{:});
Error in sift (line 22) image = imread(imagefile);"
function [image, descriptors, locs] = sift(imagefile)
% Load image
image = imread(imagefile); %%in this line im getting error sir
% If you have the Image Processing Toolbox, you can uncomment the following
% lines to allow input of color images, which will be converted to grayscale.
if isrgb(image)
image = rgb2gray(image);
end
thank you sir
  1 件のコメント
Ganesh Hegade
Ganesh Hegade 2017 年 4 月 19 日
Error clearly stating that you should input image name in string format. Example :
[descriptors, locs] = sift('ImageName');

サインインしてコメントする。

回答 (2 件)

Dimitris Iliou
Dimitris Iliou 2017 年 4 月 21 日
As Ganesh mentioned in the comment, the error you are getting is because the input in your sift function is not a string.
'imread' needs a string that contains the filename as the input. You can find more information and examples on 'imread' in the following documentation link:
Keep in mind, that in case the image file is not in the MATLAB current working directory, you might need to insert the full path and filename in order to read the image.
For example:
[image, descriptors, locs] = sift('C:\user\...\test.jpg');

Ahmed
Ahmed 2023 年 2 月 1 日
I=imread("tes1.jpg")

Community Treasure Hunt

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

Start Hunting!

Translated by