# tracked_features

Python API: `depthai_nodes.message.creators.tracked_features`

## Functions

| Name | Description |
| --- | --- |
| [`create_feature_point`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/tracked_features.md#tracked_features-Functions-create_feature_point) | Create a tracked feature point. |
| [`create_tracked_features_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/tracked_features.md#tracked_features-Functions-create_tracked_features_message) | Create paired tracked features from reference and target points. |

### function `create_feature_point`

```python
def create_feature_point(x: float, y: float, id: int, age: int) -> dai.TrackedFeature
```

Create a tracked feature point.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `x` | `float` | X coordinate of the feature point. | required |
| `y` | `float` | Y coordinate of the feature point. | required |
| `id` | `int` | ID of the feature point. | required |
| `age` | `int` | Age of the feature point. | required |

Returns

| Type | Description |
| --- | --- |
| `dai.TrackedFeature` | Tracked feature point. |

### function `create_tracked_features_message`

```python
def create_tracked_features_message(
    reference_points: np.ndarray,
    target_points: np.ndarray,
) -> dai.TrackedFeatures
```

Create paired tracked features from reference and target points.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `reference_points` | `np.ndarray` | NumPy array of shape `(N, 2)` with reference `[x, y]` points. | required |
| `target_points` | `np.ndarray` | NumPy array of shape `(N, 2)` with matching target points. | required |

Returns

| Type | Description |
| --- | --- |
| `dai.TrackedFeatures` | Message containing alternating reference and target features. Each pair shares an ID; reference features have age 0 and target features have age 1. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If either input is not a NumPy array of shape `(N, 2)`, or the arrays contain different numbers of points. |
