MATLAB: Hello! I am working on IRIS RECOGNITION system.My code only takes one iris image and compare it with another image to find the match.I wanna do iris recognition by comparing an iris image template, with a folder that filled with iris image template

Image Processing Toolboxiris based projectiris recognition

PLEASE help me to modify my code and to apply loop so that the loop continues until the match is found and at the end show a message if the matched iris template is found. Thanking in Advance. my code is as follow :
clc; clear all; close all; warning off;
[FileName1,FilePath1] = uigetfile('*.jpg','Select 1st Iris Image');
file1 = fullfile(FilePath1, FileName1);
[FileName2,FilePath2] = uigetfile('*.jpg','Select the Iris Image for comparison');
file2 = fullfile(FilePath2, FileName2);
mkdir('scrap')
% addpath('scrap')
hd = irisRecognition(file1,file2);
if hd < 0.0 && hd <= 0.2
h = msgbox('Same IRIS','Result');
else if hd <= 1.0 && hd >= 0.4
h = msgbox('Different IRIS','Result');
else if hd <=0.4 && hd >= 0.3
h = msgbox('Uncertain, Please run test again or change iris images','Result');
else if hd ==0
h = msgbox('Same IRIS','Result');
end
end
end
end
clc; clear all;

Best Answer

Read in the reference image into a variable called refImage before the loop starts. Then in the for loop, read in "thisImage" and compare
thisImage = imread(filename);
if isequal(thisImage, refImage)
% They're the same image.
else
% They're different by at least one pixel.
end