Definition at line 494 of file ShotSegmenter.h. References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Util::Database::GetInstance(), ILOG_INFO, Impala::Core::Array::LessThanVal(), Impala::Core::Array::MakeRoi(), mBinCount, mCentered, mCUTs, mMode, mRadius, mRunName, mScores, mSigma, mSymmetry, mThreshold, Impala::Core::Array::PixMin(), Impala::Util::IOBuffer::Puts(), Impala::Util::IOBuffer::Valid(), and Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::Value(). Referenced by HandleDoneFile(). 00495 { 00496 #ifndef REPOSITORY_USED // Here comes the deprecated stuff 00497 //First find all values below our treshold: 00498 //mScores<mTreshold 00499 Array::Array2dScalarInt32* TrainSet = 0; 00500 LessThanVal(TrainSet,mScores,mThreshold); 00501 00502 std::ostringstream osssvm; 00503 std::ostringstream osslfv; 00504 00505 //LFV File 00506 char OutFileName[300]; 00507 sprintf(OutFileName,"%s_%s_%g_%d-%g-%d.lfv", SrcName.c_str(), 00508 mRunName.c_str(),mThreshold,mRadius,mSigma,mBinCount); 00509 Util::Database& Db = Util::Database::GetInstance(); 00510 Db.MakeDir("ShotSegmentation","Lfv",mMode,mRunName); 00511 String FileName=Db.GetFilePath("ShotSegmentation","Lfv",mMode,mRunName,OutFileName,true,false); 00512 Util::IOBuffer* LfvOutput=Db.GetIOBuffer(FileName,false,false,"tmp"); 00513 ILOG_INFO("Writing LFV to "<<FileName); 00514 //SVM File 00515 sprintf(OutFileName,"%s_%s_%g_%d-%g-%d.svm",SrcName.c_str(), 00516 mRunName.c_str(),mThreshold,mRadius,mSigma,mBinCount); 00517 Db.MakeDir("ShotSegmentation","Svm",mMode,mRunName); 00518 FileName=Db.GetFilePath("ShotSegmentation","Svm",mMode,mRunName,OutFileName,true,false); 00519 ILOG_INFO("Writing SVM to "<<FileName); 00520 Util::IOBuffer* SvmOutput=Db.GetIOBuffer(FileName,false,false,"tmp"); 00521 if(LfvOutput && SvmOutput && LfvOutput->Valid() && SvmOutput->Valid()) 00522 { 00523 ILOG_INFO("Writing Training Files!"); 00524 00525 //Find the local minimums, discard non-minimums 00526 //Make ROI to be i-R:i+R =>>TODO: Check Validity of borders 00527 for(int i = mCentered ? mRadius : mRadius - 1 ; 00528 i < ( mCentered ? mScores->CW() - mRadius - 1 00529 :mScores->CW() - mRadius) ; i++) 00530 { 00531 ILOG_INFO("Checking if LocalMin"); 00532 00533 if ((TrainSet->Value(i,0) == 1) || (((mMode=="Test")||(mMode=="EvalTest"))&& 00534 (mCUTs->Value(i,0)==1)&& 00535 (mCUTs->Value(i-1,0)==1))) 00536 { 00537 ILOG_INFO("Either LocalMin, or Creating Test set"); 00538 //Centered has 3 more features 00539 int left = mCentered ? i - mRadius : i - mRadius + 1; 00540 int right = mCentered ? i + mRadius + 1 : i + mRadius ; 00541 int center = mCentered ? mRadius : mRadius-1; 00542 Array2dScalarReal64* roi = 00543 MakeRoi(mScores,Geometry::Rectangle(left,0,right,0)); 00544 //if it's a local min, or a CUT in test run 00545 if((roi->Value(center,0)==PixMin(roi)) 00546 ||( ((mMode=="Test")||(mMode=="EvalTest")) 00547 && (mCUTs->Value(i,0) ==1) 00548 && (mCUTs->Value(i-1,0) ==1)) ) 00549 00550 { 00551 bool isCut = ((mCUTs->Value(i-1,0) == 1) | 00552 (mCUTs->Value(i,0) == 1) | 00553 (mCUTs->Value(i+1,0) == 1) ); 00554 00555 ILOG_INFO("LocalMin is "<<(isCut?"a cut":"not a cut")); 00556 00557 if(mSymmetry!="Inv") 00558 { 00559 osssvm<<(isCut?1:-1); 00560 osslfv<<fileId<<"_"<<i<<" "<<(isCut?1:-1); 00561 00562 for(int j=0;j<roi->CW();j++) 00563 { 00564 //if we are not going to use symmetry 00565 osslfv<<" "<<j+1<<":"<<roi->Value(j,0); 00566 osssvm<<" "<<j+1<<":"<<roi->Value(j,0); 00567 } 00568 SvmOutput->Puts(osssvm.str()); 00569 LfvOutput->Puts(osslfv.str()); 00570 osssvm.str(""); 00571 osslfv.str(""); 00572 } 00573 if(mSymmetry!="None") 00574 { 00575 osssvm<<(isCut?1:-1); 00576 osslfv<<fileId<<"_"<<i<<"_sym "<<(isCut?1:-1); 00577 for(int j=0;j<roi->CW();j++) 00578 { 00579 //if we are going to use symmetry,output reverse also 00580 osslfv<<" "<<j+1<<":"<<roi->Value(roi->CW()-j-1,0); 00581 osssvm<<" "<<j+1<<":"<<roi->Value(roi->CW()-j-1,0); 00582 } 00583 SvmOutput->Puts(osssvm.str()); 00584 LfvOutput->Puts(osslfv.str()); 00585 osssvm.str(""); 00586 osslfv.str(""); 00587 } 00588 } 00589 } 00590 } 00591 delete SvmOutput; 00592 delete LfvOutput; 00593 } 00594 #endif // REPOSITORY_USED 00595 }
Here is the call graph for this function:
|