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

조회 수: 4 (최근 30일)
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.

답변 (2개)

Image Analyst
Image Analyst 2018년 6월 12일
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 2018년 6월 12일
편집: jonas 2018년 6월 12일
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

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by