Class CVErodeBlock
- Namespace
- VisioForge.Core.MediaBlocks.OpenCV
- Assembly
- VisioForge.Core.dll
OpenCV erode block for morphological image processing operations. This block performs erosion, a fundamental morphological operation that shrinks white regions (foreground objects) in binary or grayscale images. Erosion is commonly used for noise removal, thin line detection, separating connected objects, and removing small artifacts. The operation uses a structuring element (kernel) that defines the shape and size of the erosion. Often paired with dilation for opening/closing operations in computer vision preprocessing. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class CVErodeBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
CVErodeBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenCV.CVErodeBlock class. Creates a morphological erosion block with default kernel settings.
public CVErodeBlock()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 erode 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 erode block.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Constructs and initializes the OpenCV erode element within the pipeline. This method creates the erode filter with default morphological settings, establishes input and output pads, and prepares the block for image processing.
public override bool Build()Returns
- bool
-
trueif the erode element was successfully built and configured;falseif initialization failed.
CleanUp()
Releases all resources and performs cleanup operations for this OpenCV erode block. This method disposes of the erode 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 erode element.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement wrapper instance that encapsulates the erode functionality.
GetElement()
Gets the underlying GStreamer element that performs the erode operation.
public Element GetElement()Returns
- Element
-
The GStreamer Element instance representing the OpenCV erode 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 morphological operations support.
public static bool IsAvailable()Returns
- bool
-
trueif OpenCV erode functionality is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this OpenCV erode 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.