SyntheticSequenceGenerator.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.BgsegmModule
  8. {
  9. // C++: class SyntheticSequenceGenerator
  10. //javadoc: SyntheticSequenceGenerator
  11. public class SyntheticSequenceGenerator : 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. bgsegm_SyntheticSequenceGenerator_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal SyntheticSequenceGenerator (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new SyntheticSequenceGenerator __fromPtr__ (IntPtr addr) { return new SyntheticSequenceGenerator (addr); }
  34. //
  35. // C++: cv::bgsegm::SyntheticSequenceGenerator::SyntheticSequenceGenerator(Mat background, Mat _object, double amplitude, double wavelength, double wavespeed, double objspeed)
  36. //
  37. //javadoc: SyntheticSequenceGenerator::SyntheticSequenceGenerator(background, _object, amplitude, wavelength, wavespeed, objspeed)
  38. public SyntheticSequenceGenerator (Mat background, Mat _object, double amplitude, double wavelength, double wavespeed, double objspeed) :
  39. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  40. base( bgsegm_SyntheticSequenceGenerator_SyntheticSequenceGenerator_10(background.nativeObj, _object.nativeObj, amplitude, wavelength, wavespeed, objspeed) )
  41. #else
  42. base (IntPtr.Zero)
  43. #endif
  44. {
  45. return;
  46. }
  47. //
  48. // C++: void cv::bgsegm::SyntheticSequenceGenerator::getNextFrame(Mat& frame, Mat& gtMask)
  49. //
  50. //javadoc: SyntheticSequenceGenerator::getNextFrame(frame, gtMask)
  51. public void getNextFrame (Mat frame, Mat gtMask)
  52. {
  53. ThrowIfDisposed ();
  54. if (frame != null) frame.ThrowIfDisposed ();
  55. if (gtMask != null) gtMask.ThrowIfDisposed ();
  56. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  57. bgsegm_SyntheticSequenceGenerator_getNextFrame_10(nativeObj, frame.nativeObj, gtMask.nativeObj);
  58. return;
  59. #else
  60. return;
  61. #endif
  62. }
  63. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  64. const string LIBNAME = "__Internal";
  65. #else
  66. const string LIBNAME = "opencvforunity";
  67. #endif
  68. // C++: cv::bgsegm::SyntheticSequenceGenerator::SyntheticSequenceGenerator(Mat background, Mat _object, double amplitude, double wavelength, double wavespeed, double objspeed)
  69. [DllImport (LIBNAME)]
  70. private static extern IntPtr bgsegm_SyntheticSequenceGenerator_SyntheticSequenceGenerator_10 (IntPtr background_nativeObj, IntPtr _object_nativeObj, double amplitude, double wavelength, double wavespeed, double objspeed);
  71. // C++: void cv::bgsegm::SyntheticSequenceGenerator::getNextFrame(Mat& frame, Mat& gtMask)
  72. [DllImport (LIBNAME)]
  73. private static extern void bgsegm_SyntheticSequenceGenerator_getNextFrame_10 (IntPtr nativeObj, IntPtr frame_nativeObj, IntPtr gtMask_nativeObj);
  74. // native support for java finalize()
  75. [DllImport (LIBNAME)]
  76. private static extern void bgsegm_SyntheticSequenceGenerator_delete (IntPtr nativeObj);
  77. }
  78. }