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

int Impala::Application::SDash::RegionsOfInterestInfo::GetAbsRoiNr ( int  videoId,
int  frameNr,
int  roiNr 
) const [inline]

Definition at line 148 of file RegionsOfInterestInfo.h.

References mNrOfVideos, mRois, and ROIS_PER_VIDEO.

Referenced by Impala::Application::SDash::IdentificationPane::SearchSimilars().

00149     {
00150         int absRoiNr = 0;
00151 
00152         if (videoId >= mNrOfVideos)
00153             return -1;
00154 
00155         for (int v = 0; v < videoId; v++)
00156             absRoiNr += ROIS_PER_VIDEO[v];
00157 
00158         // add roi counts for all lower frame nrs for specified video id
00159         const std::map<int, std::vector<Rectangle> >& roisForVideo = mRois[videoId];
00160         // note that the map is ordered by frame nr
00161         std::map<int, std::vector<Rectangle> >::const_iterator frameIter = roisForVideo.begin();
00162         while (frameIter != roisForVideo.end())
00163         {
00164             if (frameIter->first < frameNr)
00165                 absRoiNr += frameIter->second.size();
00166             else
00167                 break;
00168             frameIter++;
00169         }
00170 
00171         if (frameIter == roisForVideo.end() || frameIter->first > frameNr)
00172             return -1; // no frames for requested video, or no roi's for requested frame
00173 
00174         if (frameIter->second.size() < roiNr)
00175             return -1; // roi nr invalid for requested frame
00176 
00177         // add roi nr for the specified frame
00178         absRoiNr += roiNr;
00179 
00180         return absRoiNr;
00181     }


Generated on Thu Jan 13 09:16:07 2011 for ImpalaSrc by  doxygen 1.5.1