%  signature 
clear; 
x=[0,1,1,1;
    0,1,0,1;
    0,1,0,1;
    0,1,1,1] % input 
B = bwboundaries(x,'noholes');
B1=B{1}; % boundary coordinates
xc=mean(B1(1:end-1,1)) % centroid
yc=mean(B1(1:end-1,2)) % centroid
[th,d]=cart2pol(B1(:,1)-xc,B1(:,2)-yc);
th=round(180*th/pi)' % angle
d' % distance 


