Photo.cs 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.PhotoModule
  7. {
  8. // C++: class Photo
  9. public class Photo
  10. {
  11. // C++: enum <unnamed>
  12. public const int INPAINT_NS = 0;
  13. public const int INPAINT_TELEA = 1;
  14. public const int LDR_SIZE = 256;
  15. public const int NORMAL_CLONE = 1;
  16. public const int MIXED_CLONE = 2;
  17. public const int MONOCHROME_TRANSFER = 3;
  18. public const int RECURS_FILTER = 1;
  19. public const int NORMCONV_FILTER = 2;
  20. //
  21. // C++: void cv::inpaint(Mat src, Mat inpaintMask, Mat& dst, double inpaintRadius, int flags)
  22. //
  23. /**
  24. * Restores the selected region in an image using the region neighborhood.
  25. *
  26. * param src Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.
  27. * param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that
  28. * needs to be inpainted.
  29. * param dst Output image with the same size and type as src .
  30. * param inpaintRadius Radius of a circular neighborhood of each point inpainted that is considered
  31. * by the algorithm.
  32. * param flags Inpainting method that could be cv::INPAINT_NS or cv::INPAINT_TELEA
  33. *
  34. * The function reconstructs the selected image area from the pixel near the area boundary. The
  35. * function may be used to remove dust and scratches from a scanned photo, or to remove undesirable
  36. * objects from still images or video. See &lt;http://en.wikipedia.org/wiki/Inpainting&gt; for more details.
  37. *
  38. * <b>Note:</b>
  39. * <ul>
  40. * <li>
  41. * An example using the inpainting technique can be found at
  42. * opencv_source_code/samples/cpp/inpaint.cpp
  43. * </li>
  44. * <li>
  45. * (Python) An example using the inpainting technique can be found at
  46. * opencv_source_code/samples/python/inpaint.py
  47. * </li>
  48. * </ul>
  49. */
  50. public static void inpaint(Mat src, Mat inpaintMask, Mat dst, double inpaintRadius, int flags)
  51. {
  52. if (src != null) src.ThrowIfDisposed();
  53. if (inpaintMask != null) inpaintMask.ThrowIfDisposed();
  54. if (dst != null) dst.ThrowIfDisposed();
  55. photo_Photo_inpaint_10(src.nativeObj, inpaintMask.nativeObj, dst.nativeObj, inpaintRadius, flags);
  56. }
  57. //
  58. // C++: void cv::fastNlMeansDenoising(Mat src, Mat& dst, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  59. //
  60. /**
  61. * Perform image denoising using Non-local Means Denoising algorithm
  62. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  63. * optimizations. Noise expected to be a gaussian white noise
  64. *
  65. * param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
  66. * param dst Output image with the same size and type as src .
  67. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  68. * Should be odd. Recommended value 7 pixels
  69. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  70. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  71. * denoising time. Recommended value 21 pixels
  72. * param h Parameter regulating filter strength. Big h value perfectly removes noise but also
  73. * removes image details, smaller h value preserves details but also preserves some noise
  74. *
  75. * This function expected to be applied to grayscale images. For colored images look at
  76. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  77. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  78. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  79. * parameter.
  80. */
  81. public static void fastNlMeansDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize)
  82. {
  83. if (src != null) src.ThrowIfDisposed();
  84. if (dst != null) dst.ThrowIfDisposed();
  85. photo_Photo_fastNlMeansDenoising_10(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize);
  86. }
  87. /**
  88. * Perform image denoising using Non-local Means Denoising algorithm
  89. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  90. * optimizations. Noise expected to be a gaussian white noise
  91. *
  92. * param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
  93. * param dst Output image with the same size and type as src .
  94. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  95. * Should be odd. Recommended value 7 pixels
  96. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  97. * denoising time. Recommended value 21 pixels
  98. * param h Parameter regulating filter strength. Big h value perfectly removes noise but also
  99. * removes image details, smaller h value preserves details but also preserves some noise
  100. *
  101. * This function expected to be applied to grayscale images. For colored images look at
  102. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  103. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  104. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  105. * parameter.
  106. */
  107. public static void fastNlMeansDenoising(Mat src, Mat dst, float h, int templateWindowSize)
  108. {
  109. if (src != null) src.ThrowIfDisposed();
  110. if (dst != null) dst.ThrowIfDisposed();
  111. photo_Photo_fastNlMeansDenoising_11(src.nativeObj, dst.nativeObj, h, templateWindowSize);
  112. }
  113. /**
  114. * Perform image denoising using Non-local Means Denoising algorithm
  115. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  116. * optimizations. Noise expected to be a gaussian white noise
  117. *
  118. * param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
  119. * param dst Output image with the same size and type as src .
  120. * Should be odd. Recommended value 7 pixels
  121. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  122. * denoising time. Recommended value 21 pixels
  123. * param h Parameter regulating filter strength. Big h value perfectly removes noise but also
  124. * removes image details, smaller h value preserves details but also preserves some noise
  125. *
  126. * This function expected to be applied to grayscale images. For colored images look at
  127. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  128. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  129. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  130. * parameter.
  131. */
  132. public static void fastNlMeansDenoising(Mat src, Mat dst, float h)
  133. {
  134. if (src != null) src.ThrowIfDisposed();
  135. if (dst != null) dst.ThrowIfDisposed();
  136. photo_Photo_fastNlMeansDenoising_12(src.nativeObj, dst.nativeObj, h);
  137. }
  138. /**
  139. * Perform image denoising using Non-local Means Denoising algorithm
  140. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  141. * optimizations. Noise expected to be a gaussian white noise
  142. *
  143. * param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
  144. * param dst Output image with the same size and type as src .
  145. * Should be odd. Recommended value 7 pixels
  146. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  147. * denoising time. Recommended value 21 pixels
  148. * removes image details, smaller h value preserves details but also preserves some noise
  149. *
  150. * This function expected to be applied to grayscale images. For colored images look at
  151. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  152. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  153. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  154. * parameter.
  155. */
  156. public static void fastNlMeansDenoising(Mat src, Mat dst)
  157. {
  158. if (src != null) src.ThrowIfDisposed();
  159. if (dst != null) dst.ThrowIfDisposed();
  160. photo_Photo_fastNlMeansDenoising_13(src.nativeObj, dst.nativeObj);
  161. }
  162. //
  163. // C++: void cv::fastNlMeansDenoising(Mat src, Mat& dst, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2)
  164. //
  165. /**
  166. * Perform image denoising using Non-local Means Denoising algorithm
  167. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  168. * optimizations. Noise expected to be a gaussian white noise
  169. *
  170. * param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  171. * 2-channel, 3-channel or 4-channel image.
  172. * param dst Output image with the same size and type as src .
  173. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  174. * Should be odd. Recommended value 7 pixels
  175. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  176. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  177. * denoising time. Recommended value 21 pixels
  178. * param h Array of parameters regulating filter strength, either one
  179. * parameter applied to all channels or one per channel in dst. Big h value
  180. * perfectly removes noise but also removes image details, smaller h
  181. * value preserves details but also preserves some noise
  182. * param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
  183. *
  184. * This function expected to be applied to grayscale images. For colored images look at
  185. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  186. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  187. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  188. * parameter.
  189. */
  190. public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType)
  191. {
  192. if (src != null) src.ThrowIfDisposed();
  193. if (dst != null) dst.ThrowIfDisposed();
  194. if (h != null) h.ThrowIfDisposed();
  195. Mat h_mat = h;
  196. photo_Photo_fastNlMeansDenoising_14(src.nativeObj, dst.nativeObj, h_mat.nativeObj, templateWindowSize, searchWindowSize, normType);
  197. }
  198. /**
  199. * Perform image denoising using Non-local Means Denoising algorithm
  200. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  201. * optimizations. Noise expected to be a gaussian white noise
  202. *
  203. * param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  204. * 2-channel, 3-channel or 4-channel image.
  205. * param dst Output image with the same size and type as src .
  206. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  207. * Should be odd. Recommended value 7 pixels
  208. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  209. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  210. * denoising time. Recommended value 21 pixels
  211. * param h Array of parameters regulating filter strength, either one
  212. * parameter applied to all channels or one per channel in dst. Big h value
  213. * perfectly removes noise but also removes image details, smaller h
  214. * value preserves details but also preserves some noise
  215. *
  216. * This function expected to be applied to grayscale images. For colored images look at
  217. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  218. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  219. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  220. * parameter.
  221. */
  222. public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize, int searchWindowSize)
  223. {
  224. if (src != null) src.ThrowIfDisposed();
  225. if (dst != null) dst.ThrowIfDisposed();
  226. if (h != null) h.ThrowIfDisposed();
  227. Mat h_mat = h;
  228. photo_Photo_fastNlMeansDenoising_15(src.nativeObj, dst.nativeObj, h_mat.nativeObj, templateWindowSize, searchWindowSize);
  229. }
  230. /**
  231. * Perform image denoising using Non-local Means Denoising algorithm
  232. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  233. * optimizations. Noise expected to be a gaussian white noise
  234. *
  235. * param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  236. * 2-channel, 3-channel or 4-channel image.
  237. * param dst Output image with the same size and type as src .
  238. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  239. * Should be odd. Recommended value 7 pixels
  240. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  241. * denoising time. Recommended value 21 pixels
  242. * param h Array of parameters regulating filter strength, either one
  243. * parameter applied to all channels or one per channel in dst. Big h value
  244. * perfectly removes noise but also removes image details, smaller h
  245. * value preserves details but also preserves some noise
  246. *
  247. * This function expected to be applied to grayscale images. For colored images look at
  248. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  249. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  250. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  251. * parameter.
  252. */
  253. public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize)
  254. {
  255. if (src != null) src.ThrowIfDisposed();
  256. if (dst != null) dst.ThrowIfDisposed();
  257. if (h != null) h.ThrowIfDisposed();
  258. Mat h_mat = h;
  259. photo_Photo_fastNlMeansDenoising_16(src.nativeObj, dst.nativeObj, h_mat.nativeObj, templateWindowSize);
  260. }
  261. /**
  262. * Perform image denoising using Non-local Means Denoising algorithm
  263. * &lt;http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/&gt; with several computational
  264. * optimizations. Noise expected to be a gaussian white noise
  265. *
  266. * param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  267. * 2-channel, 3-channel or 4-channel image.
  268. * param dst Output image with the same size and type as src .
  269. * Should be odd. Recommended value 7 pixels
  270. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  271. * denoising time. Recommended value 21 pixels
  272. * param h Array of parameters regulating filter strength, either one
  273. * parameter applied to all channels or one per channel in dst. Big h value
  274. * perfectly removes noise but also removes image details, smaller h
  275. * value preserves details but also preserves some noise
  276. *
  277. * This function expected to be applied to grayscale images. For colored images look at
  278. * fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
  279. * image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
  280. * image to CIELAB colorspace and then separately denoise L and AB components with different h
  281. * parameter.
  282. */
  283. public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h)
  284. {
  285. if (src != null) src.ThrowIfDisposed();
  286. if (dst != null) dst.ThrowIfDisposed();
  287. if (h != null) h.ThrowIfDisposed();
  288. Mat h_mat = h;
  289. photo_Photo_fastNlMeansDenoising_17(src.nativeObj, dst.nativeObj, h_mat.nativeObj);
  290. }
  291. //
  292. // C++: void cv::fastNlMeansDenoisingColored(Mat src, Mat& dst, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  293. //
  294. /**
  295. * Modification of fastNlMeansDenoising function for colored images
  296. *
  297. * param src Input 8-bit 3-channel image.
  298. * param dst Output image with the same size and type as src .
  299. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  300. * Should be odd. Recommended value 7 pixels
  301. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  302. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  303. * denoising time. Recommended value 21 pixels
  304. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  305. * removes noise but also removes image details, smaller h value preserves details but also preserves
  306. * some noise
  307. * param hColor The same as h but for color components. For most images value equals 10
  308. * will be enough to remove colored noise and do not distort colors
  309. *
  310. * The function converts image to CIELAB colorspace and then separately denoise L and AB components
  311. * with given h parameters using fastNlMeansDenoising function.
  312. */
  313. public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize)
  314. {
  315. if (src != null) src.ThrowIfDisposed();
  316. if (dst != null) dst.ThrowIfDisposed();
  317. photo_Photo_fastNlMeansDenoisingColored_10(src.nativeObj, dst.nativeObj, h, hColor, templateWindowSize, searchWindowSize);
  318. }
  319. /**
  320. * Modification of fastNlMeansDenoising function for colored images
  321. *
  322. * param src Input 8-bit 3-channel image.
  323. * param dst Output image with the same size and type as src .
  324. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  325. * Should be odd. Recommended value 7 pixels
  326. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  327. * denoising time. Recommended value 21 pixels
  328. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  329. * removes noise but also removes image details, smaller h value preserves details but also preserves
  330. * some noise
  331. * param hColor The same as h but for color components. For most images value equals 10
  332. * will be enough to remove colored noise and do not distort colors
  333. *
  334. * The function converts image to CIELAB colorspace and then separately denoise L and AB components
  335. * with given h parameters using fastNlMeansDenoising function.
  336. */
  337. public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor, int templateWindowSize)
  338. {
  339. if (src != null) src.ThrowIfDisposed();
  340. if (dst != null) dst.ThrowIfDisposed();
  341. photo_Photo_fastNlMeansDenoisingColored_11(src.nativeObj, dst.nativeObj, h, hColor, templateWindowSize);
  342. }
  343. /**
  344. * Modification of fastNlMeansDenoising function for colored images
  345. *
  346. * param src Input 8-bit 3-channel image.
  347. * param dst Output image with the same size and type as src .
  348. * Should be odd. Recommended value 7 pixels
  349. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  350. * denoising time. Recommended value 21 pixels
  351. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  352. * removes noise but also removes image details, smaller h value preserves details but also preserves
  353. * some noise
  354. * param hColor The same as h but for color components. For most images value equals 10
  355. * will be enough to remove colored noise and do not distort colors
  356. *
  357. * The function converts image to CIELAB colorspace and then separately denoise L and AB components
  358. * with given h parameters using fastNlMeansDenoising function.
  359. */
  360. public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor)
  361. {
  362. if (src != null) src.ThrowIfDisposed();
  363. if (dst != null) dst.ThrowIfDisposed();
  364. photo_Photo_fastNlMeansDenoisingColored_12(src.nativeObj, dst.nativeObj, h, hColor);
  365. }
  366. /**
  367. * Modification of fastNlMeansDenoising function for colored images
  368. *
  369. * param src Input 8-bit 3-channel image.
  370. * param dst Output image with the same size and type as src .
  371. * Should be odd. Recommended value 7 pixels
  372. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  373. * denoising time. Recommended value 21 pixels
  374. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  375. * removes noise but also removes image details, smaller h value preserves details but also preserves
  376. * some noise
  377. * will be enough to remove colored noise and do not distort colors
  378. *
  379. * The function converts image to CIELAB colorspace and then separately denoise L and AB components
  380. * with given h parameters using fastNlMeansDenoising function.
  381. */
  382. public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h)
  383. {
  384. if (src != null) src.ThrowIfDisposed();
  385. if (dst != null) dst.ThrowIfDisposed();
  386. photo_Photo_fastNlMeansDenoisingColored_13(src.nativeObj, dst.nativeObj, h);
  387. }
  388. /**
  389. * Modification of fastNlMeansDenoising function for colored images
  390. *
  391. * param src Input 8-bit 3-channel image.
  392. * param dst Output image with the same size and type as src .
  393. * Should be odd. Recommended value 7 pixels
  394. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  395. * denoising time. Recommended value 21 pixels
  396. * removes noise but also removes image details, smaller h value preserves details but also preserves
  397. * some noise
  398. * will be enough to remove colored noise and do not distort colors
  399. *
  400. * The function converts image to CIELAB colorspace and then separately denoise L and AB components
  401. * with given h parameters using fastNlMeansDenoising function.
  402. */
  403. public static void fastNlMeansDenoisingColored(Mat src, Mat dst)
  404. {
  405. if (src != null) src.ThrowIfDisposed();
  406. if (dst != null) dst.ThrowIfDisposed();
  407. photo_Photo_fastNlMeansDenoisingColored_14(src.nativeObj, dst.nativeObj);
  408. }
  409. //
  410. // C++: void cv::fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  411. //
  412. /**
  413. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  414. * captured in small period of time. For example video. This version of the function is for grayscale
  415. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  416. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  417. *
  418. * param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or
  419. * 4-channel images sequence. All images should have the same type and
  420. * size.
  421. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  422. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  423. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  424. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  425. * srcImgs[imgToDenoiseIndex] image.
  426. * param dst Output image with the same size and type as srcImgs images.
  427. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  428. * Should be odd. Recommended value 7 pixels
  429. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  430. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  431. * denoising time. Recommended value 21 pixels
  432. * param h Parameter regulating filter strength. Bigger h value
  433. * perfectly removes noise but also removes image details, smaller h
  434. * value preserves details but also preserves some noise
  435. */
  436. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize)
  437. {
  438. if (dst != null) dst.ThrowIfDisposed();
  439. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  440. photo_Photo_fastNlMeansDenoisingMulti_10(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize);
  441. }
  442. /**
  443. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  444. * captured in small period of time. For example video. This version of the function is for grayscale
  445. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  446. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  447. *
  448. * param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or
  449. * 4-channel images sequence. All images should have the same type and
  450. * size.
  451. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  452. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  453. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  454. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  455. * srcImgs[imgToDenoiseIndex] image.
  456. * param dst Output image with the same size and type as srcImgs images.
  457. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  458. * Should be odd. Recommended value 7 pixels
  459. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  460. * denoising time. Recommended value 21 pixels
  461. * param h Parameter regulating filter strength. Bigger h value
  462. * perfectly removes noise but also removes image details, smaller h
  463. * value preserves details but also preserves some noise
  464. */
  465. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize)
  466. {
  467. if (dst != null) dst.ThrowIfDisposed();
  468. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  469. photo_Photo_fastNlMeansDenoisingMulti_11(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize);
  470. }
  471. /**
  472. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  473. * captured in small period of time. For example video. This version of the function is for grayscale
  474. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  475. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  476. *
  477. * param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or
  478. * 4-channel images sequence. All images should have the same type and
  479. * size.
  480. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  481. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  482. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  483. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  484. * srcImgs[imgToDenoiseIndex] image.
  485. * param dst Output image with the same size and type as srcImgs images.
  486. * Should be odd. Recommended value 7 pixels
  487. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  488. * denoising time. Recommended value 21 pixels
  489. * param h Parameter regulating filter strength. Bigger h value
  490. * perfectly removes noise but also removes image details, smaller h
  491. * value preserves details but also preserves some noise
  492. */
  493. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h)
  494. {
  495. if (dst != null) dst.ThrowIfDisposed();
  496. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  497. photo_Photo_fastNlMeansDenoisingMulti_12(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h);
  498. }
  499. /**
  500. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  501. * captured in small period of time. For example video. This version of the function is for grayscale
  502. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  503. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  504. *
  505. * param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or
  506. * 4-channel images sequence. All images should have the same type and
  507. * size.
  508. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  509. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  510. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  511. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  512. * srcImgs[imgToDenoiseIndex] image.
  513. * param dst Output image with the same size and type as srcImgs images.
  514. * Should be odd. Recommended value 7 pixels
  515. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  516. * denoising time. Recommended value 21 pixels
  517. * perfectly removes noise but also removes image details, smaller h
  518. * value preserves details but also preserves some noise
  519. */
  520. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize)
  521. {
  522. if (dst != null) dst.ThrowIfDisposed();
  523. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  524. photo_Photo_fastNlMeansDenoisingMulti_13(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize);
  525. }
  526. //
  527. // C++: void cv::fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2)
  528. //
  529. /**
  530. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  531. * captured in small period of time. For example video. This version of the function is for grayscale
  532. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  533. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  534. *
  535. * param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  536. * 2-channel, 3-channel or 4-channel images sequence. All images should
  537. * have the same type and size.
  538. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  539. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  540. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  541. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  542. * srcImgs[imgToDenoiseIndex] image.
  543. * param dst Output image with the same size and type as srcImgs images.
  544. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  545. * Should be odd. Recommended value 7 pixels
  546. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  547. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  548. * denoising time. Recommended value 21 pixels
  549. * param h Array of parameters regulating filter strength, either one
  550. * parameter applied to all channels or one per channel in dst. Big h value
  551. * perfectly removes noise but also removes image details, smaller h
  552. * value preserves details but also preserves some noise
  553. * param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
  554. */
  555. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType)
  556. {
  557. if (dst != null) dst.ThrowIfDisposed();
  558. if (h != null) h.ThrowIfDisposed();
  559. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  560. Mat h_mat = h;
  561. photo_Photo_fastNlMeansDenoisingMulti_14(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj, templateWindowSize, searchWindowSize, normType);
  562. }
  563. /**
  564. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  565. * captured in small period of time. For example video. This version of the function is for grayscale
  566. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  567. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  568. *
  569. * param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  570. * 2-channel, 3-channel or 4-channel images sequence. All images should
  571. * have the same type and size.
  572. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  573. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  574. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  575. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  576. * srcImgs[imgToDenoiseIndex] image.
  577. * param dst Output image with the same size and type as srcImgs images.
  578. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  579. * Should be odd. Recommended value 7 pixels
  580. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  581. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  582. * denoising time. Recommended value 21 pixels
  583. * param h Array of parameters regulating filter strength, either one
  584. * parameter applied to all channels or one per channel in dst. Big h value
  585. * perfectly removes noise but also removes image details, smaller h
  586. * value preserves details but also preserves some noise
  587. */
  588. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize, int searchWindowSize)
  589. {
  590. if (dst != null) dst.ThrowIfDisposed();
  591. if (h != null) h.ThrowIfDisposed();
  592. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  593. Mat h_mat = h;
  594. photo_Photo_fastNlMeansDenoisingMulti_15(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj, templateWindowSize, searchWindowSize);
  595. }
  596. /**
  597. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  598. * captured in small period of time. For example video. This version of the function is for grayscale
  599. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  600. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  601. *
  602. * param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  603. * 2-channel, 3-channel or 4-channel images sequence. All images should
  604. * have the same type and size.
  605. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  606. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  607. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  608. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  609. * srcImgs[imgToDenoiseIndex] image.
  610. * param dst Output image with the same size and type as srcImgs images.
  611. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  612. * Should be odd. Recommended value 7 pixels
  613. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  614. * denoising time. Recommended value 21 pixels
  615. * param h Array of parameters regulating filter strength, either one
  616. * parameter applied to all channels or one per channel in dst. Big h value
  617. * perfectly removes noise but also removes image details, smaller h
  618. * value preserves details but also preserves some noise
  619. */
  620. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize)
  621. {
  622. if (dst != null) dst.ThrowIfDisposed();
  623. if (h != null) h.ThrowIfDisposed();
  624. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  625. Mat h_mat = h;
  626. photo_Photo_fastNlMeansDenoisingMulti_16(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj, templateWindowSize);
  627. }
  628. /**
  629. * Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
  630. * captured in small period of time. For example video. This version of the function is for grayscale
  631. * images or for manual manipulation with colorspaces. See CITE: Buades2005DenoisingIS for more details
  632. * (open access [here](https://static.aminer.org/pdf/PDF/000/317/196/spatio_temporal_wiener_filtering_of_image_sequences_using_a_parametric.pdf)).
  633. *
  634. * param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
  635. * 2-channel, 3-channel or 4-channel images sequence. All images should
  636. * have the same type and size.
  637. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  638. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  639. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  640. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  641. * srcImgs[imgToDenoiseIndex] image.
  642. * param dst Output image with the same size and type as srcImgs images.
  643. * Should be odd. Recommended value 7 pixels
  644. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  645. * denoising time. Recommended value 21 pixels
  646. * param h Array of parameters regulating filter strength, either one
  647. * parameter applied to all channels or one per channel in dst. Big h value
  648. * perfectly removes noise but also removes image details, smaller h
  649. * value preserves details but also preserves some noise
  650. */
  651. public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h)
  652. {
  653. if (dst != null) dst.ThrowIfDisposed();
  654. if (h != null) h.ThrowIfDisposed();
  655. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  656. Mat h_mat = h;
  657. photo_Photo_fastNlMeansDenoisingMulti_17(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj);
  658. }
  659. //
  660. // C++: void cv::fastNlMeansDenoisingColoredMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  661. //
  662. /**
  663. * Modification of fastNlMeansDenoisingMulti function for colored images sequences
  664. *
  665. * param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
  666. * size.
  667. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  668. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  669. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  670. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  671. * srcImgs[imgToDenoiseIndex] image.
  672. * param dst Output image with the same size and type as srcImgs images.
  673. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  674. * Should be odd. Recommended value 7 pixels
  675. * param searchWindowSize Size in pixels of the window that is used to compute weighted average for
  676. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  677. * denoising time. Recommended value 21 pixels
  678. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  679. * removes noise but also removes image details, smaller h value preserves details but also preserves
  680. * some noise.
  681. * param hColor The same as h but for color components.
  682. *
  683. * The function converts images to CIELAB colorspace and then separately denoise L and AB components
  684. * with given h parameters using fastNlMeansDenoisingMulti function.
  685. */
  686. public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize)
  687. {
  688. if (dst != null) dst.ThrowIfDisposed();
  689. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  690. photo_Photo_fastNlMeansDenoisingColoredMulti_10(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, hColor, templateWindowSize, searchWindowSize);
  691. }
  692. /**
  693. * Modification of fastNlMeansDenoisingMulti function for colored images sequences
  694. *
  695. * param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
  696. * size.
  697. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  698. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  699. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  700. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  701. * srcImgs[imgToDenoiseIndex] image.
  702. * param dst Output image with the same size and type as srcImgs images.
  703. * param templateWindowSize Size in pixels of the template patch that is used to compute weights.
  704. * Should be odd. Recommended value 7 pixels
  705. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  706. * denoising time. Recommended value 21 pixels
  707. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  708. * removes noise but also removes image details, smaller h value preserves details but also preserves
  709. * some noise.
  710. * param hColor The same as h but for color components.
  711. *
  712. * The function converts images to CIELAB colorspace and then separately denoise L and AB components
  713. * with given h parameters using fastNlMeansDenoisingMulti function.
  714. */
  715. public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize)
  716. {
  717. if (dst != null) dst.ThrowIfDisposed();
  718. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  719. photo_Photo_fastNlMeansDenoisingColoredMulti_11(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, hColor, templateWindowSize);
  720. }
  721. /**
  722. * Modification of fastNlMeansDenoisingMulti function for colored images sequences
  723. *
  724. * param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
  725. * size.
  726. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  727. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  728. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  729. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  730. * srcImgs[imgToDenoiseIndex] image.
  731. * param dst Output image with the same size and type as srcImgs images.
  732. * Should be odd. Recommended value 7 pixels
  733. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  734. * denoising time. Recommended value 21 pixels
  735. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  736. * removes noise but also removes image details, smaller h value preserves details but also preserves
  737. * some noise.
  738. * param hColor The same as h but for color components.
  739. *
  740. * The function converts images to CIELAB colorspace and then separately denoise L and AB components
  741. * with given h parameters using fastNlMeansDenoisingMulti function.
  742. */
  743. public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor)
  744. {
  745. if (dst != null) dst.ThrowIfDisposed();
  746. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  747. photo_Photo_fastNlMeansDenoisingColoredMulti_12(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, hColor);
  748. }
  749. /**
  750. * Modification of fastNlMeansDenoisingMulti function for colored images sequences
  751. *
  752. * param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
  753. * size.
  754. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  755. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  756. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  757. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  758. * srcImgs[imgToDenoiseIndex] image.
  759. * param dst Output image with the same size and type as srcImgs images.
  760. * Should be odd. Recommended value 7 pixels
  761. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  762. * denoising time. Recommended value 21 pixels
  763. * param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
  764. * removes noise but also removes image details, smaller h value preserves details but also preserves
  765. * some noise.
  766. *
  767. * The function converts images to CIELAB colorspace and then separately denoise L and AB components
  768. * with given h parameters using fastNlMeansDenoisingMulti function.
  769. */
  770. public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h)
  771. {
  772. if (dst != null) dst.ThrowIfDisposed();
  773. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  774. photo_Photo_fastNlMeansDenoisingColoredMulti_13(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h);
  775. }
  776. /**
  777. * Modification of fastNlMeansDenoisingMulti function for colored images sequences
  778. *
  779. * param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
  780. * size.
  781. * param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
  782. * param temporalWindowSize Number of surrounding images to use for target image denoising. Should
  783. * be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
  784. * imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
  785. * srcImgs[imgToDenoiseIndex] image.
  786. * param dst Output image with the same size and type as srcImgs images.
  787. * Should be odd. Recommended value 7 pixels
  788. * given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
  789. * denoising time. Recommended value 21 pixels
  790. * removes noise but also removes image details, smaller h value preserves details but also preserves
  791. * some noise.
  792. *
  793. * The function converts images to CIELAB colorspace and then separately denoise L and AB components
  794. * with given h parameters using fastNlMeansDenoisingMulti function.
  795. */
  796. public static void fastNlMeansDenoisingColoredMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize)
  797. {
  798. if (dst != null) dst.ThrowIfDisposed();
  799. Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
  800. photo_Photo_fastNlMeansDenoisingColoredMulti_14(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize);
  801. }
  802. //
  803. // C++: void cv::denoise_TVL1(vector_Mat observations, Mat result, double lambda = 1.0, int niters = 30)
  804. //
  805. /**
  806. * Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
  807. * finding a function to minimize some functional). As the image denoising, in particular, may be seen
  808. * as the variational problem, primal-dual algorithm then can be used to perform denoising and this is
  809. * exactly what is implemented.
  810. *
  811. * It should be noted, that this implementation was taken from the July 2013 blog entry
  812. * CITE: MA13 , which also contained (slightly more general) ready-to-use source code on Python.
  813. * Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end
  814. * of July 2013 and finally it was slightly adapted by later authors.
  815. *
  816. * Although the thorough discussion and justification of the algorithm involved may be found in
  817. * CITE: ChambolleEtAl, it might make sense to skim over it here, following CITE: MA13 . To begin
  818. * with, we consider the 1-byte gray-level images as the functions from the rectangular domain of
  819. * pixels (it may be seen as set
  820. * \(\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}\) for some
  821. * \(m,\;n\in\mathbb{N}\)) into \(\{0,1,\dots,255\}\). We shall denote the noised images as \(f_i\) and with
  822. * this view, given some image \(x\) of the same size, we may measure how bad it is by the formula
  823. *
  824. * \(\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|\)
  825. *
  826. * \(\|\|\cdot\|\|\) here denotes \(L_2\)-norm and as you see, the first addend states that we want our
  827. * image to be smooth (ideally, having zero gradient, thus being constant) and the second states that
  828. * we want our result to be close to the observations we've got. If we treat \(x\) as a function, this is
  829. * exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play.
  830. *
  831. * param observations This array should contain one or more noised versions of the image that is to
  832. * be restored.
  833. * param result Here the denoised image will be stored. There is no need to do pre-allocation of
  834. * storage space, as it will be automatically allocated, if necessary.
  835. * param lambda Corresponds to \(\lambda\) in the formulas above. As it is enlarged, the smooth
  836. * (blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
  837. * speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
  838. * removed.
  839. * param niters Number of iterations that the algorithm will run. Of course, as more iterations as
  840. * better, but it is hard to quantitatively refine this statement, so just use the default and
  841. * increase it if the results are poor.
  842. */
  843. public static void denoise_TVL1(List<Mat> observations, Mat result, double lambda, int niters)
  844. {
  845. if (result != null) result.ThrowIfDisposed();
  846. Mat observations_mat = Converters.vector_Mat_to_Mat(observations);
  847. photo_Photo_denoise_1TVL1_10(observations_mat.nativeObj, result.nativeObj, lambda, niters);
  848. }
  849. /**
  850. * Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
  851. * finding a function to minimize some functional). As the image denoising, in particular, may be seen
  852. * as the variational problem, primal-dual algorithm then can be used to perform denoising and this is
  853. * exactly what is implemented.
  854. *
  855. * It should be noted, that this implementation was taken from the July 2013 blog entry
  856. * CITE: MA13 , which also contained (slightly more general) ready-to-use source code on Python.
  857. * Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end
  858. * of July 2013 and finally it was slightly adapted by later authors.
  859. *
  860. * Although the thorough discussion and justification of the algorithm involved may be found in
  861. * CITE: ChambolleEtAl, it might make sense to skim over it here, following CITE: MA13 . To begin
  862. * with, we consider the 1-byte gray-level images as the functions from the rectangular domain of
  863. * pixels (it may be seen as set
  864. * \(\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}\) for some
  865. * \(m,\;n\in\mathbb{N}\)) into \(\{0,1,\dots,255\}\). We shall denote the noised images as \(f_i\) and with
  866. * this view, given some image \(x\) of the same size, we may measure how bad it is by the formula
  867. *
  868. * \(\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|\)
  869. *
  870. * \(\|\|\cdot\|\|\) here denotes \(L_2\)-norm and as you see, the first addend states that we want our
  871. * image to be smooth (ideally, having zero gradient, thus being constant) and the second states that
  872. * we want our result to be close to the observations we've got. If we treat \(x\) as a function, this is
  873. * exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play.
  874. *
  875. * param observations This array should contain one or more noised versions of the image that is to
  876. * be restored.
  877. * param result Here the denoised image will be stored. There is no need to do pre-allocation of
  878. * storage space, as it will be automatically allocated, if necessary.
  879. * param lambda Corresponds to \(\lambda\) in the formulas above. As it is enlarged, the smooth
  880. * (blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
  881. * speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
  882. * removed.
  883. * better, but it is hard to quantitatively refine this statement, so just use the default and
  884. * increase it if the results are poor.
  885. */
  886. public static void denoise_TVL1(List<Mat> observations, Mat result, double lambda)
  887. {
  888. if (result != null) result.ThrowIfDisposed();
  889. Mat observations_mat = Converters.vector_Mat_to_Mat(observations);
  890. photo_Photo_denoise_1TVL1_11(observations_mat.nativeObj, result.nativeObj, lambda);
  891. }
  892. /**
  893. * Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
  894. * finding a function to minimize some functional). As the image denoising, in particular, may be seen
  895. * as the variational problem, primal-dual algorithm then can be used to perform denoising and this is
  896. * exactly what is implemented.
  897. *
  898. * It should be noted, that this implementation was taken from the July 2013 blog entry
  899. * CITE: MA13 , which also contained (slightly more general) ready-to-use source code on Python.
  900. * Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end
  901. * of July 2013 and finally it was slightly adapted by later authors.
  902. *
  903. * Although the thorough discussion and justification of the algorithm involved may be found in
  904. * CITE: ChambolleEtAl, it might make sense to skim over it here, following CITE: MA13 . To begin
  905. * with, we consider the 1-byte gray-level images as the functions from the rectangular domain of
  906. * pixels (it may be seen as set
  907. * \(\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}\) for some
  908. * \(m,\;n\in\mathbb{N}\)) into \(\{0,1,\dots,255\}\). We shall denote the noised images as \(f_i\) and with
  909. * this view, given some image \(x\) of the same size, we may measure how bad it is by the formula
  910. *
  911. * \(\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|\)
  912. *
  913. * \(\|\|\cdot\|\|\) here denotes \(L_2\)-norm and as you see, the first addend states that we want our
  914. * image to be smooth (ideally, having zero gradient, thus being constant) and the second states that
  915. * we want our result to be close to the observations we've got. If we treat \(x\) as a function, this is
  916. * exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play.
  917. *
  918. * param observations This array should contain one or more noised versions of the image that is to
  919. * be restored.
  920. * param result Here the denoised image will be stored. There is no need to do pre-allocation of
  921. * storage space, as it will be automatically allocated, if necessary.
  922. * (blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
  923. * speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
  924. * removed.
  925. * better, but it is hard to quantitatively refine this statement, so just use the default and
  926. * increase it if the results are poor.
  927. */
  928. public static void denoise_TVL1(List<Mat> observations, Mat result)
  929. {
  930. if (result != null) result.ThrowIfDisposed();
  931. Mat observations_mat = Converters.vector_Mat_to_Mat(observations);
  932. photo_Photo_denoise_1TVL1_12(observations_mat.nativeObj, result.nativeObj);
  933. }
  934. //
  935. // C++: Ptr_Tonemap cv::createTonemap(float gamma = 1.0f)
  936. //
  937. /**
  938. * Creates simple linear mapper with gamma correction
  939. *
  940. * param gamma positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma
  941. * equal to 2.2f is suitable for most displays.
  942. * Generally gamma &gt; 1 brightens the image and gamma &lt; 1 darkens it.
  943. * return automatically generated
  944. */
  945. public static Tonemap createTonemap(float gamma)
  946. {
  947. return Tonemap.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemap_10(gamma)));
  948. }
  949. /**
  950. * Creates simple linear mapper with gamma correction
  951. *
  952. * equal to 2.2f is suitable for most displays.
  953. * Generally gamma &gt; 1 brightens the image and gamma &lt; 1 darkens it.
  954. * return automatically generated
  955. */
  956. public static Tonemap createTonemap()
  957. {
  958. return Tonemap.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemap_11()));
  959. }
  960. //
  961. // C++: Ptr_TonemapDrago cv::createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f)
  962. //
  963. /**
  964. * Creates TonemapDrago object
  965. *
  966. * param gamma gamma value for gamma correction. See createTonemap
  967. * param saturation positive saturation enhancement value. 1.0 preserves saturation, values greater
  968. * than 1 increase saturation and values less than 1 decrease it.
  969. * param bias value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best
  970. * results, default value is 0.85.
  971. * return automatically generated
  972. */
  973. public static TonemapDrago createTonemapDrago(float gamma, float saturation, float bias)
  974. {
  975. return TonemapDrago.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapDrago_10(gamma, saturation, bias)));
  976. }
  977. /**
  978. * Creates TonemapDrago object
  979. *
  980. * param gamma gamma value for gamma correction. See createTonemap
  981. * param saturation positive saturation enhancement value. 1.0 preserves saturation, values greater
  982. * than 1 increase saturation and values less than 1 decrease it.
  983. * results, default value is 0.85.
  984. * return automatically generated
  985. */
  986. public static TonemapDrago createTonemapDrago(float gamma, float saturation)
  987. {
  988. return TonemapDrago.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapDrago_11(gamma, saturation)));
  989. }
  990. /**
  991. * Creates TonemapDrago object
  992. *
  993. * param gamma gamma value for gamma correction. See createTonemap
  994. * than 1 increase saturation and values less than 1 decrease it.
  995. * results, default value is 0.85.
  996. * return automatically generated
  997. */
  998. public static TonemapDrago createTonemapDrago(float gamma)
  999. {
  1000. return TonemapDrago.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapDrago_12(gamma)));
  1001. }
  1002. /**
  1003. * Creates TonemapDrago object
  1004. *
  1005. * than 1 increase saturation and values less than 1 decrease it.
  1006. * results, default value is 0.85.
  1007. * return automatically generated
  1008. */
  1009. public static TonemapDrago createTonemapDrago()
  1010. {
  1011. return TonemapDrago.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapDrago_13()));
  1012. }
  1013. //
  1014. // C++: Ptr_TonemapReinhard cv::createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f)
  1015. //
  1016. /**
  1017. * Creates TonemapReinhard object
  1018. *
  1019. * param gamma gamma value for gamma correction. See createTonemap
  1020. * param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results.
  1021. * param light_adapt light adaptation in [0, 1] range. If 1 adaptation is based only on pixel
  1022. * value, if 0 it's global, otherwise it's a weighted mean of this two cases.
  1023. * param color_adapt chromatic adaptation in [0, 1] range. If 1 channels are treated independently,
  1024. * if 0 adaptation level is the same for each channel.
  1025. * return automatically generated
  1026. */
  1027. public static TonemapReinhard createTonemapReinhard(float gamma, float intensity, float light_adapt, float color_adapt)
  1028. {
  1029. return TonemapReinhard.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapReinhard_10(gamma, intensity, light_adapt, color_adapt)));
  1030. }
  1031. /**
  1032. * Creates TonemapReinhard object
  1033. *
  1034. * param gamma gamma value for gamma correction. See createTonemap
  1035. * param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results.
  1036. * param light_adapt light adaptation in [0, 1] range. If 1 adaptation is based only on pixel
  1037. * value, if 0 it's global, otherwise it's a weighted mean of this two cases.
  1038. * if 0 adaptation level is the same for each channel.
  1039. * return automatically generated
  1040. */
  1041. public static TonemapReinhard createTonemapReinhard(float gamma, float intensity, float light_adapt)
  1042. {
  1043. return TonemapReinhard.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapReinhard_11(gamma, intensity, light_adapt)));
  1044. }
  1045. /**
  1046. * Creates TonemapReinhard object
  1047. *
  1048. * param gamma gamma value for gamma correction. See createTonemap
  1049. * param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results.
  1050. * value, if 0 it's global, otherwise it's a weighted mean of this two cases.
  1051. * if 0 adaptation level is the same for each channel.
  1052. * return automatically generated
  1053. */
  1054. public static TonemapReinhard createTonemapReinhard(float gamma, float intensity)
  1055. {
  1056. return TonemapReinhard.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapReinhard_12(gamma, intensity)));
  1057. }
  1058. /**
  1059. * Creates TonemapReinhard object
  1060. *
  1061. * param gamma gamma value for gamma correction. See createTonemap
  1062. * value, if 0 it's global, otherwise it's a weighted mean of this two cases.
  1063. * if 0 adaptation level is the same for each channel.
  1064. * return automatically generated
  1065. */
  1066. public static TonemapReinhard createTonemapReinhard(float gamma)
  1067. {
  1068. return TonemapReinhard.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapReinhard_13(gamma)));
  1069. }
  1070. /**
  1071. * Creates TonemapReinhard object
  1072. *
  1073. * value, if 0 it's global, otherwise it's a weighted mean of this two cases.
  1074. * if 0 adaptation level is the same for each channel.
  1075. * return automatically generated
  1076. */
  1077. public static TonemapReinhard createTonemapReinhard()
  1078. {
  1079. return TonemapReinhard.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapReinhard_14()));
  1080. }
  1081. //
  1082. // C++: Ptr_TonemapMantiuk cv::createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f)
  1083. //
  1084. /**
  1085. * Creates TonemapMantiuk object
  1086. *
  1087. * param gamma gamma value for gamma correction. See createTonemap
  1088. * param scale contrast scale factor. HVS response is multiplied by this parameter, thus compressing
  1089. * dynamic range. Values from 0.6 to 0.9 produce best results.
  1090. * param saturation saturation enhancement value. See createTonemapDrago
  1091. * return automatically generated
  1092. */
  1093. public static TonemapMantiuk createTonemapMantiuk(float gamma, float scale, float saturation)
  1094. {
  1095. return TonemapMantiuk.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapMantiuk_10(gamma, scale, saturation)));
  1096. }
  1097. /**
  1098. * Creates TonemapMantiuk object
  1099. *
  1100. * param gamma gamma value for gamma correction. See createTonemap
  1101. * param scale contrast scale factor. HVS response is multiplied by this parameter, thus compressing
  1102. * dynamic range. Values from 0.6 to 0.9 produce best results.
  1103. * return automatically generated
  1104. */
  1105. public static TonemapMantiuk createTonemapMantiuk(float gamma, float scale)
  1106. {
  1107. return TonemapMantiuk.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapMantiuk_11(gamma, scale)));
  1108. }
  1109. /**
  1110. * Creates TonemapMantiuk object
  1111. *
  1112. * param gamma gamma value for gamma correction. See createTonemap
  1113. * dynamic range. Values from 0.6 to 0.9 produce best results.
  1114. * return automatically generated
  1115. */
  1116. public static TonemapMantiuk createTonemapMantiuk(float gamma)
  1117. {
  1118. return TonemapMantiuk.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapMantiuk_12(gamma)));
  1119. }
  1120. /**
  1121. * Creates TonemapMantiuk object
  1122. *
  1123. * dynamic range. Values from 0.6 to 0.9 produce best results.
  1124. * return automatically generated
  1125. */
  1126. public static TonemapMantiuk createTonemapMantiuk()
  1127. {
  1128. return TonemapMantiuk.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createTonemapMantiuk_13()));
  1129. }
  1130. //
  1131. // C++: Ptr_AlignMTB cv::createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true)
  1132. //
  1133. /**
  1134. * Creates AlignMTB object
  1135. *
  1136. * param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
  1137. * usually good enough (31 and 63 pixels shift respectively).
  1138. * param exclude_range range for exclusion bitmap that is constructed to suppress noise around the
  1139. * median value.
  1140. * param cut if true cuts images, otherwise fills the new regions with zeros.
  1141. * return automatically generated
  1142. */
  1143. public static AlignMTB createAlignMTB(int max_bits, int exclude_range, bool cut)
  1144. {
  1145. return AlignMTB.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createAlignMTB_10(max_bits, exclude_range, cut)));
  1146. }
  1147. /**
  1148. * Creates AlignMTB object
  1149. *
  1150. * param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
  1151. * usually good enough (31 and 63 pixels shift respectively).
  1152. * param exclude_range range for exclusion bitmap that is constructed to suppress noise around the
  1153. * median value.
  1154. * return automatically generated
  1155. */
  1156. public static AlignMTB createAlignMTB(int max_bits, int exclude_range)
  1157. {
  1158. return AlignMTB.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createAlignMTB_11(max_bits, exclude_range)));
  1159. }
  1160. /**
  1161. * Creates AlignMTB object
  1162. *
  1163. * param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
  1164. * usually good enough (31 and 63 pixels shift respectively).
  1165. * median value.
  1166. * return automatically generated
  1167. */
  1168. public static AlignMTB createAlignMTB(int max_bits)
  1169. {
  1170. return AlignMTB.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createAlignMTB_12(max_bits)));
  1171. }
  1172. /**
  1173. * Creates AlignMTB object
  1174. *
  1175. * usually good enough (31 and 63 pixels shift respectively).
  1176. * median value.
  1177. * return automatically generated
  1178. */
  1179. public static AlignMTB createAlignMTB()
  1180. {
  1181. return AlignMTB.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createAlignMTB_13()));
  1182. }
  1183. //
  1184. // C++: Ptr_CalibrateDebevec cv::createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false)
  1185. //
  1186. /**
  1187. * Creates CalibrateDebevec object
  1188. *
  1189. * param samples number of pixel locations to use
  1190. * param lambda smoothness term weight. Greater values produce smoother results, but can alter the
  1191. * response.
  1192. * param random if true sample pixel locations are chosen at random, otherwise they form a
  1193. * rectangular grid.
  1194. * return automatically generated
  1195. */
  1196. public static CalibrateDebevec createCalibrateDebevec(int samples, float lambda, bool random)
  1197. {
  1198. return CalibrateDebevec.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateDebevec_10(samples, lambda, random)));
  1199. }
  1200. /**
  1201. * Creates CalibrateDebevec object
  1202. *
  1203. * param samples number of pixel locations to use
  1204. * param lambda smoothness term weight. Greater values produce smoother results, but can alter the
  1205. * response.
  1206. * rectangular grid.
  1207. * return automatically generated
  1208. */
  1209. public static CalibrateDebevec createCalibrateDebevec(int samples, float lambda)
  1210. {
  1211. return CalibrateDebevec.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateDebevec_11(samples, lambda)));
  1212. }
  1213. /**
  1214. * Creates CalibrateDebevec object
  1215. *
  1216. * param samples number of pixel locations to use
  1217. * response.
  1218. * rectangular grid.
  1219. * return automatically generated
  1220. */
  1221. public static CalibrateDebevec createCalibrateDebevec(int samples)
  1222. {
  1223. return CalibrateDebevec.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateDebevec_12(samples)));
  1224. }
  1225. /**
  1226. * Creates CalibrateDebevec object
  1227. *
  1228. * response.
  1229. * rectangular grid.
  1230. * return automatically generated
  1231. */
  1232. public static CalibrateDebevec createCalibrateDebevec()
  1233. {
  1234. return CalibrateDebevec.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateDebevec_13()));
  1235. }
  1236. //
  1237. // C++: Ptr_CalibrateRobertson cv::createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f)
  1238. //
  1239. /**
  1240. * Creates CalibrateRobertson object
  1241. *
  1242. * param max_iter maximal number of Gauss-Seidel solver iterations.
  1243. * param threshold target difference between results of two successive steps of the minimization.
  1244. * return automatically generated
  1245. */
  1246. public static CalibrateRobertson createCalibrateRobertson(int max_iter, float threshold)
  1247. {
  1248. return CalibrateRobertson.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateRobertson_10(max_iter, threshold)));
  1249. }
  1250. /**
  1251. * Creates CalibrateRobertson object
  1252. *
  1253. * param max_iter maximal number of Gauss-Seidel solver iterations.
  1254. * return automatically generated
  1255. */
  1256. public static CalibrateRobertson createCalibrateRobertson(int max_iter)
  1257. {
  1258. return CalibrateRobertson.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateRobertson_11(max_iter)));
  1259. }
  1260. /**
  1261. * Creates CalibrateRobertson object
  1262. *
  1263. * return automatically generated
  1264. */
  1265. public static CalibrateRobertson createCalibrateRobertson()
  1266. {
  1267. return CalibrateRobertson.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createCalibrateRobertson_12()));
  1268. }
  1269. //
  1270. // C++: Ptr_MergeDebevec cv::createMergeDebevec()
  1271. //
  1272. /**
  1273. * Creates MergeDebevec object
  1274. * return automatically generated
  1275. */
  1276. public static MergeDebevec createMergeDebevec()
  1277. {
  1278. return MergeDebevec.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeDebevec_10()));
  1279. }
  1280. //
  1281. // C++: Ptr_MergeMertens cv::createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f)
  1282. //
  1283. /**
  1284. * Creates MergeMertens object
  1285. *
  1286. * param contrast_weight contrast measure weight. See MergeMertens.
  1287. * param saturation_weight saturation measure weight
  1288. * param exposure_weight well-exposedness measure weight
  1289. * return automatically generated
  1290. */
  1291. public static MergeMertens createMergeMertens(float contrast_weight, float saturation_weight, float exposure_weight)
  1292. {
  1293. return MergeMertens.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeMertens_10(contrast_weight, saturation_weight, exposure_weight)));
  1294. }
  1295. /**
  1296. * Creates MergeMertens object
  1297. *
  1298. * param contrast_weight contrast measure weight. See MergeMertens.
  1299. * param saturation_weight saturation measure weight
  1300. * return automatically generated
  1301. */
  1302. public static MergeMertens createMergeMertens(float contrast_weight, float saturation_weight)
  1303. {
  1304. return MergeMertens.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeMertens_11(contrast_weight, saturation_weight)));
  1305. }
  1306. /**
  1307. * Creates MergeMertens object
  1308. *
  1309. * param contrast_weight contrast measure weight. See MergeMertens.
  1310. * return automatically generated
  1311. */
  1312. public static MergeMertens createMergeMertens(float contrast_weight)
  1313. {
  1314. return MergeMertens.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeMertens_12(contrast_weight)));
  1315. }
  1316. /**
  1317. * Creates MergeMertens object
  1318. *
  1319. * return automatically generated
  1320. */
  1321. public static MergeMertens createMergeMertens()
  1322. {
  1323. return MergeMertens.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeMertens_13()));
  1324. }
  1325. //
  1326. // C++: Ptr_MergeRobertson cv::createMergeRobertson()
  1327. //
  1328. /**
  1329. * Creates MergeRobertson object
  1330. * return automatically generated
  1331. */
  1332. public static MergeRobertson createMergeRobertson()
  1333. {
  1334. return MergeRobertson.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(photo_Photo_createMergeRobertson_10()));
  1335. }
  1336. //
  1337. // C++: void cv::decolor(Mat src, Mat& grayscale, Mat& color_boost)
  1338. //
  1339. /**
  1340. * Transforms a color image to a grayscale image. It is a basic tool in digital printing, stylized
  1341. * black-and-white photograph rendering, and in many single channel image processing applications
  1342. * CITE: CL12 .
  1343. *
  1344. * param src Input 8-bit 3-channel image.
  1345. * param grayscale Output 8-bit 1-channel image.
  1346. * param color_boost Output 8-bit 3-channel image.
  1347. *
  1348. * This function is to be applied on color images.
  1349. */
  1350. public static void decolor(Mat src, Mat grayscale, Mat color_boost)
  1351. {
  1352. if (src != null) src.ThrowIfDisposed();
  1353. if (grayscale != null) grayscale.ThrowIfDisposed();
  1354. if (color_boost != null) color_boost.ThrowIfDisposed();
  1355. photo_Photo_decolor_10(src.nativeObj, grayscale.nativeObj, color_boost.nativeObj);
  1356. }
  1357. //
  1358. // C++: void cv::seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat& blend, int flags)
  1359. //
  1360. /**
  1361. * Image editing tasks concern either global changes (color/intensity corrections, filters,
  1362. * deformations) or local changes concerned to a selection. Here we are interested in achieving local
  1363. * changes, ones that are restricted to a region manually selected (ROI), in a seamless and effortless
  1364. * manner. The extent of the changes ranges from slight distortions to complete replacement by novel
  1365. * content CITE: PM03 .
  1366. *
  1367. * param src Input 8-bit 3-channel image.
  1368. * param dst Input 8-bit 3-channel image.
  1369. * param mask Input 8-bit 1 or 3-channel image.
  1370. * param p Point in dst image where object is placed.
  1371. * param blend Output image with the same size and type as dst.
  1372. * param flags Cloning method that could be cv::NORMAL_CLONE, cv::MIXED_CLONE or cv::MONOCHROME_TRANSFER
  1373. */
  1374. public static void seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat blend, int flags)
  1375. {
  1376. if (src != null) src.ThrowIfDisposed();
  1377. if (dst != null) dst.ThrowIfDisposed();
  1378. if (mask != null) mask.ThrowIfDisposed();
  1379. if (blend != null) blend.ThrowIfDisposed();
  1380. photo_Photo_seamlessClone_10(src.nativeObj, dst.nativeObj, mask.nativeObj, p.x, p.y, blend.nativeObj, flags);
  1381. }
  1382. //
  1383. // C++: void cv::colorChange(Mat src, Mat mask, Mat& dst, float red_mul = 1.0f, float green_mul = 1.0f, float blue_mul = 1.0f)
  1384. //
  1385. /**
  1386. * Given an original color image, two differently colored versions of this image can be mixed
  1387. * seamlessly.
  1388. *
  1389. * param src Input 8-bit 3-channel image.
  1390. * param mask Input 8-bit 1 or 3-channel image.
  1391. * param dst Output image with the same size and type as src .
  1392. * param red_mul R-channel multiply factor.
  1393. * param green_mul G-channel multiply factor.
  1394. * param blue_mul B-channel multiply factor.
  1395. *
  1396. * Multiplication factor is between .5 to 2.5.
  1397. */
  1398. public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul, float blue_mul)
  1399. {
  1400. if (src != null) src.ThrowIfDisposed();
  1401. if (mask != null) mask.ThrowIfDisposed();
  1402. if (dst != null) dst.ThrowIfDisposed();
  1403. photo_Photo_colorChange_10(src.nativeObj, mask.nativeObj, dst.nativeObj, red_mul, green_mul, blue_mul);
  1404. }
  1405. /**
  1406. * Given an original color image, two differently colored versions of this image can be mixed
  1407. * seamlessly.
  1408. *
  1409. * param src Input 8-bit 3-channel image.
  1410. * param mask Input 8-bit 1 or 3-channel image.
  1411. * param dst Output image with the same size and type as src .
  1412. * param red_mul R-channel multiply factor.
  1413. * param green_mul G-channel multiply factor.
  1414. *
  1415. * Multiplication factor is between .5 to 2.5.
  1416. */
  1417. public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul)
  1418. {
  1419. if (src != null) src.ThrowIfDisposed();
  1420. if (mask != null) mask.ThrowIfDisposed();
  1421. if (dst != null) dst.ThrowIfDisposed();
  1422. photo_Photo_colorChange_11(src.nativeObj, mask.nativeObj, dst.nativeObj, red_mul, green_mul);
  1423. }
  1424. /**
  1425. * Given an original color image, two differently colored versions of this image can be mixed
  1426. * seamlessly.
  1427. *
  1428. * param src Input 8-bit 3-channel image.
  1429. * param mask Input 8-bit 1 or 3-channel image.
  1430. * param dst Output image with the same size and type as src .
  1431. * param red_mul R-channel multiply factor.
  1432. *
  1433. * Multiplication factor is between .5 to 2.5.
  1434. */
  1435. public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul)
  1436. {
  1437. if (src != null) src.ThrowIfDisposed();
  1438. if (mask != null) mask.ThrowIfDisposed();
  1439. if (dst != null) dst.ThrowIfDisposed();
  1440. photo_Photo_colorChange_12(src.nativeObj, mask.nativeObj, dst.nativeObj, red_mul);
  1441. }
  1442. /**
  1443. * Given an original color image, two differently colored versions of this image can be mixed
  1444. * seamlessly.
  1445. *
  1446. * param src Input 8-bit 3-channel image.
  1447. * param mask Input 8-bit 1 or 3-channel image.
  1448. * param dst Output image with the same size and type as src .
  1449. *
  1450. * Multiplication factor is between .5 to 2.5.
  1451. */
  1452. public static void colorChange(Mat src, Mat mask, Mat dst)
  1453. {
  1454. if (src != null) src.ThrowIfDisposed();
  1455. if (mask != null) mask.ThrowIfDisposed();
  1456. if (dst != null) dst.ThrowIfDisposed();
  1457. photo_Photo_colorChange_13(src.nativeObj, mask.nativeObj, dst.nativeObj);
  1458. }
  1459. //
  1460. // C++: void cv::illuminationChange(Mat src, Mat mask, Mat& dst, float alpha = 0.2f, float beta = 0.4f)
  1461. //
  1462. /**
  1463. * Applying an appropriate non-linear transformation to the gradient field inside the selection and
  1464. * then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
  1465. *
  1466. * param src Input 8-bit 3-channel image.
  1467. * param mask Input 8-bit 1 or 3-channel image.
  1468. * param dst Output image with the same size and type as src.
  1469. * param alpha Value ranges between 0-2.
  1470. * param beta Value ranges between 0-2.
  1471. *
  1472. * This is useful to highlight under-exposed foreground objects or to reduce specular reflections.
  1473. */
  1474. public static void illuminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta)
  1475. {
  1476. if (src != null) src.ThrowIfDisposed();
  1477. if (mask != null) mask.ThrowIfDisposed();
  1478. if (dst != null) dst.ThrowIfDisposed();
  1479. photo_Photo_illuminationChange_10(src.nativeObj, mask.nativeObj, dst.nativeObj, alpha, beta);
  1480. }
  1481. /**
  1482. * Applying an appropriate non-linear transformation to the gradient field inside the selection and
  1483. * then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
  1484. *
  1485. * param src Input 8-bit 3-channel image.
  1486. * param mask Input 8-bit 1 or 3-channel image.
  1487. * param dst Output image with the same size and type as src.
  1488. * param alpha Value ranges between 0-2.
  1489. *
  1490. * This is useful to highlight under-exposed foreground objects or to reduce specular reflections.
  1491. */
  1492. public static void illuminationChange(Mat src, Mat mask, Mat dst, float alpha)
  1493. {
  1494. if (src != null) src.ThrowIfDisposed();
  1495. if (mask != null) mask.ThrowIfDisposed();
  1496. if (dst != null) dst.ThrowIfDisposed();
  1497. photo_Photo_illuminationChange_11(src.nativeObj, mask.nativeObj, dst.nativeObj, alpha);
  1498. }
  1499. /**
  1500. * Applying an appropriate non-linear transformation to the gradient field inside the selection and
  1501. * then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
  1502. *
  1503. * param src Input 8-bit 3-channel image.
  1504. * param mask Input 8-bit 1 or 3-channel image.
  1505. * param dst Output image with the same size and type as src.
  1506. *
  1507. * This is useful to highlight under-exposed foreground objects or to reduce specular reflections.
  1508. */
  1509. public static void illuminationChange(Mat src, Mat mask, Mat dst)
  1510. {
  1511. if (src != null) src.ThrowIfDisposed();
  1512. if (mask != null) mask.ThrowIfDisposed();
  1513. if (dst != null) dst.ThrowIfDisposed();
  1514. photo_Photo_illuminationChange_12(src.nativeObj, mask.nativeObj, dst.nativeObj);
  1515. }
  1516. //
  1517. // C++: void cv::textureFlattening(Mat src, Mat mask, Mat& dst, float low_threshold = 30, float high_threshold = 45, int kernel_size = 3)
  1518. //
  1519. /**
  1520. * By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
  1521. * washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used.
  1522. *
  1523. * param src Input 8-bit 3-channel image.
  1524. * param mask Input 8-bit 1 or 3-channel image.
  1525. * param dst Output image with the same size and type as src.
  1526. * param low_threshold %Range from 0 to 100.
  1527. * param high_threshold Value &gt; 100.
  1528. * param kernel_size The size of the Sobel kernel to be used.
  1529. *
  1530. * <b>Note:</b>
  1531. * The algorithm assumes that the color of the source image is close to that of the destination. This
  1532. * assumption means that when the colors don't match, the source image color gets tinted toward the
  1533. * color of the destination image.
  1534. */
  1535. public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size)
  1536. {
  1537. if (src != null) src.ThrowIfDisposed();
  1538. if (mask != null) mask.ThrowIfDisposed();
  1539. if (dst != null) dst.ThrowIfDisposed();
  1540. photo_Photo_textureFlattening_10(src.nativeObj, mask.nativeObj, dst.nativeObj, low_threshold, high_threshold, kernel_size);
  1541. }
  1542. /**
  1543. * By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
  1544. * washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used.
  1545. *
  1546. * param src Input 8-bit 3-channel image.
  1547. * param mask Input 8-bit 1 or 3-channel image.
  1548. * param dst Output image with the same size and type as src.
  1549. * param low_threshold %Range from 0 to 100.
  1550. * param high_threshold Value &gt; 100.
  1551. *
  1552. * <b>Note:</b>
  1553. * The algorithm assumes that the color of the source image is close to that of the destination. This
  1554. * assumption means that when the colors don't match, the source image color gets tinted toward the
  1555. * color of the destination image.
  1556. */
  1557. public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold)
  1558. {
  1559. if (src != null) src.ThrowIfDisposed();
  1560. if (mask != null) mask.ThrowIfDisposed();
  1561. if (dst != null) dst.ThrowIfDisposed();
  1562. photo_Photo_textureFlattening_11(src.nativeObj, mask.nativeObj, dst.nativeObj, low_threshold, high_threshold);
  1563. }
  1564. /**
  1565. * By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
  1566. * washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used.
  1567. *
  1568. * param src Input 8-bit 3-channel image.
  1569. * param mask Input 8-bit 1 or 3-channel image.
  1570. * param dst Output image with the same size and type as src.
  1571. * param low_threshold %Range from 0 to 100.
  1572. *
  1573. * <b>Note:</b>
  1574. * The algorithm assumes that the color of the source image is close to that of the destination. This
  1575. * assumption means that when the colors don't match, the source image color gets tinted toward the
  1576. * color of the destination image.
  1577. */
  1578. public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold)
  1579. {
  1580. if (src != null) src.ThrowIfDisposed();
  1581. if (mask != null) mask.ThrowIfDisposed();
  1582. if (dst != null) dst.ThrowIfDisposed();
  1583. photo_Photo_textureFlattening_12(src.nativeObj, mask.nativeObj, dst.nativeObj, low_threshold);
  1584. }
  1585. /**
  1586. * By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
  1587. * washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used.
  1588. *
  1589. * param src Input 8-bit 3-channel image.
  1590. * param mask Input 8-bit 1 or 3-channel image.
  1591. * param dst Output image with the same size and type as src.
  1592. *
  1593. * <b>Note:</b>
  1594. * The algorithm assumes that the color of the source image is close to that of the destination. This
  1595. * assumption means that when the colors don't match, the source image color gets tinted toward the
  1596. * color of the destination image.
  1597. */
  1598. public static void textureFlattening(Mat src, Mat mask, Mat dst)
  1599. {
  1600. if (src != null) src.ThrowIfDisposed();
  1601. if (mask != null) mask.ThrowIfDisposed();
  1602. if (dst != null) dst.ThrowIfDisposed();
  1603. photo_Photo_textureFlattening_13(src.nativeObj, mask.nativeObj, dst.nativeObj);
  1604. }
  1605. //
  1606. // C++: void cv::edgePreservingFilter(Mat src, Mat& dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4f)
  1607. //
  1608. /**
  1609. * Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
  1610. * filters are used in many different applications CITE: EM11 .
  1611. *
  1612. * param src Input 8-bit 3-channel image.
  1613. * param dst Output 8-bit 3-channel image.
  1614. * param flags Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTER
  1615. * param sigma_s %Range between 0 to 200.
  1616. * param sigma_r %Range between 0 to 1.
  1617. */
  1618. public static void edgePreservingFilter(Mat src, Mat dst, int flags, float sigma_s, float sigma_r)
  1619. {
  1620. if (src != null) src.ThrowIfDisposed();
  1621. if (dst != null) dst.ThrowIfDisposed();
  1622. photo_Photo_edgePreservingFilter_10(src.nativeObj, dst.nativeObj, flags, sigma_s, sigma_r);
  1623. }
  1624. /**
  1625. * Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
  1626. * filters are used in many different applications CITE: EM11 .
  1627. *
  1628. * param src Input 8-bit 3-channel image.
  1629. * param dst Output 8-bit 3-channel image.
  1630. * param flags Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTER
  1631. * param sigma_s %Range between 0 to 200.
  1632. */
  1633. public static void edgePreservingFilter(Mat src, Mat dst, int flags, float sigma_s)
  1634. {
  1635. if (src != null) src.ThrowIfDisposed();
  1636. if (dst != null) dst.ThrowIfDisposed();
  1637. photo_Photo_edgePreservingFilter_11(src.nativeObj, dst.nativeObj, flags, sigma_s);
  1638. }
  1639. /**
  1640. * Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
  1641. * filters are used in many different applications CITE: EM11 .
  1642. *
  1643. * param src Input 8-bit 3-channel image.
  1644. * param dst Output 8-bit 3-channel image.
  1645. * param flags Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTER
  1646. */
  1647. public static void edgePreservingFilter(Mat src, Mat dst, int flags)
  1648. {
  1649. if (src != null) src.ThrowIfDisposed();
  1650. if (dst != null) dst.ThrowIfDisposed();
  1651. photo_Photo_edgePreservingFilter_12(src.nativeObj, dst.nativeObj, flags);
  1652. }
  1653. /**
  1654. * Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
  1655. * filters are used in many different applications CITE: EM11 .
  1656. *
  1657. * param src Input 8-bit 3-channel image.
  1658. * param dst Output 8-bit 3-channel image.
  1659. */
  1660. public static void edgePreservingFilter(Mat src, Mat dst)
  1661. {
  1662. if (src != null) src.ThrowIfDisposed();
  1663. if (dst != null) dst.ThrowIfDisposed();
  1664. photo_Photo_edgePreservingFilter_13(src.nativeObj, dst.nativeObj);
  1665. }
  1666. //
  1667. // C++: void cv::detailEnhance(Mat src, Mat& dst, float sigma_s = 10, float sigma_r = 0.15f)
  1668. //
  1669. /**
  1670. * This filter enhances the details of a particular image.
  1671. *
  1672. * param src Input 8-bit 3-channel image.
  1673. * param dst Output image with the same size and type as src.
  1674. * param sigma_s %Range between 0 to 200.
  1675. * param sigma_r %Range between 0 to 1.
  1676. */
  1677. public static void detailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r)
  1678. {
  1679. if (src != null) src.ThrowIfDisposed();
  1680. if (dst != null) dst.ThrowIfDisposed();
  1681. photo_Photo_detailEnhance_10(src.nativeObj, dst.nativeObj, sigma_s, sigma_r);
  1682. }
  1683. /**
  1684. * This filter enhances the details of a particular image.
  1685. *
  1686. * param src Input 8-bit 3-channel image.
  1687. * param dst Output image with the same size and type as src.
  1688. * param sigma_s %Range between 0 to 200.
  1689. */
  1690. public static void detailEnhance(Mat src, Mat dst, float sigma_s)
  1691. {
  1692. if (src != null) src.ThrowIfDisposed();
  1693. if (dst != null) dst.ThrowIfDisposed();
  1694. photo_Photo_detailEnhance_11(src.nativeObj, dst.nativeObj, sigma_s);
  1695. }
  1696. /**
  1697. * This filter enhances the details of a particular image.
  1698. *
  1699. * param src Input 8-bit 3-channel image.
  1700. * param dst Output image with the same size and type as src.
  1701. */
  1702. public static void detailEnhance(Mat src, Mat dst)
  1703. {
  1704. if (src != null) src.ThrowIfDisposed();
  1705. if (dst != null) dst.ThrowIfDisposed();
  1706. photo_Photo_detailEnhance_12(src.nativeObj, dst.nativeObj);
  1707. }
  1708. //
  1709. // C++: void cv::pencilSketch(Mat src, Mat& dst1, Mat& dst2, float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f)
  1710. //
  1711. /**
  1712. * Pencil-like non-photorealistic line drawing
  1713. *
  1714. * param src Input 8-bit 3-channel image.
  1715. * param dst1 Output 8-bit 1-channel image.
  1716. * param dst2 Output image with the same size and type as src.
  1717. * param sigma_s %Range between 0 to 200.
  1718. * param sigma_r %Range between 0 to 1.
  1719. * param shade_factor %Range between 0 to 0.1.
  1720. */
  1721. public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor)
  1722. {
  1723. if (src != null) src.ThrowIfDisposed();
  1724. if (dst1 != null) dst1.ThrowIfDisposed();
  1725. if (dst2 != null) dst2.ThrowIfDisposed();
  1726. photo_Photo_pencilSketch_10(src.nativeObj, dst1.nativeObj, dst2.nativeObj, sigma_s, sigma_r, shade_factor);
  1727. }
  1728. /**
  1729. * Pencil-like non-photorealistic line drawing
  1730. *
  1731. * param src Input 8-bit 3-channel image.
  1732. * param dst1 Output 8-bit 1-channel image.
  1733. * param dst2 Output image with the same size and type as src.
  1734. * param sigma_s %Range between 0 to 200.
  1735. * param sigma_r %Range between 0 to 1.
  1736. */
  1737. public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r)
  1738. {
  1739. if (src != null) src.ThrowIfDisposed();
  1740. if (dst1 != null) dst1.ThrowIfDisposed();
  1741. if (dst2 != null) dst2.ThrowIfDisposed();
  1742. photo_Photo_pencilSketch_11(src.nativeObj, dst1.nativeObj, dst2.nativeObj, sigma_s, sigma_r);
  1743. }
  1744. /**
  1745. * Pencil-like non-photorealistic line drawing
  1746. *
  1747. * param src Input 8-bit 3-channel image.
  1748. * param dst1 Output 8-bit 1-channel image.
  1749. * param dst2 Output image with the same size and type as src.
  1750. * param sigma_s %Range between 0 to 200.
  1751. */
  1752. public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s)
  1753. {
  1754. if (src != null) src.ThrowIfDisposed();
  1755. if (dst1 != null) dst1.ThrowIfDisposed();
  1756. if (dst2 != null) dst2.ThrowIfDisposed();
  1757. photo_Photo_pencilSketch_12(src.nativeObj, dst1.nativeObj, dst2.nativeObj, sigma_s);
  1758. }
  1759. /**
  1760. * Pencil-like non-photorealistic line drawing
  1761. *
  1762. * param src Input 8-bit 3-channel image.
  1763. * param dst1 Output 8-bit 1-channel image.
  1764. * param dst2 Output image with the same size and type as src.
  1765. */
  1766. public static void pencilSketch(Mat src, Mat dst1, Mat dst2)
  1767. {
  1768. if (src != null) src.ThrowIfDisposed();
  1769. if (dst1 != null) dst1.ThrowIfDisposed();
  1770. if (dst2 != null) dst2.ThrowIfDisposed();
  1771. photo_Photo_pencilSketch_13(src.nativeObj, dst1.nativeObj, dst2.nativeObj);
  1772. }
  1773. //
  1774. // C++: void cv::stylization(Mat src, Mat& dst, float sigma_s = 60, float sigma_r = 0.45f)
  1775. //
  1776. /**
  1777. * Stylization aims to produce digital imagery with a wide variety of effects not focused on
  1778. * photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low
  1779. * contrast while preserving, or enhancing, high-contrast features.
  1780. *
  1781. * param src Input 8-bit 3-channel image.
  1782. * param dst Output image with the same size and type as src.
  1783. * param sigma_s %Range between 0 to 200.
  1784. * param sigma_r %Range between 0 to 1.
  1785. */
  1786. public static void stylization(Mat src, Mat dst, float sigma_s, float sigma_r)
  1787. {
  1788. if (src != null) src.ThrowIfDisposed();
  1789. if (dst != null) dst.ThrowIfDisposed();
  1790. photo_Photo_stylization_10(src.nativeObj, dst.nativeObj, sigma_s, sigma_r);
  1791. }
  1792. /**
  1793. * Stylization aims to produce digital imagery with a wide variety of effects not focused on
  1794. * photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low
  1795. * contrast while preserving, or enhancing, high-contrast features.
  1796. *
  1797. * param src Input 8-bit 3-channel image.
  1798. * param dst Output image with the same size and type as src.
  1799. * param sigma_s %Range between 0 to 200.
  1800. */
  1801. public static void stylization(Mat src, Mat dst, float sigma_s)
  1802. {
  1803. if (src != null) src.ThrowIfDisposed();
  1804. if (dst != null) dst.ThrowIfDisposed();
  1805. photo_Photo_stylization_11(src.nativeObj, dst.nativeObj, sigma_s);
  1806. }
  1807. /**
  1808. * Stylization aims to produce digital imagery with a wide variety of effects not focused on
  1809. * photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low
  1810. * contrast while preserving, or enhancing, high-contrast features.
  1811. *
  1812. * param src Input 8-bit 3-channel image.
  1813. * param dst Output image with the same size and type as src.
  1814. */
  1815. public static void stylization(Mat src, Mat dst)
  1816. {
  1817. if (src != null) src.ThrowIfDisposed();
  1818. if (dst != null) dst.ThrowIfDisposed();
  1819. photo_Photo_stylization_12(src.nativeObj, dst.nativeObj);
  1820. }
  1821. //
  1822. // C++: void cv::cuda::nonLocalMeans(GpuMat src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, int borderMode = BORDER_DEFAULT, Stream stream = Stream::Null())
  1823. //
  1824. // Unknown type 'GpuMat' (I), skipping the function
  1825. //
  1826. // C++: void cv::cuda::fastNlMeansDenoising(GpuMat src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, Stream stream = Stream::Null())
  1827. //
  1828. // Unknown type 'GpuMat' (I), skipping the function
  1829. //
  1830. // C++: void cv::cuda::fastNlMeansDenoisingColored(GpuMat src, GpuMat& dst, float h_luminance, float photo_render, int search_window = 21, int block_size = 7, Stream stream = Stream::Null())
  1831. //
  1832. // Unknown type 'GpuMat' (I), skipping the function
  1833. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  1834. const string LIBNAME = "__Internal";
  1835. #else
  1836. const string LIBNAME = "opencvforunity";
  1837. #endif
  1838. // C++: void cv::inpaint(Mat src, Mat inpaintMask, Mat& dst, double inpaintRadius, int flags)
  1839. [DllImport(LIBNAME)]
  1840. private static extern void photo_Photo_inpaint_10(IntPtr src_nativeObj, IntPtr inpaintMask_nativeObj, IntPtr dst_nativeObj, double inpaintRadius, int flags);
  1841. // C++: void cv::fastNlMeansDenoising(Mat src, Mat& dst, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  1842. [DllImport(LIBNAME)]
  1843. private static extern void photo_Photo_fastNlMeansDenoising_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize, int searchWindowSize);
  1844. [DllImport(LIBNAME)]
  1845. private static extern void photo_Photo_fastNlMeansDenoising_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, int templateWindowSize);
  1846. [DllImport(LIBNAME)]
  1847. private static extern void photo_Photo_fastNlMeansDenoising_12(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h);
  1848. [DllImport(LIBNAME)]
  1849. private static extern void photo_Photo_fastNlMeansDenoising_13(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  1850. // C++: void cv::fastNlMeansDenoising(Mat src, Mat& dst, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2)
  1851. [DllImport(LIBNAME)]
  1852. private static extern void photo_Photo_fastNlMeansDenoising_14(IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr h_mat_nativeObj, int templateWindowSize, int searchWindowSize, int normType);
  1853. [DllImport(LIBNAME)]
  1854. private static extern void photo_Photo_fastNlMeansDenoising_15(IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr h_mat_nativeObj, int templateWindowSize, int searchWindowSize);
  1855. [DllImport(LIBNAME)]
  1856. private static extern void photo_Photo_fastNlMeansDenoising_16(IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr h_mat_nativeObj, int templateWindowSize);
  1857. [DllImport(LIBNAME)]
  1858. private static extern void photo_Photo_fastNlMeansDenoising_17(IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr h_mat_nativeObj);
  1859. // C++: void cv::fastNlMeansDenoisingColored(Mat src, Mat& dst, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  1860. [DllImport(LIBNAME)]
  1861. private static extern void photo_Photo_fastNlMeansDenoisingColored_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, float hColor, int templateWindowSize, int searchWindowSize);
  1862. [DllImport(LIBNAME)]
  1863. private static extern void photo_Photo_fastNlMeansDenoisingColored_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, float hColor, int templateWindowSize);
  1864. [DllImport(LIBNAME)]
  1865. private static extern void photo_Photo_fastNlMeansDenoisingColored_12(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h, float hColor);
  1866. [DllImport(LIBNAME)]
  1867. private static extern void photo_Photo_fastNlMeansDenoisingColored_13(IntPtr src_nativeObj, IntPtr dst_nativeObj, float h);
  1868. [DllImport(LIBNAME)]
  1869. private static extern void photo_Photo_fastNlMeansDenoisingColored_14(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  1870. // C++: void cv::fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  1871. [DllImport(LIBNAME)]
  1872. private static extern void photo_Photo_fastNlMeansDenoisingMulti_10(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize);
  1873. [DllImport(LIBNAME)]
  1874. private static extern void photo_Photo_fastNlMeansDenoisingMulti_11(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize);
  1875. [DllImport(LIBNAME)]
  1876. private static extern void photo_Photo_fastNlMeansDenoisingMulti_12(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h);
  1877. [DllImport(LIBNAME)]
  1878. private static extern void photo_Photo_fastNlMeansDenoisingMulti_13(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize);
  1879. // C++: void cv::fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2)
  1880. [DllImport(LIBNAME)]
  1881. private static extern void photo_Photo_fastNlMeansDenoisingMulti_14(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, IntPtr h_mat_nativeObj, int templateWindowSize, int searchWindowSize, int normType);
  1882. [DllImport(LIBNAME)]
  1883. private static extern void photo_Photo_fastNlMeansDenoisingMulti_15(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, IntPtr h_mat_nativeObj, int templateWindowSize, int searchWindowSize);
  1884. [DllImport(LIBNAME)]
  1885. private static extern void photo_Photo_fastNlMeansDenoisingMulti_16(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, IntPtr h_mat_nativeObj, int templateWindowSize);
  1886. [DllImport(LIBNAME)]
  1887. private static extern void photo_Photo_fastNlMeansDenoisingMulti_17(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, IntPtr h_mat_nativeObj);
  1888. // C++: void cv::fastNlMeansDenoisingColoredMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21)
  1889. [DllImport(LIBNAME)]
  1890. private static extern void photo_Photo_fastNlMeansDenoisingColoredMulti_10(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize);
  1891. [DllImport(LIBNAME)]
  1892. private static extern void photo_Photo_fastNlMeansDenoisingColoredMulti_11(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize);
  1893. [DllImport(LIBNAME)]
  1894. private static extern void photo_Photo_fastNlMeansDenoisingColoredMulti_12(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor);
  1895. [DllImport(LIBNAME)]
  1896. private static extern void photo_Photo_fastNlMeansDenoisingColoredMulti_13(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h);
  1897. [DllImport(LIBNAME)]
  1898. private static extern void photo_Photo_fastNlMeansDenoisingColoredMulti_14(IntPtr srcImgs_mat_nativeObj, IntPtr dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize);
  1899. // C++: void cv::denoise_TVL1(vector_Mat observations, Mat result, double lambda = 1.0, int niters = 30)
  1900. [DllImport(LIBNAME)]
  1901. private static extern void photo_Photo_denoise_1TVL1_10(IntPtr observations_mat_nativeObj, IntPtr result_nativeObj, double lambda, int niters);
  1902. [DllImport(LIBNAME)]
  1903. private static extern void photo_Photo_denoise_1TVL1_11(IntPtr observations_mat_nativeObj, IntPtr result_nativeObj, double lambda);
  1904. [DllImport(LIBNAME)]
  1905. private static extern void photo_Photo_denoise_1TVL1_12(IntPtr observations_mat_nativeObj, IntPtr result_nativeObj);
  1906. // C++: Ptr_Tonemap cv::createTonemap(float gamma = 1.0f)
  1907. [DllImport(LIBNAME)]
  1908. private static extern IntPtr photo_Photo_createTonemap_10(float gamma);
  1909. [DllImport(LIBNAME)]
  1910. private static extern IntPtr photo_Photo_createTonemap_11();
  1911. // C++: Ptr_TonemapDrago cv::createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f)
  1912. [DllImport(LIBNAME)]
  1913. private static extern IntPtr photo_Photo_createTonemapDrago_10(float gamma, float saturation, float bias);
  1914. [DllImport(LIBNAME)]
  1915. private static extern IntPtr photo_Photo_createTonemapDrago_11(float gamma, float saturation);
  1916. [DllImport(LIBNAME)]
  1917. private static extern IntPtr photo_Photo_createTonemapDrago_12(float gamma);
  1918. [DllImport(LIBNAME)]
  1919. private static extern IntPtr photo_Photo_createTonemapDrago_13();
  1920. // C++: Ptr_TonemapReinhard cv::createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f)
  1921. [DllImport(LIBNAME)]
  1922. private static extern IntPtr photo_Photo_createTonemapReinhard_10(float gamma, float intensity, float light_adapt, float color_adapt);
  1923. [DllImport(LIBNAME)]
  1924. private static extern IntPtr photo_Photo_createTonemapReinhard_11(float gamma, float intensity, float light_adapt);
  1925. [DllImport(LIBNAME)]
  1926. private static extern IntPtr photo_Photo_createTonemapReinhard_12(float gamma, float intensity);
  1927. [DllImport(LIBNAME)]
  1928. private static extern IntPtr photo_Photo_createTonemapReinhard_13(float gamma);
  1929. [DllImport(LIBNAME)]
  1930. private static extern IntPtr photo_Photo_createTonemapReinhard_14();
  1931. // C++: Ptr_TonemapMantiuk cv::createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f)
  1932. [DllImport(LIBNAME)]
  1933. private static extern IntPtr photo_Photo_createTonemapMantiuk_10(float gamma, float scale, float saturation);
  1934. [DllImport(LIBNAME)]
  1935. private static extern IntPtr photo_Photo_createTonemapMantiuk_11(float gamma, float scale);
  1936. [DllImport(LIBNAME)]
  1937. private static extern IntPtr photo_Photo_createTonemapMantiuk_12(float gamma);
  1938. [DllImport(LIBNAME)]
  1939. private static extern IntPtr photo_Photo_createTonemapMantiuk_13();
  1940. // C++: Ptr_AlignMTB cv::createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true)
  1941. [DllImport(LIBNAME)]
  1942. private static extern IntPtr photo_Photo_createAlignMTB_10(int max_bits, int exclude_range, [MarshalAs(UnmanagedType.U1)] bool cut);
  1943. [DllImport(LIBNAME)]
  1944. private static extern IntPtr photo_Photo_createAlignMTB_11(int max_bits, int exclude_range);
  1945. [DllImport(LIBNAME)]
  1946. private static extern IntPtr photo_Photo_createAlignMTB_12(int max_bits);
  1947. [DllImport(LIBNAME)]
  1948. private static extern IntPtr photo_Photo_createAlignMTB_13();
  1949. // C++: Ptr_CalibrateDebevec cv::createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false)
  1950. [DllImport(LIBNAME)]
  1951. private static extern IntPtr photo_Photo_createCalibrateDebevec_10(int samples, float lambda, [MarshalAs(UnmanagedType.U1)] bool random);
  1952. [DllImport(LIBNAME)]
  1953. private static extern IntPtr photo_Photo_createCalibrateDebevec_11(int samples, float lambda);
  1954. [DllImport(LIBNAME)]
  1955. private static extern IntPtr photo_Photo_createCalibrateDebevec_12(int samples);
  1956. [DllImport(LIBNAME)]
  1957. private static extern IntPtr photo_Photo_createCalibrateDebevec_13();
  1958. // C++: Ptr_CalibrateRobertson cv::createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f)
  1959. [DllImport(LIBNAME)]
  1960. private static extern IntPtr photo_Photo_createCalibrateRobertson_10(int max_iter, float threshold);
  1961. [DllImport(LIBNAME)]
  1962. private static extern IntPtr photo_Photo_createCalibrateRobertson_11(int max_iter);
  1963. [DllImport(LIBNAME)]
  1964. private static extern IntPtr photo_Photo_createCalibrateRobertson_12();
  1965. // C++: Ptr_MergeDebevec cv::createMergeDebevec()
  1966. [DllImport(LIBNAME)]
  1967. private static extern IntPtr photo_Photo_createMergeDebevec_10();
  1968. // C++: Ptr_MergeMertens cv::createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f)
  1969. [DllImport(LIBNAME)]
  1970. private static extern IntPtr photo_Photo_createMergeMertens_10(float contrast_weight, float saturation_weight, float exposure_weight);
  1971. [DllImport(LIBNAME)]
  1972. private static extern IntPtr photo_Photo_createMergeMertens_11(float contrast_weight, float saturation_weight);
  1973. [DllImport(LIBNAME)]
  1974. private static extern IntPtr photo_Photo_createMergeMertens_12(float contrast_weight);
  1975. [DllImport(LIBNAME)]
  1976. private static extern IntPtr photo_Photo_createMergeMertens_13();
  1977. // C++: Ptr_MergeRobertson cv::createMergeRobertson()
  1978. [DllImport(LIBNAME)]
  1979. private static extern IntPtr photo_Photo_createMergeRobertson_10();
  1980. // C++: void cv::decolor(Mat src, Mat& grayscale, Mat& color_boost)
  1981. [DllImport(LIBNAME)]
  1982. private static extern void photo_Photo_decolor_10(IntPtr src_nativeObj, IntPtr grayscale_nativeObj, IntPtr color_boost_nativeObj);
  1983. // C++: void cv::seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat& blend, int flags)
  1984. [DllImport(LIBNAME)]
  1985. private static extern void photo_Photo_seamlessClone_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, IntPtr mask_nativeObj, double p_x, double p_y, IntPtr blend_nativeObj, int flags);
  1986. // C++: void cv::colorChange(Mat src, Mat mask, Mat& dst, float red_mul = 1.0f, float green_mul = 1.0f, float blue_mul = 1.0f)
  1987. [DllImport(LIBNAME)]
  1988. private static extern void photo_Photo_colorChange_10(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float red_mul, float green_mul, float blue_mul);
  1989. [DllImport(LIBNAME)]
  1990. private static extern void photo_Photo_colorChange_11(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float red_mul, float green_mul);
  1991. [DllImport(LIBNAME)]
  1992. private static extern void photo_Photo_colorChange_12(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float red_mul);
  1993. [DllImport(LIBNAME)]
  1994. private static extern void photo_Photo_colorChange_13(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj);
  1995. // C++: void cv::illuminationChange(Mat src, Mat mask, Mat& dst, float alpha = 0.2f, float beta = 0.4f)
  1996. [DllImport(LIBNAME)]
  1997. private static extern void photo_Photo_illuminationChange_10(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float alpha, float beta);
  1998. [DllImport(LIBNAME)]
  1999. private static extern void photo_Photo_illuminationChange_11(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float alpha);
  2000. [DllImport(LIBNAME)]
  2001. private static extern void photo_Photo_illuminationChange_12(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj);
  2002. // C++: void cv::textureFlattening(Mat src, Mat mask, Mat& dst, float low_threshold = 30, float high_threshold = 45, int kernel_size = 3)
  2003. [DllImport(LIBNAME)]
  2004. private static extern void photo_Photo_textureFlattening_10(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float low_threshold, float high_threshold, int kernel_size);
  2005. [DllImport(LIBNAME)]
  2006. private static extern void photo_Photo_textureFlattening_11(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float low_threshold, float high_threshold);
  2007. [DllImport(LIBNAME)]
  2008. private static extern void photo_Photo_textureFlattening_12(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj, float low_threshold);
  2009. [DllImport(LIBNAME)]
  2010. private static extern void photo_Photo_textureFlattening_13(IntPtr src_nativeObj, IntPtr mask_nativeObj, IntPtr dst_nativeObj);
  2011. // C++: void cv::edgePreservingFilter(Mat src, Mat& dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4f)
  2012. [DllImport(LIBNAME)]
  2013. private static extern void photo_Photo_edgePreservingFilter_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, int flags, float sigma_s, float sigma_r);
  2014. [DllImport(LIBNAME)]
  2015. private static extern void photo_Photo_edgePreservingFilter_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, int flags, float sigma_s);
  2016. [DllImport(LIBNAME)]
  2017. private static extern void photo_Photo_edgePreservingFilter_12(IntPtr src_nativeObj, IntPtr dst_nativeObj, int flags);
  2018. [DllImport(LIBNAME)]
  2019. private static extern void photo_Photo_edgePreservingFilter_13(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  2020. // C++: void cv::detailEnhance(Mat src, Mat& dst, float sigma_s = 10, float sigma_r = 0.15f)
  2021. [DllImport(LIBNAME)]
  2022. private static extern void photo_Photo_detailEnhance_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float sigma_s, float sigma_r);
  2023. [DllImport(LIBNAME)]
  2024. private static extern void photo_Photo_detailEnhance_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, float sigma_s);
  2025. [DllImport(LIBNAME)]
  2026. private static extern void photo_Photo_detailEnhance_12(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  2027. // C++: void cv::pencilSketch(Mat src, Mat& dst1, Mat& dst2, float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f)
  2028. [DllImport(LIBNAME)]
  2029. private static extern void photo_Photo_pencilSketch_10(IntPtr src_nativeObj, IntPtr dst1_nativeObj, IntPtr dst2_nativeObj, float sigma_s, float sigma_r, float shade_factor);
  2030. [DllImport(LIBNAME)]
  2031. private static extern void photo_Photo_pencilSketch_11(IntPtr src_nativeObj, IntPtr dst1_nativeObj, IntPtr dst2_nativeObj, float sigma_s, float sigma_r);
  2032. [DllImport(LIBNAME)]
  2033. private static extern void photo_Photo_pencilSketch_12(IntPtr src_nativeObj, IntPtr dst1_nativeObj, IntPtr dst2_nativeObj, float sigma_s);
  2034. [DllImport(LIBNAME)]
  2035. private static extern void photo_Photo_pencilSketch_13(IntPtr src_nativeObj, IntPtr dst1_nativeObj, IntPtr dst2_nativeObj);
  2036. // C++: void cv::stylization(Mat src, Mat& dst, float sigma_s = 60, float sigma_r = 0.45f)
  2037. [DllImport(LIBNAME)]
  2038. private static extern void photo_Photo_stylization_10(IntPtr src_nativeObj, IntPtr dst_nativeObj, float sigma_s, float sigma_r);
  2039. [DllImport(LIBNAME)]
  2040. private static extern void photo_Photo_stylization_11(IntPtr src_nativeObj, IntPtr dst_nativeObj, float sigma_s);
  2041. [DllImport(LIBNAME)]
  2042. private static extern void photo_Photo_stylization_12(IntPtr src_nativeObj, IntPtr dst_nativeObj);
  2043. }
  2044. }