Skip to content

Commit edeb0a5

Browse files
authored
Merge branch 'main' into fov_tutorial
2 parents 1e876ee + 95652c8 commit edeb0a5

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
EdgeDetectorConfig
2+
==================
3+
4+
This message is used to configure the :ref:`EdgeDetector` node.
5+
You can set the horizontal and vertical Sobel filter kernel.
6+
7+
Examples of functionality
8+
#########################
9+
10+
- :ref:`Edge detector`
11+
12+
Reference
13+
#########
14+
15+
.. tabs::
16+
17+
.. tab:: Python
18+
19+
.. autoclass:: depthai.EdgeDetectorConfig
20+
:members:
21+
:inherited-members:
22+
:noindex:
23+
24+
.. tab:: C++
25+
26+
.. doxygenclass:: dai::EdgeDetectorConfig
27+
:project: depthai-core
28+
:members:
29+
:private-members:
30+
:undoc-members:
31+
32+
.. include:: ../../includes/footer-short.rst
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
EdgeDetector
2+
============
3+
4+
Edge detector uses `Sobel filter <https://en.wikipedia.org/wiki/Sobel_operator>`__ to create an image that emphasises edges.
5+
6+
How to place it
7+
###############
8+
9+
.. tabs::
10+
11+
.. code-tab:: py
12+
13+
pipeline = dai.Pipeline()
14+
edgeDetector = pipeline.createEdgeDetector()
15+
16+
.. code-tab:: c++
17+
18+
dai::Pipeline pipeline;
19+
auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();
20+
21+
22+
Inputs and Outputs
23+
##################
24+
25+
.. code-block::
26+
27+
┌───────────────────┐
28+
inputImage │ │
29+
──────────────►│ │
30+
│ │ outputImage
31+
│ EdgeDetector ├───────────►
32+
inputConfig │ │
33+
──────────────►│ │
34+
│ │
35+
└───────────────────┘
36+
37+
**Message types**
38+
39+
- :code:`inputImage` - :ref:`ImgFrame`
40+
- :code:`inputConfig` - :ref:`EdgeDetectorConfig`
41+
- :code:`outputImage` - :ref:`ImgFrame`
42+
43+
Usage
44+
#####
45+
46+
.. tabs::
47+
48+
.. code-tab:: py
49+
50+
pipeline = dai.Pipeline()
51+
edgeDetector = pipeline.createEdgeDetector()
52+
53+
sobelHorizontalKernel = [[1, 0, -1], [2, 0, -2], [1, 0, -1]]
54+
sobelVerticalKernel = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
55+
edgeDetector.initialConfig.setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel)
56+
57+
.. code-tab:: c++
58+
59+
dai::Pipeline pipeline;
60+
auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();
61+
62+
std::vector<std::vector<int>> sobelHorizontalKernel = {{1, 0, -1}, {2, 0, -2}, {1, 0, -1}};
63+
std::vector<std::vector<int>> sobelVerticalKernel = {{1, 2, 1}, {0, 0, 0}, {-1, -2, -1}};
64+
edgeDetector->setSobelFilterKernels(sobelHorizontalKernel, sobelVerticalKernel);
65+
66+
Examples of functionality
67+
#########################
68+
69+
- :ref:`Edge detector`
70+
71+
Reference
72+
#########
73+
74+
.. tabs::
75+
76+
.. tab:: Python
77+
78+
.. autoclass:: depthai.EdgeDetector
79+
:members:
80+
:inherited-members:
81+
:noindex:
82+
83+
.. tab:: C++
84+
85+
.. doxygenclass:: dai::node::EdgeDetector
86+
:project: depthai-core
87+
:members:
88+
:private-members:
89+
:undoc-members:
90+
91+
.. include:: ../../includes/footer-short.rst

0 commit comments

Comments
 (0)