Adding a dedicated FPS tracker.

This commit is contained in:
Tadas Baltrusaitis
2017-11-13 09:07:52 +00:00
parent bee6d185cb
commit fa48372f4c
8 changed files with 89 additions and 38 deletions

View File

@@ -246,6 +246,12 @@ bool SequenceCapture::OpenVideoFile(std::string video_file, float fx, float fy,
capture.open(video_file);
if (!capture.isOpened())
{
std::cout << "Failed to open the video file at location: " << video_file << std::endl;
return false;
}
this->fps = capture.get(CV_CAP_PROP_FPS);
// Check if fps is nan or less than 0
@@ -263,12 +269,6 @@ bool SequenceCapture::OpenVideoFile(std::string video_file, float fx, float fy,
vid_length = (int)capture.get(CV_CAP_PROP_FRAME_COUNT);
if (!capture.isOpened())
{
std::cout << "Failed to open the video file at location: " << video_file << std::endl;
return false;
}
SetCameraIntrinsics(fx, fy, cx, cy);
this->name = boost::filesystem::path(video_file).filename().replace_extension("").string();