2#include <opencv2/opencv.hpp>
40 Box(
float l,
float t,
float r,
float b);
125 :
width(std::exchange(other.width, 0)),
126 height(std::exchange(other.height, 0)),
127 data(std::exchange(other.data,
nullptr)) {}
ObjectType
Enumeration of supported detection object types.
@ DEPTH_PRO
Depth map from DepthPro model.
@ DEPTH_ANYTHING
Depth map from DepthAnything model.
@ UNKNOW
Unknown or unclassified object type.
@ POSITION
Simple position/region of interest.
@ OBB
Oriented bounding box.
@ DETECTION
Standard bounding box detection.
@ TRACK
Multi-object tracking result.
@ POSE
Human pose estimation result.
@ SEGMENTATION
Instance segmentation mask.
cv::Mat segmentMapToMat(const std::shared_ptr< SegmentMap > &map)
Convert a SegmentMap to an OpenCV Mat (zero-copy header wrapper).
std::vector< DetectionBox > DetectionBoxArray
Convenience alias for a collection of DetectionBox results.
Axis-aligned bounding box defined by (left, top, right, bottom) coordinates.
float right
Right edge x-coordinate.
float left
Left edge x-coordinate.
float center_y() const noexcept
Returns the y-coordinate of the box center.
float top
Top edge y-coordinate.
float bottom
Bottom edge y-coordinate.
float width() const noexcept
Returns the width of the box.
friend std::ostream & operator<<(std::ostream &os, const Box &box)
float area() const noexcept
Returns the area of the box.
float height() const noexcept
Returns the height of the box.
Box(float l, float t, float r, float b)
Construct a Box with explicit corner coordinates.
float center_x() const noexcept
Returns the x-coordinate of the box center.
Depth map result with per-pixel depth values.
float area_average_depth(const Box &box) const
Returns the average depth within the given bounding box region.
float point_depth(int x, int y) const
Returns the depth at pixel (x, y).
float max_depth() const
Returns the maximum depth value.
cv::Mat depth
CV_32F depth image.
float area_average_depth(const cv::Mat &seg) const
Returns the average depth within the region indicated by a segmentation mask.
float min_depth() const
Returns the minimum depth value.
float average_depth() const
Returns the average depth over the entire map.
float fog_data
Optional fog/haze estimate.
Universal detection result container that holds a bounding box plus optional enriched data (pose,...
std::optional< Obb > obb
Populated for OBB detections.
ObjectType type
Type of this detection.
std::optional< Track > track
Populated for TRACK detections.
float score
Confidence score in [0, 1].
std::string class_name
Human-readable class label.
std::optional< Segmentation > segmentation
Populated for SEGMENTATION detections.
std::optional< Depth > depth
Populated for DEPTH_* detections.
friend std::ostream & operator<<(std::ostream &os, const DetectionBox &box)
std::optional< Pose > pose
Populated for POSE detections.
Box box
Axis-aligned bounding box.
float area() const
Returns the area of the oriented bounding box.
float angle
Rotation angle in degrees.
float cx
Center x-coordinate.
Obb & operator=(const Obb &other)
float h
Height of the box.
friend std::ostream & operator<<(std::ostream &os, const Obb &obb)
float cy
Center y-coordinate.
Obb(float cx, float cy, float w, float h, float angle)
Construct an Obb with center, size, and angle.
PosePoint(float x, float y, float vis)
Construct a PosePoint with position and visibility.
friend std::ostream & operator<<(std::ostream &os, const PosePoint &point)
float y
Y-coordinate of the keypoint.
float x
X-coordinate of the keypoint.
PosePoint & operator=(const PosePoint &other)
float vis
Visibility/confidence score (0 = invisible, 1 = visible).
A set of keypoints representing a human or object pose.
Pose & operator=(const Pose &other)
friend std::ostream & operator<<(std::ostream &os, const Pose &pose)
std::vector< PosePoint > points
Ordered list of pose keypoints.
int width
Width of the mask in pixels (must be % 8 == 0).
SegmentMap & operator=(const SegmentMap &)=delete
SegmentMap(SegmentMap &&other) noexcept
Move constructor — transfers ownership and resets source.
SegmentMap(int width, int height)
Allocate a SegmentMap of the given dimensions using pinned CUDA host memory.
SegmentMap & operator=(SegmentMap &&other) noexcept
Move assignment — transfers ownership and resets source.
unsigned char * data
Raw mask data (width * height bytes).
SegmentMap(const SegmentMap &)=delete
Copy is disabled — use move semantics instead.
int height
Height of the mask in pixels.
Instance segmentation result backed by an OpenCV mask.
Segmentation & operator=(const Segmentation &other)
void keep_largest_part()
Retain only the largest connected component in the mask.
cv::Mat mask
Binary or grayscale segmentation mask.
Segmentation align_to_left_top(int left, int top, int width, int height) const
Return a new Segmentation placed at the given (left, top) offset within a canvas of the specified dim...
Multi-object tracking state for a single tracked instance.
int track_id
Unique tracking identifier.
friend std::ostream & operator<<(std::ostream &os, const Track &track)
std::optional< std::vector< Pose > > history_pose
Optional history of pose keypoints from previous frames.
std::vector< std::tuple< float, float > > track_trace
Trajectory trace as (x, y) positions from previous frames.