Image Processing Reference
In-Depth Information
%Angular function
function AngFuncDescrp(curve)
%Function
X=curve(1,:);Y=curve(2,:);
M=size(X,2);%number points
%Arc length
S=zeros(1,m);
S(1)=sqrt((X(1)-X(m))^2+(Y(1)-Y(m))^2);
for i=2:m
S(i)=S(i-1)+sqrt((X(i)-X(i-1))^2+(Y(i)-Y(i-1))^2);
End
L=S(m);
%Normalised Parameter
t=(2*pi*S)/L;
%Graph of the curve
subplot(3,3,1);
plot(X,Y);
mx=max(max(X),max(Y))+10;
axis([0,mx,0,mx]); axis square; %Aspect ratio
%Graph of the angular function y'/x'
avrg=10;
A=zeros(1,m);
for i=1:m
x1=0; x2=0; y1=0; y2=0;
for j=1:avrg
pa=i-j; pb=i+j;
if(pa<1) pa=m+pa; end
if(pb>m) pb=pb-m; end
x1=x1+X(pa); y1=y1+Y(pa);
x2=x2+X(pb); y2=y2+Y(pb);
end
x1=x1/avrg; y1=y1/avrg;
x2=x2/avrg; y2=y2/avrg;
dx=x2-x1; dy=y2-y1;
if(dx==0) dx=.00001; end
if dx>0 & dy>0
A(i)=atan(dy/dx);
elseif dx>0 & dy<0
A(i)=atan(dy/dx)+2*pi;
else
A(i)=atan(dy/dx)+pi;
end
end
subplot(3,3,2);
Search WWH ::




Custom Search