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