Definition at line 186 of file RegionsOfInterestInfo.h. References Impala::Application::SDash::RoiInfo::frameNr, mNrOfVideos, mRois, Impala::Application::SDash::RoiInfo::roiNr, ROIS_PER_VIDEO, and Impala::Application::SDash::RoiInfo::videoId. Referenced by Impala::Application::SDash::IdentificationPane::SearchSimilars(). 00187 { 00188 RoiInfo roiInfo; // data structure to return 00189 00190 int runningRoiNr = absRoiNr; 00191 00192 // determine roi nr relative to video: 00193 for (int v = 0; v < mNrOfVideos; v++) 00194 { 00195 if (runningRoiNr < ROIS_PER_VIDEO[v]) 00196 { 00197 roiInfo.videoId = v; 00198 break; 00199 } 00200 runningRoiNr -= ROIS_PER_VIDEO[v]; 00201 } 00202 00203 // determine roi nr relative to frame: 00204 const std::map<int, std::vector<Rectangle> >& roisForVideo = mRois[roiInfo.videoId]; 00205 // note that the map is ordered by frame nr 00206 std::map<int, std::vector<Rectangle> >::const_iterator frameIter = roisForVideo.begin(); 00207 while (frameIter != roisForVideo.end()) 00208 { 00209 int frameRois = frameIter->second.size(); 00210 if (runningRoiNr < frameRois) 00211 break; 00212 runningRoiNr -= frameRois; 00213 frameIter++; 00214 } 00215 00216 if (frameIter != roisForVideo.end() && runningRoiNr >= 0 && runningRoiNr < frameIter->second.size()) 00217 { 00218 roiInfo.frameNr = frameIter->first; 00219 roiInfo.roiNr = runningRoiNr; 00220 } 00221 else 00222 { 00223 roiInfo.videoId = -1; 00224 roiInfo.frameNr = -1; 00225 roiInfo.roiNr = -1; 00226 } 00227 00228 return roiInfo; 00229 }
|