Xphoto.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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.XphotoModule {
  8. // C++: class Xphoto
  9. //javadoc: Xphoto
  10. public class Xphoto {
  11. // C++: enum InpaintTypes
  12. public const int INPAINT_SHIFTMAP = 0;
  13. // C++: enum Bm3dSteps
  14. public const int BM3D_STEPALL = 0;
  15. public const int BM3D_STEP1 = 1;
  16. public const int BM3D_STEP2 = 2;
  17. // C++: enum TransformTypes
  18. public const int HAAR = 0;
  19. //
  20. // C++: Ptr_GrayworldWB cv::xphoto::createGrayworldWB()
  21. //
  22. //javadoc: createGrayworldWB()
  23. public static GrayworldWB createGrayworldWB() {
  24. #if (UNITY_ANDROID && !UNITY_EDITOR)
  25. GrayworldWB retVal = GrayworldWB.__fromPtr__(xphoto_Xphoto_createGrayworldWB_10());
  26. return retVal;
  27. #else
  28. return null;
  29. #endif
  30. }
  31. //
  32. // C++: Ptr_LearningBasedWB cv::xphoto::createLearningBasedWB(String path_to_model = String())
  33. //
  34. //javadoc: createLearningBasedWB(path_to_model)
  35. public static LearningBasedWB createLearningBasedWB(string path_to_model) {
  36. #if (UNITY_ANDROID && !UNITY_EDITOR)
  37. LearningBasedWB retVal = LearningBasedWB.__fromPtr__(xphoto_Xphoto_createLearningBasedWB_10(path_to_model));
  38. return retVal;
  39. #else
  40. return null;
  41. #endif
  42. }
  43. //javadoc: createLearningBasedWB()
  44. public static LearningBasedWB createLearningBasedWB() {
  45. #if (UNITY_ANDROID && !UNITY_EDITOR)
  46. LearningBasedWB retVal = LearningBasedWB.__fromPtr__(xphoto_Xphoto_createLearningBasedWB_11());
  47. return retVal;
  48. #else
  49. return null;
  50. #endif
  51. }
  52. //
  53. // C++: Ptr_SimpleWB cv::xphoto::createSimpleWB()
  54. //
  55. //javadoc: createSimpleWB()
  56. public static SimpleWB createSimpleWB() {
  57. #if (UNITY_ANDROID && !UNITY_EDITOR)
  58. SimpleWB retVal = SimpleWB.__fromPtr__(xphoto_Xphoto_createSimpleWB_10());
  59. return retVal;
  60. #else
  61. return null;
  62. #endif
  63. }
  64. //
  65. // C++: void cv::xphoto::applyChannelGains(Mat src, Mat& dst, float gainB, float gainG, float gainR)
  66. //
  67. //javadoc: applyChannelGains(src, dst, gainB, gainG, gainR)
  68. public static void applyChannelGains(Mat src, Mat dst, float gainB, float gainG, float gainR) {
  69. if (src != null) src.ThrowIfDisposed();
  70. if (dst != null) dst.ThrowIfDisposed();
  71. #if (UNITY_ANDROID && !UNITY_EDITOR)
  72. xphoto_Xphoto_applyChannelGains_10(src.nativeObj, dst.nativeObj, gainB, gainG, gainR);
  73. return;
  74. #else
  75. return;
  76. #endif
  77. }
  78. //
  79. // C++: void cv::xphoto::bm3dDenoising(Mat src, Mat& dst, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2.0f, int normType = cv::NORM_L2, int step = cv::xphoto::BM3D_STEPALL, int transformType = cv::xphoto::HAAR)
  80. //
  81. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType)
  82. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step, int transformType) {
  83. if (src != null) src.ThrowIfDisposed();
  84. if (dst != null) dst.ThrowIfDisposed();
  85. #if (UNITY_ANDROID && !UNITY_EDITOR)
  86. xphoto_Xphoto_bm3dDenoising_10(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType);
  87. return;
  88. #else
  89. return;
  90. #endif
  91. }
  92. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step)
  93. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step) {
  94. if (src != null) src.ThrowIfDisposed();
  95. if (dst != null) dst.ThrowIfDisposed();
  96. #if (UNITY_ANDROID && !UNITY_EDITOR)
  97. xphoto_Xphoto_bm3dDenoising_11(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step);
  98. return;
  99. #else
  100. return;
  101. #endif
  102. }
  103. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType)
  104. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType) {
  105. if (src != null) src.ThrowIfDisposed();
  106. if (dst != null) dst.ThrowIfDisposed();
  107. #if (UNITY_ANDROID && !UNITY_EDITOR)
  108. xphoto_Xphoto_bm3dDenoising_12(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType);
  109. return;
  110. #else
  111. return;
  112. #endif
  113. }
  114. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta)
  115. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta) {
  116. if (src != null) src.ThrowIfDisposed();
  117. if (dst != null) dst.ThrowIfDisposed();
  118. #if (UNITY_ANDROID && !UNITY_EDITOR)
  119. xphoto_Xphoto_bm3dDenoising_13(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta);
  120. return;
  121. #else
  122. return;
  123. #endif
  124. }
  125. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep)
  126. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep) {
  127. if (src != null) src.ThrowIfDisposed();
  128. if (dst != null) dst.ThrowIfDisposed();
  129. #if (UNITY_ANDROID && !UNITY_EDITOR)
  130. xphoto_Xphoto_bm3dDenoising_14(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep);
  131. return;
  132. #else
  133. return;
  134. #endif
  135. }
  136. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize)
  137. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize) {
  138. if (src != null) src.ThrowIfDisposed();
  139. if (dst != null) dst.ThrowIfDisposed();
  140. #if (UNITY_ANDROID && !UNITY_EDITOR)
  141. xphoto_Xphoto_bm3dDenoising_15(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize);
  142. return;
  143. #else
  144. return;
  145. #endif
  146. }
  147. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2)
  148. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2) {
  149. if (src != null) src.ThrowIfDisposed();
  150. if (dst != null) dst.ThrowIfDisposed();
  151. #if (UNITY_ANDROID && !UNITY_EDITOR)
  152. xphoto_Xphoto_bm3dDenoising_16(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2);
  153. return;
  154. #else
  155. return;
  156. #endif
  157. }
  158. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize, blockMatchingStep1)
  159. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1) {
  160. if (src != null) src.ThrowIfDisposed();
  161. if (dst != null) dst.ThrowIfDisposed();
  162. #if (UNITY_ANDROID && !UNITY_EDITOR)
  163. xphoto_Xphoto_bm3dDenoising_17(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1);
  164. return;
  165. #else
  166. return;
  167. #endif
  168. }
  169. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize, searchWindowSize)
  170. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize) {
  171. if (src != null) src.ThrowIfDisposed();
  172. if (dst != null) dst.ThrowIfDisposed();
  173. #if (UNITY_ANDROID && !UNITY_EDITOR)
  174. xphoto_Xphoto_bm3dDenoising_18(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize);
  175. return;
  176. #else
  177. return;
  178. #endif
  179. }
  180. //javadoc: bm3dDenoising(src, dst, h, templateWindowSize)
  181. public static void bm3dDenoising(Mat src, Mat dst, float h, int templateWindowSize) {
  182. if (src != null) src.ThrowIfDisposed();
  183. if (dst != null) dst.ThrowIfDisposed();
  184. #if (UNITY_ANDROID && !UNITY_EDITOR)
  185. xphoto_Xphoto_bm3dDenoising_19(src.nativeObj, dst.nativeObj, h, templateWindowSize);
  186. return;
  187. #else
  188. return;
  189. #endif
  190. }
  191. //javadoc: bm3dDenoising(src, dst, h)
  192. public static void bm3dDenoising(Mat src, Mat dst, float h) {
  193. if (src != null) src.ThrowIfDisposed();
  194. if (dst != null) dst.ThrowIfDisposed();
  195. #if (UNITY_ANDROID && !UNITY_EDITOR)
  196. xphoto_Xphoto_bm3dDenoising_110(src.nativeObj, dst.nativeObj, h);
  197. return;
  198. #else
  199. return;
  200. #endif
  201. }
  202. //javadoc: bm3dDenoising(src, dst)
  203. public static void bm3dDenoising(Mat src, Mat dst) {
  204. if (src != null) src.ThrowIfDisposed();
  205. if (dst != null) dst.ThrowIfDisposed();
  206. #if (UNITY_ANDROID && !UNITY_EDITOR)
  207. xphoto_Xphoto_bm3dDenoising_111(src.nativeObj, dst.nativeObj);
  208. return;
  209. #else
  210. return;
  211. #endif
  212. }
  213. //
  214. // C++: void cv::xphoto::bm3dDenoising(Mat src, Mat& dstStep1, Mat& dstStep2, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2.0f, int normType = cv::NORM_L2, int step = cv::xphoto::BM3D_STEPALL, int transformType = cv::xphoto::HAAR)
  215. //
  216. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType)
  217. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step, int transformType) {
  218. if (src != null) src.ThrowIfDisposed();
  219. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  220. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  221. #if (UNITY_ANDROID && !UNITY_EDITOR)
  222. xphoto_Xphoto_bm3dDenoising_112(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step, transformType);
  223. return;
  224. #else
  225. return;
  226. #endif
  227. }
  228. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step)
  229. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step) {
  230. if (src != null) src.ThrowIfDisposed();
  231. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  232. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  233. #if (UNITY_ANDROID && !UNITY_EDITOR)
  234. xphoto_Xphoto_bm3dDenoising_113(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType, step);
  235. return;
  236. #else
  237. return;
  238. #endif
  239. }
  240. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType)
  241. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType) {
  242. if (src != null) src.ThrowIfDisposed();
  243. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  244. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  245. #if (UNITY_ANDROID && !UNITY_EDITOR)
  246. xphoto_Xphoto_bm3dDenoising_114(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta, normType);
  247. return;
  248. #else
  249. return;
  250. #endif
  251. }
  252. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta)
  253. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta) {
  254. if (src != null) src.ThrowIfDisposed();
  255. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  256. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  257. #if (UNITY_ANDROID && !UNITY_EDITOR)
  258. xphoto_Xphoto_bm3dDenoising_115(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep, beta);
  259. return;
  260. #else
  261. return;
  262. #endif
  263. }
  264. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep)
  265. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep) {
  266. if (src != null) src.ThrowIfDisposed();
  267. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  268. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  269. #if (UNITY_ANDROID && !UNITY_EDITOR)
  270. xphoto_Xphoto_bm3dDenoising_116(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize, slidingStep);
  271. return;
  272. #else
  273. return;
  274. #endif
  275. }
  276. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize)
  277. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize) {
  278. if (src != null) src.ThrowIfDisposed();
  279. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  280. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  281. #if (UNITY_ANDROID && !UNITY_EDITOR)
  282. xphoto_Xphoto_bm3dDenoising_117(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2, groupSize);
  283. return;
  284. #else
  285. return;
  286. #endif
  287. }
  288. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2)
  289. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2) {
  290. if (src != null) src.ThrowIfDisposed();
  291. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  292. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  293. #if (UNITY_ANDROID && !UNITY_EDITOR)
  294. xphoto_Xphoto_bm3dDenoising_118(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1, blockMatchingStep2);
  295. return;
  296. #else
  297. return;
  298. #endif
  299. }
  300. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize, blockMatchingStep1)
  301. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1) {
  302. if (src != null) src.ThrowIfDisposed();
  303. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  304. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  305. #if (UNITY_ANDROID && !UNITY_EDITOR)
  306. xphoto_Xphoto_bm3dDenoising_119(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize, blockMatchingStep1);
  307. return;
  308. #else
  309. return;
  310. #endif
  311. }
  312. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize, searchWindowSize)
  313. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize, int searchWindowSize) {
  314. if (src != null) src.ThrowIfDisposed();
  315. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  316. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  317. #if (UNITY_ANDROID && !UNITY_EDITOR)
  318. xphoto_Xphoto_bm3dDenoising_120(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize, searchWindowSize);
  319. return;
  320. #else
  321. return;
  322. #endif
  323. }
  324. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h, templateWindowSize)
  325. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h, int templateWindowSize) {
  326. if (src != null) src.ThrowIfDisposed();
  327. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  328. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  329. #if (UNITY_ANDROID && !UNITY_EDITOR)
  330. xphoto_Xphoto_bm3dDenoising_121(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h, templateWindowSize);
  331. return;
  332. #else
  333. return;
  334. #endif
  335. }
  336. //javadoc: bm3dDenoising(src, dstStep1, dstStep2, h)
  337. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2, float h) {
  338. if (src != null) src.ThrowIfDisposed();
  339. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  340. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  341. #if (UNITY_ANDROID && !UNITY_EDITOR)
  342. xphoto_Xphoto_bm3dDenoising_122(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj, h);
  343. return;
  344. #else
  345. return;
  346. #endif
  347. }
  348. //javadoc: bm3dDenoising(src, dstStep1, dstStep2)
  349. public static void bm3dDenoising(Mat src, Mat dstStep1, Mat dstStep2) {
  350. if (src != null) src.ThrowIfDisposed();
  351. if (dstStep1 != null) dstStep1.ThrowIfDisposed();
  352. if (dstStep2 != null) dstStep2.ThrowIfDisposed();
  353. #if (UNITY_ANDROID && !UNITY_EDITOR)
  354. xphoto_Xphoto_bm3dDenoising_123(src.nativeObj, dstStep1.nativeObj, dstStep2.nativeObj);
  355. return;
  356. #else
  357. return;
  358. #endif
  359. }
  360. //
  361. // C++: void cv::xphoto::dctDenoising(Mat src, Mat dst, double sigma, int psize = 16)
  362. //
  363. //javadoc: dctDenoising(src, dst, sigma, psize)
  364. public static void dctDenoising(Mat src, Mat dst, double sigma, int psize) {
  365. if (src != null) src.ThrowIfDisposed();
  366. if (dst != null) dst.ThrowIfDisposed();
  367. #if (UNITY_ANDROID && !UNITY_EDITOR)
  368. xphoto_Xphoto_dctDenoising_10(src.nativeObj, dst.nativeObj, sigma, psize);
  369. return;
  370. #else
  371. return;
  372. #endif
  373. }
  374. //javadoc: dctDenoising(src, dst, sigma)
  375. public static void dctDenoising(Mat src, Mat dst, double sigma) {
  376. if (src != null) src.ThrowIfDisposed();
  377. if (dst != null) dst.ThrowIfDisposed();
  378. #if (UNITY_ANDROID && !UNITY_EDITOR)
  379. xphoto_Xphoto_dctDenoising_11(src.nativeObj, dst.nativeObj, sigma);
  380. return;
  381. #else
  382. return;
  383. #endif
  384. }
  385. //
  386. // C++: void cv::xphoto::inpaint(Mat src, Mat mask, Mat dst, int algorithmType)
  387. //
  388. //javadoc: inpaint(src, mask, dst, algorithmType)
  389. public static void inpaint(Mat src, Mat mask, Mat dst, int algorithmType) {
  390. if (src != null) src.ThrowIfDisposed();
  391. if (mask != null) mask.ThrowIfDisposed();
  392. if (dst != null) dst.ThrowIfDisposed();
  393. #if (UNITY_ANDROID && !UNITY_EDITOR)
  394. xphoto_Xphoto_inpaint_10(src.nativeObj, mask.nativeObj, dst.nativeObj, algorithmType);
  395. return;
  396. #else
  397. return;
  398. #endif
  399. }
  400. //
  401. // C++: void cv::xphoto::oilPainting(Mat src, Mat& dst, int size, int dynRatio, int code)
  402. //
  403. //javadoc: oilPainting(src, dst, size, dynRatio, code)
  404. public static void oilPainting(Mat src, Mat dst, int size, int dynRatio, int code) {
  405. if (src != null) src.ThrowIfDisposed();
  406. if (dst != null) dst.ThrowIfDisposed();
  407. #if (UNITY_ANDROID && !UNITY_EDITOR)
  408. xphoto_Xphoto_oilPainting_10(src.nativeObj, dst.nativeObj, size, dynRatio, code);
  409. return;
  410. #else
  411. return;
  412. #endif
  413. }
  414. //
  415. // C++: void cv::xphoto::oilPainting(Mat src, Mat& dst, int size, int dynRatio)
  416. //
  417. //javadoc: oilPainting(src, dst, size, dynRatio)
  418. public static void oilPainting(Mat src, Mat dst, int size, int dynRatio) {
  419. if (src != null) src.ThrowIfDisposed();
  420. if (dst != null) dst.ThrowIfDisposed();
  421. #if (UNITY_ANDROID && !UNITY_EDITOR)
  422. xphoto_Xphoto_oilPainting_11(src.nativeObj, dst.nativeObj, size, dynRatio);
  423. return;
  424. #else
  425. return;
  426. #endif
  427. }
  428. #if (UNITY_ANDROID && !UNITY_EDITOR)
  429. const string LIBNAME = "opencvforunity";
  430. // C++: Ptr_GrayworldWB cv::xphoto::createGrayworldWB()
  431. [DllImport(LIBNAME)]
  432. private static extern IntPtr xphoto_Xphoto_createGrayworldWB_10();
  433. // C++: Ptr_LearningBasedWB cv::xphoto::createLearningBasedWB(String path_to_model = String())
  434. [DllImport(LIBNAME)]
  435. private static extern IntPtr xphoto_Xphoto_createLearningBasedWB_10(string path_to_model);
  436. [DllImport(LIBNAME)]
  437. private static extern IntPtr xphoto_Xphoto_createLearningBasedWB_11();
  438. // C++: Ptr_SimpleWB cv::xphoto::createSimpleWB()
  439. [DllImport(LIBNAME)]
  440. private static extern IntPtr xphoto_Xphoto_createSimpleWB_10();
  441. // C++: void cv::xphoto::applyChannelGains(Mat src, Mat& dst, float gainB, float gainG, float gainR)
  442. [DllImport(LIBNAME)]
  443. private static extern void xphoto_Xphoto_applyChannelGains_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float gainB, float gainG, float gainR);
  444. // C++: void cv::xphoto::bm3dDenoising(Mat src, Mat& dst, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2.0f, int normType = cv::NORM_L2, int step = cv::xphoto::BM3D_STEPALL, int transformType = cv::xphoto::HAAR)
  445. [DllImport(LIBNAME)]
  446. private static extern void xphoto_Xphoto_bm3dDenoising_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step, int transformType);
  447. [DllImport(LIBNAME)]
  448. private static extern void xphoto_Xphoto_bm3dDenoising_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step);
  449. [DllImport(LIBNAME)]
  450. private static extern void xphoto_Xphoto_bm3dDenoising_12(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType);
  451. [DllImport(LIBNAME)]
  452. private static extern void xphoto_Xphoto_bm3dDenoising_13(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta);
  453. [DllImport(LIBNAME)]
  454. private static extern void xphoto_Xphoto_bm3dDenoising_14(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep);
  455. [DllImport(LIBNAME)]
  456. private static extern void xphoto_Xphoto_bm3dDenoising_15(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize);
  457. [DllImport(LIBNAME)]
  458. private static extern void xphoto_Xphoto_bm3dDenoising_16(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2);
  459. [DllImport(LIBNAME)]
  460. private static extern void xphoto_Xphoto_bm3dDenoising_17(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1);
  461. [DllImport(LIBNAME)]
  462. private static extern void xphoto_Xphoto_bm3dDenoising_18(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize);
  463. [DllImport(LIBNAME)]
  464. private static extern void xphoto_Xphoto_bm3dDenoising_19(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize);
  465. [DllImport(LIBNAME)]
  466. private static extern void xphoto_Xphoto_bm3dDenoising_110(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h);
  467. [DllImport(LIBNAME)]
  468. private static extern void xphoto_Xphoto_bm3dDenoising_111(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  469. // C++: void cv::xphoto::bm3dDenoising(Mat src, Mat& dstStep1, Mat& dstStep2, float h = 1, int templateWindowSize = 4, int searchWindowSize = 16, int blockMatchingStep1 = 2500, int blockMatchingStep2 = 400, int groupSize = 8, int slidingStep = 1, float beta = 2.0f, int normType = cv::NORM_L2, int step = cv::xphoto::BM3D_STEPALL, int transformType = cv::xphoto::HAAR)
  470. [DllImport(LIBNAME)]
  471. private static extern void xphoto_Xphoto_bm3dDenoising_112(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step, int transformType);
  472. [DllImport(LIBNAME)]
  473. private static extern void xphoto_Xphoto_bm3dDenoising_113(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType, int step);
  474. [DllImport(LIBNAME)]
  475. private static extern void xphoto_Xphoto_bm3dDenoising_114(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta, int normType);
  476. [DllImport(LIBNAME)]
  477. private static extern void xphoto_Xphoto_bm3dDenoising_115(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep, float beta);
  478. [DllImport(LIBNAME)]
  479. private static extern void xphoto_Xphoto_bm3dDenoising_116(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize, int slidingStep);
  480. [DllImport(LIBNAME)]
  481. private static extern void xphoto_Xphoto_bm3dDenoising_117(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2, int groupSize);
  482. [DllImport(LIBNAME)]
  483. private static extern void xphoto_Xphoto_bm3dDenoising_118(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1, int blockMatchingStep2);
  484. [DllImport(LIBNAME)]
  485. private static extern void xphoto_Xphoto_bm3dDenoising_119(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize, int blockMatchingStep1);
  486. [DllImport(LIBNAME)]
  487. private static extern void xphoto_Xphoto_bm3dDenoising_120(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize, int searchWindowSize);
  488. [DllImport(LIBNAME)]
  489. private static extern void xphoto_Xphoto_bm3dDenoising_121(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h, int templateWindowSize);
  490. [DllImport(LIBNAME)]
  491. private static extern void xphoto_Xphoto_bm3dDenoising_122(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj, float h);
  492. [DllImport(LIBNAME)]
  493. private static extern void xphoto_Xphoto_bm3dDenoising_123(IntPtr src_nativeObj, IntPtr dstStep1_nativeObj, IntPtr dstStep2_nativeObj);
  494. // C++: void cv::xphoto::dctDenoising(Mat src, Mat dst, double sigma, int psize = 16)
  495. [DllImport(LIBNAME)]
  496. private static extern void xphoto_Xphoto_dctDenoising_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, double sigma, int psize);
  497. [DllImport(LIBNAME)]
  498. private static extern void xphoto_Xphoto_dctDenoising_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, double sigma);
  499. // C++: void cv::xphoto::inpaint(Mat src, Mat mask, Mat dst, int algorithmType)
  500. [DllImport(LIBNAME)]
  501. private static extern void xphoto_Xphoto_inpaint_10(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, int algorithmType);
  502. // C++: void cv::xphoto::oilPainting(Mat src, Mat& dst, int size, int dynRatio, int code)
  503. [DllImport(LIBNAME)]
  504. private static extern void xphoto_Xphoto_oilPainting_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, int size, int dynRatio, int code);
  505. // C++: void cv::xphoto::oilPainting(Mat src, Mat& dst, int size, int dynRatio)
  506. [DllImport(LIBNAME)]
  507. private static extern void xphoto_Xphoto_oilPainting_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, int size, int dynRatio);
  508. #endif
  509. }
  510. }