ContourFitting.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/ximgproc.hpp"
  8. #import "opencv2/ximgproc/fourier_descriptors.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Algorithm.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class ContourFitting
  17. /**
  18. * Class for ContourFitting algorithms.
  19. * ContourFitting match two contours `$$ z_a $$` and `$$ z_b $$` minimizing distance
  20. * `$$ 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
  21. *
  22. * Member of `Ximgproc`
  23. */
  24. CV_EXPORTS @interface ContourFitting : Algorithm
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::ximgproc::ContourFitting> nativePtrContourFitting;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::ximgproc::ContourFitting>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::ximgproc::ContourFitting>)nativePtr;
  31. #endif
  32. #pragma mark - Methods
  33. //
  34. // void cv::ximgproc::ContourFitting::estimateTransformation(Mat src, Mat dst, Mat& alphaPhiST, double& dist, bool fdContour = false)
  35. //
  36. /**
  37. * Fit two closed curves using fourier descriptors. More details in CITE: PersoonFu1977 and CITE: BergerRaghunathan1998
  38. *
  39. * @param src Contour defining first shape.
  40. * @param dst Contour defining second shape (Target).
  41. * @param alphaPhiST : `$$ \alpha $$`=alphaPhiST(0,0), `$$ \phi $$`=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  42. * @param dist distance between src and dst after matching.
  43. * @param fdContour false then src and dst are contours and true src and dst are fourier descriptors.
  44. */
  45. - (void)estimateTransformation:(Mat*)src dst:(Mat*)dst alphaPhiST:(Mat*)alphaPhiST dist:(double*)dist fdContour:(BOOL)fdContour NS_SWIFT_NAME(estimateTransformation(src:dst:alphaPhiST:dist:fdContour:));
  46. /**
  47. * Fit two closed curves using fourier descriptors. More details in CITE: PersoonFu1977 and CITE: BergerRaghunathan1998
  48. *
  49. * @param src Contour defining first shape.
  50. * @param dst Contour defining second shape (Target).
  51. * @param alphaPhiST : `$$ \alpha $$`=alphaPhiST(0,0), `$$ \phi $$`=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center
  52. * @param dist distance between src and dst after matching.
  53. */
  54. - (void)estimateTransformation:(Mat*)src dst:(Mat*)dst alphaPhiST:(Mat*)alphaPhiST dist:(double*)dist NS_SWIFT_NAME(estimateTransformation(src:dst:alphaPhiST:dist:));
  55. //
  56. // void cv::ximgproc::ContourFitting::setCtrSize(int n)
  57. //
  58. /**
  59. * set number of Fourier descriptors used in estimateTransformation
  60. *
  61. * @param n number of Fourier descriptors equal to number of contour points after resampling.
  62. */
  63. - (void)setCtrSize:(int)n NS_SWIFT_NAME(setCtrSize(n:));
  64. //
  65. // void cv::ximgproc::ContourFitting::setFDSize(int n)
  66. //
  67. /**
  68. * set number of Fourier descriptors when estimateTransformation used vector<Point>
  69. *
  70. * @param n number of fourier descriptors used for optimal curve matching.
  71. */
  72. - (void)setFDSize:(int)n NS_SWIFT_NAME(setFDSize(n:));
  73. //
  74. // int cv::ximgproc::ContourFitting::getCtrSize()
  75. //
  76. /**
  77. * @return number of fourier descriptors
  78. */
  79. - (int)getCtrSize NS_SWIFT_NAME(getCtrSize());
  80. //
  81. // int cv::ximgproc::ContourFitting::getFDSize()
  82. //
  83. /**
  84. * @return number of fourier descriptors used for optimal curve matching
  85. */
  86. - (int)getFDSize NS_SWIFT_NAME(getFDSize());
  87. @end
  88. NS_ASSUME_NONNULL_END