# EdgeDetector

边缘检测器使用 [Sobel 滤波器](https://en.wikipedia.org/wiki/Sobel_operator) 创建强调边缘的图像。

## 如何放置

#### Python

```python
pipeline = dai.Pipeline()
edgeDetector = pipeline.create(dai.node.EdgeDetector)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();
```

## 输入和输出

## 用法

#### Python

```python
pipeline = dai.Pipeline()
edgeDetector = pipeline.create(dai.node.EdgeDetector)

sobelHorizontalKernel = [[1, 0, -1], [2, 0, -2], [1, 0, -1]]
sobelVerticalKernel = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
edgeDetector.initialConfig.setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();

std::vector<std::vector<int>> sobelHorizontalKernel = {{1, 0, -1}, {2, 0, -2}, {1, 0, -1}};
std::vector<std::vector<int>> sobelVerticalKernel = {{1, 2, 1}, {0, 0, 0}, {-1, -2, -1}};
edgeDetector->setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel);
```

## 功能示例

 * [边缘检测器](https://docs.luxonis.com/software/depthai/examples/edge_detector.md)

## 参考

### depthai.node.EdgeDetector(depthai.Node)

Kind: Class

EdgeDetector node. Performs edge detection using 3x3 Sobel filter

#### getWaitForConfigInput(self) -> bool: bool

Kind: Method

See also:
setWaitForConfigInput

Returns:
True if wait for inputConfig message, false otherwise

#### setMaxOutputFrameSize(self, arg0: typing.SupportsInt)

Kind: Method

Specify maximum size of output image.

Parameter ``maxFrameSize``:
Maximum frame size in bytes

#### setNumFramesPool(self, arg0: typing.SupportsInt)

Kind: Method

Specify number of frames in pool.

Parameter ``numFramesPool``:
How many frames should the pool have

#### setWaitForConfigInput(self, wait: bool)

Kind: Method

Specify whether or not wait until configuration message arrives to inputConfig
Input.

Parameter ``wait``:
True to wait for configuration message, false otherwise.

#### initialConfig

Kind: Property

Initial config to use for edge detection.

#### inputConfig

Kind: Property

Input EdgeDetectorConfig message with ability to modify parameters in runtime.
Default queue is non-blocking with size 4.

#### inputImage

Kind: Property

Input image on which edge detection is performed. Default queue is non-blocking
with size 4.

#### outputImage

Kind: Property

Outputs image frame with detected edges

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
