# coordinates_mapper

Python API: `depthai_nodes.node.coordinates_mapper`

## 类

### CoordinatesMapper

将支持的消息重新映射到缓存的目标图像变换中。

第一个目标消息建立参考帧。后续消息在可用时更新缓存的变换。设备上的脚本节点仅转发目标变换、时间戳和空图像帧，以减少主机-设备流量。

`MessageGroup`、`Collection` 和 `GatheredData` 项在递归重新映射时保留容器时间戳和序列号。`GatheredData.reference_data` 保持不变。支持的叶消息是 `remap_message`
接受的消息；它们必须公开 `getTransformation()`。没有源变换的消息将保持不变。

> **注意**
> 此临时主机节点旨在由 DepthAI 的 `ImageAlign` 节点中的等效功能取代。

引发

 * `RuntimeError`: 如果在 RVC2 上构建，或者在处理开始时目标消息没有可用的变换。
 * `TypeError`: 如果具有源变换的叶消息类型不受支持。

#### 方法

##### init

```python
def __init__(self):
```

初始化日志记录和特定于平台的输出图像格式。

引发

 * `ValueError`: 如果管道设备平台没有配置图像帧格式。

##### build

```python
def build(toTransformationInput: dai.Node.Output, fromTransformationInput: dai.Node.Output) -> CoordinatesMapper:
```

连接用于坐标重新映射的目标流和源流。

参数

 * `toTransformationInput` (`dai.Node.Output`): 提供消息的流，其变换定义目标参考帧。
 * `fromTransformationInput` (`dai.Node.Output`): 提供消息的流，其坐标应重新映射。

返回

 * `CoordinatesMapper`: 配置的节点实例。

##### run

```python
def run(self):
```

缓存最新的目标变换并重新映射传入消息。

#### 属性

##### out

返回重新映射的输出流。

##### SCRIPT_CONTENT
