NativeMethods_cuda.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. #if ENABLED_CUDA
  2. using System;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. using OpenCvSharp.Cuda;
  6. #pragma warning disable 1591
  7. namespace OpenCvSharp
  8. {
  9. // ReSharper disable InconsistentNaming
  10. static partial class NativeMethods
  11. {
  12. #region Device
  13. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  14. public static extern int cuda_getCudaEnabledDeviceCount();
  15. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  16. public static extern void cuda_setDevice(int device);
  17. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  18. public static extern int cuda_getDevice();
  19. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  20. public static extern void cuda_resetDevice();
  21. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  22. public static extern int cuda_deviceSupports(int feature_set);
  23. // TargetArchs
  24. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  25. public static extern int cuda_TargetArchs_builtWith(int feature_set);
  26. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  27. public static extern int cuda_TargetArchs_has(int major, int minor);
  28. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  29. public static extern int cuda_TargetArchs_hasPtx(int major, int minor);
  30. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  31. public static extern int cuda_TargetArchs_hasBin(int major, int minor);
  32. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  33. public static extern int cuda_TargetArchs_hasEqualOrLessPtx(int major, int minor);
  34. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  35. public static extern int cuda_TargetArchs_hasEqualOrGreater(int major, int minor);
  36. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  37. public static extern int cuda_TargetArchs_hasEqualOrGreaterPtx(int major, int minor);
  38. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  39. public static extern int cuda_TargetArchs_hasEqualOrGreaterBin(int major, int minor);
  40. // DeviceInfo
  41. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  42. public static extern IntPtr cuda_DeviceInfo_new1();
  43. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  44. public static extern IntPtr cuda_DeviceInfo_new2(int deviceId);
  45. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  46. public static extern void cuda_DeviceInfo_delete(IntPtr obj);
  47. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
  48. public static extern void cuda_DeviceInfo_name(
  49. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength);
  50. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  51. public static extern int cuda_DeviceInfo_majorVersion(IntPtr obj);
  52. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  53. public static extern int cuda_DeviceInfo_minorVersion(IntPtr obj);
  54. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  55. public static extern int cuda_DeviceInfo_multiProcessorCount(IntPtr obj);
  56. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  57. public static extern ulong cuda_DeviceInfo_sharedMemPerBlock(IntPtr obj);
  58. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  59. public static extern void cuda_DeviceInfo_queryMemory(
  60. IntPtr obj, out ulong totalMemory, out ulong freeMemory);
  61. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  62. public static extern ulong cuda_DeviceInfo_freeMemory(IntPtr obj);
  63. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  64. public static extern ulong cuda_DeviceInfo_totalMemory(IntPtr obj);
  65. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  66. public static extern int cuda_DeviceInfo_supports(IntPtr obj, int featureSet);
  67. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  68. public static extern int cuda_DeviceInfo_isCompatible(IntPtr obj);
  69. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  70. public static extern int cuda_DeviceInfo_deviceID(IntPtr obj);
  71. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  72. public static extern int cuda_DeviceInfo_canMapHostMemory(IntPtr obj);
  73. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  74. public static extern void cuda_printCudaDeviceInfo(int device);
  75. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  76. public static extern void cuda_printShortCudaDeviceInfo(int device);
  77. #endregion
  78. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  79. public static extern void cuda_registerPageLocked(IntPtr m);
  80. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  81. public static extern void cuda_unregisterPageLocked(IntPtr m);
  82. #region Stream
  83. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  84. public static extern IntPtr cuda_Stream_new1();
  85. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  86. public static extern IntPtr cuda_Stream_new2(IntPtr s);
  87. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  88. public static extern void cuda_Stream_delete(IntPtr obj);
  89. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  90. public static extern void cuda_Stream_opAssign(IntPtr left, IntPtr right);
  91. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  92. public static extern int cuda_Stream_queryIfComplete(IntPtr obj);
  93. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  94. public static extern void cuda_Stream_waitForCompletion(IntPtr obj);
  95. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  96. public static extern void cuda_Stream_enqueueDownload_CudaMem(IntPtr obj, IntPtr src, IntPtr dst);
  97. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  98. public static extern void cuda_Stream_enqueueDownload_Mat(IntPtr obj, IntPtr src, IntPtr dst);
  99. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  100. public static extern void cuda_Stream_enqueueUpload_CudaMem(IntPtr obj, IntPtr src, IntPtr dst);
  101. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  102. public static extern void cuda_Stream_enqueueUpload_Mat(IntPtr obj, IntPtr src, IntPtr dst);
  103. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  104. public static extern void cuda_Stream_enqueueCopy(IntPtr obj, IntPtr src, IntPtr dst);
  105. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  106. public static extern void cuda_Stream_enqueueMemSet(IntPtr obj, IntPtr src, Scalar val);
  107. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  108. public static extern void cuda_Stream_enqueueMemSet_WithMask(IntPtr obj, IntPtr src, Scalar val, IntPtr mask);
  109. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  110. public static extern void cuda_Stream_enqueueConvert(
  111. IntPtr obj, IntPtr src, IntPtr dst, int dtype, double a, double b);
  112. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  113. public static extern void cuda_Stream_enqueueHostCallback(
  114. IntPtr obj, IntPtr callback, IntPtr userData);
  115. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  116. public static extern IntPtr cuda_Stream_Null();
  117. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  118. public static extern int cuda_Stream_bool(IntPtr obj);
  119. #endregion
  120. #region CascadeClassifier_GPU
  121. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  122. public static extern void cuda_CascadeClassifier_GPU_delete(IntPtr obj);
  123. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  124. public static extern IntPtr cuda_CascadeClassifier_GPU_new1();
  125. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  126. public static extern IntPtr cuda_CascadeClassifier_GPU_new2(string filename);
  127. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  128. public static extern int cuda_CascadeClassifier_GPU_empty(IntPtr obj);
  129. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  130. public static extern int cuda_CascadeClassifier_GPU_load(IntPtr obj, string filename);
  131. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  132. public static extern void cuda_CascadeClassifier_GPU_release(IntPtr obj);
  133. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  134. public static extern int cuda_CascadeClassifier_GPU_detectMultiScale1(IntPtr obj,
  135. IntPtr image, IntPtr objectsBuf, double scaleFactor, int minNeighbors, Size minSize);
  136. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  137. public static extern int cuda_CascadeClassifier_GPU_detectMultiScale2(IntPtr obj,
  138. IntPtr image, IntPtr objectsBuf, Size maxObjectSize, Size minSize, double scaleFactor,
  139. int minNeighbors);
  140. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  141. public static extern int cuda_CascadeClassifier_GPU_findLargestObject_get(IntPtr obj);
  142. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  143. public static extern void cuda_CascadeClassifier_GPU_findLargestObject_set(IntPtr obj, int value);
  144. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  145. public static extern int cuda_CascadeClassifier_GPU_visualizeInPlace_get(IntPtr obj);
  146. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  147. public static extern void cuda_CascadeClassifier_GPU_visualizeInPlace_set(IntPtr obj, int value);
  148. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  149. public static extern Size cuda_CascadeClassifier_GPU_getClassifierSize(IntPtr obj);
  150. #endregion
  151. #region HogDescriptor
  152. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  153. public static extern int HOGDescriptor_sizeof();
  154. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  155. public static extern IntPtr HOGDescriptor_new(Size win_size, Size block_size, Size block_stride, Size cell_size,
  156. int nbins, double winSigma, double threshold_L2Hys, bool gamma_correction, int nlevels);
  157. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  158. public static extern void HOGDescriptor_delete(IntPtr obj);
  159. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  160. public static extern ulong HOGDescriptor_getDescriptorSize(IntPtr obj);
  161. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  162. public static extern ulong HOGDescriptor_getBlockHistogramSize(IntPtr obj);
  163. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  164. public static extern int HOGDescriptor_checkDetectorSize(IntPtr obj);
  165. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  166. public static extern double HOGDescriptor_getWinSigma(IntPtr obj);
  167. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  168. public static extern void HOGDescriptor_setSVMDetector(IntPtr obj, IntPtr svmdetector);
  169. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  170. public static extern void HOGDescriptor_detect(IntPtr obj, IntPtr img, IntPtr found_locations, double hit_threshold, Size win_stride, Size padding);
  171. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  172. public static extern void HOGDescriptor_detectMultiScale(IntPtr obj, IntPtr img, IntPtr found_locations,
  173. double hit_threshold, Size win_stride, Size padding, double scale, int group_threshold);
  174. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  175. public static extern void HOGDescriptor_getDescriptors(IntPtr obj, IntPtr img, Size win_stride, IntPtr descriptors, [MarshalAs(UnmanagedType.I4)] DescriptorFormat descr_format);
  176. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  177. public static extern Size HOGDescriptor_win_size_get(IntPtr obj);
  178. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  179. public static extern Size HOGDescriptor_block_size_get(IntPtr obj);
  180. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  181. public static extern Size HOGDescriptor_block_stride_get(IntPtr obj);
  182. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  183. public static extern Size HOGDescriptor_cell_size_get(IntPtr obj);
  184. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  185. public static extern int HOGDescriptor_nbins_get(IntPtr obj);
  186. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  187. public static extern double HOGDescriptor_win_sigma_get(IntPtr obj);
  188. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  189. public static extern double HOGDescriptor_threshold_L2hys_get(IntPtr obj);
  190. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  191. public static extern int HOGDescriptor_nlevels_get(IntPtr obj);
  192. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  193. public static extern int HOGDescriptor_gamma_correction_get(IntPtr obj);
  194. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  195. public static extern void HOGDescriptor_win_size_set(IntPtr obj, Size value);
  196. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  197. public static extern void HOGDescriptor_block_size_set(IntPtr obj, Size value);
  198. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  199. public static extern void HOGDescriptor_block_stride_set(IntPtr obj, Size value);
  200. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  201. public static extern void HOGDescriptor_cell_size_set(IntPtr obj, Size value);
  202. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  203. public static extern void HOGDescriptor_nbins_set(IntPtr obj, int value);
  204. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  205. public static extern void HOGDescriptor_win_sigma_set(IntPtr obj, double value);
  206. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  207. public static extern void HOGDescriptor_threshold_L2hys_set(IntPtr obj, double value);
  208. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  209. public static extern void HOGDescriptor_nlevels_set(IntPtr obj, int value);
  210. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  211. public static extern void HOGDescriptor_gamma_correction_set(IntPtr obj, int value);
  212. #endregion
  213. #region MOG_GPU
  214. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  215. public static extern void cuda_MOG_GPU_delete(IntPtr obj);
  216. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  217. public static extern IntPtr cuda_MOG_GPU_new(int nmixtures);
  218. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  219. public static extern void cuda_MOG_GPU_initialize(
  220. IntPtr obj, Size frameSize, int frameType);
  221. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  222. public static extern void cuda_MOG_GPU_operator(
  223. IntPtr obj, IntPtr frame, IntPtr fgmask, float learningRate, IntPtr stream);
  224. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  225. public static extern void cuda_MOG_GPU_getBackgroundImage(
  226. IntPtr obj, IntPtr backgroundImage, IntPtr stream);
  227. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  228. public static extern void cuda_MOG_GPU_release(IntPtr obj);
  229. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  230. public static extern unsafe int* cuda_MOG_GPU_history(IntPtr obj);
  231. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  232. public static extern unsafe float* cuda_MOG_GPU_varThreshold(IntPtr obj);
  233. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  234. public static extern unsafe float* cuda_MOG_GPU_backgroundRatio(IntPtr obj);
  235. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  236. public static extern unsafe float* cuda_MOG_GPU_noiseSigma(IntPtr obj);
  237. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  238. public static extern void cuda_MOG2_GPU_delete(IntPtr obj);
  239. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  240. public static extern IntPtr cuda_MOG2_GPU_new(int nmixtures);
  241. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  242. public static extern void cuda_MOG2_GPU_initialize(
  243. IntPtr obj, Size frameSize, int frameType);
  244. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  245. public static extern void cuda_MOG2_GPU_operator(
  246. IntPtr obj, IntPtr frame, IntPtr fgmask, float learningRate, IntPtr stream);
  247. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  248. public static extern void cuda_MOG2_GPU_getBackgroundImage(
  249. IntPtr obj, IntPtr backgroundImage, IntPtr stream);
  250. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  251. public static extern void cuda_MOG2_GPU_release(IntPtr obj);
  252. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  253. public static extern unsafe int* cuda_MOG2_GPU_history(IntPtr obj);
  254. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  255. public static extern unsafe float* cuda_MOG2_GPU_varThreshold(IntPtr obj);
  256. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  257. public static extern unsafe float* cuda_MOG2_GPU_backgroundRatio(IntPtr obj);
  258. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  259. public static extern unsafe float* cuda_MOG2_GPU_varThresholdGen(IntPtr obj);
  260. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  261. public static extern unsafe float* cuda_MOG2_GPU_fVarInit(IntPtr obj);
  262. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  263. public static extern unsafe float* cuda_MOG2_GPU_fVarMin(IntPtr obj);
  264. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  265. public static extern unsafe float* cuda_MOG2_GPU_fVarMax(IntPtr obj);
  266. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  267. public static extern unsafe float* cuda_MOG2_GPU_fCT(IntPtr obj);
  268. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  269. public static extern int cuda_MOG2_GPU_bShadowDetection_get(IntPtr obj);
  270. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  271. public static extern void cuda_MOG2_GPU_bShadowDetection_set(IntPtr obj, int value);
  272. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  273. public static extern unsafe byte* cuda_MOG2_GPU_nShadowDetection(IntPtr obj);
  274. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  275. public static extern unsafe float* cuda_MOG2_GPU_fTau(IntPtr obj);
  276. #endregion
  277. #region StereoBM_GPU
  278. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  279. public static extern IntPtr cuda_StereoBM_GPU_new1();
  280. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  281. public static extern IntPtr cuda_StereoBM_GPU_new2(int preset, int ndisparities, int winSize);
  282. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  283. public static extern void cuda_StereoBM_GPU_delete(IntPtr obj);
  284. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  285. public static extern void cuda_StereoBM_GPU_run1(IntPtr obj, IntPtr left, IntPtr right, IntPtr disparity);
  286. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  287. public static extern void cuda_StereoBM_GPU_run2(IntPtr obj, IntPtr left, IntPtr right, IntPtr disparity, IntPtr stream);
  288. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  289. public static extern int cuda_StereoBM_GPU_checkIfGpuCallReasonable();
  290. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  291. public static extern unsafe int* cuda_StereoBM_GPU_preset(IntPtr obj);
  292. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  293. public static extern unsafe int* cuda_StereoBM_GPU_ndisp(IntPtr obj);
  294. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  295. public static extern unsafe int* cuda_StereoBM_GPU_winSize(IntPtr obj);
  296. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  297. public static extern unsafe float* cuda_StereoBM_GPU_avergeTexThreshold(IntPtr obj);
  298. #endregion
  299. }
  300. }
  301. #endif