function build_db(ICount, JCount) p=0; path = 'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\minuite\FVC2002\DB1_B\' for i=1:ICount % 10
for j=1:JCount % 8
filename=[path,num2str(i) '_' num2str(j) '.bmp']; img = imread(filename); img = imresize(img,[374 388]); p=p+1; if ndims(img) == 3; img = rgb2gray(img); end % colour image
disp(['extracting features from ' filename ' ...']); if j<4 testdata{p}=ext_vein(img,1); else traindata{p}=ext_vein(img,1); end end end save('db1.mat','testdata'); save('db2.mat','traindata');end
%********************************************** Function invoked *******************
build_db(2,8); %THIS WILL TAKE ABOUT 30 MINUTES
load('db1.mat'); load('db2.mat');testdata = testdata'; % Adjust matrix dimension
testfeature = cell2mat(testdata); % Convert cell array to matrix
traindata = traindata';trainfeature = cell2mat(traindata);dist = pdist2(testfeature,trainfeature,'euclidean'); % compute euclidian distance
%*****************************************OUTPUT We Get *********************************************** Testdata matrix contains following values
54x6 double44x6 double44x6 double[][][][][]44x6 double60x6 double38x6 double
and traindata contains following values
[][][]50x6 double47x6 double38x6 double31x6 double43x6 double[][][]35x6 double37x6 double39x6 double27x6 double27x6 double
Best Answer