%obtain the bins vector of a image.
%Example:
%binsvector_of_image('Sunset.jpg')

function [result]=binsvector_of_image(img)
data=double(imread(img));  %store the matrix
a=size(data);      %store the size   
result=zeros(1,72);
for k=1:1:3
    t=(k-1)*8;
    for i=1:1:a(1)
        for j=1:1:a(2)
            m=floor((data(i,j,k))/32)+t;
            s=3*m;
            result(s+1)=result(s+1)+i;%adding the coordinates of y
            result(s+2)=result(s+2)+j;%adding the coordinates of x
            result(s+3)=result(s+3)+1;
        end
    end
end

for i=3:3:72
    if(result(i)>0)
        result(i-2)=result(i-2)/result(i);%compute the mean value of y
        result(i-1)=result(i-1)/result(i);%compute the mean value of x
    end
end
%result=round(result);
