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.
需要帮助?
请访问讨论论坛以获取技术支持或您可能有的任何其他问题。