ximgproc_ContourFitting
import { ximgproc_ContourFitting } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.
Class for ContourFitting algorithms.
ContourFitting match two contours z_a and z_b minimizing distance
d(z_a,z_b)=\sum (a_n - s b_n e^{j(n \alpha +\phi )})^2
where a_n and b_n are Fourier descriptors of z_a and z_b and s is a scaling factor and \phi is angle rotation and \alpha is starting point factor adjustement
Constructors and members
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
estimateTransformation
Fit two closed curves using fourier descriptors. More details in [PersoonFu1977] and [BergerRaghunathan1998]
estimateTransformation(src: Mat, dst: Mat, alphaPhiST: Mat, fdContour: boolean): ximgproc_ContourFitting_estimateTransformationResult;2 available overloads
estimateTransformation(src: Mat, dst: Mat, alphaPhiST: Mat): ximgproc_ContourFitting_estimateTransformationResult;estimateTransformation(src: Mat, dst: Mat, alphaPhiST: Mat, fdContour: boolean): ximgproc_ContourFitting_estimateTransformationResult;srcContour defining first shape.
dstContour defining second shape (Target).
alphaPhiSTOutput destination, filled by the native operation. :
\alpha=alphaPhiST(0,0),\phi=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation centerfdContourfalse then src and dst are contours and true src and dst are fourier descriptors.
The ximgproc_ContourFitting_estimateTransformationResult result. Scalar output parameters are returned as named fields in this object. Release returned native handles with using or delete(), including handles nested in results.
setCtrSize
set number of Fourier descriptors used in estimateTransformation
setCtrSize(n: number): void;nnumber of Fourier descriptors equal to number of contour points after resampling.
setFDSize
set number of Fourier descriptors when estimateTransformation used vector<Point>
setFDSize(n: number): void;nnumber of fourier descriptors used for optimal curve matching.
getCtrSize
Read the ctr size.
set number of Fourier descriptors used in estimateTransformation
getCtrSize(): number;number of fourier descriptors
getFDSize
Read the fdsize.
set number of Fourier descriptors when estimateTransformation used vector<Point>
getFDSize(): number;number of fourier descriptors used for optimal curve matching
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.