BOWImgDescriptorExtractor.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.Features2dModule
  8. {
  9. // C++: class BOWImgDescriptorExtractor
  10. //javadoc: BOWImgDescriptorExtractor
  11. public class BOWImgDescriptorExtractor : DisposableOpenCVObject
  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. features2d_BOWImgDescriptorExtractor_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal BOWImgDescriptorExtractor (IntPtr addr) : base (addr) { }
  32. public IntPtr getNativeObjAddr () { return nativeObj; }
  33. // internal usage only
  34. public static BOWImgDescriptorExtractor __fromPtr__ (IntPtr addr) { return new BOWImgDescriptorExtractor (addr); }
  35. //
  36. // C++: cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher)
  37. //
  38. // Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function
  39. //
  40. // C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary()
  41. //
  42. //javadoc: BOWImgDescriptorExtractor::getVocabulary()
  43. public Mat getVocabulary ()
  44. {
  45. ThrowIfDisposed ();
  46. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  47. Mat retVal = new Mat(features2d_BOWImgDescriptorExtractor_getVocabulary_10(nativeObj));
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //
  54. // C++: int cv::BOWImgDescriptorExtractor::descriptorSize()
  55. //
  56. //javadoc: BOWImgDescriptorExtractor::descriptorSize()
  57. public int descriptorSize ()
  58. {
  59. ThrowIfDisposed ();
  60. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  61. int retVal = features2d_BOWImgDescriptorExtractor_descriptorSize_10(nativeObj);
  62. return retVal;
  63. #else
  64. return -1;
  65. #endif
  66. }
  67. //
  68. // C++: int cv::BOWImgDescriptorExtractor::descriptorType()
  69. //
  70. //javadoc: BOWImgDescriptorExtractor::descriptorType()
  71. public int descriptorType ()
  72. {
  73. ThrowIfDisposed ();
  74. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  75. int retVal = features2d_BOWImgDescriptorExtractor_descriptorType_10(nativeObj);
  76. return retVal;
  77. #else
  78. return -1;
  79. #endif
  80. }
  81. //
  82. // C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
  83. //
  84. //javadoc: BOWImgDescriptorExtractor::compute(image, keypoints, imgDescriptor)
  85. public void compute (Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor)
  86. {
  87. ThrowIfDisposed ();
  88. if (image != null) image.ThrowIfDisposed ();
  89. if (keypoints != null) keypoints.ThrowIfDisposed ();
  90. if (imgDescriptor != null) imgDescriptor.ThrowIfDisposed ();
  91. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  92. Mat keypoints_mat = keypoints;
  93. features2d_BOWImgDescriptorExtractor_compute_10(nativeObj, image.nativeObj, keypoints_mat.nativeObj, imgDescriptor.nativeObj);
  94. return;
  95. #else
  96. return;
  97. #endif
  98. }
  99. //
  100. // C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary)
  101. //
  102. //javadoc: BOWImgDescriptorExtractor::setVocabulary(vocabulary)
  103. public void setVocabulary (Mat vocabulary)
  104. {
  105. ThrowIfDisposed ();
  106. if (vocabulary != null) vocabulary.ThrowIfDisposed ();
  107. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  108. features2d_BOWImgDescriptorExtractor_setVocabulary_10(nativeObj, vocabulary.nativeObj);
  109. return;
  110. #else
  111. return;
  112. #endif
  113. }
  114. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  115. const string LIBNAME = "__Internal";
  116. #else
  117. const string LIBNAME = "opencvforunity";
  118. #endif
  119. // C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary()
  120. [DllImport (LIBNAME)]
  121. private static extern IntPtr features2d_BOWImgDescriptorExtractor_getVocabulary_10 (IntPtr nativeObj);
  122. // C++: int cv::BOWImgDescriptorExtractor::descriptorSize()
  123. [DllImport (LIBNAME)]
  124. private static extern int features2d_BOWImgDescriptorExtractor_descriptorSize_10 (IntPtr nativeObj);
  125. // C++: int cv::BOWImgDescriptorExtractor::descriptorType()
  126. [DllImport (LIBNAME)]
  127. private static extern int features2d_BOWImgDescriptorExtractor_descriptorType_10 (IntPtr nativeObj);
  128. // C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
  129. [DllImport (LIBNAME)]
  130. private static extern void features2d_BOWImgDescriptorExtractor_compute_10 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr keypoints_mat_nativeObj, IntPtr imgDescriptor_nativeObj);
  131. // C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary)
  132. [DllImport (LIBNAME)]
  133. private static extern void features2d_BOWImgDescriptorExtractor_setVocabulary_10 (IntPtr nativeObj, IntPtr vocabulary_nativeObj);
  134. // native support for java finalize()
  135. [DllImport (LIBNAME)]
  136. private static extern void features2d_BOWImgDescriptorExtractor_delete (IntPtr nativeObj);
  137. }
  138. }