SyntheticSequenceGenerator.cs 3.4 KB

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