ReUseX  0.0.1
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
osd.hpp
Go to the documentation of this file.
1#pragma once
2#include "reusex/vision/common/object.hpp"
3
4#include <opencv2/opencv.hpp>
5
6#include <string>
7#include <tuple>
8#include <unordered_map>
9#include <vector>
10
11namespace ReUseX::vision::osd {
12
20 const cv::Scalar &color, int thickness);
21
27void drawPositionRectGeometry(cv::Mat &img,
29 const cv::Scalar &color, int thickness);
30
36void drawPoseSkeleton(cv::Mat &img, const common::object::DetectionBox &box,
37 int thickness);
38
43void drawObbBox(cv::Mat &img, const common::object::DetectionBox &box,
44 int thickness);
45
49void drawSegmentationMask(cv::Mat &img,
51
56void drawTrackTrace(cv::Mat &img, const common::object::DetectionBox &box,
57 int font_size);
58
64 int thickness);
65
69void drawDepth(cv::Mat &img, const common::object::DetectionBox &box);
70
76void drawPolygon(cv::Mat &img,
77 const std::vector<std::tuple<float, float>> &points,
78 const cv::Scalar &color, int thickness);
79
84void make_labled_image(cv::Mat &img,
86
94void osd(cv::Mat &img, const common::object::DetectionBoxArray &boxes,
95 bool osd_rect = true, double font_scale_ratio = 0.04);
96
102void osd(
103 cv::Mat &img,
104 const std::unordered_map<std::string, std::vector<std::tuple<float, float>>>
105 &points,
106 const cv::Scalar &color = cv::Scalar(0, 255, 0),
107 double font_scale_ratio = 0.04);
108
115void osd(cv::Mat &img, const std::string &fence_name,
116 const std::vector<std::tuple<float, float>> &points,
117 const cv::Scalar &color = cv::Scalar(0, 255, 0),
118 double font_scale_ratio = 0.04);
119
126void osd(cv::Mat &img, const std::tuple<float, float> &position,
127 const std::string &text,
128 const cv::Scalar &color = cv::Scalar(0, 255, 0), int font_size = 40);
129
130} // namespace ReUseX::vision::osd
std::vector< DetectionBox > DetectionBoxArray
Convenience alias for a collection of DetectionBox results.
Definition object.hpp:212
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 drawTrackHistoryPose(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw historical pose keypoints from previous frames.
void drawDepth(cv::Mat &img, const common::object::DetectionBox &box)
Overlay a depth map as a colour-mapped image blended with the input.
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 drawTrackTrace(cv::Mat &img, const common::object::DetectionBox &box, int font_size)
Draw the tracking trajectory trace for a tracked object.
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 drawPoseSkeleton(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw pose skeleton connections between keypoints.
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 drawObbBox(cv::Mat &img, const common::object::DetectionBox &box, int thickness)
Draw an oriented bounding box as a rotated rectangle.
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 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:189