当前位置: 首页>>代码示例>>C++>>正文


C++ Args::GetMaskFolderName方法代码示例

本文整理汇总了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;
}
开发者ID:hnkulkarni,项目名称:DetectCarriedObjs-PerfEval,代码行数:59,代码来源:PriorProb.cpp


注:本文中的Args::GetMaskFolderName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。