RefineParameters.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.ObjdetectModule
  7. {
  8. // C++: class RefineParameters
  9. /**
  10. * struct RefineParameters is used by ArucoDetector
  11. */
  12. public class RefineParameters : DisposableOpenCVObject
  13. {
  14. protected override void Dispose(bool disposing)
  15. {
  16. try
  17. {
  18. if (disposing)
  19. {
  20. }
  21. if (IsEnabledDispose)
  22. {
  23. if (nativeObj != IntPtr.Zero)
  24. objdetect_RefineParameters_delete(nativeObj);
  25. nativeObj = IntPtr.Zero;
  26. }
  27. }
  28. finally
  29. {
  30. base.Dispose(disposing);
  31. }
  32. }
  33. protected internal RefineParameters(IntPtr addr) : base(addr) { }
  34. public IntPtr getNativeObjAddr() { return nativeObj; }
  35. // internal usage only
  36. public static RefineParameters __fromPtr__(IntPtr addr) { return new RefineParameters(addr); }
  37. //
  38. // C++: cv::aruco::RefineParameters::RefineParameters(float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true)
  39. //
  40. public RefineParameters(float minRepDistance, float errorCorrectionRate, bool checkAllOrders)
  41. {
  42. nativeObj = DisposableObject.ThrowIfNullIntPtr(objdetect_RefineParameters_RefineParameters_10(minRepDistance, errorCorrectionRate, checkAllOrders));
  43. }
  44. public RefineParameters(float minRepDistance, float errorCorrectionRate)
  45. {
  46. nativeObj = DisposableObject.ThrowIfNullIntPtr(objdetect_RefineParameters_RefineParameters_11(minRepDistance, errorCorrectionRate));
  47. }
  48. public RefineParameters(float minRepDistance)
  49. {
  50. nativeObj = DisposableObject.ThrowIfNullIntPtr(objdetect_RefineParameters_RefineParameters_12(minRepDistance));
  51. }
  52. public RefineParameters()
  53. {
  54. nativeObj = DisposableObject.ThrowIfNullIntPtr(objdetect_RefineParameters_RefineParameters_13());
  55. }
  56. //
  57. // C++: bool cv::aruco::RefineParameters::readRefineParameters(FileNode fn)
  58. //
  59. // Unknown type 'FileNode' (I), skipping the function
  60. //
  61. // C++: bool cv::aruco::RefineParameters::writeRefineParameters(FileStorage fs, String name = String())
  62. //
  63. // Unknown type 'FileStorage' (I), skipping the function
  64. //
  65. // C++: float RefineParameters::minRepDistance
  66. //
  67. public float get_minRepDistance()
  68. {
  69. ThrowIfDisposed();
  70. return objdetect_RefineParameters_get_1minRepDistance_10(nativeObj);
  71. }
  72. //
  73. // C++: void RefineParameters::minRepDistance
  74. //
  75. public void set_minRepDistance(float minRepDistance)
  76. {
  77. ThrowIfDisposed();
  78. objdetect_RefineParameters_set_1minRepDistance_10(nativeObj, minRepDistance);
  79. }
  80. //
  81. // C++: float RefineParameters::errorCorrectionRate
  82. //
  83. public float get_errorCorrectionRate()
  84. {
  85. ThrowIfDisposed();
  86. return objdetect_RefineParameters_get_1errorCorrectionRate_10(nativeObj);
  87. }
  88. //
  89. // C++: void RefineParameters::errorCorrectionRate
  90. //
  91. public void set_errorCorrectionRate(float errorCorrectionRate)
  92. {
  93. ThrowIfDisposed();
  94. objdetect_RefineParameters_set_1errorCorrectionRate_10(nativeObj, errorCorrectionRate);
  95. }
  96. //
  97. // C++: bool RefineParameters::checkAllOrders
  98. //
  99. public bool get_checkAllOrders()
  100. {
  101. ThrowIfDisposed();
  102. return objdetect_RefineParameters_get_1checkAllOrders_10(nativeObj);
  103. }
  104. //
  105. // C++: void RefineParameters::checkAllOrders
  106. //
  107. public void set_checkAllOrders(bool checkAllOrders)
  108. {
  109. ThrowIfDisposed();
  110. objdetect_RefineParameters_set_1checkAllOrders_10(nativeObj, checkAllOrders);
  111. }
  112. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  113. const string LIBNAME = "__Internal";
  114. #else
  115. const string LIBNAME = "opencvforunity";
  116. #endif
  117. // C++: cv::aruco::RefineParameters::RefineParameters(float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true)
  118. [DllImport(LIBNAME)]
  119. private static extern IntPtr objdetect_RefineParameters_RefineParameters_10(float minRepDistance, float errorCorrectionRate, [MarshalAs(UnmanagedType.U1)] bool checkAllOrders);
  120. [DllImport(LIBNAME)]
  121. private static extern IntPtr objdetect_RefineParameters_RefineParameters_11(float minRepDistance, float errorCorrectionRate);
  122. [DllImport(LIBNAME)]
  123. private static extern IntPtr objdetect_RefineParameters_RefineParameters_12(float minRepDistance);
  124. [DllImport(LIBNAME)]
  125. private static extern IntPtr objdetect_RefineParameters_RefineParameters_13();
  126. // C++: float RefineParameters::minRepDistance
  127. [DllImport(LIBNAME)]
  128. private static extern float objdetect_RefineParameters_get_1minRepDistance_10(IntPtr nativeObj);
  129. // C++: void RefineParameters::minRepDistance
  130. [DllImport(LIBNAME)]
  131. private static extern void objdetect_RefineParameters_set_1minRepDistance_10(IntPtr nativeObj, float minRepDistance);
  132. // C++: float RefineParameters::errorCorrectionRate
  133. [DllImport(LIBNAME)]
  134. private static extern float objdetect_RefineParameters_get_1errorCorrectionRate_10(IntPtr nativeObj);
  135. // C++: void RefineParameters::errorCorrectionRate
  136. [DllImport(LIBNAME)]
  137. private static extern void objdetect_RefineParameters_set_1errorCorrectionRate_10(IntPtr nativeObj, float errorCorrectionRate);
  138. // C++: bool RefineParameters::checkAllOrders
  139. [DllImport(LIBNAME)]
  140. [return: MarshalAs(UnmanagedType.U1)]
  141. private static extern bool objdetect_RefineParameters_get_1checkAllOrders_10(IntPtr nativeObj);
  142. // C++: void RefineParameters::checkAllOrders
  143. [DllImport(LIBNAME)]
  144. private static extern void objdetect_RefineParameters_set_1checkAllOrders_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool checkAllOrders);
  145. // native support for java finalize()
  146. [DllImport(LIBNAME)]
  147. private static extern void objdetect_RefineParameters_delete(IntPtr nativeObj);
  148. }
  149. }