DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.
此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 如何放置
  • 输入和输出
  • 用法
  • 支持的图像格式
  • 限制
  • 功能示例
  • 参考
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包
最后更新
ImageManip 节点可用于裁剪、旋转矩形区域或执行各种图像变换:旋转、镜像、翻转、透视变换。对于缩小,ImageManip 使用双线性/双三次插值。

如何放置

Python

Python
1pipeline = dai.Pipeline()
2manip = pipeline.create(dai.node.ImageManip)

C++

C++
1dai::Pipeline pipeline;
2auto manip = pipeline.create<dai::node::ImageManip>();

输入和输出

用法

Python

Python
1pipeline = dai.Pipeline()
2manip = pipeline.create(dai.node.ImageManip)
3
4manip.initialConfig.setResize(300, 300)
5manip.initialConfig.setFrameType(dai.ImgFrame.Type.BGR888p)

C++

C++
1dai::Pipeline pipeline;
2auto manip = pipeline.create<dai::node::ImageManip>();
3
4manip->initialConfig.setResize(300, 300);
5manip->initialConfig.setFrameType(dai::ImgFrame.Type::BGR888p);

支持的图像格式

ImageManip 节点支持以下图像格式(更多信息请参见此处 PR):
  • 支持的输入格式:RGB/BGR、平面/交错、YUV/NV12、RAW8 和 GRAY8
  • 将格式转换为上述任何其他格式
  • 支持 RAW16 (uint16, depth 输出),但不支持颜色转换功能
请注意,平面格式处理速度更快,因此应避免使用交错图像(例如 NV12 输入)。

限制

除了上述限制(不支持的帧格式)之外,还有其他限制:
  • 由于硬件扭曲限制,旋转/扭曲只能在宽度值为 16 的倍数的帧上进行
  • 帧的最大输出宽度为 4056 像素

功能示例

参考

class

depthai.node.ImageManip(depthai.Node)

method
getWaitForConfigInput(self) -> bool: bool
See also:     setWaitForConfigInput  Returns:     True if wait for inputConfig message, false otherwise
method
method
method
method
method
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
method
setWaitForConfigInput(self, wait: bool)
Specify whether or not wait until configuration message arrives to inputConfig Input.  Parameter ``wait``:     True to wait for configuration message, false otherwise.
method
property
initialConfig
Initial config to use when manipulating frames
property
inputConfig
Input ImageManipConfig message with ability to modify parameters in runtime Default queue is blocking with size 8
property
inputImage
Input image to be modified Default queue is blocking with size 8
property
out
Outputs ImgFrame message that carries modified image.

需要帮助?

请访问讨论论坛以获取技术支持或您可能有的任何其他问题。