My question I have folder of image organized as
Database -> CASIA Iris Image Database (version 1.0) -> folder001(this folder change to 001to 108) -> previouse folder contains two folder each of them contains 3 images
the structure of folder as
how i can read CASIA V1.0 1 IN MATLAB?
解决方案
Below is a generic code for any number of images in a folder. You can simplify it if you are sure to have 3 images per folder and you know the filename format for each.
%# Set the relative path for the database
basePath = 'Database/CASIA Iris Image Database (version 1.0)/';
for iFolder = 1:108
%# Set current folder
folder = sprintf('%s%03d/', basePath, iFolder);
%# Find the image (e.g. bmp) files in the folder. Modify bmp for your needs.
%# and also modify 'left' string according to the subfolder of left images
filenames = arrayfun(@(x) x.name, dir([folder 'left/*.bmp']),'UniformOutput',false);
for iFile = 1:length(filenames)
img = imread([folder filenames{iFile}]);
%# and process the image
%# ...
end
%# Modify the code for to run it for right folder
%# ...
end