Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

bool Impala::Application::WindowTrecSearch::ComputeFinalResult (  )  [inline, private]

Definition at line 973 of file mainTrecSearch.cpp.

References Impala::Core::Trec::ThreadSet::AddThreadShots(), Impala::Core::VideoSet::SegmentationDocument::GetBookmarked(), Impala::Core::Trec::Thread::GetFirstShot(), Impala::Core::Trec::Thread::GetLength(), Impala::Core::Trec::ThreadSet::GetSegmentation(), Impala::Core::Trec::Thread::GetShotAt(), Impala::Core::Trec::Thread::GetShotPosition(), Impala::Core::Trec::ThreadSet::GetThreadByName(), Impala::Core::VideoSet::Segmentation::GetVideoId(), ILOG_INFO, ILOG_SYSTEM, ILOG_WARN, mSegDoc, and mThreadSet.

Referenced by RequestComputeFinalEvent().

00974     {
00975         ILOG_SYSTEM("computing final result set.");
00976 
00977         std::list<Core::Trec::ShotResult> finalresult;
00978 
00979         std::map<int,bool> nodups;
00980 
00981         int rank = 1;
00982         for (int i=0 ; i<mSegDoc->GetBookmarked()->Size() ; i++)
00983         {
00984             Core::Trec::ShotResult r;
00985             r.shotid = mSegDoc->GetBookmarked()->Get1(i);
00986             r.rank = rank++;
00987             nodups[r.shotid] = true;
00988             finalresult.push_back(r);
00989         }
00990 
00991         ILOG_INFO( rank-1 << " bookmarked shots added to final result set.");
00992 
00993         int startsuprank   = rank;
00994         int duplicates     = 0;
00995         int dropped        = 0;
00996         Thread* supplement = mThreadSet->GetThreadByName("shots_supplement");
00997         Thread* negatives  = mThreadSet->GetThreadByName("bookmarked_negative");
00998 
00999         if (supplement == NULL)
01000         {
01001             ILOG_WARN("no supplement thread set! Only " << 
01002                       finalresult.size() << " shots will be submitted!");
01003         }
01004         else
01005         {
01006             int firstshot = supplement->GetFirstShot();
01007             for (int i=0; i < supplement->GetLength(); i++)
01008             {
01009                 Core::Trec::ShotResult r;
01010                 r.shotid = supplement->GetShotAt(firstshot, i);
01011                 if (nodups.find(r.shotid) == nodups.end())
01012                 {
01013                     if (negatives && negatives->GetShotPosition(r.shotid) >= 0)
01014                         dropped++;
01015                     else
01016                     {
01017                         r.rank = rank++;
01018                         finalresult.push_back(r);
01019                     }
01020                 }
01021                 else duplicates++;
01022             }
01023         }
01024         char* str = " supplement shots added to final result set.";
01025         ILOG_INFO(rank - startsuprank << str);
01026         ILOG_INFO(duplicates << " duplicates in supplement shot set ignored.");
01027         str = " shots dropped from supplement because of negative annotation.";
01028         ILOG_INFO(dropped << str);
01029 
01030         ILOG_INFO(finalresult.size() << " shots before dumping TV09 dropped movies.");
01031         std::list<Core::Trec::ShotResult>  out;
01032         for (std::list<Core::Trec::ShotResult>::iterator i=finalresult.begin();i!=finalresult.end();i++)
01033             switch (mThreadSet->GetSegmentation()->GetVideoId((*i).shotid))
01034             {
01035                 case 22:  // shot23_*
01036                 case 158: // shot159_*
01037                 case 187: // shot188_*
01038                 case 198: // shot199_*
01039                 case 407: // shot488_*
01040                 case 514: // shot595_*
01041                 case 543: // shot624_*
01042                     continue;
01043                 default:
01044                     out.push_back(*i);
01045             }           
01046         ILOG_INFO(out.size() << " shots in final result set.");
01047         mThreadSet->AddThreadShots("finalresult", out);
01048                 return true;
01049     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:38:46 2010 for ImpalaSrc by  doxygen 1.5.1