Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
]
clear all;
start_time = cputime;
no_of_objects = 40;
no_of_views = 10; % Select alternate views for training...36 views can also be
considered
step_size = 2;
obj_views = no_of_views/step_size;
total_views = no_of_objects * obj_views ;
row = 112;
col = 92;
avg_image = zeros(row, col);
sum_image = zeros(row, col);
directory = 'C:\Documents and Settings\mithun\Desktop\KPCA_PACE\ORL_DATASET\s';
no_of_eigen = 20;
end
end
avg_image = sum_image / total_views;
end
close all;
fprintf(1, 'Started eigenvalue computation...\n');
[v, d] = eig(Q);
TestImage = strcat(directory,char(TestImage1),'\',char(TestImage2),'.pgm');
image_data = double(imread(TestImage));
PR_data = image_data-avg_image;
test_data= reshape(PR_data, row*col,1);
t_data = Qv' * test_data;
clear trained_vector;
for i=1:total_views
trained_vector(:, 1) = F_M(:, i);
sim_value = 0;
for j=1:no_of_eigen
sim_value = sqrt(sim_value + ( (trained_vector(j, 1) - t_data(j, 1)) *
(trained_vector(j, 1) - t_data(j, 1)) ));
end
DIST(i) = sim_value;
end