Warp
Warp
setWarpMesh() 函数)相比:Warp 节点 使用底层的翘曲硬件块(更多信息请参阅 文档), 无需额外资源(SHAVE/cmx 核心)。硬件限制:宽度必须是 16 的倍数。ImageManip 节点 结合了翘曲硬 件块的强大功能和 CMX 内存的效率,以实现更高的 吞吐量(例如 4k@30 fps)。硬件块的调度由 SHAVE 核心完成,SHAVE 核心还负责颜色空间转换、类型转换(YUV420 到 NV12)等。 使用 ImageManip 节点的缺点是额外的 RAM 和 SHAVE 资源消耗。如何放置
Python
Python
1pipeline = dai.Pipeline()
2warp = pipeline.create(dai.node.Warp)输入和输出
用法
Python
Python
1pipeline = dai.Pipeline()
2
3warp = pipeline.create(dai.node.Warp)
4# 创建自定义翘曲网格
5p1 = dai.Point2f(20, 20)
6p2 = dai.Point2f(460, 20)
7p3 = dai.Point2f(20, 460)
8p4 = dai.Point2f(460, 460)
9warp.setWarpMesh([p1,p2,p3,p4], 2, 2)
10warp.setOutputSize((512,512))
11warp.setMaxOutputFrameSize(512 * 512 * 3)
12# 要使用的翘曲引擎 (0,1,2)
13warp.setHwIds([1])
14# 翘曲插值模式,可在 BILINEAR, BICUBIC, BYPASS 中选择
15warp.setInterpolation(dai.Interpolation.NEAREST_NEIGHBOR)功能示例
参考
class
depthai.node.Warp(depthai.Node)
method
getHwIds(self) -> list[int]: list[int]Retrieve which hardware warp engines to use
method
getInterpolation(self) -> depthai.Interpolation: depthai.InterpolationRetrieve which interpolation method to use
method
setHwIds(self, arg0: collections.abc.Sequence
[
typing.SupportsInt
])Specify which hardware warp engines to use Parameter ``ids``: Which warp engines to use (0, 1, 2)
method
setInterpolation(self, arg0: depthai.Interpolation)Specify which interpolation method to use Parameter ``interpolation``: type of interpolation
method
setMaxOutputFrameSize(self, arg0: typing.SupportsInt)Specify maximum size of output image. Parameter ``maxFrameSize``: Maximum frame size in bytes
method
setNumFramesPool(self, arg0: typing.SupportsInt)Specify number of frames in pool. Parameter ``numFramesPool``: How many frames should the pool have
method
method
property
inputImage
Input image to be modified Default queue is blocking with size 8
property
out
Outputs ImgFrame message that carries warped image.
需要帮助?
请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。