function[d5,d10,d20,d50,d100] = accuracydriver(dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10)
% This function is used as the accuracy test driver. It can
% be used to test for any note and any degree of rotation. The templates
% are sent into the program as dollar5, dollar20 and so on and so forth.
% Note: May take hours to complete depending on test sets

%Reading in the noe images
I = imread('5_1.bmp');
I1 = imread('10.bmp');
I2 = imread('20.bmp');
I3 = imread('50.bmp');
I4 = imread('100.bmp');

% Tresholding the images
image5 = tresh(0.85,I);
image10 = tresh(0.85,I1);
image20 = tresh(0.85,I2);
image50 = tresh(0.85,I3);
image100 = tresh(0.85,I4);

% This section is to introduce noise into the test sets
% image5 = double(image5);
% image10 = double(image10);
% image20 = double(image20);
% image50 = double(image50);
% image100 = double(image100);
% image5 = imnoise(image5,'salt & pepper');
% image10 = imnoise(image10,'salt & pepper');
% image20 = imnoise(image20,'salt & pepper');
% image50 = imnoise(image50,'salt & pepper');
% image100 = imnoise(image100,'salt & pepper');


% Calling the functions to perform the accuracy test
d5 = accuracyinput(image5,dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10);
d10 = accuracyinput(image10,dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10);
d20 = accuracyinput(image20,dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10);
d50 = accuracyinput(image50,dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10);
d100 = accuracyinput(image100,dollar5,dollar10,dollar20,dollar50,dollar100,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10);
toc