TransientAreasSegmentationModule.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.BioinspiredModule
  8. {
  9. // C++: class TransientAreasSegmentationModule
  10. //javadoc: TransientAreasSegmentationModule
  11. public class TransientAreasSegmentationModule : Algorithm
  12. {
  13. protected override void Dispose (bool disposing)
  14. {
  15. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  16. try {
  17. if (disposing) {
  18. }
  19. if (IsEnabledDispose) {
  20. if (nativeObj != IntPtr.Zero)
  21. bioinspired_TransientAreasSegmentationModule_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal TransientAreasSegmentationModule (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new TransientAreasSegmentationModule __fromPtr__ (IntPtr addr) { return new TransientAreasSegmentationModule (addr); }
  34. //
  35. // C++: static Ptr_TransientAreasSegmentationModule cv::bioinspired::TransientAreasSegmentationModule::create(Size inputSize)
  36. //
  37. //javadoc: TransientAreasSegmentationModule::create(inputSize)
  38. public static TransientAreasSegmentationModule create (Size inputSize)
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. TransientAreasSegmentationModule retVal = TransientAreasSegmentationModule.__fromPtr__(bioinspired_TransientAreasSegmentationModule_create_10(inputSize.width, inputSize.height));
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //
  48. // C++: Size cv::bioinspired::TransientAreasSegmentationModule::getSize()
  49. //
  50. //javadoc: TransientAreasSegmentationModule::getSize()
  51. public Size getSize ()
  52. {
  53. ThrowIfDisposed ();
  54. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  55. double[] tmpArray = new double[2];
  56. bioinspired_TransientAreasSegmentationModule_getSize_10(nativeObj, tmpArray);
  57. Size retVal = new Size (tmpArray);
  58. return retVal;
  59. #else
  60. return null;
  61. #endif
  62. }
  63. //
  64. // C++: String cv::bioinspired::TransientAreasSegmentationModule::printSetup()
  65. //
  66. //javadoc: TransientAreasSegmentationModule::printSetup()
  67. public string printSetup ()
  68. {
  69. ThrowIfDisposed ();
  70. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  71. string retVal = Marshal.PtrToStringAnsi (bioinspired_TransientAreasSegmentationModule_printSetup_10(nativeObj));
  72. return retVal;
  73. #else
  74. return null;
  75. #endif
  76. }
  77. //
  78. // C++: void cv::bioinspired::TransientAreasSegmentationModule::clearAllBuffers()
  79. //
  80. //javadoc: TransientAreasSegmentationModule::clearAllBuffers()
  81. public void clearAllBuffers ()
  82. {
  83. ThrowIfDisposed ();
  84. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  85. bioinspired_TransientAreasSegmentationModule_clearAllBuffers_10(nativeObj);
  86. return;
  87. #else
  88. return;
  89. #endif
  90. }
  91. //
  92. // C++: void cv::bioinspired::TransientAreasSegmentationModule::getSegmentationPicture(Mat& transientAreas)
  93. //
  94. //javadoc: TransientAreasSegmentationModule::getSegmentationPicture(transientAreas)
  95. public void getSegmentationPicture (Mat transientAreas)
  96. {
  97. ThrowIfDisposed ();
  98. if (transientAreas != null) transientAreas.ThrowIfDisposed ();
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. bioinspired_TransientAreasSegmentationModule_getSegmentationPicture_10(nativeObj, transientAreas.nativeObj);
  101. return;
  102. #else
  103. return;
  104. #endif
  105. }
  106. //
  107. // C++: void cv::bioinspired::TransientAreasSegmentationModule::run(Mat inputToSegment, int channelIndex = 0)
  108. //
  109. //javadoc: TransientAreasSegmentationModule::run(inputToSegment, channelIndex)
  110. public void run (Mat inputToSegment, int channelIndex)
  111. {
  112. ThrowIfDisposed ();
  113. if (inputToSegment != null) inputToSegment.ThrowIfDisposed ();
  114. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  115. bioinspired_TransientAreasSegmentationModule_run_10(nativeObj, inputToSegment.nativeObj, channelIndex);
  116. return;
  117. #else
  118. return;
  119. #endif
  120. }
  121. //javadoc: TransientAreasSegmentationModule::run(inputToSegment)
  122. public void run (Mat inputToSegment)
  123. {
  124. ThrowIfDisposed ();
  125. if (inputToSegment != null) inputToSegment.ThrowIfDisposed ();
  126. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  127. bioinspired_TransientAreasSegmentationModule_run_11(nativeObj, inputToSegment.nativeObj);
  128. return;
  129. #else
  130. return;
  131. #endif
  132. }
  133. //
  134. // C++: void cv::bioinspired::TransientAreasSegmentationModule::setup(String segmentationParameterFile = "", bool applyDefaultSetupOnFailure = true)
  135. //
  136. //javadoc: TransientAreasSegmentationModule::setup(segmentationParameterFile, applyDefaultSetupOnFailure)
  137. public void setup (string segmentationParameterFile, bool applyDefaultSetupOnFailure)
  138. {
  139. ThrowIfDisposed ();
  140. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  141. bioinspired_TransientAreasSegmentationModule_setup_10(nativeObj, segmentationParameterFile, applyDefaultSetupOnFailure);
  142. return;
  143. #else
  144. return;
  145. #endif
  146. }
  147. //javadoc: TransientAreasSegmentationModule::setup(segmentationParameterFile)
  148. public void setup (string segmentationParameterFile)
  149. {
  150. ThrowIfDisposed ();
  151. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  152. bioinspired_TransientAreasSegmentationModule_setup_11(nativeObj, segmentationParameterFile);
  153. return;
  154. #else
  155. return;
  156. #endif
  157. }
  158. //javadoc: TransientAreasSegmentationModule::setup()
  159. public void setup ()
  160. {
  161. ThrowIfDisposed ();
  162. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  163. bioinspired_TransientAreasSegmentationModule_setup_12(nativeObj);
  164. return;
  165. #else
  166. return;
  167. #endif
  168. }
  169. //
  170. // C++: void cv::bioinspired::TransientAreasSegmentationModule::write(String fs)
  171. //
  172. //javadoc: TransientAreasSegmentationModule::write(fs)
  173. public void write (string fs)
  174. {
  175. ThrowIfDisposed ();
  176. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  177. bioinspired_TransientAreasSegmentationModule_write_10(nativeObj, fs);
  178. return;
  179. #else
  180. return;
  181. #endif
  182. }
  183. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  184. const string LIBNAME = "__Internal";
  185. #else
  186. const string LIBNAME = "opencvforunity";
  187. #endif
  188. // C++: static Ptr_TransientAreasSegmentationModule cv::bioinspired::TransientAreasSegmentationModule::create(Size inputSize)
  189. [DllImport (LIBNAME)]
  190. private static extern IntPtr bioinspired_TransientAreasSegmentationModule_create_10 (double inputSize_width, double inputSize_height);
  191. // C++: Size cv::bioinspired::TransientAreasSegmentationModule::getSize()
  192. [DllImport (LIBNAME)]
  193. private static extern void bioinspired_TransientAreasSegmentationModule_getSize_10 (IntPtr nativeObj, double[] retVal);
  194. // C++: String cv::bioinspired::TransientAreasSegmentationModule::printSetup()
  195. [DllImport (LIBNAME)]
  196. private static extern IntPtr bioinspired_TransientAreasSegmentationModule_printSetup_10 (IntPtr nativeObj);
  197. // C++: void cv::bioinspired::TransientAreasSegmentationModule::clearAllBuffers()
  198. [DllImport (LIBNAME)]
  199. private static extern void bioinspired_TransientAreasSegmentationModule_clearAllBuffers_10 (IntPtr nativeObj);
  200. // C++: void cv::bioinspired::TransientAreasSegmentationModule::getSegmentationPicture(Mat& transientAreas)
  201. [DllImport (LIBNAME)]
  202. private static extern void bioinspired_TransientAreasSegmentationModule_getSegmentationPicture_10 (IntPtr nativeObj, IntPtr transientAreas_nativeObj);
  203. // C++: void cv::bioinspired::TransientAreasSegmentationModule::run(Mat inputToSegment, int channelIndex = 0)
  204. [DllImport (LIBNAME)]
  205. private static extern void bioinspired_TransientAreasSegmentationModule_run_10 (IntPtr nativeObj, IntPtr inputToSegment_nativeObj, int channelIndex);
  206. [DllImport (LIBNAME)]
  207. private static extern void bioinspired_TransientAreasSegmentationModule_run_11 (IntPtr nativeObj, IntPtr inputToSegment_nativeObj);
  208. // C++: void cv::bioinspired::TransientAreasSegmentationModule::setup(String segmentationParameterFile = "", bool applyDefaultSetupOnFailure = true)
  209. [DllImport (LIBNAME)]
  210. private static extern void bioinspired_TransientAreasSegmentationModule_setup_10 (IntPtr nativeObj, string segmentationParameterFile, bool applyDefaultSetupOnFailure);
  211. [DllImport (LIBNAME)]
  212. private static extern void bioinspired_TransientAreasSegmentationModule_setup_11 (IntPtr nativeObj, string segmentationParameterFile);
  213. [DllImport (LIBNAME)]
  214. private static extern void bioinspired_TransientAreasSegmentationModule_setup_12 (IntPtr nativeObj);
  215. // C++: void cv::bioinspired::TransientAreasSegmentationModule::write(String fs)
  216. [DllImport (LIBNAME)]
  217. private static extern void bioinspired_TransientAreasSegmentationModule_write_10 (IntPtr nativeObj, string fs);
  218. // native support for java finalize()
  219. [DllImport (LIBNAME)]
  220. private static extern void bioinspired_TransientAreasSegmentationModule_delete (IntPtr nativeObj);
  221. }
  222. }