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

Impala::Application::SDash::RegionsOfInterestCorrelation::RegionsOfInterestCorrelation ( std::string  roiCorrFile,
const RegionsOfInterestInfo roiInfos 
) [inline]

Definition at line 46 of file RegionsOfInterestCorrelation.h.

References Impala::Application::SDash::CORRELATED_PER_ROI, firstRoiPosPerVideo, Impala::Application::SDash::INPUT_VALUES_PER_ROI, mValues, Impala::Application::SDash::NR_OF_VIDEOS, Impala::Application::SDash::ROI_COUNT, and Impala::Application::SDash::ROIS_PER_VIDEO.

00050     {
00051         std::cout << "reading regions of interest correlation from " << roiCorrFile << std::endl;
00052 
00053         // calculate start position per video
00054         firstRoiPosPerVideo[0] = 0;
00055         for (int i = 1; i < NR_OF_VIDEOS; i++)
00056             firstRoiPosPerVideo[i] = firstRoiPosPerVideo[i - 1] + ROIS_PER_VIDEO[i];
00057 
00058         static const int REC_SIZE = INPUT_VALUES_PER_ROI * 2; // bytes per roi
00059         unsigned char bytes[REC_SIZE];
00060 
00061         const bool readOnly = true;
00062         const bool readIntoMem = false;
00063         Util::IOBufferFile ioBuffer(roiCorrFile, readOnly, readIntoMem);
00064 
00065         int pos = 0;
00066         int loByte = 1;
00067         for (int roi = 0; roi < ROI_COUNT; roi++)
00068         {
00069             int bytesRead = ioBuffer.Read(bytes, REC_SIZE);
00070             if (bytesRead < REC_SIZE)
00071                 throw std::logic_error("unable to read complete roi correlation record ");
00072 
00073             //int insertPos = 0;
00074             for (int matchedRoi = 0; matchedRoi < CORRELATED_PER_ROI; matchedRoi++)
00075             {
00076                 int pos = matchedRoi * 2;
00077                 int matchedRoiNr = bytes[pos] * 256 + bytes[pos + 1];
00078                 //RoiInfo roiInfo = roiInfos.GetRoiInfo(matchedRoiNr);
00079                 //if (true)
00080                 //if (roiInfo.videoId >= 0 && !videos[roiInfo.videoId].IsMovement(roiInfo.frameNr))
00081                 //{
00082                     //mValues[roi][index] = (unsigned short) ((unsigned short) bytes[pos] * 256);
00083                     //mValues[roi][index] += (unsigned short) bytes[pos + 1];
00084                     //mValues[roi][insertPos] = (unsigned short) matchedRoiNr;
00085                     mValues[roi][matchedRoi] = (unsigned short) matchedRoiNr;
00086                     //insertPos++;
00087                 //}
00088             }
00089         }
00090 
00091         std::cout << "finished reading regions of interest correlation" << std::endl;
00092     }


Generated on Fri Mar 19 10:49:31 2010 for ImpalaSrc by  doxygen 1.5.1