1

私の質問には、次のように整理された画像のフォルダーがあります

データベース -> CASIA Iris Image Database (バージョン 1.0) -> フォルダー 001 (このフォルダーは 001 から 108 に変更) -> 前のフォルダーには 2 つのフォルダーがあり、それぞれに 3 つの画像が含まれています

としてのフォルダの構造

http://imageshack.us/photo/my-images/337/picture1ki.png/

MATLAB で CASIA V1.0 1 を読み取るにはどうすればよいですか?

4

1 に答える 1

1

以下は、フォルダー内の任意の数の画像の一般的なコードです。フォルダーごとに 3 つの画像があり、それぞれのファイル名の形式がわかっている場合は、簡単にすることができます。

%# 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
于 2012-05-16T12:47:37.297 に答える