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


C++ PerformanceTimer::Stop方法代码示例

本文整理汇总了C++中PerformanceTimer::Stop方法的典型用法代码示例。如果您正苦于以下问题:C++ PerformanceTimer::Stop方法的具体用法?C++ PerformanceTimer::Stop怎么用?C++ PerformanceTimer::Stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PerformanceTimer的用法示例。


在下文中一共展示了PerformanceTimer::Stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _tmain

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	HMODULE hModule = ::GetModuleHandle(NULL);

	if (hModule != NULL)
	{
		// initialize MFC and print and error on failure
		if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0))
		{
			// TODO: change error code to suit your needs
			_tprintf(_T("Fatal Error: MFC initialization failed\n"));
			nRetCode = 1;
		}
		else
		{
			// TODO: code your application's behavior here.
			try {
				// Number of clusters for building BOW vocabulary from SURF features
				if(argc == 4) {
					Mat out, aligned, face, flandmark, in = imread(argv[2]);
					Rect face_rect;
					if(!FindFace(in,face_rect,face)) 
						cout << "Error couldn't find face";
					else {
						PerformanceTimer time;
						resize(face,face,Size(86,86));
						/*time.Start();
						AlignFace(face,aligned);
						time.Stop();
						cout << "My Alignment: " << time.Duration() << endl;*/
						
						time.Start();
						int ret1 = AlignFLandmark(in,face_rect,flandmark);
						time.Stop();
						cout << "Landmark Alignment: " << time.Duration() << endl;
						
						/*time.Start();
						AlignImage(flandmark,out);
						time.Stop();
						cout << "LFW Alignment: " << time.Duration() << endl;
						imshow("out",out);*/

						imshow("in",in);
						imshow("face",face);
						//imshow("features",aligned);
						imshow("landmarks",flandmark);
						waitKey();
						categorizer c(argv[1]);
						if(atoi(argv[3]) == 0) {
							c.train_classifiers();
							c.save_vocab();
						} else {
							cout << "loading vocab" << endl;
							c.load_vocab();
							cout << "vocab loaded" << endl;
						}
						cout << "fast method" << endl;
						c.categorize(flandmark);
						/*cout << "slow method" << endl;
						c.categorize(out);*/
					}
				} else {
					categorizer c(argv[1]);
					if(atoi(argv[2]) == 0) {
						c.train_classifiers();
						c.save_vocab();
					} else {
						cout << "loading vocab" << endl;
						c.load_vocab();
						cout << "vocab loaded" << endl;
					}

					c.categorize();
				}
			} catch(cv::Exception &e) {
				printf("Error: %s\n", e.what());
			}
			cin.get();
		}
	}
	else
	{
		// TODO: change error code to suit your needs
		_tprintf(_T("Fatal Error: GetModuleHandle failed\n"));
		nRetCode = 1;
	}

	return nRetCode;
}
开发者ID:StevenHickson,项目名称:EigenAttractiveness,代码行数:91,代码来源:EigenHot.cpp


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