基于三点说构成的夹角提取特征点
clear all;
clc;
aa=xlsread('E:\chilun05188.xlsx');
N=length(aa);
ang=0:(0.4*2*205*pi*0.000001/60):(0.4*2*205*pi*0.000001/60)*(N-1);
ang=ang';
aa=aa+116.6479;
%基于三點(diǎn)說構(gòu)成的夾角提取特征點(diǎn)
cc=1;
s=20;? %間隔s個(gè)點(diǎn)進(jìn)行一次計(jì)算
t=0.12;? ? ?%用于調(diào)整特征點(diǎn)的位置
for k=1:s:N-2*s
? ? A=[ang(k) aa(k)];
? ? B=[ang(k+s) aa(k+s)];
? ? C=[ang(k+2*s) aa(k+2*s)];
? ? a1=B(1)-A(1)+j*(B(2)-A(2));
? ? a2=C(1)-B(1)+j*(C(2)-B(2));
? ? alpha(1,cc)=(angle(a2)-angle(a1))*180/pi;
? ? cc=cc+1;
?end
alpha=alpha';
tw=find(abs(alpha)>t);? ?%滿足要求的齒頂齒根數(shù)據(jù)點(diǎn)在原數(shù)組中的索引位置
l_tw=length(tw);
tw_diff=diff(tw);
w_tw=find(tw_diff>20);
w1_feature_points1=tw(w_tw)*s;
w2_feature_points1=tw(w_tw+1)*s;
tw_one=tw(1)*s
tw_last=tw(l_tw)*s
w1_feature_points=[w1_feature_points1' tw_last];? ? %齒形分離特征點(diǎn)在原數(shù)組中的索引位置
w2_feature_points=[tw_one w2_feature_points1'];? ? ?%齒形分離特征點(diǎn)在原數(shù)組中的索引位置
l_w1_feature_points=length(w1_feature_points');
w_feature_points=sort([w1_feature_points w2_feature_points]);
t1=1;
t2=1;
for k1=1:2:l_w1_feature_points
? ? w_one_1(1,t1)=w_feature_points(2*k1-1);
? ? w_one_2(1,t2)=w_feature_points(2*k1);
? ? t1=t1+1;
? ? t2=t2+1;
end
w_one=sort([w_one_1 w_one_2]);? ? ? ?%齒頂特征點(diǎn)在原數(shù)組中的索引位置
t3=1;
t4=1;
for k2=2:2:l_w1_feature_points
? ? w_other_1(1,t3)=w_feature_points(2*k2-1);
? ? w_other_2(1,t4)=w_feature_points(2*k2);
? ? t3=t3+1;
? ? t4=t4+1;
end
w_other=sort([w_other_1 w_other_2]);? ? ?%齒根特征點(diǎn)在原數(shù)組中的索引位置
?
figure(1)
polar(ang,aa,'k')
hold on
polar(ang(w_one),aa(w_one),'.r')
hold on
polar(ang(w_other),aa(w_other),'.g')
figure(2)
plot(ang,aa)
hold on
plot(ang(w_one),aa(w_one),'.r','MarkerSize',20)
hold on
plot(ang(w_other),aa(w_other),'.g','MarkerSize',20)
總結(jié)
以上是生活随笔為你收集整理的基于三点说构成的夹角提取特征点的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阿里短信服务集成
- 下一篇: git----如何撤销上次提交