TrackerKCF_Params.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.TrackingModule
  7. {
  8. // C++: class Params
  9. public class TrackerKCF_Params : DisposableOpenCVObject
  10. {
  11. protected override void Dispose(bool disposing)
  12. {
  13. try
  14. {
  15. if (disposing)
  16. {
  17. }
  18. if (IsEnabledDispose)
  19. {
  20. if (nativeObj != IntPtr.Zero)
  21. tracking_TrackerKCF_1Params_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. }
  25. finally
  26. {
  27. base.Dispose(disposing);
  28. }
  29. }
  30. protected internal TrackerKCF_Params(IntPtr addr) : base(addr) { }
  31. public IntPtr getNativeObjAddr() { return nativeObj; }
  32. // internal usage only
  33. public static TrackerKCF_Params __fromPtr__(IntPtr addr) { return new TrackerKCF_Params(addr); }
  34. //
  35. // C++: cv::TrackerKCF::Params::Params()
  36. //
  37. public TrackerKCF_Params()
  38. {
  39. nativeObj = DisposableObject.ThrowIfNullIntPtr(tracking_TrackerKCF_1Params_TrackerKCF_1Params_10());
  40. }
  41. //
  42. // C++: float TrackerKCF_Params::detect_thresh
  43. //
  44. public float get_detect_thresh()
  45. {
  46. ThrowIfDisposed();
  47. return tracking_TrackerKCF_1Params_get_1detect_1thresh_10(nativeObj);
  48. }
  49. //
  50. // C++: void TrackerKCF_Params::detect_thresh
  51. //
  52. public void set_detect_thresh(float detect_thresh)
  53. {
  54. ThrowIfDisposed();
  55. tracking_TrackerKCF_1Params_set_1detect_1thresh_10(nativeObj, detect_thresh);
  56. }
  57. //
  58. // C++: float TrackerKCF_Params::sigma
  59. //
  60. public float get_sigma()
  61. {
  62. ThrowIfDisposed();
  63. return tracking_TrackerKCF_1Params_get_1sigma_10(nativeObj);
  64. }
  65. //
  66. // C++: void TrackerKCF_Params::sigma
  67. //
  68. public void set_sigma(float sigma)
  69. {
  70. ThrowIfDisposed();
  71. tracking_TrackerKCF_1Params_set_1sigma_10(nativeObj, sigma);
  72. }
  73. //
  74. // C++: float TrackerKCF_Params::lambda
  75. //
  76. public float get_lambda()
  77. {
  78. ThrowIfDisposed();
  79. return tracking_TrackerKCF_1Params_get_1lambda_10(nativeObj);
  80. }
  81. //
  82. // C++: void TrackerKCF_Params::lambda
  83. //
  84. public void set_lambda(float lambda)
  85. {
  86. ThrowIfDisposed();
  87. tracking_TrackerKCF_1Params_set_1lambda_10(nativeObj, lambda);
  88. }
  89. //
  90. // C++: float TrackerKCF_Params::interp_factor
  91. //
  92. public float get_interp_factor()
  93. {
  94. ThrowIfDisposed();
  95. return tracking_TrackerKCF_1Params_get_1interp_1factor_10(nativeObj);
  96. }
  97. //
  98. // C++: void TrackerKCF_Params::interp_factor
  99. //
  100. public void set_interp_factor(float interp_factor)
  101. {
  102. ThrowIfDisposed();
  103. tracking_TrackerKCF_1Params_set_1interp_1factor_10(nativeObj, interp_factor);
  104. }
  105. //
  106. // C++: float TrackerKCF_Params::output_sigma_factor
  107. //
  108. public float get_output_sigma_factor()
  109. {
  110. ThrowIfDisposed();
  111. return tracking_TrackerKCF_1Params_get_1output_1sigma_1factor_10(nativeObj);
  112. }
  113. //
  114. // C++: void TrackerKCF_Params::output_sigma_factor
  115. //
  116. public void set_output_sigma_factor(float output_sigma_factor)
  117. {
  118. ThrowIfDisposed();
  119. tracking_TrackerKCF_1Params_set_1output_1sigma_1factor_10(nativeObj, output_sigma_factor);
  120. }
  121. //
  122. // C++: float TrackerKCF_Params::pca_learning_rate
  123. //
  124. public float get_pca_learning_rate()
  125. {
  126. ThrowIfDisposed();
  127. return tracking_TrackerKCF_1Params_get_1pca_1learning_1rate_10(nativeObj);
  128. }
  129. //
  130. // C++: void TrackerKCF_Params::pca_learning_rate
  131. //
  132. public void set_pca_learning_rate(float pca_learning_rate)
  133. {
  134. ThrowIfDisposed();
  135. tracking_TrackerKCF_1Params_set_1pca_1learning_1rate_10(nativeObj, pca_learning_rate);
  136. }
  137. //
  138. // C++: bool TrackerKCF_Params::resize
  139. //
  140. public bool get_resize()
  141. {
  142. ThrowIfDisposed();
  143. return tracking_TrackerKCF_1Params_get_1resize_10(nativeObj);
  144. }
  145. //
  146. // C++: void TrackerKCF_Params::resize
  147. //
  148. public void set_resize(bool resize)
  149. {
  150. ThrowIfDisposed();
  151. tracking_TrackerKCF_1Params_set_1resize_10(nativeObj, resize);
  152. }
  153. //
  154. // C++: bool TrackerKCF_Params::split_coeff
  155. //
  156. public bool get_split_coeff()
  157. {
  158. ThrowIfDisposed();
  159. return tracking_TrackerKCF_1Params_get_1split_1coeff_10(nativeObj);
  160. }
  161. //
  162. // C++: void TrackerKCF_Params::split_coeff
  163. //
  164. public void set_split_coeff(bool split_coeff)
  165. {
  166. ThrowIfDisposed();
  167. tracking_TrackerKCF_1Params_set_1split_1coeff_10(nativeObj, split_coeff);
  168. }
  169. //
  170. // C++: bool TrackerKCF_Params::wrap_kernel
  171. //
  172. public bool get_wrap_kernel()
  173. {
  174. ThrowIfDisposed();
  175. return tracking_TrackerKCF_1Params_get_1wrap_1kernel_10(nativeObj);
  176. }
  177. //
  178. // C++: void TrackerKCF_Params::wrap_kernel
  179. //
  180. public void set_wrap_kernel(bool wrap_kernel)
  181. {
  182. ThrowIfDisposed();
  183. tracking_TrackerKCF_1Params_set_1wrap_1kernel_10(nativeObj, wrap_kernel);
  184. }
  185. //
  186. // C++: bool TrackerKCF_Params::compress_feature
  187. //
  188. public bool get_compress_feature()
  189. {
  190. ThrowIfDisposed();
  191. return tracking_TrackerKCF_1Params_get_1compress_1feature_10(nativeObj);
  192. }
  193. //
  194. // C++: void TrackerKCF_Params::compress_feature
  195. //
  196. public void set_compress_feature(bool compress_feature)
  197. {
  198. ThrowIfDisposed();
  199. tracking_TrackerKCF_1Params_set_1compress_1feature_10(nativeObj, compress_feature);
  200. }
  201. //
  202. // C++: int TrackerKCF_Params::max_patch_size
  203. //
  204. public int get_max_patch_size()
  205. {
  206. ThrowIfDisposed();
  207. return tracking_TrackerKCF_1Params_get_1max_1patch_1size_10(nativeObj);
  208. }
  209. //
  210. // C++: void TrackerKCF_Params::max_patch_size
  211. //
  212. public void set_max_patch_size(int max_patch_size)
  213. {
  214. ThrowIfDisposed();
  215. tracking_TrackerKCF_1Params_set_1max_1patch_1size_10(nativeObj, max_patch_size);
  216. }
  217. //
  218. // C++: int TrackerKCF_Params::compressed_size
  219. //
  220. public int get_compressed_size()
  221. {
  222. ThrowIfDisposed();
  223. return tracking_TrackerKCF_1Params_get_1compressed_1size_10(nativeObj);
  224. }
  225. //
  226. // C++: void TrackerKCF_Params::compressed_size
  227. //
  228. public void set_compressed_size(int compressed_size)
  229. {
  230. ThrowIfDisposed();
  231. tracking_TrackerKCF_1Params_set_1compressed_1size_10(nativeObj, compressed_size);
  232. }
  233. //
  234. // C++: int TrackerKCF_Params::desc_pca
  235. //
  236. public int get_desc_pca()
  237. {
  238. ThrowIfDisposed();
  239. return tracking_TrackerKCF_1Params_get_1desc_1pca_10(nativeObj);
  240. }
  241. //
  242. // C++: void TrackerKCF_Params::desc_pca
  243. //
  244. public void set_desc_pca(int desc_pca)
  245. {
  246. ThrowIfDisposed();
  247. tracking_TrackerKCF_1Params_set_1desc_1pca_10(nativeObj, desc_pca);
  248. }
  249. //
  250. // C++: int TrackerKCF_Params::desc_npca
  251. //
  252. public int get_desc_npca()
  253. {
  254. ThrowIfDisposed();
  255. return tracking_TrackerKCF_1Params_get_1desc_1npca_10(nativeObj);
  256. }
  257. //
  258. // C++: void TrackerKCF_Params::desc_npca
  259. //
  260. public void set_desc_npca(int desc_npca)
  261. {
  262. ThrowIfDisposed();
  263. tracking_TrackerKCF_1Params_set_1desc_1npca_10(nativeObj, desc_npca);
  264. }
  265. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  266. const string LIBNAME = "__Internal";
  267. #else
  268. const string LIBNAME = "opencvforunity";
  269. #endif
  270. // C++: cv::TrackerKCF::Params::Params()
  271. [DllImport(LIBNAME)]
  272. private static extern IntPtr tracking_TrackerKCF_1Params_TrackerKCF_1Params_10();
  273. // C++: float TrackerKCF_Params::detect_thresh
  274. [DllImport(LIBNAME)]
  275. private static extern float tracking_TrackerKCF_1Params_get_1detect_1thresh_10(IntPtr nativeObj);
  276. // C++: void TrackerKCF_Params::detect_thresh
  277. [DllImport(LIBNAME)]
  278. private static extern void tracking_TrackerKCF_1Params_set_1detect_1thresh_10(IntPtr nativeObj, float detect_thresh);
  279. // C++: float TrackerKCF_Params::sigma
  280. [DllImport(LIBNAME)]
  281. private static extern float tracking_TrackerKCF_1Params_get_1sigma_10(IntPtr nativeObj);
  282. // C++: void TrackerKCF_Params::sigma
  283. [DllImport(LIBNAME)]
  284. private static extern void tracking_TrackerKCF_1Params_set_1sigma_10(IntPtr nativeObj, float sigma);
  285. // C++: float TrackerKCF_Params::lambda
  286. [DllImport(LIBNAME)]
  287. private static extern float tracking_TrackerKCF_1Params_get_1lambda_10(IntPtr nativeObj);
  288. // C++: void TrackerKCF_Params::lambda
  289. [DllImport(LIBNAME)]
  290. private static extern void tracking_TrackerKCF_1Params_set_1lambda_10(IntPtr nativeObj, float lambda);
  291. // C++: float TrackerKCF_Params::interp_factor
  292. [DllImport(LIBNAME)]
  293. private static extern float tracking_TrackerKCF_1Params_get_1interp_1factor_10(IntPtr nativeObj);
  294. // C++: void TrackerKCF_Params::interp_factor
  295. [DllImport(LIBNAME)]
  296. private static extern void tracking_TrackerKCF_1Params_set_1interp_1factor_10(IntPtr nativeObj, float interp_factor);
  297. // C++: float TrackerKCF_Params::output_sigma_factor
  298. [DllImport(LIBNAME)]
  299. private static extern float tracking_TrackerKCF_1Params_get_1output_1sigma_1factor_10(IntPtr nativeObj);
  300. // C++: void TrackerKCF_Params::output_sigma_factor
  301. [DllImport(LIBNAME)]
  302. private static extern void tracking_TrackerKCF_1Params_set_1output_1sigma_1factor_10(IntPtr nativeObj, float output_sigma_factor);
  303. // C++: float TrackerKCF_Params::pca_learning_rate
  304. [DllImport(LIBNAME)]
  305. private static extern float tracking_TrackerKCF_1Params_get_1pca_1learning_1rate_10(IntPtr nativeObj);
  306. // C++: void TrackerKCF_Params::pca_learning_rate
  307. [DllImport(LIBNAME)]
  308. private static extern void tracking_TrackerKCF_1Params_set_1pca_1learning_1rate_10(IntPtr nativeObj, float pca_learning_rate);
  309. // C++: bool TrackerKCF_Params::resize
  310. [DllImport(LIBNAME)]
  311. [return: MarshalAs(UnmanagedType.U1)]
  312. private static extern bool tracking_TrackerKCF_1Params_get_1resize_10(IntPtr nativeObj);
  313. // C++: void TrackerKCF_Params::resize
  314. [DllImport(LIBNAME)]
  315. private static extern void tracking_TrackerKCF_1Params_set_1resize_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool resize);
  316. // C++: bool TrackerKCF_Params::split_coeff
  317. [DllImport(LIBNAME)]
  318. [return: MarshalAs(UnmanagedType.U1)]
  319. private static extern bool tracking_TrackerKCF_1Params_get_1split_1coeff_10(IntPtr nativeObj);
  320. // C++: void TrackerKCF_Params::split_coeff
  321. [DllImport(LIBNAME)]
  322. private static extern void tracking_TrackerKCF_1Params_set_1split_1coeff_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool split_coeff);
  323. // C++: bool TrackerKCF_Params::wrap_kernel
  324. [DllImport(LIBNAME)]
  325. [return: MarshalAs(UnmanagedType.U1)]
  326. private static extern bool tracking_TrackerKCF_1Params_get_1wrap_1kernel_10(IntPtr nativeObj);
  327. // C++: void TrackerKCF_Params::wrap_kernel
  328. [DllImport(LIBNAME)]
  329. private static extern void tracking_TrackerKCF_1Params_set_1wrap_1kernel_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool wrap_kernel);
  330. // C++: bool TrackerKCF_Params::compress_feature
  331. [DllImport(LIBNAME)]
  332. [return: MarshalAs(UnmanagedType.U1)]
  333. private static extern bool tracking_TrackerKCF_1Params_get_1compress_1feature_10(IntPtr nativeObj);
  334. // C++: void TrackerKCF_Params::compress_feature
  335. [DllImport(LIBNAME)]
  336. private static extern void tracking_TrackerKCF_1Params_set_1compress_1feature_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool compress_feature);
  337. // C++: int TrackerKCF_Params::max_patch_size
  338. [DllImport(LIBNAME)]
  339. private static extern int tracking_TrackerKCF_1Params_get_1max_1patch_1size_10(IntPtr nativeObj);
  340. // C++: void TrackerKCF_Params::max_patch_size
  341. [DllImport(LIBNAME)]
  342. private static extern void tracking_TrackerKCF_1Params_set_1max_1patch_1size_10(IntPtr nativeObj, int max_patch_size);
  343. // C++: int TrackerKCF_Params::compressed_size
  344. [DllImport(LIBNAME)]
  345. private static extern int tracking_TrackerKCF_1Params_get_1compressed_1size_10(IntPtr nativeObj);
  346. // C++: void TrackerKCF_Params::compressed_size
  347. [DllImport(LIBNAME)]
  348. private static extern void tracking_TrackerKCF_1Params_set_1compressed_1size_10(IntPtr nativeObj, int compressed_size);
  349. // C++: int TrackerKCF_Params::desc_pca
  350. [DllImport(LIBNAME)]
  351. private static extern int tracking_TrackerKCF_1Params_get_1desc_1pca_10(IntPtr nativeObj);
  352. // C++: void TrackerKCF_Params::desc_pca
  353. [DllImport(LIBNAME)]
  354. private static extern void tracking_TrackerKCF_1Params_set_1desc_1pca_10(IntPtr nativeObj, int desc_pca);
  355. // C++: int TrackerKCF_Params::desc_npca
  356. [DllImport(LIBNAME)]
  357. private static extern int tracking_TrackerKCF_1Params_get_1desc_1npca_10(IntPtr nativeObj);
  358. // C++: void TrackerKCF_Params::desc_npca
  359. [DllImport(LIBNAME)]
  360. private static extern void tracking_TrackerKCF_1Params_set_1desc_1npca_10(IntPtr nativeObj, int desc_npca);
  361. // native support for java finalize()
  362. [DllImport(LIBNAME)]
  363. private static extern void tracking_TrackerKCF_1Params_delete(IntPtr nativeObj);
  364. }
  365. }