本文整理汇总了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;
}