Definition at line 952 of file ShotSegmenter.h. References mCentered, mNormW, mRadius, mSim, Impala::Core::Array::MulVal(), mWeights, mWindowSize, Impala::Core::Array::PixMax(), and Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::Value(). Referenced by HandleNewFrame(). 00953 { 00954 if(mNormW) 00955 { 00956 //Scale the weights for visualization 00957 MulVal(mWeights,mWeights,1/PixMax(mWeights)); 00958 } 00959 int center = mCentered ? mRadius +1 : mRadius; 00960 00961 Real64 DisSimA=0; 00962 Real64 DisSimB=0; 00963 Real64 SimA=0; 00964 Real64 SimB=0; 00965 //include ==mRadius also 00966 for(int i=0;i<mRadius;i++) 00967 { 00968 for(int j=0;j<mRadius;j++) 00969 { 00970 SimA+=mWeights->Value(i,j); 00971 DisSimA+=mWeights->Value(i,j+center); 00972 } 00973 } 00974 00975 for(int i=center;i<mWindowSize;i++) 00976 { 00977 for(int j=0;j<mRadius;j++) 00978 { 00979 SimB+=mWeights->Value(i,j+center); 00980 DisSimB+=mWeights->Value(i,j); 00981 } 00982 00983 } 00984 Real64 CutAB=DisSimA+DisSimB; 00985 Real64 NCutAB=SimA+SimB; 00986 00987 Real64 s = CutAB/SimA+CutAB/SimB; 00988 Real64 Ns=NCutAB/DisSimA+NCutAB/DisSimB; 00989 00990 if((SimA*SimB==0)||(DisSimA*DisSimB==0)) 00991 { 00992 return 4; 00993 } 00994 00995 if(mSim=="+") 00996 return s; 00997 else if(mSim=="-") 00998 return Ns; 00999 else if(mSim=="log+") 01000 return log(s); 01001 else if(mSim=="log-") 01002 return log(Ns); 01003 return 0; 01004 }
Here is the call graph for this function:
|