# box_geometry

Python API: `depthai_nodes.node.box_dimensioner.box_geometry`

Box dimensions from the points of one box above a support plane.

## Classes

| Name | Description |
| --- | --- |
| [`BoxGeometry`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/box_dimensioner/box_geometry.md#box_geometry-Classes-BoxGeometry) | Measure box dimensions from a millimeter point cloud of one box. |

### class `BoxGeometry`

```python
class BoxGeometry
```

Measure box dimensions from a millimeter point cloud of one box.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `HEIGHT_PERCENTILE` | `float` |  |
| `MAD_K` | `float` |  |
| `MAX_HEIGHT_MARGIN_MM` | `float` |  |
| `MIN_FOOTPRINT_POINTS` | `int` |  |
| `MIN_POINTS` | `int` |  |
| `MIN_TOP_PLANE_POINTS` | `int` |  |
| `TOP_BAND_FRACTION` | `float` |  |
| `TOP_PLANE_BAND_FRACTION` | `float` |  |
| `TOP_PLANE_ITERATIONS` | `int` |  |
| `TOP_PLANE_RANSAC_THRESH_MM` | `float` |  |
| `VOXEL_SIZE` | `float` |  |

Methods

| Name | Description |
| --- | --- |
| [`measure`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/box_dimensioner/box_geometry.md#box_geometry-Classes-BoxGeometry-measure) | Measure the box whose points lie above a support plane. |

#### method `measure`

```python
def measure(points: np.ndarray, plane_eq: np.ndarray) -> BoxDimensions | None
```

Measure the box whose points lie above a support plane.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `points` | `np.ndarray` | `(N, 3)` box points in millimeters. | required |
| `plane_eq` | `np.ndarray` | Support plane `(a, b, c, d)` with `ax + by + cz + d = 0`, in millimeters. The normal need not be unit length or point up. | required |

Returns

| Type | Description |
| --- | --- |
| `BoxDimensions | None` | The box dimensions, or `None` when there are too few points or no dominant top surface. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the plane normal is zero. |

## Module Attributes

| Name | Description |
| --- | --- |
| [`logger`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/box_dimensioner/box_geometry.md#box_geometry-Module-Attributes-logger) |  |

### variable `logger`

```python
logger = logging.getLogger(__name__)
```
