NativeMethods_optflow.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System.Diagnostics.Contracts;
  2. using System.Runtime.InteropServices;
  3. #pragma warning disable 1591
  4. #pragma warning disable CA1401 // P/Invokes should not be visible
  5. #pragma warning disable IDE1006 // Naming style
  6. namespace OpenCvSharp.Internal;
  7. static partial class NativeMethods
  8. {
  9. #region motempl
  10. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  11. public static extern ExceptionStatus optflow_motempl_updateMotionHistory(
  12. IntPtr silhouette, IntPtr mhi,
  13. double timestamp, double duration);
  14. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  15. public static extern ExceptionStatus optflow_motempl_calcMotionGradient(
  16. IntPtr mhi, IntPtr mask, IntPtr orientation,
  17. double delta1, double delta2, int apertureSize);
  18. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  19. public static extern ExceptionStatus optflow_motempl_calcGlobalOrientation(
  20. IntPtr orientation, IntPtr mask,
  21. IntPtr mhi, double timestamp, double duration, out double returnValue);
  22. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  23. public static extern ExceptionStatus optflow_motempl_segmentMotion(
  24. IntPtr mhi, IntPtr segmask, IntPtr boundingRects,
  25. double timestamp, double segThresh);
  26. #endregion
  27. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  28. public static extern ExceptionStatus optflow_calcOpticalFlowSF1(
  29. IntPtr from, IntPtr to, IntPtr flow,
  30. int layers,
  31. int averagingBlockSize,
  32. int maxFlow);
  33. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  34. public static extern ExceptionStatus optflow_calcOpticalFlowSF2(
  35. IntPtr from, IntPtr to, IntPtr flow,
  36. int layers,
  37. int averagingBlockSize,
  38. int maxFlow,
  39. double sigmaDist,
  40. double sigmaColor,
  41. int postprocessWindow,
  42. double sigmaDistFix,
  43. double sigmaColorFix,
  44. double occThr,
  45. int upscaleAveragingRadius,
  46. double upscaleSigmaDist,
  47. double upscaleSigmaColor,
  48. double speedUpThr);
  49. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  50. public static extern ExceptionStatus optflow_calcOpticalFlowSparseToDense(
  51. IntPtr from, IntPtr to, IntPtr flow,
  52. int gridStep, int k, float sigma, int usePostProc, float fgsLambda, float fgsSigma);
  53. }