CharucoParameters.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 CharucoParameters
  9. public class CharucoParameters : DisposableOpenCVObject
  10. {
  11. protected override void Dispose(bool disposing)
  12. {
  13. try
  14. {
  15. if (disposing)
  16. {
  17. }
  18. if (IsEnabledDispose)
  19. {
  20. if (nativeObj != IntPtr.Zero)
  21. objdetect_CharucoParameters_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. }
  25. finally
  26. {
  27. base.Dispose(disposing);
  28. }
  29. }
  30. protected internal CharucoParameters(IntPtr addr) : base(addr) { }
  31. public IntPtr getNativeObjAddr() { return nativeObj; }
  32. // internal usage only
  33. public static CharucoParameters __fromPtr__(IntPtr addr) { return new CharucoParameters(addr); }
  34. //
  35. // C++: cv::aruco::CharucoParameters::CharucoParameters()
  36. //
  37. public CharucoParameters()
  38. {
  39. nativeObj = DisposableObject.ThrowIfNullIntPtr(objdetect_CharucoParameters_CharucoParameters_10());
  40. }
  41. //
  42. // C++: Mat CharucoParameters::cameraMatrix
  43. //
  44. public Mat get_cameraMatrix()
  45. {
  46. ThrowIfDisposed();
  47. return new Mat(DisposableObject.ThrowIfNullIntPtr(objdetect_CharucoParameters_get_1cameraMatrix_10(nativeObj)));
  48. }
  49. //
  50. // C++: void CharucoParameters::cameraMatrix
  51. //
  52. public void set_cameraMatrix(Mat cameraMatrix)
  53. {
  54. ThrowIfDisposed();
  55. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  56. objdetect_CharucoParameters_set_1cameraMatrix_10(nativeObj, cameraMatrix.nativeObj);
  57. }
  58. //
  59. // C++: Mat CharucoParameters::distCoeffs
  60. //
  61. public Mat get_distCoeffs()
  62. {
  63. ThrowIfDisposed();
  64. return new Mat(DisposableObject.ThrowIfNullIntPtr(objdetect_CharucoParameters_get_1distCoeffs_10(nativeObj)));
  65. }
  66. //
  67. // C++: void CharucoParameters::distCoeffs
  68. //
  69. public void set_distCoeffs(Mat distCoeffs)
  70. {
  71. ThrowIfDisposed();
  72. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  73. objdetect_CharucoParameters_set_1distCoeffs_10(nativeObj, distCoeffs.nativeObj);
  74. }
  75. //
  76. // C++: int CharucoParameters::minMarkers
  77. //
  78. public int get_minMarkers()
  79. {
  80. ThrowIfDisposed();
  81. return objdetect_CharucoParameters_get_1minMarkers_10(nativeObj);
  82. }
  83. //
  84. // C++: void CharucoParameters::minMarkers
  85. //
  86. public void set_minMarkers(int minMarkers)
  87. {
  88. ThrowIfDisposed();
  89. objdetect_CharucoParameters_set_1minMarkers_10(nativeObj, minMarkers);
  90. }
  91. //
  92. // C++: bool CharucoParameters::tryRefineMarkers
  93. //
  94. public bool get_tryRefineMarkers()
  95. {
  96. ThrowIfDisposed();
  97. return objdetect_CharucoParameters_get_1tryRefineMarkers_10(nativeObj);
  98. }
  99. //
  100. // C++: void CharucoParameters::tryRefineMarkers
  101. //
  102. public void set_tryRefineMarkers(bool tryRefineMarkers)
  103. {
  104. ThrowIfDisposed();
  105. objdetect_CharucoParameters_set_1tryRefineMarkers_10(nativeObj, tryRefineMarkers);
  106. }
  107. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  108. const string LIBNAME = "__Internal";
  109. #else
  110. const string LIBNAME = "opencvforunity";
  111. #endif
  112. // C++: cv::aruco::CharucoParameters::CharucoParameters()
  113. [DllImport(LIBNAME)]
  114. private static extern IntPtr objdetect_CharucoParameters_CharucoParameters_10();
  115. // C++: Mat CharucoParameters::cameraMatrix
  116. [DllImport(LIBNAME)]
  117. private static extern IntPtr objdetect_CharucoParameters_get_1cameraMatrix_10(IntPtr nativeObj);
  118. // C++: void CharucoParameters::cameraMatrix
  119. [DllImport(LIBNAME)]
  120. private static extern void objdetect_CharucoParameters_set_1cameraMatrix_10(IntPtr nativeObj, IntPtr cameraMatrix_nativeObj);
  121. // C++: Mat CharucoParameters::distCoeffs
  122. [DllImport(LIBNAME)]
  123. private static extern IntPtr objdetect_CharucoParameters_get_1distCoeffs_10(IntPtr nativeObj);
  124. // C++: void CharucoParameters::distCoeffs
  125. [DllImport(LIBNAME)]
  126. private static extern void objdetect_CharucoParameters_set_1distCoeffs_10(IntPtr nativeObj, IntPtr distCoeffs_nativeObj);
  127. // C++: int CharucoParameters::minMarkers
  128. [DllImport(LIBNAME)]
  129. private static extern int objdetect_CharucoParameters_get_1minMarkers_10(IntPtr nativeObj);
  130. // C++: void CharucoParameters::minMarkers
  131. [DllImport(LIBNAME)]
  132. private static extern void objdetect_CharucoParameters_set_1minMarkers_10(IntPtr nativeObj, int minMarkers);
  133. // C++: bool CharucoParameters::tryRefineMarkers
  134. [DllImport(LIBNAME)]
  135. [return: MarshalAs(UnmanagedType.U1)]
  136. private static extern bool objdetect_CharucoParameters_get_1tryRefineMarkers_10(IntPtr nativeObj);
  137. // C++: void CharucoParameters::tryRefineMarkers
  138. [DllImport(LIBNAME)]
  139. private static extern void objdetect_CharucoParameters_set_1tryRefineMarkers_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool tryRefineMarkers);
  140. // native support for java finalize()
  141. [DllImport(LIBNAME)]
  142. private static extern void objdetect_CharucoParameters_delete(IntPtr nativeObj);
  143. }
  144. }