ei_impulse_result_bounding_box_t

typedef struct {
    const char *label;
    uint32_t x;
    uint32_t y;
    uint32_t width;
    uint32_t height;
    float value;
} ei_impulse_result_bounding_box_t;

Brief: Holds information for a single bounding box.

Location: edge-impulse-sdk/classifier/ei_classifier_types.h

Description:
If object detection is enabled (i.e. EI_CLASSIFIER_OBJECT_DETECTION == 1), then inference results will be one or more bounding boxes. The bounding boxes with the highest confidence scores (assuming those scores are equal to or greater than EI_CLASSIFIER_OBJECT_DETECTION_THRESHOLD), given by the value member, are returned from inference. The total number of bounding boxes returned will be at least EI_CLASSIFIER_OBJECT_DETECTION_COUNT. The exact number of bounding boxes is stored in bounding_boxes_count field of [ei_impulse_result_t]/C++ Inference SDK Library/structs/ei_impulse_result_t.md).

A bounding box is a rectangle that ideally surrounds the identified object. The (x, y) coordinates in the struct identify the top-left corner of the box. label is the predicted class with the highest confidence score. value is the confidence score between [0.0..1.0] of the given label.

Members:

  • label - Pointer to a character array describing the associated class of the given bounding box. Taken from one of the elements of ei_classifier_inferencing_categories[].
  • x - x coordinate of the top-left corner of the bounding box.
  • y - y coordinate of the top-left corner of the bounding box.
  • width - Width of the bounding box.
  • height - Height of the bounding box.
  • value - Confidence score of the label describing the bounding box.

Example:
https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp