void get_color_from_label(const std::string &label, float *red, float *green, float *blue, int num_classes)
Generates a consistent color based on a class label.
void calculate_centroid(const float *points, float *centroid)
Calculates the centroid of a 3D bounding box from its 2D projection.
std::vector< std::string > extract_class_labels(const std::vector< ClassThreshold > &class_thresholds)
Extract class label strings from ClassThreshold vector.
bool count_visible_corners(const float *points, int num_corners, int img_width, int img_height)
Counts visible corners of a 3D bounding box.
void attach_bbox3d_to_display(NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta, const torch::Tensor &camera_frames, const torch::Tensor &boxes_3d, const torch::Tensor &labels_3d, const torch::Tensor &instance_ids, const torch::Tensor &scores_3d, int img_width, int img_height, const std::vector< std::string > &class_labels, const std::string &bbox_color_mode, const bool &display_class_labels, const bool &display_instance_ids, const bool &display_class_score, PrettyLogger *logger)
Attach 3D bounding boxes to display metadata for visualization.
void attach_bbox2d_to_objectmeta(NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta, const torch::Tensor &bbox2d, const torch::Tensor &boxes_3d, const torch::Tensor &labels_3d, const torch::Tensor &instance_ids, const torch::Tensor &scores_3d, const std::vector< std::string > &class_labels, const std::string &bbox_color_mode, const bool &display_2d_bbox, PrettyLogger *logger)
Attach 2D bounding boxes as NvDsObjectMeta to frame metadata.
void get_color_from_instance_id(int64_t instance_id, float *red, float *green, float *blue)
Generates a color based on instance ID for tracking visualization.
std::vector< ClassThreshold > fetch_class_labels_with_thresholds(const std::string &labels_file, PrettyLogger *logger)
Fetch class labels and thresholds from a labels file.
void clamp_point(float *x, float *y, int img_width, int img_height)
Clamps a point to stay within image boundaries.