ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
osd.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6#include "reusex/vision/common/object.hpp"
7
8#include <opencv2/opencv.hpp>
9
10#include <string>
11#include <tuple>
12#include <unordered_map>
13#include <vector>
14
15namespace reusex::vision::osd {
16
24 const cv::Scalar &color, int thickness);
25
31void drawPositionRectGeometry(cv::Mat &img,
33 const cv::Scalar &color, int thickness);
34
40void drawPoseSkeleton(cv::Mat &img, const common::object::DetectionBox &box,
41 int thickness);
42
47void drawObbBox(cv::Mat &img, const common::object::DetectionBox &box,
48 int thickness);
49
53void drawSegmentationMask(cv::Mat &img,
55
60void drawTrackTrace(cv::Mat &img, const common::object::DetectionBox &box,
61 int font_size);
62
68 int thickness);
69
73void drawDepth(cv::Mat &img, const common::object::DetectionBox &box);
74
80void drawPolygon(cv::Mat &img,
81 const std::vector<std::tuple<float, float>> &points,
82 const cv::Scalar &color, int thickness);
83
88void make_labled_image(cv::Mat &img,
90
98void osd(cv::Mat &img, const common::object::DetectionBoxArray &boxes,
99 bool osd_rect = true, double font_scale_ratio = 0.04);
100
106void osd(
107 cv::Mat &img,
108 const std::unordered_map<std::string, std::vector<std::tuple<float, float>>>
109 &points,
110 const cv::Scalar &color = cv::Scalar(0, 255, 0),
111 double font_scale_ratio = 0.04);
112
119void osd(cv::Mat &img, const std::string &fence_name,
120 const std::vector<std::tuple<float, float>> &points,
121 const cv::Scalar &color = cv::Scalar(0, 255, 0),
122 double font_scale_ratio = 0.04);
123
130void osd(cv::Mat &img, const std::tuple<float, float> &position,
131 const std::string &text,
132 const cv::Scalar &color = cv::Scalar(0, 255, 0), int font_size = 40);
133
134} // namespace reusex::vision::osd
std::vector< DetectionBox > DetectionBoxArray
Convenience alias for a collection of DetectionBox results.
Definition object.hpp:216
void drawTrackHistoryPose(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw historical pose keypoints from previous frames.
void drawPolygon(cv::Mat &img, const std::vector< std::tuple< float, float > > &points, const cv::Scalar &color, int thickness)
Draw a polygon from a list of (x, y) vertices.
void drawTrackTrace(cv::Mat &img, const common::object::DetectionBox &box, int font_size)
Draw the tracking trajectory trace for a tracked object.
void drawObbBox(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw an oriented bounding box as a rotated rectangle.
void osd(cv::Mat &img, const common::object::DetectionBoxArray &boxes, bool osd_rect=true, double font_scale_ratio=0.04)
Full on-screen display: draws bounding boxes, masks, poses, OBBs, tracks, and text labels with automa...
void drawPositionRectGeometry(cv::Mat &img, const common::object::DetectionBox &box, const cv::Scalar &color, int thickness)
Draw a dashed or solid rectangle indicating a position ROI.
void drawPoseSkeleton(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw pose skeleton connections between keypoints.
void drawDepth(cv::Mat &img, const common::object::DetectionBox &box)
Overlay a depth map as a colour-mapped image blended with the input.
void drawBaseInfoGeometry(cv::Mat &img, const common::object::DetectionBox &box, const cv::Scalar &color, int thickness)
Draw the base detection rectangle and label background for a single box.
void make_labled_image(cv::Mat &img, const common::object::DetectionBoxArray &boxes)
Minimal OSD that paints each segmentation mask with its class_id color (no text labels).
void drawSegmentationMask(cv::Mat &img, const common::object::DetectionBox &box)
Overlay a semi-transparent segmentation mask onto the image.
Universal detection result container that holds a bounding box plus optional enriched data (pose,...
Definition object.hpp:193