EdgeDetector¶
Edge detector uses Sobel filter to create an image that emphasises edges.
How to place it¶
pipeline = dai.Pipeline()
edgeDetector = pipeline.create(dai.node.EdgeDetector)
dai::Pipeline pipeline;
auto edgeDetector = pipeline.create<dai::node::EdgeDetector>();
Inputs and Outputs¶
┌───────────────────┐
inputImage │ │
──────────────►│ │
│ │ outputImage
│ EdgeDetector ├───────────►
inputConfig │ │
──────────────►│ │
│ │
└───────────────────┘
Message types
inputImage
- ImgFrameinputConfig
- EdgeDetectorConfigoutputImage
- ImgFrame
Usage¶
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)
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¶
Reference¶
-
class
depthai.node.
EdgeDetector
-
class
Id
Node identificator. Unique for every node on a single Pipeline
-
getAssetManager
(*args, **kwargs) Overloaded function.
getAssetManager(self: depthai.Node) -> depthai.AssetManager
getAssetManager(self: depthai.Node) -> depthai.AssetManager
-
getInputRefs
(*args, **kwargs) Overloaded function.
getInputRefs(self: depthai.Node) -> list[depthai.Node.Input]
getInputRefs(self: depthai.Node) -> list[depthai.Node.Input]
-
getInputs
(self: depthai.Node) → list[depthai.Node.Input]
-
getName
(self: depthai.Node) → str
-
getOutputRefs
(*args, **kwargs) Overloaded function.
getOutputRefs(self: depthai.Node) -> list[depthai.Node.Output]
getOutputRefs(self: depthai.Node) -> list[depthai.Node.Output]
-
getOutputs
(self: depthai.Node) → list[depthai.Node.Output]
-
getParentPipeline
(*args, **kwargs) Overloaded function.
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
-
getWaitForConfigInput
(self: depthai.node.EdgeDetector) → bool
-
setMaxOutputFrameSize
(self: depthai.node.EdgeDetector, arg0: int) → None
-
setNumFramesPool
(self: depthai.node.EdgeDetector, arg0: int) → None
-
setWaitForConfigInput
(self: depthai.node.EdgeDetector, wait: bool) → None
-
class
-
class
dai::node
::
EdgeDetector
: public dai::NodeCRTP<Node, EdgeDetector, EdgeDetectorProperties>¶ EdgeDetector node. Performs edge detection using 3x3 Sobel filter.
Public Functions
-
void
setWaitForConfigInput
(bool wait)¶ Specify whether or not wait until configuration message arrives to inputConfig Input.
- Parameters
wait
: True to wait for configuration message, false otherwise.
-
bool
getWaitForConfigInput
() const¶ - See
- Return
True if wait for inputConfig message, false otherwise
-
void
setNumFramesPool
(int numFramesPool)¶ Specify number of frames in pool.
- Parameters
numFramesPool
: How many frames should the pool have
-
void
setMaxOutputFrameSize
(int maxFrameSize)¶ Specify maximum size of output image.
- Parameters
maxFrameSize
: Maximum frame size in bytes
Public Members
-
EdgeDetectorConfig
initialConfig
¶ Initial config to use for edge detection.
-
Input
inputConfig
= {*this, "inputConfig", Input::Type::SReceiver, false, 4, {{DatatypeEnum::EdgeDetectorConfig, false}}}¶ Input EdgeDetectorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
-
Input
inputImage
= {*this, "inputImage", Input::Type::SReceiver, false, 4, true, {{DatatypeEnum::ImgFrame, false}}}¶ Input image on which edge detection is performed. Default queue is non-blocking with size 4.
-
Output
outputImage
= {*this, "outputImage", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}¶ Outputs image frame with detected edges
-
Output
passthroughInputImage
= {*this, "passthroughInputImage", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}¶ Passthrough message on which the calculation was performed.
Public Static Attributes
-
static constexpr const char *
NAME
= "EdgeDetector"¶
Private Members
-
std::shared_ptr<RawEdgeDetectorConfig>
rawConfig
¶
-
void