Performance Metrics#

class PerformanceMetrics#

Public Types

enum MetricTypes#

Values:

enumerator ALL#
enumerator FPS#
enumerator LATENCY#
using Clock = std::chrono::steady_clock#
using TimePoint = std::chrono::time_point<Clock>#
using Duration = Clock::duration#
using Ms = std::chrono::duration<double, std::ratio<1, 1000>>#
using Sec = std::chrono::duration<double, std::ratio<1, 1>>#

Public Functions

PerformanceMetrics(Duration timeWindow = std::chrono::seconds(1))#
void update(TimePoint lastRequestStartTime, const cv::Mat &frame, cv::Point position = {15, 30}, int fontFace = cv::FONT_HERSHEY_COMPLEX, double fontScale = 0.75, cv::Scalar color = {200, 10, 10}, int thickness = 2, MetricTypes metricType = ALL)#
void update(TimePoint lastRequestStartTime)#
void paintMetrics(const cv::Mat &frame, cv::Point position = {15, 30}, int fontFace = cv::FONT_HERSHEY_COMPLEX, double fontScale = 0.75, cv::Scalar color = {200, 10, 10}, int thickness = 2, MetricTypes metricType = ALL) const#

Paints metrics over provided mat

Parameters:
  • frame – frame to paint over

  • position – left top corner of text block

  • fontScale – font scale

  • color – font color

  • thickness – font thickness

Metrics getLast() const#
Metrics getTotal() const#
void logTotal() const#

Private Members

Duration timeWindowSize#
Statistic lastMovingStatistic#
Statistic currentMovingStatistic#
Statistic totalStatistic#
TimePoint lastUpdateTime#
bool firstFrameProcessed#
struct Metrics#

Public Members

double latency#
double fps#
struct Statistic#

Public Functions

inline Statistic()#
inline void combine(const Statistic &other)#

Public Members

Duration latency#
Duration period#
int frameCount#