Added timing for main steps (videostab)

This commit is contained in:
Alexey Spizhevoy
2012-04-19 09:29:13 +00:00
parent ada63d1800
commit f42eea1029
3 changed files with 84 additions and 43 deletions

View File

@@ -37,26 +37,30 @@ void run()
Mat stabilizedFrame;
int nframes = 0;
// for each stabilized frame
while (!(stabilizedFrame = stabilizedFrames->nextFrame()).empty())
{
nframes++;
// init writer (once) and save stabilized frame
if (!outputPath.empty())
{
if (!writer.isOpened())
writer.open(outputPath, CV_FOURCC('X','V','I','D'), outputFps, stabilizedFrame.size());
writer.open(outputPath, CV_FOURCC('X','V','I','D'),
outputFps, stabilizedFrame.size());
writer << stabilizedFrame;
}
// show stabilized frame
if (!quietMode)
{
imshow("stabilizedFrame", stabilizedFrame);
char key = static_cast<char>(waitKey(3));
if (key == 27)
break;
if (key == 27) { cout << endl; break; }
}
}
cout << endl
<< "processed frames: " << nframes << endl
cout << "processed frames: " << nframes << endl
<< "finished\n";
}