Retina.cs 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.BioinspiredModule
  7. {
  8. // C++: class Retina
  9. /**
  10. * class which allows the Gipsa/Listic Labs model to be used with OpenCV.
  11. *
  12. * This retina model allows spatio-temporal image processing (applied on still images, video sequences).
  13. * As a summary, these are the retina model properties:
  14. * <ul>
  15. * <li>
  16. * It applies a spectral whithening (mid-frequency details enhancement)
  17. * </li>
  18. * <li>
  19. * high frequency spatio-temporal noise reduction
  20. * </li>
  21. * <li>
  22. * low frequency luminance to be reduced (luminance range compression)
  23. * </li>
  24. * <li>
  25. * local logarithmic luminance compression allows details to be enhanced in low light conditions
  26. * </li>
  27. * </ul>
  28. *
  29. * USE : this model can be used basically for spatio-temporal video effects but also for :
  30. * _using the getParvo method output matrix : texture analysiswith enhanced signal to noise ratio and enhanced details robust against input images luminance ranges
  31. * _using the getMagno method output matrix : motion analysis also with the previously cited properties
  32. *
  33. * for more information, reer to the following papers :
  34. * Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  35. * Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
  36. *
  37. * The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
  38. * take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
  39. * B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
  40. * take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
  41. * more informations in the above cited Jeanny Heraults's book.
  42. */
  43. public class Retina : Algorithm
  44. {
  45. protected override void Dispose(bool disposing)
  46. {
  47. try
  48. {
  49. if (disposing)
  50. {
  51. }
  52. if (IsEnabledDispose)
  53. {
  54. if (nativeObj != IntPtr.Zero)
  55. bioinspired_Retina_delete(nativeObj);
  56. nativeObj = IntPtr.Zero;
  57. }
  58. }
  59. finally
  60. {
  61. base.Dispose(disposing);
  62. }
  63. }
  64. protected internal Retina(IntPtr addr) : base(addr) { }
  65. // internal usage only
  66. public static new Retina __fromPtr__(IntPtr addr) { return new Retina(addr); }
  67. //
  68. // C++: Size cv::bioinspired::Retina::getInputSize()
  69. //
  70. /**
  71. * Retreive retina input buffer size
  72. * return the retina input buffer size
  73. */
  74. public Size getInputSize()
  75. {
  76. ThrowIfDisposed();
  77. double[] tmpArray = new double[2];
  78. bioinspired_Retina_getInputSize_10(nativeObj, tmpArray);
  79. Size retVal = new Size(tmpArray);
  80. return retVal;
  81. }
  82. //
  83. // C++: Size cv::bioinspired::Retina::getOutputSize()
  84. //
  85. /**
  86. * Retreive retina output buffer size that can be different from the input if a spatial log
  87. * transformation is applied
  88. * return the retina output buffer size
  89. */
  90. public Size getOutputSize()
  91. {
  92. ThrowIfDisposed();
  93. double[] tmpArray = new double[2];
  94. bioinspired_Retina_getOutputSize_10(nativeObj, tmpArray);
  95. Size retVal = new Size(tmpArray);
  96. return retVal;
  97. }
  98. //
  99. // C++: void cv::bioinspired::Retina::setup(String retinaParameterFile = "", bool applyDefaultSetupOnFailure = true)
  100. //
  101. /**
  102. * Try to open an XML retina parameters file to adjust current retina instance setup
  103. *
  104. * <ul>
  105. * <li>
  106. * if the xml file does not exist, then default setup is applied
  107. * </li>
  108. * <li>
  109. * warning, Exceptions are thrown if read XML file is not valid
  110. * </li>
  111. * </ul>
  112. * param retinaParameterFile the parameters filename
  113. * param applyDefaultSetupOnFailure set to true if an error must be thrown on error
  114. *
  115. * You can retrieve the current parameters structure using the method Retina::getParameters and update
  116. * it before running method Retina::setup.
  117. */
  118. public void setup(string retinaParameterFile, bool applyDefaultSetupOnFailure)
  119. {
  120. ThrowIfDisposed();
  121. bioinspired_Retina_setup_10(nativeObj, retinaParameterFile, applyDefaultSetupOnFailure);
  122. }
  123. /**
  124. * Try to open an XML retina parameters file to adjust current retina instance setup
  125. *
  126. * <ul>
  127. * <li>
  128. * if the xml file does not exist, then default setup is applied
  129. * </li>
  130. * <li>
  131. * warning, Exceptions are thrown if read XML file is not valid
  132. * </li>
  133. * </ul>
  134. * param retinaParameterFile the parameters filename
  135. *
  136. * You can retrieve the current parameters structure using the method Retina::getParameters and update
  137. * it before running method Retina::setup.
  138. */
  139. public void setup(string retinaParameterFile)
  140. {
  141. ThrowIfDisposed();
  142. bioinspired_Retina_setup_11(nativeObj, retinaParameterFile);
  143. }
  144. /**
  145. * Try to open an XML retina parameters file to adjust current retina instance setup
  146. *
  147. * <ul>
  148. * <li>
  149. * if the xml file does not exist, then default setup is applied
  150. * </li>
  151. * <li>
  152. * warning, Exceptions are thrown if read XML file is not valid
  153. * </li>
  154. * </ul>
  155. *
  156. * You can retrieve the current parameters structure using the method Retina::getParameters and update
  157. * it before running method Retina::setup.
  158. */
  159. public void setup()
  160. {
  161. ThrowIfDisposed();
  162. bioinspired_Retina_setup_12(nativeObj);
  163. }
  164. //
  165. // C++: String cv::bioinspired::Retina::printSetup()
  166. //
  167. /**
  168. * Outputs a string showing the used parameters setup
  169. * return a string which contains formated parameters information
  170. */
  171. public string printSetup()
  172. {
  173. ThrowIfDisposed();
  174. string retVal = Marshal.PtrToStringAnsi(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_printSetup_10(nativeObj)));
  175. return retVal;
  176. }
  177. //
  178. // C++: void cv::bioinspired::Retina::write(String fs)
  179. //
  180. /**
  181. * Write xml/yml formated parameters information
  182. * param fs the filename of the xml file that will be open and writen with formatted parameters
  183. * information
  184. */
  185. public void write(string fs)
  186. {
  187. ThrowIfDisposed();
  188. bioinspired_Retina_write_10(nativeObj, fs);
  189. }
  190. //
  191. // C++: void cv::bioinspired::Retina::setupOPLandIPLParvoChannel(bool colorMode = true, bool normaliseOutput = true, float photoreceptorsLocalAdaptationSensitivity = 0.7f, float photoreceptorsTemporalConstant = 0.5f, float photoreceptorsSpatialConstant = 0.53f, float horizontalCellsGain = 0.f, float HcellsTemporalConstant = 1.f, float HcellsSpatialConstant = 7.f, float ganglionCellsSensitivity = 0.7f)
  192. //
  193. /**
  194. * Setup the OPL and IPL parvo channels (see biologocal model)
  195. *
  196. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  197. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  198. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  199. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  200. * reference papers for more informations.
  201. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  202. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  203. * level image
  204. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  205. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  206. * (more log compression effect when value increases)
  207. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  208. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  209. * frames, typical value is 1 frame
  210. * param photoreceptorsSpatialConstant the spatial constant of the first order low pass filter of
  211. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  212. * pixels, typical value is 1 pixel
  213. * param horizontalCellsGain gain of the horizontal cells network, if 0, then the mean value of
  214. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  215. * still reachable at the output, typicall value is 0
  216. * param HcellsTemporalConstant the time constant of the first order low pass filter of the
  217. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  218. * frames, typical value is 1 frame, as the photoreceptors
  219. * param HcellsSpatialConstant the spatial constant of the first order low pass filter of the
  220. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  221. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  222. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  223. * channel model)
  224. * param ganglionCellsSensitivity the compression strengh of the ganglion cells local adaptation
  225. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  226. * value sensitivity... and the output saturates faster, recommended value: 0.7
  227. */
  228. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant, float ganglionCellsSensitivity)
  229. {
  230. ThrowIfDisposed();
  231. bioinspired_Retina_setupOPLandIPLParvoChannel_10(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant, ganglionCellsSensitivity);
  232. }
  233. /**
  234. * Setup the OPL and IPL parvo channels (see biologocal model)
  235. *
  236. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  237. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  238. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  239. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  240. * reference papers for more informations.
  241. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  242. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  243. * level image
  244. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  245. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  246. * (more log compression effect when value increases)
  247. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  248. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  249. * frames, typical value is 1 frame
  250. * param photoreceptorsSpatialConstant the spatial constant of the first order low pass filter of
  251. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  252. * pixels, typical value is 1 pixel
  253. * param horizontalCellsGain gain of the horizontal cells network, if 0, then the mean value of
  254. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  255. * still reachable at the output, typicall value is 0
  256. * param HcellsTemporalConstant the time constant of the first order low pass filter of the
  257. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  258. * frames, typical value is 1 frame, as the photoreceptors
  259. * param HcellsSpatialConstant the spatial constant of the first order low pass filter of the
  260. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  261. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  262. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  263. * channel model)
  264. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  265. * value sensitivity... and the output saturates faster, recommended value: 0.7
  266. */
  267. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant)
  268. {
  269. ThrowIfDisposed();
  270. bioinspired_Retina_setupOPLandIPLParvoChannel_11(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant);
  271. }
  272. /**
  273. * Setup the OPL and IPL parvo channels (see biologocal model)
  274. *
  275. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  276. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  277. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  278. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  279. * reference papers for more informations.
  280. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  281. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  282. * level image
  283. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  284. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  285. * (more log compression effect when value increases)
  286. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  287. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  288. * frames, typical value is 1 frame
  289. * param photoreceptorsSpatialConstant the spatial constant of the first order low pass filter of
  290. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  291. * pixels, typical value is 1 pixel
  292. * param horizontalCellsGain gain of the horizontal cells network, if 0, then the mean value of
  293. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  294. * still reachable at the output, typicall value is 0
  295. * param HcellsTemporalConstant the time constant of the first order low pass filter of the
  296. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  297. * frames, typical value is 1 frame, as the photoreceptors
  298. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  299. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  300. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  301. * channel model)
  302. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  303. * value sensitivity... and the output saturates faster, recommended value: 0.7
  304. */
  305. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant)
  306. {
  307. ThrowIfDisposed();
  308. bioinspired_Retina_setupOPLandIPLParvoChannel_12(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant);
  309. }
  310. /**
  311. * Setup the OPL and IPL parvo channels (see biologocal model)
  312. *
  313. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  314. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  315. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  316. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  317. * reference papers for more informations.
  318. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  319. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  320. * level image
  321. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  322. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  323. * (more log compression effect when value increases)
  324. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  325. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  326. * frames, typical value is 1 frame
  327. * param photoreceptorsSpatialConstant the spatial constant of the first order low pass filter of
  328. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  329. * pixels, typical value is 1 pixel
  330. * param horizontalCellsGain gain of the horizontal cells network, if 0, then the mean value of
  331. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  332. * still reachable at the output, typicall value is 0
  333. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  334. * frames, typical value is 1 frame, as the photoreceptors
  335. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  336. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  337. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  338. * channel model)
  339. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  340. * value sensitivity... and the output saturates faster, recommended value: 0.7
  341. */
  342. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain)
  343. {
  344. ThrowIfDisposed();
  345. bioinspired_Retina_setupOPLandIPLParvoChannel_13(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain);
  346. }
  347. /**
  348. * Setup the OPL and IPL parvo channels (see biologocal model)
  349. *
  350. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  351. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  352. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  353. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  354. * reference papers for more informations.
  355. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  356. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  357. * level image
  358. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  359. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  360. * (more log compression effect when value increases)
  361. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  362. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  363. * frames, typical value is 1 frame
  364. * param photoreceptorsSpatialConstant the spatial constant of the first order low pass filter of
  365. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  366. * pixels, typical value is 1 pixel
  367. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  368. * still reachable at the output, typicall value is 0
  369. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  370. * frames, typical value is 1 frame, as the photoreceptors
  371. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  372. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  373. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  374. * channel model)
  375. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  376. * value sensitivity... and the output saturates faster, recommended value: 0.7
  377. */
  378. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant)
  379. {
  380. ThrowIfDisposed();
  381. bioinspired_Retina_setupOPLandIPLParvoChannel_14(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant);
  382. }
  383. /**
  384. * Setup the OPL and IPL parvo channels (see biologocal model)
  385. *
  386. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  387. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  388. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  389. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  390. * reference papers for more informations.
  391. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  392. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  393. * level image
  394. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  395. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  396. * (more log compression effect when value increases)
  397. * param photoreceptorsTemporalConstant the time constant of the first order low pass filter of
  398. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  399. * frames, typical value is 1 frame
  400. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  401. * pixels, typical value is 1 pixel
  402. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  403. * still reachable at the output, typicall value is 0
  404. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  405. * frames, typical value is 1 frame, as the photoreceptors
  406. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  407. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  408. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  409. * channel model)
  410. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  411. * value sensitivity... and the output saturates faster, recommended value: 0.7
  412. */
  413. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant)
  414. {
  415. ThrowIfDisposed();
  416. bioinspired_Retina_setupOPLandIPLParvoChannel_15(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant);
  417. }
  418. /**
  419. * Setup the OPL and IPL parvo channels (see biologocal model)
  420. *
  421. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  422. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  423. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  424. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  425. * reference papers for more informations.
  426. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  427. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  428. * level image
  429. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  430. * param photoreceptorsLocalAdaptationSensitivity the photoreceptors sensitivity renage is 0-1
  431. * (more log compression effect when value increases)
  432. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  433. * frames, typical value is 1 frame
  434. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  435. * pixels, typical value is 1 pixel
  436. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  437. * still reachable at the output, typicall value is 0
  438. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  439. * frames, typical value is 1 frame, as the photoreceptors
  440. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  441. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  442. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  443. * channel model)
  444. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  445. * value sensitivity... and the output saturates faster, recommended value: 0.7
  446. */
  447. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity)
  448. {
  449. ThrowIfDisposed();
  450. bioinspired_Retina_setupOPLandIPLParvoChannel_16(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity);
  451. }
  452. /**
  453. * Setup the OPL and IPL parvo channels (see biologocal model)
  454. *
  455. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  456. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  457. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  458. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  459. * reference papers for more informations.
  460. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  461. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  462. * level image
  463. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  464. * (more log compression effect when value increases)
  465. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  466. * frames, typical value is 1 frame
  467. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  468. * pixels, typical value is 1 pixel
  469. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  470. * still reachable at the output, typicall value is 0
  471. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  472. * frames, typical value is 1 frame, as the photoreceptors
  473. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  474. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  475. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  476. * channel model)
  477. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  478. * value sensitivity... and the output saturates faster, recommended value: 0.7
  479. */
  480. public void setupOPLandIPLParvoChannel(bool colorMode, bool normaliseOutput)
  481. {
  482. ThrowIfDisposed();
  483. bioinspired_Retina_setupOPLandIPLParvoChannel_17(nativeObj, colorMode, normaliseOutput);
  484. }
  485. /**
  486. * Setup the OPL and IPL parvo channels (see biologocal model)
  487. *
  488. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  489. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  490. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  491. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  492. * reference papers for more informations.
  493. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  494. * param colorMode specifies if (true) color is processed of not (false) to then processing gray
  495. * level image
  496. * (more log compression effect when value increases)
  497. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  498. * frames, typical value is 1 frame
  499. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  500. * pixels, typical value is 1 pixel
  501. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  502. * still reachable at the output, typicall value is 0
  503. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  504. * frames, typical value is 1 frame, as the photoreceptors
  505. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  506. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  507. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  508. * channel model)
  509. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  510. * value sensitivity... and the output saturates faster, recommended value: 0.7
  511. */
  512. public void setupOPLandIPLParvoChannel(bool colorMode)
  513. {
  514. ThrowIfDisposed();
  515. bioinspired_Retina_setupOPLandIPLParvoChannel_18(nativeObj, colorMode);
  516. }
  517. /**
  518. * Setup the OPL and IPL parvo channels (see biologocal model)
  519. *
  520. * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering
  521. * which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance
  522. * (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the
  523. * Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See
  524. * reference papers for more informations.
  525. * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
  526. * level image
  527. * (more log compression effect when value increases)
  528. * the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is
  529. * frames, typical value is 1 frame
  530. * the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is
  531. * pixels, typical value is 1 pixel
  532. * the output is zero, if the parameter is near 1, then, the luminance is not filtered and is
  533. * still reachable at the output, typicall value is 0
  534. * horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is
  535. * frames, typical value is 1 frame, as the photoreceptors
  536. * horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels,
  537. * typical value is 5 pixel, this value is also used for local contrast computing when computing
  538. * the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular
  539. * channel model)
  540. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  541. * value sensitivity... and the output saturates faster, recommended value: 0.7
  542. */
  543. public void setupOPLandIPLParvoChannel()
  544. {
  545. ThrowIfDisposed();
  546. bioinspired_Retina_setupOPLandIPLParvoChannel_19(nativeObj);
  547. }
  548. //
  549. // C++: void cv::bioinspired::Retina::setupIPLMagnoChannel(bool normaliseOutput = true, float parasolCells_beta = 0.f, float parasolCells_tau = 0.f, float parasolCells_k = 7.f, float amacrinCellsTemporalCutFrequency = 1.2f, float V0CompressionParameter = 0.95f, float localAdaptintegration_tau = 0.f, float localAdaptintegration_k = 7.f)
  550. //
  551. /**
  552. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  553. *
  554. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  555. * motion information enhancement. It is decorrelated from the details channel. See reference
  556. * papers for more details.
  557. *
  558. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  559. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  560. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  561. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  562. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  563. * value is 0 (immediate response)
  564. * param parasolCells_k the low pass filter spatial constant used for local contrast adaptation
  565. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  566. * value is 5
  567. * param amacrinCellsTemporalCutFrequency the time constant of the first order high pass fiter of
  568. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  569. * param V0CompressionParameter the compression strengh of the ganglion cells local adaptation
  570. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  571. * value sensitivity... and the output saturates faster, recommended value: 0.95
  572. * param localAdaptintegration_tau specifies the temporal constant of the low pas filter
  573. * involved in the computation of the local "motion mean" for the local adaptation computation
  574. * param localAdaptintegration_k specifies the spatial constant of the low pas filter involved
  575. * in the computation of the local "motion mean" for the local adaptation computation
  576. */
  577. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau, float localAdaptintegration_k)
  578. {
  579. ThrowIfDisposed();
  580. bioinspired_Retina_setupIPLMagnoChannel_10(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau, localAdaptintegration_k);
  581. }
  582. /**
  583. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  584. *
  585. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  586. * motion information enhancement. It is decorrelated from the details channel. See reference
  587. * papers for more details.
  588. *
  589. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  590. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  591. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  592. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  593. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  594. * value is 0 (immediate response)
  595. * param parasolCells_k the low pass filter spatial constant used for local contrast adaptation
  596. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  597. * value is 5
  598. * param amacrinCellsTemporalCutFrequency the time constant of the first order high pass fiter of
  599. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  600. * param V0CompressionParameter the compression strengh of the ganglion cells local adaptation
  601. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  602. * value sensitivity... and the output saturates faster, recommended value: 0.95
  603. * param localAdaptintegration_tau specifies the temporal constant of the low pas filter
  604. * involved in the computation of the local "motion mean" for the local adaptation computation
  605. * in the computation of the local "motion mean" for the local adaptation computation
  606. */
  607. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau)
  608. {
  609. ThrowIfDisposed();
  610. bioinspired_Retina_setupIPLMagnoChannel_11(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau);
  611. }
  612. /**
  613. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  614. *
  615. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  616. * motion information enhancement. It is decorrelated from the details channel. See reference
  617. * papers for more details.
  618. *
  619. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  620. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  621. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  622. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  623. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  624. * value is 0 (immediate response)
  625. * param parasolCells_k the low pass filter spatial constant used for local contrast adaptation
  626. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  627. * value is 5
  628. * param amacrinCellsTemporalCutFrequency the time constant of the first order high pass fiter of
  629. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  630. * param V0CompressionParameter the compression strengh of the ganglion cells local adaptation
  631. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  632. * value sensitivity... and the output saturates faster, recommended value: 0.95
  633. * involved in the computation of the local "motion mean" for the local adaptation computation
  634. * in the computation of the local "motion mean" for the local adaptation computation
  635. */
  636. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter)
  637. {
  638. ThrowIfDisposed();
  639. bioinspired_Retina_setupIPLMagnoChannel_12(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter);
  640. }
  641. /**
  642. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  643. *
  644. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  645. * motion information enhancement. It is decorrelated from the details channel. See reference
  646. * papers for more details.
  647. *
  648. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  649. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  650. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  651. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  652. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  653. * value is 0 (immediate response)
  654. * param parasolCells_k the low pass filter spatial constant used for local contrast adaptation
  655. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  656. * value is 5
  657. * param amacrinCellsTemporalCutFrequency the time constant of the first order high pass fiter of
  658. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  659. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  660. * value sensitivity... and the output saturates faster, recommended value: 0.95
  661. * involved in the computation of the local "motion mean" for the local adaptation computation
  662. * in the computation of the local "motion mean" for the local adaptation computation
  663. */
  664. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency)
  665. {
  666. ThrowIfDisposed();
  667. bioinspired_Retina_setupIPLMagnoChannel_13(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency);
  668. }
  669. /**
  670. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  671. *
  672. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  673. * motion information enhancement. It is decorrelated from the details channel. See reference
  674. * papers for more details.
  675. *
  676. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  677. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  678. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  679. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  680. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  681. * value is 0 (immediate response)
  682. * param parasolCells_k the low pass filter spatial constant used for local contrast adaptation
  683. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  684. * value is 5
  685. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  686. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  687. * value sensitivity... and the output saturates faster, recommended value: 0.95
  688. * involved in the computation of the local "motion mean" for the local adaptation computation
  689. * in the computation of the local "motion mean" for the local adaptation computation
  690. */
  691. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k)
  692. {
  693. ThrowIfDisposed();
  694. bioinspired_Retina_setupIPLMagnoChannel_14(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k);
  695. }
  696. /**
  697. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  698. *
  699. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  700. * motion information enhancement. It is decorrelated from the details channel. See reference
  701. * papers for more details.
  702. *
  703. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  704. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  705. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  706. * param parasolCells_tau the low pass filter time constant used for local contrast adaptation
  707. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  708. * value is 0 (immediate response)
  709. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  710. * value is 5
  711. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  712. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  713. * value sensitivity... and the output saturates faster, recommended value: 0.95
  714. * involved in the computation of the local "motion mean" for the local adaptation computation
  715. * in the computation of the local "motion mean" for the local adaptation computation
  716. */
  717. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta, float parasolCells_tau)
  718. {
  719. ThrowIfDisposed();
  720. bioinspired_Retina_setupIPLMagnoChannel_15(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau);
  721. }
  722. /**
  723. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  724. *
  725. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  726. * motion information enhancement. It is decorrelated from the details channel. See reference
  727. * papers for more details.
  728. *
  729. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  730. * param parasolCells_beta the low pass filter gain used for local contrast adaptation at the
  731. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  732. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  733. * value is 0 (immediate response)
  734. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  735. * value is 5
  736. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  737. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  738. * value sensitivity... and the output saturates faster, recommended value: 0.95
  739. * involved in the computation of the local "motion mean" for the local adaptation computation
  740. * in the computation of the local "motion mean" for the local adaptation computation
  741. */
  742. public void setupIPLMagnoChannel(bool normaliseOutput, float parasolCells_beta)
  743. {
  744. ThrowIfDisposed();
  745. bioinspired_Retina_setupIPLMagnoChannel_16(nativeObj, normaliseOutput, parasolCells_beta);
  746. }
  747. /**
  748. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  749. *
  750. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  751. * motion information enhancement. It is decorrelated from the details channel. See reference
  752. * papers for more details.
  753. *
  754. * param normaliseOutput specifies if (true) output is rescaled between 0 and 255 of not (false)
  755. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  756. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  757. * value is 0 (immediate response)
  758. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  759. * value is 5
  760. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  761. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  762. * value sensitivity... and the output saturates faster, recommended value: 0.95
  763. * involved in the computation of the local "motion mean" for the local adaptation computation
  764. * in the computation of the local "motion mean" for the local adaptation computation
  765. */
  766. public void setupIPLMagnoChannel(bool normaliseOutput)
  767. {
  768. ThrowIfDisposed();
  769. bioinspired_Retina_setupIPLMagnoChannel_17(nativeObj, normaliseOutput);
  770. }
  771. /**
  772. * Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
  773. *
  774. * this channel processes signals output from OPL processing stage in peripheral vision, it allows
  775. * motion information enhancement. It is decorrelated from the details channel. See reference
  776. * papers for more details.
  777. *
  778. * IPL level of the retina (for ganglion cells local adaptation), typical value is 0
  779. * at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical
  780. * value is 0 (immediate response)
  781. * at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical
  782. * value is 5
  783. * the magnocellular way (motion information channel), unit is frames, typical value is 1.2
  784. * output, set a value between 0.6 and 1 for best results, a high value increases more the low
  785. * value sensitivity... and the output saturates faster, recommended value: 0.95
  786. * involved in the computation of the local "motion mean" for the local adaptation computation
  787. * in the computation of the local "motion mean" for the local adaptation computation
  788. */
  789. public void setupIPLMagnoChannel()
  790. {
  791. ThrowIfDisposed();
  792. bioinspired_Retina_setupIPLMagnoChannel_18(nativeObj);
  793. }
  794. //
  795. // C++: void cv::bioinspired::Retina::run(Mat inputImage)
  796. //
  797. /**
  798. * Method which allows retina to be applied on an input image,
  799. *
  800. * after run, encapsulated retina module is ready to deliver its outputs using dedicated
  801. * acccessors, see getParvo and getMagno methods
  802. * param inputImage the input Mat image to be processed, can be gray level or BGR coded in any
  803. * format (from 8bit to 16bits)
  804. */
  805. public void run(Mat inputImage)
  806. {
  807. ThrowIfDisposed();
  808. if (inputImage != null) inputImage.ThrowIfDisposed();
  809. bioinspired_Retina_run_10(nativeObj, inputImage.nativeObj);
  810. }
  811. //
  812. // C++: void cv::bioinspired::Retina::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
  813. //
  814. /**
  815. * Method which processes an image in the aim to correct its luminance correct
  816. * backlight problems, enhance details in shadows.
  817. *
  818. * This method is designed to perform High Dynamic Range image tone mapping (compress &gt;8bit/pixel
  819. * images to 8bit/pixel). This is a simplified version of the Retina Parvocellular model
  820. * (simplified version of the run/getParvo methods call) since it does not include the
  821. * spatio-temporal filter modelling the Outer Plexiform Layer of the retina that performs spectral
  822. * whitening and many other stuff. However, it works great for tone mapping and in a faster way.
  823. *
  824. * Check the demos and experiments section to see examples and the way to perform tone mapping
  825. * using the original retina model and the method.
  826. *
  827. * param inputImage the input image to process (should be coded in float format : CV_32F,
  828. * CV_32FC1, CV_32F_C3, CV_32F_C4, the 4th channel won't be considered).
  829. * param outputToneMappedImage the output 8bit/channel tone mapped image (CV_8U or CV_8UC3 format).
  830. */
  831. public void applyFastToneMapping(Mat inputImage, Mat outputToneMappedImage)
  832. {
  833. ThrowIfDisposed();
  834. if (inputImage != null) inputImage.ThrowIfDisposed();
  835. if (outputToneMappedImage != null) outputToneMappedImage.ThrowIfDisposed();
  836. bioinspired_Retina_applyFastToneMapping_10(nativeObj, inputImage.nativeObj, outputToneMappedImage.nativeObj);
  837. }
  838. //
  839. // C++: void cv::bioinspired::Retina::getParvo(Mat& retinaOutput_parvo)
  840. //
  841. /**
  842. * Accessor of the details channel of the retina (models foveal vision).
  843. *
  844. * Warning, getParvoRAW methods return buffers that are not rescaled within range [0;255] while
  845. * the non RAW method allows a normalized matrix to be retrieved.
  846. *
  847. * param retinaOutput_parvo the output buffer (reallocated if necessary), format can be :
  848. * <ul>
  849. * <li>
  850. * a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
  851. * </li>
  852. * <li>
  853. * RAW methods actually return a 1D matrix (encoding is R1, R2, ... Rn, G1, G2, ..., Gn, B1,
  854. * B2, ...Bn), this output is the original retina filter model output, without any
  855. * quantification or rescaling.
  856. * SEE: getParvoRAW
  857. * </li>
  858. * </ul>
  859. */
  860. public void getParvo(Mat retinaOutput_parvo)
  861. {
  862. ThrowIfDisposed();
  863. if (retinaOutput_parvo != null) retinaOutput_parvo.ThrowIfDisposed();
  864. bioinspired_Retina_getParvo_10(nativeObj, retinaOutput_parvo.nativeObj);
  865. }
  866. //
  867. // C++: void cv::bioinspired::Retina::getParvoRAW(Mat& retinaOutput_parvo)
  868. //
  869. /**
  870. * Accessor of the details channel of the retina (models foveal vision).
  871. * SEE: getParvo
  872. * param retinaOutput_parvo automatically generated
  873. */
  874. public void getParvoRAW(Mat retinaOutput_parvo)
  875. {
  876. ThrowIfDisposed();
  877. if (retinaOutput_parvo != null) retinaOutput_parvo.ThrowIfDisposed();
  878. bioinspired_Retina_getParvoRAW_10(nativeObj, retinaOutput_parvo.nativeObj);
  879. }
  880. //
  881. // C++: void cv::bioinspired::Retina::getMagno(Mat& retinaOutput_magno)
  882. //
  883. /**
  884. * Accessor of the motion channel of the retina (models peripheral vision).
  885. *
  886. * Warning, getMagnoRAW methods return buffers that are not rescaled within range [0;255] while
  887. * the non RAW method allows a normalized matrix to be retrieved.
  888. * param retinaOutput_magno the output buffer (reallocated if necessary), format can be :
  889. * <ul>
  890. * <li>
  891. * a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
  892. * </li>
  893. * <li>
  894. * RAW methods actually return a 1D matrix (encoding is M1, M2,... Mn), this output is the
  895. * original retina filter model output, without any quantification or rescaling.
  896. * SEE: getMagnoRAW
  897. * </li>
  898. * </ul>
  899. */
  900. public void getMagno(Mat retinaOutput_magno)
  901. {
  902. ThrowIfDisposed();
  903. if (retinaOutput_magno != null) retinaOutput_magno.ThrowIfDisposed();
  904. bioinspired_Retina_getMagno_10(nativeObj, retinaOutput_magno.nativeObj);
  905. }
  906. //
  907. // C++: void cv::bioinspired::Retina::getMagnoRAW(Mat& retinaOutput_magno)
  908. //
  909. /**
  910. * Accessor of the motion channel of the retina (models peripheral vision).
  911. * SEE: getMagno
  912. * param retinaOutput_magno automatically generated
  913. */
  914. public void getMagnoRAW(Mat retinaOutput_magno)
  915. {
  916. ThrowIfDisposed();
  917. if (retinaOutput_magno != null) retinaOutput_magno.ThrowIfDisposed();
  918. bioinspired_Retina_getMagnoRAW_10(nativeObj, retinaOutput_magno.nativeObj);
  919. }
  920. //
  921. // C++: Mat cv::bioinspired::Retina::getMagnoRAW()
  922. //
  923. public Mat getMagnoRAW()
  924. {
  925. ThrowIfDisposed();
  926. return new Mat(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_getMagnoRAW_11(nativeObj)));
  927. }
  928. //
  929. // C++: Mat cv::bioinspired::Retina::getParvoRAW()
  930. //
  931. public Mat getParvoRAW()
  932. {
  933. ThrowIfDisposed();
  934. return new Mat(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_getParvoRAW_11(nativeObj)));
  935. }
  936. //
  937. // C++: void cv::bioinspired::Retina::setColorSaturation(bool saturateColors = true, float colorSaturationValue = 4.0f)
  938. //
  939. /**
  940. * Activate color saturation as the final step of the color demultiplexing process -&gt; this
  941. * saturation is a sigmoide function applied to each channel of the demultiplexed image.
  942. * param saturateColors boolean that activates color saturation (if true) or desactivate (if false)
  943. * param colorSaturationValue the saturation factor : a simple factor applied on the chrominance
  944. * buffers
  945. */
  946. public void setColorSaturation(bool saturateColors, float colorSaturationValue)
  947. {
  948. ThrowIfDisposed();
  949. bioinspired_Retina_setColorSaturation_10(nativeObj, saturateColors, colorSaturationValue);
  950. }
  951. /**
  952. * Activate color saturation as the final step of the color demultiplexing process -&gt; this
  953. * saturation is a sigmoide function applied to each channel of the demultiplexed image.
  954. * param saturateColors boolean that activates color saturation (if true) or desactivate (if false)
  955. * buffers
  956. */
  957. public void setColorSaturation(bool saturateColors)
  958. {
  959. ThrowIfDisposed();
  960. bioinspired_Retina_setColorSaturation_11(nativeObj, saturateColors);
  961. }
  962. /**
  963. * Activate color saturation as the final step of the color demultiplexing process -&gt; this
  964. * saturation is a sigmoide function applied to each channel of the demultiplexed image.
  965. * buffers
  966. */
  967. public void setColorSaturation()
  968. {
  969. ThrowIfDisposed();
  970. bioinspired_Retina_setColorSaturation_12(nativeObj);
  971. }
  972. //
  973. // C++: void cv::bioinspired::Retina::clearBuffers()
  974. //
  975. /**
  976. * Clears all retina buffers
  977. *
  978. * (equivalent to opening the eyes after a long period of eye close ;o) whatchout the temporal
  979. * transition occuring just after this method call.
  980. */
  981. public void clearBuffers()
  982. {
  983. ThrowIfDisposed();
  984. bioinspired_Retina_clearBuffers_10(nativeObj);
  985. }
  986. //
  987. // C++: void cv::bioinspired::Retina::activateMovingContoursProcessing(bool activate)
  988. //
  989. /**
  990. * Activate/desactivate the Magnocellular pathway processing (motion information extraction), by
  991. * default, it is activated
  992. * param activate true if Magnocellular output should be activated, false if not... if activated,
  993. * the Magnocellular output can be retrieved using the <b>getMagno</b> methods
  994. */
  995. public void activateMovingContoursProcessing(bool activate)
  996. {
  997. ThrowIfDisposed();
  998. bioinspired_Retina_activateMovingContoursProcessing_10(nativeObj, activate);
  999. }
  1000. //
  1001. // C++: void cv::bioinspired::Retina::activateContoursProcessing(bool activate)
  1002. //
  1003. /**
  1004. * Activate/desactivate the Parvocellular pathway processing (contours information extraction), by
  1005. * default, it is activated
  1006. * param activate true if Parvocellular (contours information extraction) output should be
  1007. * activated, false if not... if activated, the Parvocellular output can be retrieved using the
  1008. * Retina::getParvo methods
  1009. */
  1010. public void activateContoursProcessing(bool activate)
  1011. {
  1012. ThrowIfDisposed();
  1013. bioinspired_Retina_activateContoursProcessing_10(nativeObj, activate);
  1014. }
  1015. //
  1016. // C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize)
  1017. //
  1018. public static Retina create(Size inputSize)
  1019. {
  1020. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_10(inputSize.width, inputSize.height)));
  1021. }
  1022. //
  1023. // C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize, bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, bool useRetinaLogSampling = false, float reductionFactor = 1.0f, float samplingStrength = 10.0f)
  1024. //
  1025. /**
  1026. * Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
  1027. *
  1028. * param inputSize the input frame size
  1029. * param colorMode the chosen processing mode : with or without color processing
  1030. * param colorSamplingMethod specifies which kind of color sampling will be used :
  1031. * <ul>
  1032. * <li>
  1033. * cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  1034. * </li>
  1035. * <li>
  1036. * cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
  1037. * </li>
  1038. * <li>
  1039. * cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  1040. * </li>
  1041. * </ul>
  1042. * param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
  1043. * be used
  1044. * param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
  1045. * factor of the output frame (as the center (fovea) is high resolution and corners can be
  1046. * underscaled, then a reduction of the output is allowed without precision leak
  1047. * param samplingStrength only usefull if param useRetinaLogSampling=true, specifies the strength of
  1048. * the log scale that is applied
  1049. * return automatically generated
  1050. */
  1051. public static Retina create(Size inputSize, bool colorMode, int colorSamplingMethod, bool useRetinaLogSampling, float reductionFactor, float samplingStrength)
  1052. {
  1053. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_11(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrength)));
  1054. }
  1055. /**
  1056. * Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
  1057. *
  1058. * param inputSize the input frame size
  1059. * param colorMode the chosen processing mode : with or without color processing
  1060. * param colorSamplingMethod specifies which kind of color sampling will be used :
  1061. * <ul>
  1062. * <li>
  1063. * cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  1064. * </li>
  1065. * <li>
  1066. * cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
  1067. * </li>
  1068. * <li>
  1069. * cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  1070. * </li>
  1071. * </ul>
  1072. * param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
  1073. * be used
  1074. * param reductionFactor only usefull if param useRetinaLogSampling=true, specifies the reduction
  1075. * factor of the output frame (as the center (fovea) is high resolution and corners can be
  1076. * underscaled, then a reduction of the output is allowed without precision leak
  1077. * the log scale that is applied
  1078. * return automatically generated
  1079. */
  1080. public static Retina create(Size inputSize, bool colorMode, int colorSamplingMethod, bool useRetinaLogSampling, float reductionFactor)
  1081. {
  1082. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_12(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor)));
  1083. }
  1084. /**
  1085. * Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
  1086. *
  1087. * param inputSize the input frame size
  1088. * param colorMode the chosen processing mode : with or without color processing
  1089. * param colorSamplingMethod specifies which kind of color sampling will be used :
  1090. * <ul>
  1091. * <li>
  1092. * cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  1093. * </li>
  1094. * <li>
  1095. * cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
  1096. * </li>
  1097. * <li>
  1098. * cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  1099. * </li>
  1100. * </ul>
  1101. * param useRetinaLogSampling activate retina log sampling, if true, the 2 following parameters can
  1102. * be used
  1103. * factor of the output frame (as the center (fovea) is high resolution and corners can be
  1104. * underscaled, then a reduction of the output is allowed without precision leak
  1105. * the log scale that is applied
  1106. * return automatically generated
  1107. */
  1108. public static Retina create(Size inputSize, bool colorMode, int colorSamplingMethod, bool useRetinaLogSampling)
  1109. {
  1110. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_13(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling)));
  1111. }
  1112. /**
  1113. * Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
  1114. *
  1115. * param inputSize the input frame size
  1116. * param colorMode the chosen processing mode : with or without color processing
  1117. * param colorSamplingMethod specifies which kind of color sampling will be used :
  1118. * <ul>
  1119. * <li>
  1120. * cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  1121. * </li>
  1122. * <li>
  1123. * cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
  1124. * </li>
  1125. * <li>
  1126. * cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  1127. * </li>
  1128. * </ul>
  1129. * be used
  1130. * factor of the output frame (as the center (fovea) is high resolution and corners can be
  1131. * underscaled, then a reduction of the output is allowed without precision leak
  1132. * the log scale that is applied
  1133. * return automatically generated
  1134. */
  1135. public static Retina create(Size inputSize, bool colorMode, int colorSamplingMethod)
  1136. {
  1137. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_14(inputSize.width, inputSize.height, colorMode, colorSamplingMethod)));
  1138. }
  1139. /**
  1140. * Constructors from standardized interfaces : retreive a smart pointer to a Retina instance
  1141. *
  1142. * param inputSize the input frame size
  1143. * param colorMode the chosen processing mode : with or without color processing
  1144. * <ul>
  1145. * <li>
  1146. * cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  1147. * </li>
  1148. * <li>
  1149. * cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...
  1150. * </li>
  1151. * <li>
  1152. * cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  1153. * </li>
  1154. * </ul>
  1155. * be used
  1156. * factor of the output frame (as the center (fovea) is high resolution and corners can be
  1157. * underscaled, then a reduction of the output is allowed without precision leak
  1158. * the log scale that is applied
  1159. * return automatically generated
  1160. */
  1161. public static Retina create(Size inputSize, bool colorMode)
  1162. {
  1163. return Retina.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(bioinspired_Retina_create_15(inputSize.width, inputSize.height, colorMode)));
  1164. }
  1165. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  1166. const string LIBNAME = "__Internal";
  1167. #else
  1168. const string LIBNAME = "opencvforunity";
  1169. #endif
  1170. // C++: Size cv::bioinspired::Retina::getInputSize()
  1171. [DllImport(LIBNAME)]
  1172. private static extern void bioinspired_Retina_getInputSize_10(IntPtr nativeObj, double[] retVal);
  1173. // C++: Size cv::bioinspired::Retina::getOutputSize()
  1174. [DllImport(LIBNAME)]
  1175. private static extern void bioinspired_Retina_getOutputSize_10(IntPtr nativeObj, double[] retVal);
  1176. // C++: void cv::bioinspired::Retina::setup(String retinaParameterFile = "", bool applyDefaultSetupOnFailure = true)
  1177. [DllImport(LIBNAME)]
  1178. private static extern void bioinspired_Retina_setup_10(IntPtr nativeObj, string retinaParameterFile, [MarshalAs(UnmanagedType.U1)] bool applyDefaultSetupOnFailure);
  1179. [DllImport(LIBNAME)]
  1180. private static extern void bioinspired_Retina_setup_11(IntPtr nativeObj, string retinaParameterFile);
  1181. [DllImport(LIBNAME)]
  1182. private static extern void bioinspired_Retina_setup_12(IntPtr nativeObj);
  1183. // C++: String cv::bioinspired::Retina::printSetup()
  1184. [DllImport(LIBNAME)]
  1185. private static extern IntPtr bioinspired_Retina_printSetup_10(IntPtr nativeObj);
  1186. // C++: void cv::bioinspired::Retina::write(String fs)
  1187. [DllImport(LIBNAME)]
  1188. private static extern void bioinspired_Retina_write_10(IntPtr nativeObj, string fs);
  1189. // C++: void cv::bioinspired::Retina::setupOPLandIPLParvoChannel(bool colorMode = true, bool normaliseOutput = true, float photoreceptorsLocalAdaptationSensitivity = 0.7f, float photoreceptorsTemporalConstant = 0.5f, float photoreceptorsSpatialConstant = 0.53f, float horizontalCellsGain = 0.f, float HcellsTemporalConstant = 1.f, float HcellsSpatialConstant = 7.f, float ganglionCellsSensitivity = 0.7f)
  1190. [DllImport(LIBNAME)]
  1191. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant, float ganglionCellsSensitivity);
  1192. [DllImport(LIBNAME)]
  1193. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_11(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant);
  1194. [DllImport(LIBNAME)]
  1195. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_12(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant);
  1196. [DllImport(LIBNAME)]
  1197. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_13(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain);
  1198. [DllImport(LIBNAME)]
  1199. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_14(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant);
  1200. [DllImport(LIBNAME)]
  1201. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_15(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant);
  1202. [DllImport(LIBNAME)]
  1203. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_16(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float photoreceptorsLocalAdaptationSensitivity);
  1204. [DllImport(LIBNAME)]
  1205. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_17(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput);
  1206. [DllImport(LIBNAME)]
  1207. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_18(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool colorMode);
  1208. [DllImport(LIBNAME)]
  1209. private static extern void bioinspired_Retina_setupOPLandIPLParvoChannel_19(IntPtr nativeObj);
  1210. // C++: void cv::bioinspired::Retina::setupIPLMagnoChannel(bool normaliseOutput = true, float parasolCells_beta = 0.f, float parasolCells_tau = 0.f, float parasolCells_k = 7.f, float amacrinCellsTemporalCutFrequency = 1.2f, float V0CompressionParameter = 0.95f, float localAdaptintegration_tau = 0.f, float localAdaptintegration_k = 7.f)
  1211. [DllImport(LIBNAME)]
  1212. private static extern void bioinspired_Retina_setupIPLMagnoChannel_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau, float localAdaptintegration_k);
  1213. [DllImport(LIBNAME)]
  1214. private static extern void bioinspired_Retina_setupIPLMagnoChannel_11(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau);
  1215. [DllImport(LIBNAME)]
  1216. private static extern void bioinspired_Retina_setupIPLMagnoChannel_12(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter);
  1217. [DllImport(LIBNAME)]
  1218. private static extern void bioinspired_Retina_setupIPLMagnoChannel_13(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency);
  1219. [DllImport(LIBNAME)]
  1220. private static extern void bioinspired_Retina_setupIPLMagnoChannel_14(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k);
  1221. [DllImport(LIBNAME)]
  1222. private static extern void bioinspired_Retina_setupIPLMagnoChannel_15(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta, float parasolCells_tau);
  1223. [DllImport(LIBNAME)]
  1224. private static extern void bioinspired_Retina_setupIPLMagnoChannel_16(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput, float parasolCells_beta);
  1225. [DllImport(LIBNAME)]
  1226. private static extern void bioinspired_Retina_setupIPLMagnoChannel_17(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool normaliseOutput);
  1227. [DllImport(LIBNAME)]
  1228. private static extern void bioinspired_Retina_setupIPLMagnoChannel_18(IntPtr nativeObj);
  1229. // C++: void cv::bioinspired::Retina::run(Mat inputImage)
  1230. [DllImport(LIBNAME)]
  1231. private static extern void bioinspired_Retina_run_10(IntPtr nativeObj, IntPtr inputImage_nativeObj);
  1232. // C++: void cv::bioinspired::Retina::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
  1233. [DllImport(LIBNAME)]
  1234. private static extern void bioinspired_Retina_applyFastToneMapping_10(IntPtr nativeObj, IntPtr inputImage_nativeObj, IntPtr outputToneMappedImage_nativeObj);
  1235. // C++: void cv::bioinspired::Retina::getParvo(Mat& retinaOutput_parvo)
  1236. [DllImport(LIBNAME)]
  1237. private static extern void bioinspired_Retina_getParvo_10(IntPtr nativeObj, IntPtr retinaOutput_parvo_nativeObj);
  1238. // C++: void cv::bioinspired::Retina::getParvoRAW(Mat& retinaOutput_parvo)
  1239. [DllImport(LIBNAME)]
  1240. private static extern void bioinspired_Retina_getParvoRAW_10(IntPtr nativeObj, IntPtr retinaOutput_parvo_nativeObj);
  1241. // C++: void cv::bioinspired::Retina::getMagno(Mat& retinaOutput_magno)
  1242. [DllImport(LIBNAME)]
  1243. private static extern void bioinspired_Retina_getMagno_10(IntPtr nativeObj, IntPtr retinaOutput_magno_nativeObj);
  1244. // C++: void cv::bioinspired::Retina::getMagnoRAW(Mat& retinaOutput_magno)
  1245. [DllImport(LIBNAME)]
  1246. private static extern void bioinspired_Retina_getMagnoRAW_10(IntPtr nativeObj, IntPtr retinaOutput_magno_nativeObj);
  1247. // C++: Mat cv::bioinspired::Retina::getMagnoRAW()
  1248. [DllImport(LIBNAME)]
  1249. private static extern IntPtr bioinspired_Retina_getMagnoRAW_11(IntPtr nativeObj);
  1250. // C++: Mat cv::bioinspired::Retina::getParvoRAW()
  1251. [DllImport(LIBNAME)]
  1252. private static extern IntPtr bioinspired_Retina_getParvoRAW_11(IntPtr nativeObj);
  1253. // C++: void cv::bioinspired::Retina::setColorSaturation(bool saturateColors = true, float colorSaturationValue = 4.0f)
  1254. [DllImport(LIBNAME)]
  1255. private static extern void bioinspired_Retina_setColorSaturation_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool saturateColors, float colorSaturationValue);
  1256. [DllImport(LIBNAME)]
  1257. private static extern void bioinspired_Retina_setColorSaturation_11(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool saturateColors);
  1258. [DllImport(LIBNAME)]
  1259. private static extern void bioinspired_Retina_setColorSaturation_12(IntPtr nativeObj);
  1260. // C++: void cv::bioinspired::Retina::clearBuffers()
  1261. [DllImport(LIBNAME)]
  1262. private static extern void bioinspired_Retina_clearBuffers_10(IntPtr nativeObj);
  1263. // C++: void cv::bioinspired::Retina::activateMovingContoursProcessing(bool activate)
  1264. [DllImport(LIBNAME)]
  1265. private static extern void bioinspired_Retina_activateMovingContoursProcessing_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool activate);
  1266. // C++: void cv::bioinspired::Retina::activateContoursProcessing(bool activate)
  1267. [DllImport(LIBNAME)]
  1268. private static extern void bioinspired_Retina_activateContoursProcessing_10(IntPtr nativeObj, [MarshalAs(UnmanagedType.U1)] bool activate);
  1269. // C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize)
  1270. [DllImport(LIBNAME)]
  1271. private static extern IntPtr bioinspired_Retina_create_10(double inputSize_width, double inputSize_height);
  1272. // C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize, bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, bool useRetinaLogSampling = false, float reductionFactor = 1.0f, float samplingStrength = 10.0f)
  1273. [DllImport(LIBNAME)]
  1274. private static extern IntPtr bioinspired_Retina_create_11(double inputSize_width, double inputSize_height, [MarshalAs(UnmanagedType.U1)] bool colorMode, int colorSamplingMethod, [MarshalAs(UnmanagedType.U1)] bool useRetinaLogSampling, float reductionFactor, float samplingStrength);
  1275. [DllImport(LIBNAME)]
  1276. private static extern IntPtr bioinspired_Retina_create_12(double inputSize_width, double inputSize_height, [MarshalAs(UnmanagedType.U1)] bool colorMode, int colorSamplingMethod, [MarshalAs(UnmanagedType.U1)] bool useRetinaLogSampling, float reductionFactor);
  1277. [DllImport(LIBNAME)]
  1278. private static extern IntPtr bioinspired_Retina_create_13(double inputSize_width, double inputSize_height, [MarshalAs(UnmanagedType.U1)] bool colorMode, int colorSamplingMethod, [MarshalAs(UnmanagedType.U1)] bool useRetinaLogSampling);
  1279. [DllImport(LIBNAME)]
  1280. private static extern IntPtr bioinspired_Retina_create_14(double inputSize_width, double inputSize_height, [MarshalAs(UnmanagedType.U1)] bool colorMode, int colorSamplingMethod);
  1281. [DllImport(LIBNAME)]
  1282. private static extern IntPtr bioinspired_Retina_create_15(double inputSize_width, double inputSize_height, [MarshalAs(UnmanagedType.U1)] bool colorMode);
  1283. // native support for java finalize()
  1284. [DllImport(LIBNAME)]
  1285. private static extern void bioinspired_Retina_delete(IntPtr nativeObj);
  1286. }
  1287. }