本文整理汇总了C++中Args::GetMaskFolderName方法的典型用法代码示例。如果您正苦于以下问题:C++ Args::GetMaskFolderName方法的具体用法?C++ Args::GetMaskFolderName怎么用?C++ Args::GetMaskFolderName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Args
的用法示例。
在下文中一共展示了Args::GetMaskFolderName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalculateRgnPriorProbs
/*******************************************************************
* Function Name: CalculateRgnPriorProbs
* Return Type : int
* Created On : Jul 14, 2013
* Created By : hrushi
* Comments : Calculate the Region Prior Probs
* Arguments : const string TrainFolderPath
*******************************************************************/
int PriorProb::CalculateRgnPriorProbs( const fs::path TrainFolderPath, const Args& args)
{
Labels AllLabels( TrainFolderPath, ALL_LABEL_FILENAME);
Labels Dragged_Lbl(TrainFolderPath, DRAG_CARRY_LABEL_FILE);
Labels Worn_Lbl(TrainFolderPath, WORN_CARRY_LABEL_FILE);
unsigned int NumPersonCntrs(0);
unsigned int NumWornCntrs(0);
unsigned int NumDraggedCntrs(0);
for(tdef_LabelMap::const_iterator itr = AllLabels.GetLabelMapItrBegin(); itr != AllLabels.GetLabelMapItrEnd(); itr++ )
{
fs::path RelativeImgPath = itr->first;
fs::path TrackImgPath = AllLabels.GetComplateImgFilePath( RelativeImgPath.string() );
fs::path MaskImgPath = FileSystem::GetMaskImgPath(args.GetMaskFolderName(), TrackImgPath, args.GetTrackFolderName() );
ContourMap CntrMap = Detect::GetSegments(TrackImgPath, MaskImgPath, false, args);
if( CntrMap.GetNumContours() > 1 ) //
{
unsigned int NumCtrs = CntrMap.GetNumContours() - 1; // Get Number of contours that are not background
m_NumCntrs += NumCtrs;
if( itr->second == NO_CARRIED_OBJECT )
{
NumPersonCntrs += NumCtrs;
}
else
{
// NumPerson Cntrs will be the number of contours -1; -1 for the any of the two labels below
NumPersonCntrs += NumCtrs - 1;
if( Dragged_Lbl.AlreadyPresent(RelativeImgPath) != UN_INITIALIZED_LABEL )
{
NumDraggedCntrs++;
}
else if( Worn_Lbl.AlreadyPresent(RelativeImgPath) != UN_INITIALIZED_LABEL )
{
NumWornCntrs++;
}
}
}
}
m_PriorProb_DraggedObj = (double)NumDraggedCntrs / m_NumCntrs;
m_PriorProb_WornObj = (double)NumWornCntrs / m_NumCntrs;
m_PriorProb_PersonRgn = (double)NumPersonCntrs / m_NumCntrs;
return EXIT_SUCCESS;
}