7#include <opencv2/core.hpp>
8#include <opencv2/core/mat.hpp>
9#include <opencv2/core/types.hpp>
10#include <opencv2/imgproc.hpp>
12#include "helpers/Globals.hpp"
13#include "helpers/Information.hpp"
15#include "helpers/FrameBuilder.hpp"
45 cv::rectangle(p_frame,
52 cv::rectangle(p_frame,
89 cv::add(p_frame, blankFrame, p_frame);
100 const std::string CURRENT_FPS = std::format(
"{} Current FPS ({} Average FPS)",
110 const std::string TIMESTAMP = std::format(
"{:%A %d %B %Y} ", std::chrono::system_clock::now()) + std::format(
"{:%H:%M:%S}", std::chrono::system_clock::now()).substr(0, 8);
121 const uint32_t SECONDS_SINCE_EPOCH = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
123 if (
static_cast<bool>(SECONDS_SINCE_EPOCH % 2))
139 double currentFontScale = p_fontScale;
156 {p_backgroundRect.x + X_PAD, p_backgroundRect.y + textSize.height + Y_PAD},
static void AddPerformanceInformation(cv::Mat &p_frame, const PerformanceInformation &p_performanceInformation, const bool &p_debugMode)
Adds performance information to p_frame.
static void AddLaneDetectorInformation(cv::Mat &p_frame, const LaneDetectionInformation &p_laneDetectionInformation, const bool &p_debugMode)
Adds lane detection information to p_frame.
static void AddBackgroundRectAndCentredText(cv::Mat &p_frame, const cv::Rect &p_backgroundRect, const std::string &p_text, const double &p_fontScale=Globals::G_FONT_DEFAULT_SCALE)
Adds p_backgroundRect to p_frame and centers p_text within p_backgroundRect.
static void AddVideoManagerInformation(cv::Mat &p_frame, const VideoManagerInformation &p_videoManagerInformation)
Adds video manager information to p_frame.
static void UpdateFrame(cv::Mat &p_frame, const ObjectDetectionInformation &p_objectDetectionInformation, const LaneDetectionInformation &p_laneDetectionInformation, const PerformanceInformation &p_performanceInformation, const VideoManagerInformation &p_videoManagerInformation)
Updates p_frame with object detection, lane detection, performance and video manager information.
static void AddObjectDetectorInformation(cv::Mat &p_frame, const ObjectDetectionInformation &p_objectDetectionInformation, const bool &p_debugMode)
Adds object detection information to p_frame.
static const uint32_t G_UI_RADIUS_RECORDING_DOT
Recording status UI locations.
static const double G_UI_H1_FONT_SCALE
Font scales for different heading sizes.
static const int32_t G_OBJECT_DETECTOR_BOUNDING_BOX_HEADER_HEIGHT
Object detection bounding box properties.
static const uint32_t G_FONT_DEFAULT_THICKNESS
Font settings.
static const cv::Scalar G_COLOUR_BLACK
OpenCV Colours (in BGR format).
static const cv::Rect G_UI_RECT_DRIVING_STATE_SUBTITLE
Driving state sub-title UI location (width is the entire screen for centering).
static const cv::Rect G_UI_RECT_RECORDING_ELAPSED_TIME
Recording status UI locations.
static const uint32_t G_VIDEO_INPUT_HEIGHT
Input video dimensions.
static const uint32_t G_VIDEO_INPUT_WIDTH
Input video dimensions.
static const cv::Rect G_UI_RECT_FPS
Performance-related information UI location.
static const double G_DIVIDE_BY_TWO
Divide by two.
static const cv::Rect G_UI_RECT_DRIVING_STATE
Driving state UI location (width is the entire screen for centering).
static const cv::Scalar G_COLOUR_WHITE
OpenCV Colours (in BGR format).
static const double G_UI_H2_FONT_SCALE
Font scales for different heading sizes.
static const double G_OBJECT_DETECTOR_BOUNDING_BOX_FONT_SCALE
Object detection bounding box properties.
static const int32_t G_FONT_DEFAULT_VERTICAL_PADDING
Font settings.
static const int32_t G_FONT_DEFAULT_HORIZONTAL_PADDING
Font settings.
static const double G_FONT_DEFAULT_DECREMENT
Font settings.
static const cv::Point G_UI_POINT_RECORDING_DOT
Recording status UI locations.
static const cv::Rect G_UI_RECT_NOT_RECORDING_STATUS
Recording status UI locations.
static const cv::Scalar G_COLOUR_RED
OpenCV Colours (in BGR format).
static const uint32_t G_FONT_DEFAULT_FACE
Font settings.
static const int32_t G_OBJECT_DETECTOR_BOUNDING_BOX_TEXT_HEIGHT_OFFSET
Object detection bounding box properties.
static const cv::Scalar G_LANE_OVERLAY_COLOUR
Translucent colour of the overlay for the current lane.
static const cv::Rect G_UI_RECT_RECORDING_STATUS
Recording status UI locations.
static const cv::Rect G_UI_RECT_TIMESTAMP
Timestamp UI location.
static const int32_t G_OBJECT_DETECTOR_BOUNDING_BOX_BORDER_THICKNESS
Object detection bounding box properties.
static const int32_t G_OBJECT_DETECTOR_BOUNDING_BOX_CHARACTER_WIDTH
Object detection bounding box properties.
static const cv::Rect G_UI_RECT_DEBUG_MODE_STATUS
Debug mode status UI location.
Contains all Lane-and-Object-Detection objects.