{
g1=M[nPointIdx-nWidth-1];
g2=M[nPointIdx-1];
g3=M[nPointIdx1];
g4=M[nPointIdxnWidth1];
dWeight=fabs(Q[nPointIdx])/fabs(P[nPointIdx]);//正切
dTmp1=g2*dWeightg1*(1-dWeight);

dTmp2=g4*dWeightg3*(1-dWeight);
}
////////////////////第三种情况///////////////////////
/////////g1g2/////////////
/////////C/////////////
/////////g4g3/////////////
/////////////////////////////////////////////////////
elseif(((Theta[nPointIdx]>=45)&&(Theta[nPointIdx]<90))||
((Theta[nPointIdx]>=225)&&(Theta[nPointIdx]<270)))
{
g1=M[nPointIdx-nWidth];
g2=M[nPointIdx-nWidth1];
g3=M[nPointIdxnWidth];
g4=M[nPointIdxnWidth-1];
dWeight=fabs(P[nPointIdx])/fabs(Q[nPointIdx]);//反正切
dTmp1=g2*dWeightg1*(1-dWeight);
dTmp2=g3*dWeightg4*(1-dWeight);
}
////////////////////第四种情况///////////////////////
/////////g1/////////////
/////////g4Cg2/////////////
/////////g3/////////////
/////////////////////////////////////////////////////
elseif(((Theta[nPointIdx]>=0)&&(Theta[nPointIdx]<45))||
((Theta[nPointIdx]>=180)&&(Theta[nPointIdx]<225)))
{
g1=M[nPointIdx-nWidth1];
g2=M[nPointIdx1];
g3=M[nPointIdxnWidth-1];
g4=M[nPointIdx-1];
dWeight=fabs(Q[nPointIdx])/fabs(P[nPointIdx]);//正切
dTmp1=g1*dWeightg2*(1-dWeight);
dTmp2=g3*dWeightg4*(1-dWeight);
}
}
//////////进行局部最大判断,并写入检测结果////////////////
if((M[nPointIdx]>=dTmp1)&&(M[nPointIdx]>=dTmp2))
N[nPointIdx]=128;
else
N[nPointIdx]=0;
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33926-8.html
天呐天呐
有钱了