# box_measurements

Python API: `depthai_nodes.message.box_measurements`

Per-frame box measurement results.

## Classes

### BoxDimensions

A box's length, width and height in millimeters.

Raises

 * `TypeError`: If a field is not a real number.
 * `ValueError`: If a field is not finite.

#### Attributes

##### height_mm

Height in millimeters.

##### length_mm

Length in millimeters.

##### volume_mm3

The box volume in cubic millimeters.

##### width_mm

Width in millimeters.

### BoxMeasurementResult

A tracked box's measurement outcome in one processed frame.

Raises

 * `TypeError`: If a field has the wrong type.
 * `ValueError`: If `confidence` is not finite, or a measured box has no dimensions.

#### Attributes

##### bounding_box

Normalized bounding box in the source frame.

##### confidence

Detection confidence.

##### dimensions

The box's aggregated dimensions, when it has any.

##### measurement_status

Outcome of measuring the box in this frame.

##### track_id

Tracker ID of the box.

##### track_status

Tracking status of the box in this frame, `NEW` or `TRACKED`. Lost tracks keep only their last-seen box, so they are not emitted.

### BoxMeasurements

Measurement results of the boxes tracked in one frame.

Parameters

 * `items`: Measurement results.

Raises

 * `TypeError`: If `items` is not a list of one type.

#### Methods

##### getVisualizationMessage

```python
def getVisualizationMessage(self) -> dai.ImgAnnotations:
```

Outline each box, labelled with its identity and any dimensions.

Returns

 * `dai.ImgAnnotations`: Annotations with this message's timestamps and sequence number.

### MeasurementStatus

Whether a box was measured in a frame.

`INELIGIBLE` boxes could not be measured, for example because no support plane is set or the box touches the frame border.
`FAILED` boxes were eligible but their geometry could not be measured. `MEASURED` boxes produced a sample and have dimensions.

#### Attributes

##### FAILED

##### INELIGIBLE

##### MEASURED

## Functions

### annotation_text

```python
def annotation_text(box: BoxMeasurementResult) -> str:
```

Return the annotation text of a measured box.

Parameters

 * `box` (`BoxMeasurementResult`): Measurement result to describe.

Returns

 * `str`: Track ID and confidence, followed by the dimensions in centimeters and the volume in cubic centimeters when the box has
   dimensions.
