# EdgeDetector

Edge detector uses [Sobel filter](https://en.wikipedia.org/wiki/Sobel_operator) to create an image that emphasises edges.

## How to place it

#### Python

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

#### C++

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

## Inputs and Outputs

## Usage

#### 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);
```

## Examples of functionality

 * [Edge detector](https://docs.luxonis.com/software/depthai/examples/edge_detector.md)

## Reference

### 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

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
