Table of Contents

Class ShapeTransformer

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Abstract base class for shape transformation algorithms.

public abstract class ShapeTransformer : Algorithm, IDisposable
Inheritance
ShapeTransformer
Implements
Derived
Inherited Members

Constructors

ShapeTransformer(nint, nint, Action<nint>)

Constructor for the factory pattern (cv::Ptr<T>* + raw T*).

protected ShapeTransformer(nint smartPtr, nint rawPtr, Action<nint> release)

Parameters

smartPtr nint
rawPtr nint
release Action<nint>

Methods

ApplyTransformation(InputArray, OutputArray?)

Apply a transformation to a contour, given a pre-estimated transformation.

public virtual float ApplyTransformation(InputArray input, OutputArray? output = null)

Parameters

input InputArray

Contour (set of points) to apply the transformation to.

output OutputArray

Output contour. If null, only the cost is returned without writing the output.

Returns

float

The transformation cost.

EstimateTransformation(InputArray, InputArray, IEnumerable<DMatch>)

Estimate the transformation parameters of the current transformer algorithm, based on point matches.

public virtual void EstimateTransformation(InputArray transformingShape, InputArray targetShape, IEnumerable<DMatch> matches)

Parameters

transformingShape InputArray

Contour defining first shape.

targetShape InputArray

Contour defining second shape (to which the first will be transformed).

matches IEnumerable<DMatch>

Vector of matching points between the two contours.

WarpImage(InputArray, OutputArray, InterpolationFlags, BorderTypes, Scalar?)

Apply a transformation to an image.

public virtual void WarpImage(InputArray transformingImage, OutputArray output, InterpolationFlags flags = InterpolationFlags.Linear, BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null)

Parameters

transformingImage InputArray

Input image to be transformed.

output OutputArray

Output image.

flags InterpolationFlags

Image interpolation method. Default: InterpolationFlags.Linear.

borderMode BorderTypes

Border extrapolation method. Default: BorderTypes.Constant.

borderValue Scalar?

Value used for BorderTypes.Constant borders. Default: black.