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

本页目录

  • 如何放置
  • 输入和输出
  • 用法
  • 功能示例
  • 参考
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

EdgeDetector

最后更新
边缘检测器使用 Sobel 滤波器 创建强调边缘的图像。

如何放置

Python

Python
1pipeline = dai.Pipeline()
2edgeDetector = pipeline.create(dai.node.EdgeDetector)

C++

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

输入和输出

用法

Python

Python
1pipeline = dai.Pipeline()
2edgeDetector = pipeline.create(dai.node.EdgeDetector)
3
4sobelHorizontalKernel = [[1, 0, -1], [2, 0, -2], [1, 0, -1]]
5sobelVerticalKernel = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
6edgeDetector.initialConfig.setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel)

C++

C++
1dai::Pipeline pipeline;
2auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();
3
4std::vector<std::vector<int>> sobelHorizontalKernel = {{1, 0, -1}, {2, 0, -2}, {1, 0, -1}};
5std::vector<std::vector<int>> sobelVerticalKernel = {{1, 2, 1}, {0, 0, 0}, {-1, -2, -1}};
6edgeDetector->setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel);

功能示例

参考

class

depthai.node.EdgeDetector(depthai.Node)

method
getWaitForConfigInput(self) -> bool: bool
See also:     setWaitForConfigInput  Returns:     True if wait for inputConfig message, false otherwise
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
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.
property
initialConfig
Initial config to use for edge detection.
property
inputConfig
Input EdgeDetectorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
property
inputImage
Input image on which edge detection is performed. Default queue is non-blocking with size 4.
property
outputImage
Outputs image frame with detected edges

需要帮助?

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