ObjectnessBING.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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.SaliencyModule
  8. {
  9. // C++: class ObjectnessBING
  10. //javadoc: ObjectnessBING
  11. public class ObjectnessBING : Objectness
  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. saliency_ObjectnessBING_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal ObjectnessBING (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new ObjectnessBING __fromPtr__ (IntPtr addr)
  37. {
  38. return new ObjectnessBING (addr);
  39. }
  40. //
  41. // C++: static Ptr_ObjectnessBING cv::saliency::ObjectnessBING::create()
  42. //
  43. //javadoc: ObjectnessBING::create()
  44. public static ObjectnessBING create ()
  45. {
  46. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  47. ObjectnessBING retVal = ObjectnessBING.__fromPtr__ (saliency_ObjectnessBING_create_10 ());
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //
  54. // C++: bool cv::saliency::ObjectnessBING::computeSaliency(Mat image, Mat& saliencyMap)
  55. //
  56. //javadoc: ObjectnessBING::computeSaliency(image, saliencyMap)
  57. public override bool computeSaliency (Mat image, Mat saliencyMap)
  58. {
  59. ThrowIfDisposed ();
  60. if (image != null)
  61. image.ThrowIfDisposed ();
  62. if (saliencyMap != null)
  63. saliencyMap.ThrowIfDisposed ();
  64. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  65. bool retVal = saliency_ObjectnessBING_computeSaliency_10 (nativeObj, image.nativeObj, saliencyMap.nativeObj);
  66. return retVal;
  67. #else
  68. return false;
  69. #endif
  70. }
  71. //
  72. // C++: double cv::saliency::ObjectnessBING::getBase()
  73. //
  74. //javadoc: ObjectnessBING::getBase()
  75. public double getBase ()
  76. {
  77. ThrowIfDisposed ();
  78. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  79. double retVal = saliency_ObjectnessBING_getBase_10 (nativeObj);
  80. return retVal;
  81. #else
  82. return -1;
  83. #endif
  84. }
  85. //
  86. // C++: int cv::saliency::ObjectnessBING::getNSS()
  87. //
  88. //javadoc: ObjectnessBING::getNSS()
  89. public int getNSS ()
  90. {
  91. ThrowIfDisposed ();
  92. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  93. int retVal = saliency_ObjectnessBING_getNSS_10 (nativeObj);
  94. return retVal;
  95. #else
  96. return -1;
  97. #endif
  98. }
  99. //
  100. // C++: int cv::saliency::ObjectnessBING::getW()
  101. //
  102. //javadoc: ObjectnessBING::getW()
  103. public int getW ()
  104. {
  105. ThrowIfDisposed ();
  106. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  107. int retVal = saliency_ObjectnessBING_getW_10 (nativeObj);
  108. return retVal;
  109. #else
  110. return -1;
  111. #endif
  112. }
  113. //
  114. // C++: vector_float cv::saliency::ObjectnessBING::getobjectnessValues()
  115. //
  116. //javadoc: ObjectnessBING::getobjectnessValues()
  117. public MatOfFloat getobjectnessValues ()
  118. {
  119. ThrowIfDisposed ();
  120. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  121. MatOfFloat retVal = MatOfFloat.fromNativeAddr (saliency_ObjectnessBING_getobjectnessValues_10 (nativeObj));
  122. return retVal;
  123. #else
  124. return null;
  125. #endif
  126. }
  127. //
  128. // C++: void cv::saliency::ObjectnessBING::read()
  129. //
  130. //javadoc: ObjectnessBING::read()
  131. public void read ()
  132. {
  133. ThrowIfDisposed ();
  134. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  135. saliency_ObjectnessBING_read_10 (nativeObj);
  136. return;
  137. #else
  138. return;
  139. #endif
  140. }
  141. //
  142. // C++: void cv::saliency::ObjectnessBING::setBBResDir(String resultsDir)
  143. //
  144. //javadoc: ObjectnessBING::setBBResDir(resultsDir)
  145. public void setBBResDir (string resultsDir)
  146. {
  147. ThrowIfDisposed ();
  148. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  149. saliency_ObjectnessBING_setBBResDir_10 (nativeObj, resultsDir);
  150. return;
  151. #else
  152. return;
  153. #endif
  154. }
  155. //
  156. // C++: void cv::saliency::ObjectnessBING::setBase(double val)
  157. //
  158. //javadoc: ObjectnessBING::setBase(val)
  159. public void setBase (double val)
  160. {
  161. ThrowIfDisposed ();
  162. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  163. saliency_ObjectnessBING_setBase_10 (nativeObj, val);
  164. return;
  165. #else
  166. return;
  167. #endif
  168. }
  169. //
  170. // C++: void cv::saliency::ObjectnessBING::setNSS(int val)
  171. //
  172. //javadoc: ObjectnessBING::setNSS(val)
  173. public void setNSS (int val)
  174. {
  175. ThrowIfDisposed ();
  176. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  177. saliency_ObjectnessBING_setNSS_10 (nativeObj, val);
  178. return;
  179. #else
  180. return;
  181. #endif
  182. }
  183. //
  184. // C++: void cv::saliency::ObjectnessBING::setTrainingPath(String trainingPath)
  185. //
  186. //javadoc: ObjectnessBING::setTrainingPath(trainingPath)
  187. public void setTrainingPath (string trainingPath)
  188. {
  189. ThrowIfDisposed ();
  190. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  191. saliency_ObjectnessBING_setTrainingPath_10 (nativeObj, trainingPath);
  192. return;
  193. #else
  194. return;
  195. #endif
  196. }
  197. //
  198. // C++: void cv::saliency::ObjectnessBING::setW(int val)
  199. //
  200. //javadoc: ObjectnessBING::setW(val)
  201. public void setW (int val)
  202. {
  203. ThrowIfDisposed ();
  204. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  205. saliency_ObjectnessBING_setW_10 (nativeObj, val);
  206. return;
  207. #else
  208. return;
  209. #endif
  210. }
  211. //
  212. // C++: void cv::saliency::ObjectnessBING::write()
  213. //
  214. //javadoc: ObjectnessBING::write()
  215. public void write ()
  216. {
  217. ThrowIfDisposed ();
  218. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  219. saliency_ObjectnessBING_write_10 (nativeObj);
  220. return;
  221. #else
  222. return;
  223. #endif
  224. }
  225. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  226. const string LIBNAME = "__Internal";
  227. #else
  228. const string LIBNAME = "opencvforunity";
  229. #endif
  230. // C++: static Ptr_ObjectnessBING cv::saliency::ObjectnessBING::create()
  231. [DllImport (LIBNAME)]
  232. private static extern IntPtr saliency_ObjectnessBING_create_10 ();
  233. // C++: bool cv::saliency::ObjectnessBING::computeSaliency(Mat image, Mat& saliencyMap)
  234. [DllImport (LIBNAME)]
  235. private static extern bool saliency_ObjectnessBING_computeSaliency_10 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr saliencyMap_nativeObj);
  236. // C++: double cv::saliency::ObjectnessBING::getBase()
  237. [DllImport (LIBNAME)]
  238. private static extern double saliency_ObjectnessBING_getBase_10 (IntPtr nativeObj);
  239. // C++: int cv::saliency::ObjectnessBING::getNSS()
  240. [DllImport (LIBNAME)]
  241. private static extern int saliency_ObjectnessBING_getNSS_10 (IntPtr nativeObj);
  242. // C++: int cv::saliency::ObjectnessBING::getW()
  243. [DllImport (LIBNAME)]
  244. private static extern int saliency_ObjectnessBING_getW_10 (IntPtr nativeObj);
  245. // C++: vector_float cv::saliency::ObjectnessBING::getobjectnessValues()
  246. [DllImport (LIBNAME)]
  247. private static extern IntPtr saliency_ObjectnessBING_getobjectnessValues_10 (IntPtr nativeObj);
  248. // C++: void cv::saliency::ObjectnessBING::read()
  249. [DllImport (LIBNAME)]
  250. private static extern void saliency_ObjectnessBING_read_10 (IntPtr nativeObj);
  251. // C++: void cv::saliency::ObjectnessBING::setBBResDir(String resultsDir)
  252. [DllImport (LIBNAME)]
  253. private static extern void saliency_ObjectnessBING_setBBResDir_10 (IntPtr nativeObj, string resultsDir);
  254. // C++: void cv::saliency::ObjectnessBING::setBase(double val)
  255. [DllImport (LIBNAME)]
  256. private static extern void saliency_ObjectnessBING_setBase_10 (IntPtr nativeObj, double val);
  257. // C++: void cv::saliency::ObjectnessBING::setNSS(int val)
  258. [DllImport (LIBNAME)]
  259. private static extern void saliency_ObjectnessBING_setNSS_10 (IntPtr nativeObj, int val);
  260. // C++: void cv::saliency::ObjectnessBING::setTrainingPath(String trainingPath)
  261. [DllImport (LIBNAME)]
  262. private static extern void saliency_ObjectnessBING_setTrainingPath_10 (IntPtr nativeObj, string trainingPath);
  263. // C++: void cv::saliency::ObjectnessBING::setW(int val)
  264. [DllImport (LIBNAME)]
  265. private static extern void saliency_ObjectnessBING_setW_10 (IntPtr nativeObj, int val);
  266. // C++: void cv::saliency::ObjectnessBING::write()
  267. [DllImport (LIBNAME)]
  268. private static extern void saliency_ObjectnessBING_write_10 (IntPtr nativeObj);
  269. // native support for java finalize()
  270. [DllImport (LIBNAME)]
  271. private static extern void saliency_ObjectnessBING_delete (IntPtr nativeObj);
  272. }
  273. }