本文整理汇总了C++中FileList::AddData方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::AddData方法的具体用法?C++ FileList::AddData怎么用?C++ FileList::AddData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::AddData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CorrespondGroundTruths
void KinectDatasetReader::CorrespondGroundTruths()
{
// Ground truth data frequency can be higher than the kinect frequency
size_t iCurrGtIndex = 0, iCurrRGBDIndex = 0;
//NOTE: This only checks time frame for rgb image, and time stamp of depth image
// is not considered.
double rgbTime, gtTime;
std::vector<std::pair<size_t, size_t> > detectedPairs;
int loopCount = 0;
while( iCurrRGBDIndex < mRGBFiles.TimeStamps.size() &&
iCurrGtIndex < mGroundTruth.size() )
{
gtTime = mGroundTruth[iCurrGtIndex].TimeStamp;
rgbTime = mRGBFiles.TimeStamps[iCurrRGBDIndex];
if( IsNear(gtTime - rgbTime) )
{
double currGTTime = gtTime;
double mindt = fabs(currGTTime - rgbTime);
size_t minIndex = iCurrGtIndex;
size_t index = iCurrGtIndex;
while( index < mGroundTruth.size() )
{
currGTTime = mGroundTruth[index].TimeStamp;
double dt = fabs(currGTTime - rgbTime);
if( IsNear(dt) )
{
if( dt < mindt )
{
minIndex = index;
mindt = dt;
}
index++;
}
else
break;
}
iCurrGtIndex = minIndex; // set it as minimum distance in time
detectedPairs.push_back(make_pair(iCurrRGBDIndex, iCurrGtIndex));
iCurrGtIndex++;
iCurrRGBDIndex++;
}
else if( gtTime < rgbTime )
{
iCurrGtIndex++;
}
else
{
iCurrRGBDIndex++;
}
loopCount++;
}
// I dont have time to optimize this code, should be done by using list instead of vector. probably!
GroundTruthArray gtInfoList;
FileList rgb;
FileList dp;
for(size_t i = 0; i < detectedPairs.size(); i++)
{
size_t rgbdIndex = detectedPairs[i].first;
size_t gtIndex = detectedPairs[i].second;
gtInfoList.push_back(mGroundTruth[gtIndex]);
rgb.AddData(mRGBFiles.TimeStamps[rgbdIndex], mRGBFiles.FileNames[rgbdIndex]);
dp.AddData(mDepthFiles.TimeStamps[rgbdIndex], mDepthFiles.FileNames[rgbdIndex]);
}
mGroundTruth = gtInfoList;
mRGBFiles = rgb;
mDepthFiles = dp;
}