clc
%%%%%%%%%%%%%%%%%%%%%读入初始时图像%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=imread('5-0.jpg');
a=2.8*A;
bw=im2bw(a,graythresh(a));
K=wiener2(bw,[6 6]);%维纳5X5领域估计图像均值
subplot(1,2,1);imshow(K)
hold on
L=bwlabel(~K);
stats=regionprops(L);
bb=zeros(size(stats,1),2);
for i=1:size(stats,1)
bb(i,:)=stats(i).Centroid;
end
plot(bb(:,1),bb(:,2),'r+')
d=[];
for(i=2:1:4)
d(i-1)=sqrt((bb(i,1)-bb(i-1,1))^2+(bb(i,2)-bb(i-1,2))^2);
end
%%%%%%%%%%%%%%%%%%%%%读入旋转平稳时图像%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=imread('5-1.jpg');
a=2.8*A;
bw1=im2bw(a,graythresh(a));
K1=wiener2(bw1,[6 6]);%维纳5X5领域估计图像均值
subplot(1,2,2);imshow(K1)
hold on
L1=bwlabel(~K1);
stats=regionprops(L1);
BB=zeros(size(stats,1),2);
for i=1:size(stats,1)
BB(i,:)=stats(i).Centroid;
end
plot(BB(:,1),BB(:,2),'r+')
D=[];
for(i=2:1:4)
D(i-1)=sqrt((BB(i,1)-BB(i-1,1))^2+(BB(i,2)-BB(i-1,2))^2);
end
%两点间距离变化
S=[];
D
d
S=D-d
%计算两点间的