Dnn.cs 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. #if !UNITY_WSA_10_0
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.DnnModule {
  8. // C++: class Dnn
  9. //javadoc: Dnn
  10. public class Dnn {
  11. // C++: enum Backend
  12. public const int DNN_BACKEND_DEFAULT = 0;
  13. public const int DNN_BACKEND_HALIDE = 1;
  14. public const int DNN_BACKEND_INFERENCE_ENGINE = 2;
  15. public const int DNN_BACKEND_OPENCV = 3;
  16. public const int DNN_BACKEND_VKCOM = 4;
  17. // C++: enum Target
  18. public const int DNN_TARGET_CPU = 0;
  19. public const int DNN_TARGET_OPENCL = 1;
  20. public const int DNN_TARGET_OPENCL_FP16 = 2;
  21. public const int DNN_TARGET_MYRIAD = 3;
  22. public const int DNN_TARGET_VULKAN = 4;
  23. //
  24. // C++: Mat cv::dnn::blobFromImage(Mat image, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
  25. //
  26. //javadoc: blobFromImage(image, scalefactor, size, mean, swapRB, crop, ddepth)
  27. public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB, bool crop, int ddepth) {
  28. if (image != null)
  29. image.ThrowIfDisposed();
  30. #if (UNITY_ANDROID && !UNITY_EDITOR)
  31. Mat retVal = new Mat(dnn_Dnn_blobFromImage_10(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop, ddepth));
  32. return retVal;
  33. #else
  34. return null;
  35. #endif
  36. }
  37. //javadoc: blobFromImage(image, scalefactor, size, mean, swapRB, crop)
  38. public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB, bool crop) {
  39. if (image != null)
  40. image.ThrowIfDisposed();
  41. #if (UNITY_ANDROID && !UNITY_EDITOR)
  42. Mat retVal = new Mat(dnn_Dnn_blobFromImage_11(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop));
  43. return retVal;
  44. #else
  45. return null;
  46. #endif
  47. }
  48. //javadoc: blobFromImage(image, scalefactor, size, mean, swapRB)
  49. public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB) {
  50. if (image != null)
  51. image.ThrowIfDisposed();
  52. #if (UNITY_ANDROID && !UNITY_EDITOR)
  53. Mat retVal = new Mat(dnn_Dnn_blobFromImage_12(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB));
  54. return retVal;
  55. #else
  56. return null;
  57. #endif
  58. }
  59. //javadoc: blobFromImage(image, scalefactor, size, mean)
  60. public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean) {
  61. if (image != null)
  62. image.ThrowIfDisposed();
  63. #if (UNITY_ANDROID && !UNITY_EDITOR)
  64. Mat retVal = new Mat(dnn_Dnn_blobFromImage_13(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3]));
  65. return retVal;
  66. #else
  67. return null;
  68. #endif
  69. }
  70. //javadoc: blobFromImage(image, scalefactor, size)
  71. public static Mat blobFromImage(Mat image, double scalefactor, Size size) {
  72. if (image != null)
  73. image.ThrowIfDisposed();
  74. #if (UNITY_ANDROID && !UNITY_EDITOR)
  75. Mat retVal = new Mat(dnn_Dnn_blobFromImage_14(image.nativeObj, scalefactor, size.width, size.height));
  76. return retVal;
  77. #else
  78. return null;
  79. #endif
  80. }
  81. //javadoc: blobFromImage(image, scalefactor)
  82. public static Mat blobFromImage(Mat image, double scalefactor) {
  83. if (image != null)
  84. image.ThrowIfDisposed();
  85. #if (UNITY_ANDROID && !UNITY_EDITOR)
  86. Mat retVal = new Mat(dnn_Dnn_blobFromImage_15(image.nativeObj, scalefactor));
  87. return retVal;
  88. #else
  89. return null;
  90. #endif
  91. }
  92. //javadoc: blobFromImage(image)
  93. public static Mat blobFromImage(Mat image) {
  94. if (image != null)
  95. image.ThrowIfDisposed();
  96. #if (UNITY_ANDROID && !UNITY_EDITOR)
  97. Mat retVal = new Mat(dnn_Dnn_blobFromImage_16(image.nativeObj));
  98. return retVal;
  99. #else
  100. return null;
  101. #endif
  102. }
  103. //
  104. // C++: Mat cv::dnn::blobFromImages(vector_Mat images, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
  105. //
  106. //javadoc: blobFromImages(images, scalefactor, size, mean, swapRB, crop, ddepth)
  107. public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, bool swapRB, bool crop, int ddepth) {
  108. #if (UNITY_ANDROID && !UNITY_EDITOR)
  109. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  110. Mat retVal = new Mat(dnn_Dnn_blobFromImages_10(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop, ddepth));
  111. return retVal;
  112. #else
  113. return null;
  114. #endif
  115. }
  116. //javadoc: blobFromImages(images, scalefactor, size, mean, swapRB, crop)
  117. public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, bool swapRB, bool crop) {
  118. #if (UNITY_ANDROID && !UNITY_EDITOR)
  119. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  120. Mat retVal = new Mat(dnn_Dnn_blobFromImages_11(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop));
  121. return retVal;
  122. #else
  123. return null;
  124. #endif
  125. }
  126. //javadoc: blobFromImages(images, scalefactor, size, mean, swapRB)
  127. public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, bool swapRB) {
  128. #if (UNITY_ANDROID && !UNITY_EDITOR)
  129. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  130. Mat retVal = new Mat(dnn_Dnn_blobFromImages_12(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB));
  131. return retVal;
  132. #else
  133. return null;
  134. #endif
  135. }
  136. //javadoc: blobFromImages(images, scalefactor, size, mean)
  137. public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean) {
  138. #if (UNITY_ANDROID && !UNITY_EDITOR)
  139. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  140. Mat retVal = new Mat(dnn_Dnn_blobFromImages_13(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3]));
  141. return retVal;
  142. #else
  143. return null;
  144. #endif
  145. }
  146. //javadoc: blobFromImages(images, scalefactor, size)
  147. public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size) {
  148. #if (UNITY_ANDROID && !UNITY_EDITOR)
  149. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  150. Mat retVal = new Mat(dnn_Dnn_blobFromImages_14(images_mat.nativeObj, scalefactor, size.width, size.height));
  151. return retVal;
  152. #else
  153. return null;
  154. #endif
  155. }
  156. //javadoc: blobFromImages(images, scalefactor)
  157. public static Mat blobFromImages(List<Mat> images, double scalefactor) {
  158. #if (UNITY_ANDROID && !UNITY_EDITOR)
  159. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  160. Mat retVal = new Mat(dnn_Dnn_blobFromImages_15(images_mat.nativeObj, scalefactor));
  161. return retVal;
  162. #else
  163. return null;
  164. #endif
  165. }
  166. //javadoc: blobFromImages(images)
  167. public static Mat blobFromImages(List<Mat> images) {
  168. #if (UNITY_ANDROID && !UNITY_EDITOR)
  169. Mat images_mat = Converters.vector_Mat_to_Mat(images);
  170. Mat retVal = new Mat(dnn_Dnn_blobFromImages_16(images_mat.nativeObj));
  171. return retVal;
  172. #else
  173. return null;
  174. #endif
  175. }
  176. //
  177. // C++: Mat cv::dnn::readTensorFromONNX(String path)
  178. //
  179. //javadoc: readTensorFromONNX(path)
  180. public static Mat readTensorFromONNX(string path) {
  181. #if (UNITY_ANDROID && !UNITY_EDITOR)
  182. Mat retVal = new Mat(dnn_Dnn_readTensorFromONNX_10(path));
  183. return retVal;
  184. #else
  185. return null;
  186. #endif
  187. }
  188. //
  189. // C++: Mat cv::dnn::readTorchBlob(String filename, bool isBinary = true)
  190. //
  191. //javadoc: readTorchBlob(filename, isBinary)
  192. public static Mat readTorchBlob(string filename, bool isBinary) {
  193. #if (UNITY_ANDROID && !UNITY_EDITOR)
  194. Mat retVal = new Mat(dnn_Dnn_readTorchBlob_10(filename, isBinary));
  195. return retVal;
  196. #else
  197. return null;
  198. #endif
  199. }
  200. //javadoc: readTorchBlob(filename)
  201. public static Mat readTorchBlob(string filename) {
  202. #if (UNITY_ANDROID && !UNITY_EDITOR)
  203. Mat retVal = new Mat(dnn_Dnn_readTorchBlob_11(filename));
  204. return retVal;
  205. #else
  206. return null;
  207. #endif
  208. }
  209. //
  210. // C++: Net cv::dnn::readNet(String framework, vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
  211. //
  212. //javadoc: readNet(framework, bufferModel, bufferConfig)
  213. public static Net readNet(string framework, MatOfByte bufferModel, MatOfByte bufferConfig) {
  214. if (bufferModel != null)
  215. bufferModel.ThrowIfDisposed();
  216. if (bufferConfig != null)
  217. bufferConfig.ThrowIfDisposed();
  218. #if (UNITY_ANDROID && !UNITY_EDITOR)
  219. Mat bufferModel_mat = bufferModel;
  220. Mat bufferConfig_mat = bufferConfig;
  221. Net retVal = new Net(dnn_Dnn_readNet_10(framework, bufferModel_mat.nativeObj, bufferConfig_mat.nativeObj));
  222. return retVal;
  223. #else
  224. return null;
  225. #endif
  226. }
  227. //javadoc: readNet(framework, bufferModel)
  228. public static Net readNet(string framework, MatOfByte bufferModel) {
  229. if (bufferModel != null)
  230. bufferModel.ThrowIfDisposed();
  231. #if (UNITY_ANDROID && !UNITY_EDITOR)
  232. Mat bufferModel_mat = bufferModel;
  233. Net retVal = new Net(dnn_Dnn_readNet_11(framework, bufferModel_mat.nativeObj));
  234. return retVal;
  235. #else
  236. return null;
  237. #endif
  238. }
  239. //
  240. // C++: Net cv::dnn::readNet(String model, String config = "", String framework = "")
  241. //
  242. //javadoc: readNet(model, config, framework)
  243. public static Net readNet(string model, string config, string framework) {
  244. #if (UNITY_ANDROID && !UNITY_EDITOR)
  245. Net retVal = new Net(dnn_Dnn_readNet_12(model, config, framework));
  246. return retVal;
  247. #else
  248. return null;
  249. #endif
  250. }
  251. //javadoc: readNet(model, config)
  252. public static Net readNet(string model, string config) {
  253. #if (UNITY_ANDROID && !UNITY_EDITOR)
  254. Net retVal = new Net(dnn_Dnn_readNet_13(model, config));
  255. return retVal;
  256. #else
  257. return null;
  258. #endif
  259. }
  260. //javadoc: readNet(model)
  261. public static Net readNet(string model) {
  262. #if (UNITY_ANDROID && !UNITY_EDITOR)
  263. Net retVal = new Net(dnn_Dnn_readNet_14(model));
  264. return retVal;
  265. #else
  266. return null;
  267. #endif
  268. }
  269. //
  270. // C++: Net cv::dnn::readNetFromCaffe(String prototxt, String caffeModel = String())
  271. //
  272. //javadoc: readNetFromCaffe(prototxt, caffeModel)
  273. public static Net readNetFromCaffe(string prototxt, string caffeModel) {
  274. #if (UNITY_ANDROID && !UNITY_EDITOR)
  275. Net retVal = new Net(dnn_Dnn_readNetFromCaffe_10(prototxt, caffeModel));
  276. return retVal;
  277. #else
  278. return null;
  279. #endif
  280. }
  281. //javadoc: readNetFromCaffe(prototxt)
  282. public static Net readNetFromCaffe(string prototxt) {
  283. #if (UNITY_ANDROID && !UNITY_EDITOR)
  284. Net retVal = new Net(dnn_Dnn_readNetFromCaffe_11(prototxt));
  285. return retVal;
  286. #else
  287. return null;
  288. #endif
  289. }
  290. //
  291. // C++: Net cv::dnn::readNetFromCaffe(vector_uchar bufferProto, vector_uchar bufferModel = std::vector<uchar>())
  292. //
  293. //javadoc: readNetFromCaffe(bufferProto, bufferModel)
  294. public static Net readNetFromCaffe(MatOfByte bufferProto, MatOfByte bufferModel) {
  295. if (bufferProto != null)
  296. bufferProto.ThrowIfDisposed();
  297. if (bufferModel != null)
  298. bufferModel.ThrowIfDisposed();
  299. #if (UNITY_ANDROID && !UNITY_EDITOR)
  300. Mat bufferProto_mat = bufferProto;
  301. Mat bufferModel_mat = bufferModel;
  302. Net retVal = new Net(dnn_Dnn_readNetFromCaffe_12(bufferProto_mat.nativeObj, bufferModel_mat.nativeObj));
  303. return retVal;
  304. #else
  305. return null;
  306. #endif
  307. }
  308. //javadoc: readNetFromCaffe(bufferProto)
  309. public static Net readNetFromCaffe(MatOfByte bufferProto) {
  310. if (bufferProto != null)
  311. bufferProto.ThrowIfDisposed();
  312. #if (UNITY_ANDROID && !UNITY_EDITOR)
  313. Mat bufferProto_mat = bufferProto;
  314. Net retVal = new Net(dnn_Dnn_readNetFromCaffe_13(bufferProto_mat.nativeObj));
  315. return retVal;
  316. #else
  317. return null;
  318. #endif
  319. }
  320. //
  321. // C++: Net cv::dnn::readNetFromDarknet(String cfgFile, String darknetModel = String())
  322. //
  323. //javadoc: readNetFromDarknet(cfgFile, darknetModel)
  324. public static Net readNetFromDarknet(string cfgFile, string darknetModel) {
  325. #if (UNITY_ANDROID && !UNITY_EDITOR)
  326. Net retVal = new Net(dnn_Dnn_readNetFromDarknet_10(cfgFile, darknetModel));
  327. return retVal;
  328. #else
  329. return null;
  330. #endif
  331. }
  332. //javadoc: readNetFromDarknet(cfgFile)
  333. public static Net readNetFromDarknet(string cfgFile) {
  334. #if (UNITY_ANDROID && !UNITY_EDITOR)
  335. Net retVal = new Net(dnn_Dnn_readNetFromDarknet_11(cfgFile));
  336. return retVal;
  337. #else
  338. return null;
  339. #endif
  340. }
  341. //
  342. // C++: Net cv::dnn::readNetFromDarknet(vector_uchar bufferCfg, vector_uchar bufferModel = std::vector<uchar>())
  343. //
  344. //javadoc: readNetFromDarknet(bufferCfg, bufferModel)
  345. public static Net readNetFromDarknet(MatOfByte bufferCfg, MatOfByte bufferModel) {
  346. if (bufferCfg != null)
  347. bufferCfg.ThrowIfDisposed();
  348. if (bufferModel != null)
  349. bufferModel.ThrowIfDisposed();
  350. #if (UNITY_ANDROID && !UNITY_EDITOR)
  351. Mat bufferCfg_mat = bufferCfg;
  352. Mat bufferModel_mat = bufferModel;
  353. Net retVal = new Net(dnn_Dnn_readNetFromDarknet_12(bufferCfg_mat.nativeObj, bufferModel_mat.nativeObj));
  354. return retVal;
  355. #else
  356. return null;
  357. #endif
  358. }
  359. //javadoc: readNetFromDarknet(bufferCfg)
  360. public static Net readNetFromDarknet(MatOfByte bufferCfg) {
  361. if (bufferCfg != null)
  362. bufferCfg.ThrowIfDisposed();
  363. #if (UNITY_ANDROID && !UNITY_EDITOR)
  364. Mat bufferCfg_mat = bufferCfg;
  365. Net retVal = new Net(dnn_Dnn_readNetFromDarknet_13(bufferCfg_mat.nativeObj));
  366. return retVal;
  367. #else
  368. return null;
  369. #endif
  370. }
  371. //
  372. // C++: Net cv::dnn::readNetFromModelOptimizer(String xml, String bin)
  373. //
  374. //javadoc: readNetFromModelOptimizer(xml, bin)
  375. public static Net readNetFromModelOptimizer(string xml, string bin) {
  376. #if (UNITY_ANDROID && !UNITY_EDITOR)
  377. Net retVal = new Net(dnn_Dnn_readNetFromModelOptimizer_10(xml, bin));
  378. return retVal;
  379. #else
  380. return null;
  381. #endif
  382. }
  383. //
  384. // C++: Net cv::dnn::readNetFromONNX(String onnxFile)
  385. //
  386. //javadoc: readNetFromONNX(onnxFile)
  387. public static Net readNetFromONNX(string onnxFile) {
  388. #if (UNITY_ANDROID && !UNITY_EDITOR)
  389. Net retVal = new Net(dnn_Dnn_readNetFromONNX_10(onnxFile));
  390. return retVal;
  391. #else
  392. return null;
  393. #endif
  394. }
  395. //
  396. // C++: Net cv::dnn::readNetFromTensorflow(String model, String config = String())
  397. //
  398. //javadoc: readNetFromTensorflow(model, config)
  399. public static Net readNetFromTensorflow(string model, string config) {
  400. #if (UNITY_ANDROID && !UNITY_EDITOR)
  401. Net retVal = new Net(dnn_Dnn_readNetFromTensorflow_10(model, config));
  402. return retVal;
  403. #else
  404. return null;
  405. #endif
  406. }
  407. //javadoc: readNetFromTensorflow(model)
  408. public static Net readNetFromTensorflow(string model) {
  409. #if (UNITY_ANDROID && !UNITY_EDITOR)
  410. Net retVal = new Net(dnn_Dnn_readNetFromTensorflow_11(model));
  411. return retVal;
  412. #else
  413. return null;
  414. #endif
  415. }
  416. //
  417. // C++: Net cv::dnn::readNetFromTensorflow(vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
  418. //
  419. //javadoc: readNetFromTensorflow(bufferModel, bufferConfig)
  420. public static Net readNetFromTensorflow(MatOfByte bufferModel, MatOfByte bufferConfig) {
  421. if (bufferModel != null)
  422. bufferModel.ThrowIfDisposed();
  423. if (bufferConfig != null)
  424. bufferConfig.ThrowIfDisposed();
  425. #if (UNITY_ANDROID && !UNITY_EDITOR)
  426. Mat bufferModel_mat = bufferModel;
  427. Mat bufferConfig_mat = bufferConfig;
  428. Net retVal = new Net(dnn_Dnn_readNetFromTensorflow_12(bufferModel_mat.nativeObj, bufferConfig_mat.nativeObj));
  429. return retVal;
  430. #else
  431. return null;
  432. #endif
  433. }
  434. //javadoc: readNetFromTensorflow(bufferModel)
  435. public static Net readNetFromTensorflow(MatOfByte bufferModel) {
  436. if (bufferModel != null)
  437. bufferModel.ThrowIfDisposed();
  438. #if (UNITY_ANDROID && !UNITY_EDITOR)
  439. Mat bufferModel_mat = bufferModel;
  440. Net retVal = new Net(dnn_Dnn_readNetFromTensorflow_13(bufferModel_mat.nativeObj));
  441. return retVal;
  442. #else
  443. return null;
  444. #endif
  445. }
  446. //
  447. // C++: Net cv::dnn::readNetFromTorch(String model, bool isBinary = true)
  448. //
  449. //javadoc: readNetFromTorch(model, isBinary)
  450. public static Net readNetFromTorch(string model, bool isBinary) {
  451. #if (UNITY_ANDROID && !UNITY_EDITOR)
  452. Net retVal = new Net(dnn_Dnn_readNetFromTorch_10(model, isBinary));
  453. return retVal;
  454. #else
  455. return null;
  456. #endif
  457. }
  458. //javadoc: readNetFromTorch(model)
  459. public static Net readNetFromTorch(string model) {
  460. #if (UNITY_ANDROID && !UNITY_EDITOR)
  461. Net retVal = new Net(dnn_Dnn_readNetFromTorch_11(model));
  462. return retVal;
  463. #else
  464. return null;
  465. #endif
  466. }
  467. //
  468. // C++: void cv::dnn::NMSBoxes(vector_Rect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  469. //
  470. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
  471. public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k) {
  472. if (bboxes != null)
  473. bboxes.ThrowIfDisposed();
  474. if (scores != null)
  475. scores.ThrowIfDisposed();
  476. if (indices != null)
  477. indices.ThrowIfDisposed();
  478. #if (UNITY_ANDROID && !UNITY_EDITOR)
  479. Mat bboxes_mat = bboxes;
  480. Mat scores_mat = scores;
  481. Mat indices_mat = indices;
  482. dnn_Dnn_NMSBoxes_10(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
  483. return;
  484. #else
  485. return;
  486. #endif
  487. }
  488. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta)
  489. public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta) {
  490. if (bboxes != null)
  491. bboxes.ThrowIfDisposed();
  492. if (scores != null)
  493. scores.ThrowIfDisposed();
  494. if (indices != null)
  495. indices.ThrowIfDisposed();
  496. #if (UNITY_ANDROID && !UNITY_EDITOR)
  497. Mat bboxes_mat = bboxes;
  498. Mat scores_mat = scores;
  499. Mat indices_mat = indices;
  500. dnn_Dnn_NMSBoxes_11(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
  501. return;
  502. #else
  503. return;
  504. #endif
  505. }
  506. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices)
  507. public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices) {
  508. if (bboxes != null)
  509. bboxes.ThrowIfDisposed();
  510. if (scores != null)
  511. scores.ThrowIfDisposed();
  512. if (indices != null)
  513. indices.ThrowIfDisposed();
  514. #if (UNITY_ANDROID && !UNITY_EDITOR)
  515. Mat bboxes_mat = bboxes;
  516. Mat scores_mat = scores;
  517. Mat indices_mat = indices;
  518. dnn_Dnn_NMSBoxes_12(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
  519. return;
  520. #else
  521. return;
  522. #endif
  523. }
  524. //
  525. // C++: void cv::dnn::NMSBoxes(vector_Rect2d bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  526. //
  527. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
  528. public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k) {
  529. if (bboxes != null)
  530. bboxes.ThrowIfDisposed();
  531. if (scores != null)
  532. scores.ThrowIfDisposed();
  533. if (indices != null)
  534. indices.ThrowIfDisposed();
  535. #if (UNITY_ANDROID && !UNITY_EDITOR)
  536. Mat bboxes_mat = bboxes;
  537. Mat scores_mat = scores;
  538. Mat indices_mat = indices;
  539. dnn_Dnn_NMSBoxes_13(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
  540. return;
  541. #else
  542. return;
  543. #endif
  544. }
  545. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta)
  546. public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta) {
  547. if (bboxes != null)
  548. bboxes.ThrowIfDisposed();
  549. if (scores != null)
  550. scores.ThrowIfDisposed();
  551. if (indices != null)
  552. indices.ThrowIfDisposed();
  553. #if (UNITY_ANDROID && !UNITY_EDITOR)
  554. Mat bboxes_mat = bboxes;
  555. Mat scores_mat = scores;
  556. Mat indices_mat = indices;
  557. dnn_Dnn_NMSBoxes_14(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
  558. return;
  559. #else
  560. return;
  561. #endif
  562. }
  563. //javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices)
  564. public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices) {
  565. if (bboxes != null)
  566. bboxes.ThrowIfDisposed();
  567. if (scores != null)
  568. scores.ThrowIfDisposed();
  569. if (indices != null)
  570. indices.ThrowIfDisposed();
  571. #if (UNITY_ANDROID && !UNITY_EDITOR)
  572. Mat bboxes_mat = bboxes;
  573. Mat scores_mat = scores;
  574. Mat indices_mat = indices;
  575. dnn_Dnn_NMSBoxes_15(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
  576. return;
  577. #else
  578. return;
  579. #endif
  580. }
  581. //
  582. // C++: void cv::dnn::NMSBoxes(vector_RotatedRect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  583. //
  584. //javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
  585. public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k) {
  586. if (bboxes != null)
  587. bboxes.ThrowIfDisposed();
  588. if (scores != null)
  589. scores.ThrowIfDisposed();
  590. if (indices != null)
  591. indices.ThrowIfDisposed();
  592. #if (UNITY_ANDROID && !UNITY_EDITOR)
  593. Mat bboxes_mat = bboxes;
  594. Mat scores_mat = scores;
  595. Mat indices_mat = indices;
  596. dnn_Dnn_NMSBoxesRotated_10(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
  597. return;
  598. #else
  599. return;
  600. #endif
  601. }
  602. //javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices, eta)
  603. public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta) {
  604. if (bboxes != null)
  605. bboxes.ThrowIfDisposed();
  606. if (scores != null)
  607. scores.ThrowIfDisposed();
  608. if (indices != null)
  609. indices.ThrowIfDisposed();
  610. #if (UNITY_ANDROID && !UNITY_EDITOR)
  611. Mat bboxes_mat = bboxes;
  612. Mat scores_mat = scores;
  613. Mat indices_mat = indices;
  614. dnn_Dnn_NMSBoxesRotated_11(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
  615. return;
  616. #else
  617. return;
  618. #endif
  619. }
  620. //javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices)
  621. public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices) {
  622. if (bboxes != null)
  623. bboxes.ThrowIfDisposed();
  624. if (scores != null)
  625. scores.ThrowIfDisposed();
  626. if (indices != null)
  627. indices.ThrowIfDisposed();
  628. #if (UNITY_ANDROID && !UNITY_EDITOR)
  629. Mat bboxes_mat = bboxes;
  630. Mat scores_mat = scores;
  631. Mat indices_mat = indices;
  632. dnn_Dnn_NMSBoxesRotated_12(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
  633. return;
  634. #else
  635. return;
  636. #endif
  637. }
  638. //
  639. // C++: void cv::dnn::imagesFromBlob(Mat blob_, vector_Mat& images_)
  640. //
  641. //javadoc: imagesFromBlob(blob_, images_)
  642. public static void imagesFromBlob(Mat blob_, List<Mat> images_) {
  643. if (blob_ != null)
  644. blob_.ThrowIfDisposed();
  645. #if (UNITY_ANDROID && !UNITY_EDITOR)
  646. Mat images__mat = new Mat();
  647. dnn_Dnn_imagesFromBlob_10(blob_.nativeObj, images__mat.nativeObj);
  648. Converters.Mat_to_vector_Mat(images__mat, images_);
  649. images__mat.release();
  650. return;
  651. #else
  652. return;
  653. #endif
  654. }
  655. //
  656. // C++: void cv::dnn::resetMyriadDevice()
  657. //
  658. //javadoc: resetMyriadDevice()
  659. public static void resetMyriadDevice() {
  660. #if (UNITY_ANDROID && !UNITY_EDITOR)
  661. dnn_Dnn_resetMyriadDevice_10();
  662. return;
  663. #else
  664. return;
  665. #endif
  666. }
  667. //
  668. // C++: void cv::dnn::shrinkCaffeModel(String src, String dst, vector_String layersTypes = std::vector<String>())
  669. //
  670. //javadoc: shrinkCaffeModel(src, dst, layersTypes)
  671. public static void shrinkCaffeModel(string src, string dst, List<string> layersTypes) {
  672. #if (UNITY_ANDROID && !UNITY_EDITOR)
  673. Mat layersTypes_mat = Converters.vector_String_to_Mat(layersTypes);
  674. dnn_Dnn_shrinkCaffeModel_10(src, dst, layersTypes_mat.nativeObj);
  675. return;
  676. #else
  677. return;
  678. #endif
  679. }
  680. //javadoc: shrinkCaffeModel(src, dst)
  681. public static void shrinkCaffeModel(string src, string dst) {
  682. #if (UNITY_ANDROID && !UNITY_EDITOR)
  683. dnn_Dnn_shrinkCaffeModel_11(src, dst);
  684. return;
  685. #else
  686. return;
  687. #endif
  688. }
  689. //
  690. // C++: void cv::dnn::writeTextGraph(String model, String output)
  691. //
  692. //javadoc: writeTextGraph(model, output)
  693. public static void writeTextGraph(string model, string output) {
  694. #if (UNITY_ANDROID && !UNITY_EDITOR)
  695. dnn_Dnn_writeTextGraph_10(model, output);
  696. return;
  697. #else
  698. return;
  699. #endif
  700. }
  701. #if (UNITY_ANDROID && !UNITY_EDITOR)
  702. const string LIBNAME = "opencvforunity";
  703. // C++: Mat cv::dnn::blobFromImage(Mat image, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
  704. [DllImport(LIBNAME)]
  705. private static extern IntPtr dnn_Dnn_blobFromImage_10(IntPtr image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB, bool crop, int ddepth);
  706. [DllImport(LIBNAME)]
  707. private static extern IntPtr dnn_Dnn_blobFromImage_11(IntPtr image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB, bool crop);
  708. [DllImport(LIBNAME)]
  709. private static extern IntPtr dnn_Dnn_blobFromImage_12(IntPtr image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB);
  710. [DllImport(LIBNAME)]
  711. private static extern IntPtr dnn_Dnn_blobFromImage_13(IntPtr image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3);
  712. [DllImport(LIBNAME)]
  713. private static extern IntPtr dnn_Dnn_blobFromImage_14(IntPtr image_nativeObj, double scalefactor, double size_width, double size_height);
  714. [DllImport(LIBNAME)]
  715. private static extern IntPtr dnn_Dnn_blobFromImage_15(IntPtr image_nativeObj, double scalefactor);
  716. [DllImport(LIBNAME)]
  717. private static extern IntPtr dnn_Dnn_blobFromImage_16(IntPtr image_nativeObj);
  718. // C++: Mat cv::dnn::blobFromImages(vector_Mat images, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
  719. [DllImport(LIBNAME)]
  720. private static extern IntPtr dnn_Dnn_blobFromImages_10(IntPtr images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB, bool crop, int ddepth);
  721. [DllImport(LIBNAME)]
  722. private static extern IntPtr dnn_Dnn_blobFromImages_11(IntPtr images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB, bool crop);
  723. [DllImport(LIBNAME)]
  724. private static extern IntPtr dnn_Dnn_blobFromImages_12(IntPtr images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, bool swapRB);
  725. [DllImport(LIBNAME)]
  726. private static extern IntPtr dnn_Dnn_blobFromImages_13(IntPtr images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3);
  727. [DllImport(LIBNAME)]
  728. private static extern IntPtr dnn_Dnn_blobFromImages_14(IntPtr images_mat_nativeObj, double scalefactor, double size_width, double size_height);
  729. [DllImport(LIBNAME)]
  730. private static extern IntPtr dnn_Dnn_blobFromImages_15(IntPtr images_mat_nativeObj, double scalefactor);
  731. [DllImport(LIBNAME)]
  732. private static extern IntPtr dnn_Dnn_blobFromImages_16(IntPtr images_mat_nativeObj);
  733. // C++: Mat cv::dnn::readTensorFromONNX(String path)
  734. [DllImport(LIBNAME)]
  735. private static extern IntPtr dnn_Dnn_readTensorFromONNX_10(string path);
  736. // C++: Mat cv::dnn::readTorchBlob(String filename, bool isBinary = true)
  737. [DllImport(LIBNAME)]
  738. private static extern IntPtr dnn_Dnn_readTorchBlob_10(string filename, bool isBinary);
  739. [DllImport(LIBNAME)]
  740. private static extern IntPtr dnn_Dnn_readTorchBlob_11(string filename);
  741. // C++: Net cv::dnn::readNet(String framework, vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
  742. [DllImport(LIBNAME)]
  743. private static extern IntPtr dnn_Dnn_readNet_10(string framework, IntPtr bufferModel_mat_nativeObj, IntPtr bufferConfig_mat_nativeObj);
  744. [DllImport(LIBNAME)]
  745. private static extern IntPtr dnn_Dnn_readNet_11(string framework, IntPtr bufferModel_mat_nativeObj);
  746. // C++: Net cv::dnn::readNet(String model, String config = "", String framework = "")
  747. [DllImport(LIBNAME)]
  748. private static extern IntPtr dnn_Dnn_readNet_12(string model, string config, string framework);
  749. [DllImport(LIBNAME)]
  750. private static extern IntPtr dnn_Dnn_readNet_13(string model, string config);
  751. [DllImport(LIBNAME)]
  752. private static extern IntPtr dnn_Dnn_readNet_14(string model);
  753. // C++: Net cv::dnn::readNetFromCaffe(String prototxt, String caffeModel = String())
  754. [DllImport(LIBNAME)]
  755. private static extern IntPtr dnn_Dnn_readNetFromCaffe_10(string prototxt, string caffeModel);
  756. [DllImport(LIBNAME)]
  757. private static extern IntPtr dnn_Dnn_readNetFromCaffe_11(string prototxt);
  758. // C++: Net cv::dnn::readNetFromCaffe(vector_uchar bufferProto, vector_uchar bufferModel = std::vector<uchar>())
  759. [DllImport(LIBNAME)]
  760. private static extern IntPtr dnn_Dnn_readNetFromCaffe_12(IntPtr bufferProto_mat_nativeObj, IntPtr bufferModel_mat_nativeObj);
  761. [DllImport(LIBNAME)]
  762. private static extern IntPtr dnn_Dnn_readNetFromCaffe_13(IntPtr bufferProto_mat_nativeObj);
  763. // C++: Net cv::dnn::readNetFromDarknet(String cfgFile, String darknetModel = String())
  764. [DllImport(LIBNAME)]
  765. private static extern IntPtr dnn_Dnn_readNetFromDarknet_10(string cfgFile, string darknetModel);
  766. [DllImport(LIBNAME)]
  767. private static extern IntPtr dnn_Dnn_readNetFromDarknet_11(string cfgFile);
  768. // C++: Net cv::dnn::readNetFromDarknet(vector_uchar bufferCfg, vector_uchar bufferModel = std::vector<uchar>())
  769. [DllImport(LIBNAME)]
  770. private static extern IntPtr dnn_Dnn_readNetFromDarknet_12(IntPtr bufferCfg_mat_nativeObj, IntPtr bufferModel_mat_nativeObj);
  771. [DllImport(LIBNAME)]
  772. private static extern IntPtr dnn_Dnn_readNetFromDarknet_13(IntPtr bufferCfg_mat_nativeObj);
  773. // C++: Net cv::dnn::readNetFromModelOptimizer(String xml, String bin)
  774. [DllImport(LIBNAME)]
  775. private static extern IntPtr dnn_Dnn_readNetFromModelOptimizer_10(string xml, string bin);
  776. // C++: Net cv::dnn::readNetFromONNX(String onnxFile)
  777. [DllImport(LIBNAME)]
  778. private static extern IntPtr dnn_Dnn_readNetFromONNX_10(string onnxFile);
  779. // C++: Net cv::dnn::readNetFromTensorflow(String model, String config = String())
  780. [DllImport(LIBNAME)]
  781. private static extern IntPtr dnn_Dnn_readNetFromTensorflow_10(string model, string config);
  782. [DllImport(LIBNAME)]
  783. private static extern IntPtr dnn_Dnn_readNetFromTensorflow_11(string model);
  784. // C++: Net cv::dnn::readNetFromTensorflow(vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
  785. [DllImport(LIBNAME)]
  786. private static extern IntPtr dnn_Dnn_readNetFromTensorflow_12(IntPtr bufferModel_mat_nativeObj, IntPtr bufferConfig_mat_nativeObj);
  787. [DllImport(LIBNAME)]
  788. private static extern IntPtr dnn_Dnn_readNetFromTensorflow_13(IntPtr bufferModel_mat_nativeObj);
  789. // C++: Net cv::dnn::readNetFromTorch(String model, bool isBinary = true)
  790. [DllImport(LIBNAME)]
  791. private static extern IntPtr dnn_Dnn_readNetFromTorch_10(string model, bool isBinary);
  792. [DllImport(LIBNAME)]
  793. private static extern IntPtr dnn_Dnn_readNetFromTorch_11(string model);
  794. // C++: void cv::dnn::NMSBoxes(vector_Rect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  795. [DllImport(LIBNAME)]
  796. private static extern void dnn_Dnn_NMSBoxes_10(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta, int top_k);
  797. [DllImport(LIBNAME)]
  798. private static extern void dnn_Dnn_NMSBoxes_11(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta);
  799. [DllImport(LIBNAME)]
  800. private static extern void dnn_Dnn_NMSBoxes_12(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj);
  801. // C++: void cv::dnn::NMSBoxes(vector_Rect2d bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  802. [DllImport(LIBNAME)]
  803. private static extern void dnn_Dnn_NMSBoxes_13(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta, int top_k);
  804. [DllImport(LIBNAME)]
  805. private static extern void dnn_Dnn_NMSBoxes_14(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta);
  806. [DllImport(LIBNAME)]
  807. private static extern void dnn_Dnn_NMSBoxes_15(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj);
  808. // C++: void cv::dnn::NMSBoxes(vector_RotatedRect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
  809. [DllImport(LIBNAME)]
  810. private static extern void dnn_Dnn_NMSBoxesRotated_10(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta, int top_k);
  811. [DllImport(LIBNAME)]
  812. private static extern void dnn_Dnn_NMSBoxesRotated_11(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj, float eta);
  813. [DllImport(LIBNAME)]
  814. private static extern void dnn_Dnn_NMSBoxesRotated_12(IntPtr bboxes_mat_nativeObj, IntPtr scores_mat_nativeObj, float score_threshold, float nms_threshold, IntPtr indices_mat_nativeObj);
  815. // C++: void cv::dnn::imagesFromBlob(Mat blob_, vector_Mat& images_)
  816. [DllImport(LIBNAME)]
  817. private static extern void dnn_Dnn_imagesFromBlob_10(IntPtr blob__nativeObj, IntPtr images__mat_nativeObj);
  818. // C++: void cv::dnn::resetMyriadDevice()
  819. [DllImport(LIBNAME)]
  820. private static extern void dnn_Dnn_resetMyriadDevice_10();
  821. // C++: void cv::dnn::shrinkCaffeModel(String src, String dst, vector_String layersTypes = std::vector<String>())
  822. [DllImport(LIBNAME)]
  823. private static extern void dnn_Dnn_shrinkCaffeModel_10(string src, string dst, IntPtr layersTypes_mat_nativeObj);
  824. [DllImport(LIBNAME)]
  825. private static extern void dnn_Dnn_shrinkCaffeModel_11(string src, string dst);
  826. // C++: void cv::dnn::writeTextGraph(String model, String output)
  827. [DllImport(LIBNAME)]
  828. private static extern void dnn_Dnn_writeTextGraph_10(string model, string output);
  829. #endif
  830. }
  831. }
  832. #endif