ON THIS PAGE

  • How to place it
  • Inputs and Outputs
  • Usage
  • Examples of functionality
  • Reference

EdgeDetector

Supported on:RVC2
Edge detector uses Sobel filter to create an image that emphasises edges.

How to place it

Python

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

C++

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

Inputs and Outputs

Usage

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

Examples of functionality

Reference

class

dai::node::EdgeDetector

#include EdgeDetector.hpp
variable
std::shared_ptr< EdgeDetectorConfig > initialConfig
Initial config to use for edge detection.
variable
Input inputConfig
Input EdgeDetectorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input image on which edge detection is performed. Default queue is non-blocking with size 4.
variable
Output outputImage
Outputs image frame with detected edges
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed.
function
EdgeDetector()
function
EdgeDetector(std::unique_ptr< Properties > props)
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setMaxOutputFrameSize(int maxFrameSize)
Specify maximum size of output image.
Parameters
  • maxFrameSize: Maximum frame size in bytes
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.