DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.

本页目录

  • 如何放置
  • 输入和输出
  • 用法
  • 功能示例
  • 参考

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

需要帮助?

请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。