function[absmaxcorrelation] = absmaxcorr(input,degree,direction)
% This function is used to calculate the absolute maximum correlation value
% for any note with any direction and degree of rotation. What it will do
% is to correlation each line of input with itself and find the maximum
% correlation value which will be the absolute maximum correlation value
% for that note, degree of rotation and direction
% input = reference image
% degree = degree of rotation
% direction = direction of rotatio


% Reading the image and performing treshold
I = imread(input);
bw = tresh(0.85,I);

% Rotating the image
y = skewtemplates(bw,degree,direction);
[row1 col1] = size(y);

% Perform FFT on template
for i =1:row1
    y1(i,:) = fft(y(i,:));
end

% Calculating the correlation values 
for i = 1:row1
    [c(i)] = maxcorr(y1,y(i,:));
end

% Obtaining the absolute maximum correlation value
absmaxcorrelation = max(c);