此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 函数
  • remap_message
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

message_remapping

最后更新
Python API: depthai_nodes.node.utils.message_remapping

函数

remap_message

Python
1def remap_message(message: GMessage, from_transformation: dai.ImgTransformation | None, to_transformation: dai.ImgTransformation) -> GMessage:
将支持的 DepthAI 消息重新映射到目标图像变换。原生 transformTo 映射坐标字段。映射和掩码像素数组通过最近邻插值单独扭曲,并在写入前从源缓冲区分离。源图像外的像素对于 uint8 数组填充 255,对于其他 dtypes 填充 -1。参数
  • message (GMessage): ImgDetections、SegmentationMask 或 beta Keypoints、Clusters、Map2D、Lines、Predictions 或 Classifications 消息。
  • from_transformation (dai.ImgTransformation | None): 回退源变换。如果消息没有变换,此值将在重新映射前附加到消息。现有消息变换优先。
  • to_transformation (dai.ImgTransformation): 目标坐标空间和输出像素尺寸。
返回
  • GMessage: 带有目标变换的重新映射消息。如果消息和 from_transformation 都没有提供源变换,则返回原始消息不变。
抛出
  • TypeError: 如果消息类型不受支持。