ReUseX  0.0.1
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
ReUseX::vision::osd Namespace Reference

Classes

class  CvxText
 FreeType-based text renderer for OpenCV images. More...
struct  LayoutBox
 Axis-aligned 2-D bounding box used internally by the label layout solver. More...
struct  TextSize
 Measured bounding box of a rendered text string. More...
struct  LayoutResult
 Final placement result for a single label. More...
struct  LayoutConfig
 Tunable parameters controlling the label placement algorithm. More...
class  FlatUniformGrid
 Compact spatial hash-grid for fast overlap queries during layout. More...
class  LabelLayoutSolver
 Greedy iterative label placement solver. More...

Functions

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 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 drawObbBox (cv::Mat &img, const common::object::DetectionBox &box, int thickness)
 Draw an oriented bounding box as a rotated rectangle.
void drawSegmentationMask (cv::Mat &img, const common::object::DetectionBox &box)
 Overlay a semi-transparent segmentation mask onto the image.
void drawTrackTrace (cv::Mat &img, const common::object::DetectionBox &box, int font_size)
 Draw the tracking trajectory trace for a tracked object.
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 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 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 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 automatic non-overlapping label placement.
void osd (cv::Mat &img, const std::unordered_map< std::string, std::vector< std::tuple< float, float > > > &points, const cv::Scalar &color=cv::Scalar(0, 255, 0), double font_scale_ratio=0.04)
 Draw polygon overlays for a map of named regions.
void osd (cv::Mat &img, const std::string &fence_name, const std::vector< std::tuple< float, float > > &points, const cv::Scalar &color=cv::Scalar(0, 255, 0), double font_scale_ratio=0.04)
 Draw a single named polygon overlay.
void osd (cv::Mat &img, const std::tuple< float, float > &position, const std::string &text, const cv::Scalar &color=cv::Scalar(0, 255, 0), int font_size=40)
 Render a text string at an arbitrary (x, y) position.

Function Documentation

◆ drawBaseInfoGeometry()

void ReUseX::vision::osd::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.

Parameters
imgImage to draw on (modified in-place).
boxDetection box providing coordinates and type.
colorBGR color for the rectangle.
thicknessLine thickness in pixels.

◆ drawDepth()

void ReUseX::vision::osd::drawDepth ( cv::Mat & img,
const common::object::DetectionBox & box )

Overlay a depth map as a colour-mapped image blended with the input.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with depth data.

◆ drawObbBox()

void ReUseX::vision::osd::drawObbBox ( cv::Mat & img,
const common::object::DetectionBox & box,
int thickness )

Draw an oriented bounding box as a rotated rectangle.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with OBB data.
thicknessLine thickness in pixels.

◆ drawPolygon()

void ReUseX::vision::osd::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.

Parameters
imgImage to draw on (modified in-place).
pointsOrdered list of (x, y) vertices.
colorBGR line color.
thicknessLine thickness in pixels.

◆ drawPoseSkeleton()

void ReUseX::vision::osd::drawPoseSkeleton ( cv::Mat & img,
const common::object::DetectionBox & box,
int thickness )

Draw pose skeleton connections between keypoints.

Supports both COCO 17-keypoint and Hand 21-keypoint formats.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with pose data.
thicknessLine thickness in pixels.

◆ drawPositionRectGeometry()

void ReUseX::vision::osd::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.

Parameters
imgImage to draw on (modified in-place).
boxDetection box providing coordinates.
colorBGR color for the rectangle.
thicknessLine thickness in pixels.

◆ drawSegmentationMask()

void ReUseX::vision::osd::drawSegmentationMask ( cv::Mat & img,
const common::object::DetectionBox & box )

Overlay a semi-transparent segmentation mask onto the image.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with segmentation mask.

◆ drawTrackHistoryPose()

void ReUseX::vision::osd::drawTrackHistoryPose ( cv::Mat & img,
const common::object::DetectionBox & box,
int thickness )

Draw historical pose keypoints from previous frames.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with track history pose data.
thicknessLine thickness in pixels.

◆ drawTrackTrace()

void ReUseX::vision::osd::drawTrackTrace ( cv::Mat & img,
const common::object::DetectionBox & box,
int font_size )

Draw the tracking trajectory trace for a tracked object.

Parameters
imgImage to draw on (modified in-place).
boxDetection box with track data.
font_sizeFont size used for the track ID label.

◆ make_labled_image()

void ReUseX::vision::osd::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).

Parameters
imgImage to draw on (modified in-place).
boxesDetection results to visualize.

◆ osd() [1/4]

void ReUseX::vision::osd::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 automatic non-overlapping label placement.

Parameters
imgImage to draw on (modified in-place).
boxesDetection results to visualize.
osd_rectWhen true, draws bounding rectangles and text labels.
font_scale_ratioFraction of the shorter image dimension used to determine the base font size (default 0.04).

References osd().

Referenced by osd(), osd(), osd(), and osd().

◆ osd() [2/4]

void ReUseX::vision::osd::osd ( cv::Mat & img,
const std::string & fence_name,
const std::vector< std::tuple< float, float > > & points,
const cv::Scalar & color = cv::Scalar(0, 255, 0),
double font_scale_ratio = 0.04 )

Draw a single named polygon overlay.

Parameters
imgImage to draw on (modified in-place).
fence_nameLabel text drawn at the polygon centroid.
pointsPolygon vertices as (x, y) pairs.
colorBGR line and label color.
font_scale_ratioBase font size ratio.

References osd().

◆ osd() [3/4]

void ReUseX::vision::osd::osd ( cv::Mat & img,
const std::tuple< float, float > & position,
const std::string & text,
const cv::Scalar & color = cv::Scalar(0, 255, 0),
int font_size = 40 )

Render a text string at an arbitrary (x, y) position.

Parameters
imgImage to draw on (modified in-place).
position(x, y) drawing origin.
textUTF-8 string to render.
colorBGR text color.
font_sizeFont size in pixels.

References osd().

◆ osd() [4/4]

void ReUseX::vision::osd::osd ( cv::Mat & img,
const std::unordered_map< std::string, std::vector< std::tuple< float, float > > > & points,
const cv::Scalar & color = cv::Scalar(0, 255, 0),
double font_scale_ratio = 0.04 )

Draw polygon overlays for a map of named regions.

Parameters
imgImage to draw on (modified in-place).
pointsMap of region name → polygon vertices.
colorBGR line and label color.
font_scale_ratioBase font size ratio.

References osd().