Class CVEdgeDetectBlock
- Namespace
- VisioForge.Core.MediaBlocks.OpenCV
- Assembly
- VisioForge.Core.dll
OpenCV edge detection block for identifying boundaries and contours in video streams. This block performs edge detection using various computer vision algorithms including Canny, Sobel, Laplacian, and Scharr operators. Edge detection is fundamental for object recognition, feature extraction, image segmentation, and computer vision applications. The block provides configurable threshold parameters, gradient calculations, and noise reduction capabilities. Essential for medical imaging, industrial inspection, autonomous vehicles, and surveillance systems. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class CVEdgeDetectBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
CVEdgeDetectBlock(CVEdgeDetectSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenCV.CVEdgeDetectBlock class with the specified edge detection settings.
public CVEdgeDetectBlock(CVEdgeDetectSettings settings)Parameters
settingsCVEdgeDetectSettings-
The edge detection configuration settings containing algorithm parameters.
Properties
Input
Gets the input pad for connecting video sources to be processed.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads for this edge detection block.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad for connecting to downstream processing blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads for this edge detection block.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the edge detection configuration settings. Defines algorithm selection, threshold parameters, and detection sensitivity.
public CVEdgeDetectSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Constructs and initializes the OpenCV edge detection element within the pipeline. This method creates the edge detection filter with the specified algorithm settings, establishes input and output pads, and prepares the block for computer vision processing.
public override bool Build()Returns
- bool
-
trueif the edge detection element was successfully built and configured;falseif initialization failed.
CleanUp()
Releases all resources and performs cleanup operations for this OpenCV edge detection block. This method disposes of the edge detection element and resets the build state.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core BaseElement wrapper that provides additional functionality around the OpenCV edge detection element.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement wrapper instance that encapsulates the edge detection functionality.
GetElement()
Gets the underlying GStreamer element that performs the edge detection operation.
public Element GetElement()Returns
- Element
-
The GStreamer Element instance representing the OpenCV edge detection filter.
IsAvailable()
Determines whether this media block is available. Correct NuGet SDK redist should be included into your project. Checks for OpenCV library availability and edge detection algorithm support.
public static bool IsAvailable()Returns
- bool
-
trueif OpenCV edge detection functionality is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this OpenCV edge detection block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.