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

@@ -37,13 +37,13 @@
#include <opencv2/core/core.hpp>
#include <vector>
#include <queue>
namespace Utilities
{
// TODO draw AU results
// Drawing a bounding box around the face in an image
void DrawBox(cv::Mat image, cv::Vec6d pose, cv::Scalar color, int thickness, float fx, float fy, float cx, float cy);
void DrawBox(const std::vector<std::pair<cv::Point2d, cv::Point2d>>& lines, cv::Mat image, cv::Scalar color, int thickness);
@@ -53,6 +53,24 @@ namespace Utilities
void Visualise_FHOG(const cv::Mat_<double>& descriptor, int num_rows, int num_cols, cv::Mat& visualisation);
class FpsTracker
{
public:
double history_length;
void AddFrame();
double GetFPS();
FpsTracker();
private:
std::queue<double> frame_times;
void DiscardOldFrames();
};
}
#endif