How to make a code that loads specific images from multiple subfolders within a single folder?

4 visualizaciones (últimos 30 días)
So basically I used readtable to create a table of several hundred image names from different folders. I am trying to load the images listed in the table, which are from multiple sub-folders within a main folder. I have 2 days of coding experience so I don't really know where to start.

Respuestas (2)

Image Analyst
Image Analyst el 12 de Jun. de 2018
See if you have the ImageDatastore function in your release:
Description An ImageDatastore object manages a collection of image files, where each individual image fits in memory, but the entire collection of images does not necessarily fit. To create an ImageDatastore object, use either the imageDatastore function or the datastore function. Once the object is created, you can specify ImageDatastore properties using dot notation and use functions that access and manage the data.
It can handle images in subfolders of some top level folder. Otherwise, see dir() like in the attached examples.

jonas
jonas el 12 de Jun. de 2018
Editada: jonas el 12 de Jun. de 2018
The documentation is great ( link )
search for 'Add Folder and Its Subfolders to Search Path'
if you have all image names in your table, just load them by
imread('filename')
Best general advice I can give you: google your issues and you will in 9 times out of 10 find a solution within a minute, either from the doc or from a previous question on this forum

Categorías

Más información sobre Computer Vision Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by