how to run all the images from a particular folder at a time ?

Iam new to matlab.Iam working with a project realted to iris recognition.So for testing the Database i need to run whole database at a time.I need scripts to run the whole images from a particular folder at a time.I need help..!!!

 Accepted Answer

you can get the listing for all the images in a folder by using imageFiles = dir('*.imageExtension');
imageFiles will be a structure that contains all the image file names in imageFiles(i).name.

2 Comments

thanks for your valuable answer Joseph Cheng..!!! from your answer iam able to store the images in an array...but can you please tell me how to acess that array..ie for example i want to generate iris templates from each image.. for one image i have function
[template mask]=createiristemplate('image1.jpg');
if i want to create templates for all the images in that array,how should i access that array..
you would write a for loop that cycles through the structure.
for i =1:length(imageFiles)
filepath = [folder '\' imageFiles(i).name];
[template mask]=createiristemplate(filepath);
end
I'll leave it to you to store the template and mask as i do not know the shape of the output of your createiristemplate.
however you could use structures.
DATA(i).name = imageFiles(i).name;
[DATA(i).template DATA(i).mask]=createiristemplate(filepath);
and store the data that way.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!