Table of Contents

Class ContourFitting

Namespace
OpenCvSharp.XImgProc
Assembly
OpenCvSharp.dll

Class for ContourFitting algorithms. ContourFitting matches two contours minimizing distance using their Fourier descriptors, a scaling factor, an angle rotation and a starting point factor adjustment.

public class ContourFitting : Algorithm, IDisposable
Inheritance
ContourFitting
Implements
Inherited Members

Properties

CtrSize

Number of Fourier descriptors equal to number of contour points after resampling, used in EstimateTransformation.

public int CtrSize { get; set; }

Property Value

int

FDSize

Number of Fourier descriptors used for optimal curve matching when EstimateTransformation is used with a vector of points.

public int FDSize { get; set; }

Property Value

int

Methods

Create(int, int)

Creates a ContourFitting algorithm object.

public static ContourFitting Create(int ctr = 1024, int fd = 16)

Parameters

ctr int

number of Fourier descriptors equal to number of contour points after resampling.

fd int

number of Fourier descriptors used for optimal curve matching.

Returns

ContourFitting

EstimateTransformation(InputArray, InputArray, OutputArray, out double, bool)

Fit two closed curves using Fourier descriptors.

public virtual void EstimateTransformation(InputArray src, InputArray dst, OutputArray alphaPhiST, out double dist, bool fdContour = false)

Parameters

src InputArray

Contour defining first shape.

dst InputArray

Contour defining second shape (Target).

alphaPhiST OutputArray

alpha=alphaPhiST(0,0), phi=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center.

dist double

distance between src and dst after matching.

fdContour bool

false then src and dst are contours and true src and dst are Fourier descriptors.