Table of Contents

Class CVDewarpBlock

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

OpenCV dewarp block for geometric distortion correction in video streams. This block performs lens distortion correction, perspective transformation, and barrel/pincushion distortion removal using OpenCV's computer vision algorithms. Essential for correcting footage from wide-angle lenses, fisheye cameras, or action cameras that produce geometric distortions. Supports various distortion models including radial and tangential distortion correction. Commonly used in surveillance systems, automotive applications, and 360-degree video processing. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class CVDewarpBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

CVDewarpBlock(CVDewarpSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenCV.CVDewarpBlock class with the specified distortion correction settings.

public CVDewarpBlock(CVDewarpSettings settings)

Parameters

settings CVDewarpSettings

The dewarp configuration settings containing distortion correction parameters.

Properties

Input

Gets the input pad for connecting distorted video sources.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads for this dewarp 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 dewarp block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the dewarp configuration settings. Defines distortion correction parameters, transformation matrices, and calibration data.

public CVDewarpSettings Settings { get; set; }

Property Value

CVDewarpSettings

Type

Gets the media block type identifier.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Constructs and initializes the OpenCV dewarp element within the pipeline. This method creates the dewarp filter with the specified distortion correction settings, establishes input and output pads, and prepares the block for geometric transformation.

public override bool Build()

Returns

bool

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

CleanUp()

Releases all resources and performs cleanup operations for this OpenCV dewarp block. This method disposes of the dewarp 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 dewarp element.

public BaseElement GetCore()

Returns

BaseElement

The BaseElement wrapper instance that encapsulates the dewarp functionality.

GetElement()

Gets the underlying GStreamer element that performs the dewarp operation.

public Element GetElement()

Returns

Element

The GStreamer Element instance representing the OpenCV dewarp 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 geometric transformation support.

public static bool IsAvailable()

Returns

bool

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

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

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