Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/source/components/messages/edge_detector_config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
EdgeDetectorConfig
==================

This message is used to configure the :ref:`EdgeDetector` node.
You can set the horizontal and vertical Sobel filter kernel.

Examples of functionality
#########################

- :ref:`Edge detector`

Reference
#########

.. tabs::

.. tab:: Python

.. autoclass:: depthai.EdgeDetectorConfig
:members:
:inherited-members:
:noindex:

.. tab:: C++

.. doxygenclass:: dai::EdgeDetectorConfig
:project: depthai-core
:members:
:private-members:
:undoc-members:

.. include:: ../../includes/footer-short.rst
91 changes: 91 additions & 0 deletions docs/source/components/nodes/edge_detector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
EdgeDetector
============

Edge detector uses `Sobel filter <https://en.wikipedia.org/wiki/Sobel_operator>`__ to create an image that emphasises edges.

How to place it
###############

.. tabs::

.. code-tab:: py

pipeline = dai.Pipeline()
edgeDetector = pipeline.createEdgeDetector()

.. code-tab:: c++

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


Inputs and Outputs
##################

.. code-block::

┌───────────────────┐
inputImage │ │
──────────────►│ │
│ │ outputImage
│ EdgeDetector ├───────────►
inputConfig │ │
──────────────►│ │
│ │
└───────────────────┘

**Message types**

- :code:`inputImage` - :ref:`ImgFrame`
- :code:`inputConfig` - :ref:`EdgeDetectorConfig`
- :code:`outputImage` - :ref:`ImgFrame`

Usage
#####

.. tabs::

.. code-tab:: py

pipeline = dai.Pipeline()
edgeDetector = pipeline.createEdgeDetector()

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)

.. code-tab:: c++

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

- :ref:`Edge detector`

Reference
#########

.. tabs::

.. tab:: Python

.. autoclass:: depthai.EdgeDetector
:members:
:inherited-members:
:noindex:

.. tab:: C++

.. doxygenclass:: dai::node::EdgeDetector
:project: depthai-core
:members:
:private-members:
:undoc-members:

.. include:: ../../includes/footer-short.rst