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
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
inputInputArrayContour (set of points) to apply the transformation to.
outputOutputArrayOutput 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
transformingShapeInputArrayContour defining first shape.
targetShapeInputArrayContour defining second shape (to which the first will be transformed).
matchesIEnumerable<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
transformingImageInputArrayInput image to be transformed.
outputOutputArrayOutput image.
flagsInterpolationFlagsImage interpolation method. Default: InterpolationFlags.Linear.
borderModeBorderTypesBorder extrapolation method. Default: BorderTypes.Constant.
borderValueScalar?Value used for BorderTypes.Constant borders. Default: black.