StaticSaliencySpectralResidual.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 StaticSaliencySpectralResidual
  10. //javadoc: StaticSaliencySpectralResidual
  11. public class StaticSaliencySpectralResidual : StaticSaliency
  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_StaticSaliencySpectralResidual_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal StaticSaliencySpectralResidual (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new StaticSaliencySpectralResidual __fromPtr__ (IntPtr addr)
  37. {
  38. return new StaticSaliencySpectralResidual (addr);
  39. }
  40. //
  41. // C++: static Ptr_StaticSaliencySpectralResidual cv::saliency::StaticSaliencySpectralResidual::create()
  42. //
  43. //javadoc: StaticSaliencySpectralResidual::create()
  44. public static StaticSaliencySpectralResidual create ()
  45. {
  46. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  47. StaticSaliencySpectralResidual retVal = StaticSaliencySpectralResidual.__fromPtr__ (saliency_StaticSaliencySpectralResidual_create_10 ());
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //
  54. // C++: bool cv::saliency::StaticSaliencySpectralResidual::computeSaliency(Mat image, Mat& saliencyMap)
  55. //
  56. //javadoc: StaticSaliencySpectralResidual::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_StaticSaliencySpectralResidual_computeSaliency_10 (nativeObj, image.nativeObj, saliencyMap.nativeObj);
  66. return retVal;
  67. #else
  68. return false;
  69. #endif
  70. }
  71. //
  72. // C++: int cv::saliency::StaticSaliencySpectralResidual::getImageHeight()
  73. //
  74. //javadoc: StaticSaliencySpectralResidual::getImageHeight()
  75. public int getImageHeight ()
  76. {
  77. ThrowIfDisposed ();
  78. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  79. int retVal = saliency_StaticSaliencySpectralResidual_getImageHeight_10 (nativeObj);
  80. return retVal;
  81. #else
  82. return -1;
  83. #endif
  84. }
  85. //
  86. // C++: int cv::saliency::StaticSaliencySpectralResidual::getImageWidth()
  87. //
  88. //javadoc: StaticSaliencySpectralResidual::getImageWidth()
  89. public int getImageWidth ()
  90. {
  91. ThrowIfDisposed ();
  92. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  93. int retVal = saliency_StaticSaliencySpectralResidual_getImageWidth_10 (nativeObj);
  94. return retVal;
  95. #else
  96. return -1;
  97. #endif
  98. }
  99. //
  100. // C++: void cv::saliency::StaticSaliencySpectralResidual::read(FileNode fn)
  101. //
  102. // Unknown type 'FileNode' (I), skipping the function
  103. //
  104. // C++: void cv::saliency::StaticSaliencySpectralResidual::setImageHeight(int val)
  105. //
  106. //javadoc: StaticSaliencySpectralResidual::setImageHeight(val)
  107. public void setImageHeight (int val)
  108. {
  109. ThrowIfDisposed ();
  110. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  111. saliency_StaticSaliencySpectralResidual_setImageHeight_10 (nativeObj, val);
  112. return;
  113. #else
  114. return;
  115. #endif
  116. }
  117. //
  118. // C++: void cv::saliency::StaticSaliencySpectralResidual::setImageWidth(int val)
  119. //
  120. //javadoc: StaticSaliencySpectralResidual::setImageWidth(val)
  121. public void setImageWidth (int val)
  122. {
  123. ThrowIfDisposed ();
  124. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  125. saliency_StaticSaliencySpectralResidual_setImageWidth_10 (nativeObj, val);
  126. return;
  127. #else
  128. return;
  129. #endif
  130. }
  131. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  132. const string LIBNAME = "__Internal";
  133. #else
  134. const string LIBNAME = "opencvforunity";
  135. #endif
  136. // C++: static Ptr_StaticSaliencySpectralResidual cv::saliency::StaticSaliencySpectralResidual::create()
  137. [DllImport (LIBNAME)]
  138. private static extern IntPtr saliency_StaticSaliencySpectralResidual_create_10 ();
  139. // C++: bool cv::saliency::StaticSaliencySpectralResidual::computeSaliency(Mat image, Mat& saliencyMap)
  140. [DllImport (LIBNAME)]
  141. private static extern bool saliency_StaticSaliencySpectralResidual_computeSaliency_10 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr saliencyMap_nativeObj);
  142. // C++: int cv::saliency::StaticSaliencySpectralResidual::getImageHeight()
  143. [DllImport (LIBNAME)]
  144. private static extern int saliency_StaticSaliencySpectralResidual_getImageHeight_10 (IntPtr nativeObj);
  145. // C++: int cv::saliency::StaticSaliencySpectralResidual::getImageWidth()
  146. [DllImport (LIBNAME)]
  147. private static extern int saliency_StaticSaliencySpectralResidual_getImageWidth_10 (IntPtr nativeObj);
  148. // C++: void cv::saliency::StaticSaliencySpectralResidual::setImageHeight(int val)
  149. [DllImport (LIBNAME)]
  150. private static extern void saliency_StaticSaliencySpectralResidual_setImageHeight_10 (IntPtr nativeObj, int val);
  151. // C++: void cv::saliency::StaticSaliencySpectralResidual::setImageWidth(int val)
  152. [DllImport (LIBNAME)]
  153. private static extern void saliency_StaticSaliencySpectralResidual_setImageWidth_10 (IntPtr nativeObj, int val);
  154. // native support for java finalize()
  155. [DllImport (LIBNAME)]
  156. private static extern void saliency_StaticSaliencySpectralResidual_delete (IntPtr nativeObj);
  157. }
  158. }