Table of Contents

Class CVSobelBlock

Namespace
VisioForge.Core.MediaBlocks.OpenCV
Assembly
VisioForge.Core.dll

OpenCV Sobel edge detection block for gradient-based image analysis. This block applies the Sobel operator to detect edges by calculating image gradients in horizontal and vertical directions. The Sobel filter is particularly effective for edge detection in noisy images due to its built-in smoothing capabilities. Provides separate X and Y gradient calculations, magnitude computation, and directional filtering options. Essential for computer vision applications, feature extraction, and image preprocessing where robust edge detection is required. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class CVSobelBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

CVSobelBlock(CVSobelSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenCV.CVSobelBlock class with the specified Sobel edge detection settings.

public CVSobelBlock(CVSobelSettings settings)

Parameters

settings CVSobelSettings

The Sobel 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

MediaBlockPad

Inputs

Gets all input pads for this Sobel block.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad for connecting to downstream processing blocks.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads for this Sobel block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the Sobel configuration settings. Defines gradient calculation parameters, directional options, and edge detection sensitivity.

public CVSobelSettings Settings { get; set; }

Property Value

CVSobelSettings

Type

Gets the media block type identifier.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Constructs and initializes the OpenCV Sobel element within the pipeline. This method creates the Sobel filter with the specified edge detection settings, establishes input and output pads, and prepares the block for gradient analysis.

public override bool Build()

Returns

bool

true if the Sobel element was successfully built and configured; false if initialization failed.

CleanUp()

Releases all resources and performs cleanup operations for this OpenCV Sobel block. This method disposes of the Sobel element and resets the build state.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core BaseElement wrapper that provides additional functionality around the OpenCV Sobel element.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper instance that encapsulates the Sobel functionality.

GetElement()

Gets the underlying GStreamer element that performs the Sobel operation.

public Element GetElement()

Returns

Element

The GStreamer Element instance representing the OpenCV Sobel 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 Sobel operator support.

public static bool IsAvailable()

Returns

bool

true if OpenCV Sobel functionality is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this OpenCV Sobel 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

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

See Also