CalibrateCRF.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.PhotoModule
  8. {
  9. // C++: class CalibrateCRF
  10. //javadoc: CalibrateCRF
  11. public class CalibrateCRF : 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. photo_CalibrateCRF_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal CalibrateCRF (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new CalibrateCRF __fromPtr__ (IntPtr addr) { return new CalibrateCRF (addr); }
  34. //
  35. // C++: void cv::CalibrateCRF::process(vector_Mat src, Mat& dst, Mat times)
  36. //
  37. //javadoc: CalibrateCRF::process(src, dst, times)
  38. public void process (List<Mat> src, Mat dst, Mat times)
  39. {
  40. ThrowIfDisposed ();
  41. if (dst != null) dst.ThrowIfDisposed ();
  42. if (times != null) times.ThrowIfDisposed ();
  43. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  44. Mat src_mat = Converters.vector_Mat_to_Mat(src);
  45. photo_CalibrateCRF_process_10(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj);
  46. return;
  47. #else
  48. return;
  49. #endif
  50. }
  51. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  52. const string LIBNAME = "__Internal";
  53. #else
  54. const string LIBNAME = "opencvforunity";
  55. #endif
  56. // C++: void cv::CalibrateCRF::process(vector_Mat src, Mat& dst, Mat times)
  57. [DllImport (LIBNAME)]
  58. private static extern void photo_CalibrateCRF_process_10 (IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_nativeObj, IntPtr times_nativeObj);
  59. // native support for java finalize()
  60. [DllImport (LIBNAME)]
  61. private static extern void photo_CalibrateCRF_delete (IntPtr nativeObj);
  62. }
  63. }