Error with imread function
Mostra commenti meno recenti
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 !
Risposte (1)
Image Analyst
il 15 Nov 2021
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 Commenti
Adrien Paire
il 15 Nov 2021
Image Analyst
il 15 Nov 2021
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
il 15 Nov 2021
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!