Hi !
I'm trying to run a script and i have an error with the function imread.
imread('DSC_0128.jpg');
Can't read URL "DSC_0128.jpg".
Reason: Invalid URL.
The picture is in the main folder and I tried too with the complete file path and it doesnt work too.
Thanks for your help !

답변 (1개)

Image Analyst
Image Analyst 2021년 11월 15일

1 개 추천

Try
baseFileName = 'DSC_0128.jpg';
fullFileName = fullfile(pwd, baseFileName);
if ~isfile(fullFileName)
warningMessage = sprintf('File not found:\n%s\n', fullFileName)
uiwait(warndlg(warningMessage));
else
rgbImage = imread(fullFileName);
imshow(rgbImage);
end
What do you see now?

댓글 수: 3

Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported
special characters.
> In imread (line 351)
Can't read URL "C:
It return this.
Thank for your answer!
Image Analyst
Image Analyst 2021년 11월 15일
Wow, bizarre. You must have some weird unprintable characters in there. Try deleting the filename and typing it in again manually and trying it. What region/keyboard layout are you using? English?
Adrien Paire
Adrien Paire 2021년 11월 15일
Yes it's very weird... Im using french keyboard layout.
I will try on another pc tomorrow.
Thanks you for your help !

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2021년 11월 15일

댓글:

2021년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by