Package org.opencv.ximgproc
Class ContourFitting
java.lang.Object
org.opencv.core.Algorithm
org.opencv.ximgproc.ContourFitting
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
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContourFitting__fromPtr__(long addr) voidestimateTransformation(Mat src, Mat dst, Mat alphaPhiST, double[] dist) Fit two closed curves using fourier descriptors.voidestimateTransformation(Mat src, Mat dst, Mat alphaPhiST, double[] dist, boolean fdContour) Fit two closed curves using fourier descriptors.protected voidfinalize()intintvoidsetCtrSize(int n) set number of Fourier descriptors used in estimateTransformationvoidsetFDSize(int n) set number of Fourier descriptors when estimateTransformation used vector<Point>Methods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
Constructor Details
-
ContourFitting
protected ContourFitting(long addr)
-
-
Method Details
-
__fromPtr__
-
estimateTransformation
public void estimateTransformation(Mat src, Mat dst, Mat alphaPhiST, double[] dist, boolean fdContour) Fit two closed curves using fourier descriptors. More details in CITE: PersoonFu1977 and CITE: BergerRaghunathan1998- Parameters:
src- Contour defining first shape.dst- Contour defining second shape (Target).alphaPhiST- : \( \alpha \)=alphaPhiST(0,0), \( \phi \)=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation centerdist- distance between src and dst after matching.fdContour- false then src and dst are contours and true src and dst are fourier descriptors.
-
estimateTransformation
Fit two closed curves using fourier descriptors. More details in CITE: PersoonFu1977 and CITE: BergerRaghunathan1998- Parameters:
src- Contour defining first shape.dst- Contour defining second shape (Target).alphaPhiST- : \( \alpha \)=alphaPhiST(0,0), \( \phi \)=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation centerdist- distance between src and dst after matching.
-
setCtrSize
public void setCtrSize(int n) set number of Fourier descriptors used in estimateTransformation- Parameters:
n- number of Fourier descriptors equal to number of contour points after resampling.
-
setFDSize
public void setFDSize(int n) set number of Fourier descriptors when estimateTransformation used vector<Point>- Parameters:
n- number of fourier descriptors used for optimal curve matching.
-
getCtrSize
public int getCtrSize()- Returns:
- number of fourier descriptors
-
getFDSize
public int getFDSize()- Returns:
- number of fourier descriptors used for optimal curve matching
-
finalize
-