%%% MATLAB routine for testing performance on test images
clc;
clear;

total_score = 0 ;
score_individual_images = zeros(10,1) ;
execution_time_images   = zeros(10,1) ;
total_execution_time    = inf ;

title = { ...
	  'Alicia_Keys_Diary';
	  'Dan_Fogelberg_Essential';
	  'Bruce_Springsteen_Magic';
	  'Chris_Brown';
	  'John_Mayer_Inside_Wants';
	  'Kate_Nash_Foundations';
	  'Rascal_Flatts_Hawaiian_Tribute';
	  'Berkeley_Quartet';
      'No_Match';
      'No_Match';
};

for img_nr = 1 : 10
  if img_nr < 10
    filename = ['./../TestImages/0' num2str(img_nr) '.jpg'] ;
  else
    filename = ['./../TestImages/' num2str(img_nr) '.jpg'] ;
  end

  img_matrix = (imread(filename)) ;
  tic
  title_returned = identify_CDcover(img_matrix) ;
  %pause(1)
  execution_time_images(img_nr) = toc

  %title_returned = title{img_nr} ;
  title_true     = title{img_nr} ;

  if strcmp(title_returned, title_true)
    score_individual_images(img_nr) = 1 ;
  else
    score_individual_images(img_nr) = 0 ;
  end

end

total_score = sum(score_individual_images) 
total_execution_time = sum(execution_time_images) 

save results total_score total_execution_time score_individual_images execution_time_images ;

