function corr = coocm6(a,p);
% coocmr - Finds the correlation of a matrix
% On input
%     a: gray level matrix
%     p: cooccurrence matrix
% On output:
%     corr - measure of correlation of a matrix
% Call:
%     corr = coocm6(a,p);
%
 
mu = mean(mean(a));
sigma2 = std(std(a))^2;
 
[m,n] = size(p);
 
sum = 0;
for r1 = 1:m
  for c1 = 1:n
    sum = sum + ((((r1-1)-mu)*((c1-1)-mu))*p(r1,c1))/sigma2;
  end
end
 
corr = sum;
 
 

