Where to store images on computer for imread
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ethan
el 8 de Feb. de 2024
Comentada: Ethan
el 8 de Feb. de 2024
I am trying to open images using the imread function however whenever I do, I get this error
I = imread('D Red bball')
Is this because the image is not stored in the right place on my computer or is it due to another issue? What is in the single commas is the name of the image that is in files.
1 comentario
Dyuman Joshi
el 8 de Feb. de 2024
Editada: Dyuman Joshi
el 8 de Feb. de 2024
You can only read 1 file at a time via imread. If you want to read more than 1 images at a time, consider using imageDatastore.
And you have to provide the extension of the image as well in the filename.
Make sure you have provided the right path where the images are to MATLAB.
Either use fullfile and provide the full file location of the images, or ensure the image(s) to be read are in the current directory.
Respuesta aceptada
Stephen23
el 8 de Feb. de 2024
Editada: Stephen23
el 8 de Feb. de 2024
"Is this because the image is not stored in the right place on my computer.."
The only "right place" is the location where you tell IMREAD where the files are.
"...or is it due to another issue?"
Most likely you did not tell IMREAD where the file is located OR the filename is wrong:
P = 'C:\Users\SomeUser\Pictures\Folder'; % absolute or relative path to where the files are
F = 'D Red bball.jpg'; % name of a file that exists on that path
I = imread(fullfile(P,F))
Do NOT pollute your MATLAB search path with folders of data, i.e. avoid ADDPATH or similar just to read a data file.
Más respuestas (0)
Ver también
Categorías
Más información sobre National Instruments Frame Grabbers en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!