draw_detected_object_boxes

Pipefile Usage

The following sections describe the blocks needed to use this process in a pipe file

Pipefile block

# ================================================================
process draw # This name can be whatever you want
 :: draw_detected_object_boxes
 :default_line_thickness 3
# ================================================================

Pipefile connections

The following Input ports will need to be set

# ProcessX will provide a detected_object_set
connect from processX.detected_object_set
       to   draw.detected_object_set
# ProcessY will provide an image
connect from processY.image
       to draw.image

The follwing Output ports are available from this process

# This process will provide an image with boxes to any processes
connect from draw.image
       to   processZ.image

Class Description

class kwiver::draw_detected_object_boxes_process

Process to draw detected object boxes on an image.

Draws boxes around detected objects.

{detected_object_set} List of detections to draw.

{image} Input image where boxes are drawn.

{image} Updated image with boxes and other annotations.

{threshold} Detections with concidence values below this value are not drawn. (float)

{alpha_blend_prob} If this item is set to true, then detections with a lower probability are drawn with more transparency.

{default_color} The default color specification for drawing boxes if no other more specific color spec is provided.

{custom_class_color}

Inherits from sprokit::process

class priv

Public Functions

void draw_box(cv::Mat &image, const vital::detected_object_sptr dos, std::string label, double prob, bool just_text = false, int offset_index = 0) const

Draw a box on an image.

This method draws a box on an image for the bounding box from a detected object.

When drawing a box with multiple class names, draw the first class_name with the just_text parameter false and all subsequent calls with it set to true. Also the offset parameter must be incremented so the labels do not overwrite.

Parameters
  • image: Input image updated with drawn box
  • dos: detected object with bounding box
  • label: Text label to use for box
  • prob: Probability value to add to label text
  • just_text: Set to true if only draw text, not the bounding box. This is used when there are multiple labels for the same detection.
  • offset: How much to offset text fill box from text baseline. This is used to offset labels when there are more than one label for a detection.

vital::image_container_sptr draw_detections(vital::image_container_sptr image_data, vital::detected_object_set_sptr in_set) const

Draw detected object on image.

This method draws the detections on a copy of the supplied image. The detections are drawn in confidence order up to the threshold. For each detection, the most likely class_name is optionally displayed below the box.

Return
Updated image.
Parameters
  • image_data: The image to draw on.
  • input_set: List of detections to draw.

bool name_selected(std::string const &name) const

See if name has been selected for display.

Return
true if name should be rendered
Parameters
  • name: Name to check.