HarrisLaplaceFeatureDetector.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.Features2dModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.Xfeatures2dModule {
  9. // C++: class HarrisLaplaceFeatureDetector
  10. //javadoc: HarrisLaplaceFeatureDetector
  11. public class HarrisLaplaceFeatureDetector : Feature2D {
  12. protected override void Dispose(bool disposing) {
  13. #if (UNITY_ANDROID && !UNITY_EDITOR)
  14. try {
  15. if (disposing) {
  16. }
  17. if (IsEnabledDispose) {
  18. if (nativeObj != IntPtr.Zero)
  19. xfeatures2d_HarrisLaplaceFeatureDetector_delete(nativeObj);
  20. nativeObj = IntPtr.Zero;
  21. }
  22. } finally {
  23. base.Dispose(disposing);
  24. }
  25. #else
  26. return;
  27. #endif
  28. }
  29. protected internal HarrisLaplaceFeatureDetector(IntPtr addr) : base(addr) { }
  30. // internal usage only
  31. public static new HarrisLaplaceFeatureDetector __fromPtr__(IntPtr addr) { return new HarrisLaplaceFeatureDetector(addr); }
  32. //
  33. // C++: static Ptr_HarrisLaplaceFeatureDetector cv::xfeatures2d::HarrisLaplaceFeatureDetector::create(int numOctaves = 6, float corn_thresh = 0.01f, float DOG_thresh = 0.01f, int maxCorners = 5000, int num_layers = 4)
  34. //
  35. //javadoc: HarrisLaplaceFeatureDetector::create(numOctaves, corn_thresh, DOG_thresh, maxCorners, num_layers)
  36. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners, int num_layers) {
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_10(numOctaves, corn_thresh, DOG_thresh, maxCorners, num_layers));
  39. return retVal;
  40. #else
  41. return null;
  42. #endif
  43. }
  44. //javadoc: HarrisLaplaceFeatureDetector::create(numOctaves, corn_thresh, DOG_thresh, maxCorners)
  45. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners) {
  46. #if (UNITY_ANDROID && !UNITY_EDITOR)
  47. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_11(numOctaves, corn_thresh, DOG_thresh, maxCorners));
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //javadoc: HarrisLaplaceFeatureDetector::create(numOctaves, corn_thresh, DOG_thresh)
  54. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh) {
  55. #if (UNITY_ANDROID && !UNITY_EDITOR)
  56. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_12(numOctaves, corn_thresh, DOG_thresh));
  57. return retVal;
  58. #else
  59. return null;
  60. #endif
  61. }
  62. //javadoc: HarrisLaplaceFeatureDetector::create(numOctaves, corn_thresh)
  63. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh) {
  64. #if (UNITY_ANDROID && !UNITY_EDITOR)
  65. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_13(numOctaves, corn_thresh));
  66. return retVal;
  67. #else
  68. return null;
  69. #endif
  70. }
  71. //javadoc: HarrisLaplaceFeatureDetector::create(numOctaves)
  72. public static HarrisLaplaceFeatureDetector create(int numOctaves) {
  73. #if (UNITY_ANDROID && !UNITY_EDITOR)
  74. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_14(numOctaves));
  75. return retVal;
  76. #else
  77. return null;
  78. #endif
  79. }
  80. //javadoc: HarrisLaplaceFeatureDetector::create()
  81. public static HarrisLaplaceFeatureDetector create() {
  82. #if (UNITY_ANDROID && !UNITY_EDITOR)
  83. HarrisLaplaceFeatureDetector retVal = HarrisLaplaceFeatureDetector.__fromPtr__(xfeatures2d_HarrisLaplaceFeatureDetector_create_15());
  84. return retVal;
  85. #else
  86. return null;
  87. #endif
  88. }
  89. #if (UNITY_ANDROID && !UNITY_EDITOR)
  90. const string LIBNAME = "opencvforunity";
  91. // C++: static Ptr_HarrisLaplaceFeatureDetector cv::xfeatures2d::HarrisLaplaceFeatureDetector::create(int numOctaves = 6, float corn_thresh = 0.01f, float DOG_thresh = 0.01f, int maxCorners = 5000, int num_layers = 4)
  92. [DllImport(LIBNAME)]
  93. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_10(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners, int num_layers);
  94. [DllImport(LIBNAME)]
  95. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_11(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners);
  96. [DllImport(LIBNAME)]
  97. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_12(int numOctaves, float corn_thresh, float DOG_thresh);
  98. [DllImport(LIBNAME)]
  99. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_13(int numOctaves, float corn_thresh);
  100. [DllImport(LIBNAME)]
  101. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_14(int numOctaves);
  102. [DllImport(LIBNAME)]
  103. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_15();
  104. // native support for java finalize()
  105. [DllImport(LIBNAME)]
  106. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_delete(IntPtr nativeObj);
  107. #endif
  108. }
  109. }