RetinaFastToneMapping.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/bioinspired.hpp"
  8. #import "opencv2/bioinspired/retinafasttonemapping.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Algorithm.h"
  14. @class Mat;
  15. @class Size2i;
  16. NS_ASSUME_NONNULL_BEGIN
  17. // C++: class RetinaFastToneMapping
  18. /**
  19. * a wrapper class which allows the tone mapping algorithm of Meylan&al(2007) to be used with OpenCV.
  20. *
  21. * This algorithm is already implemented in thre Retina class (retina::applyFastToneMapping) but used it does not require all the retina model to be allocated. This allows a light memory use for low memory devices (smartphones, etc.
  22. * As a summary, these are the model properties:
  23. * - 2 stages of local luminance adaptation with a different local neighborhood for each.
  24. * - first stage models the retina photorecetors local luminance adaptation
  25. * - second stage models th ganglion cells local information adaptation
  26. * - compared to the initial publication, this class uses spatio-temporal low pass filters instead of spatial only filters.
  27. * this can help noise robustness and temporal stability for video sequence use cases.
  28. *
  29. * for more information, read to the following papers :
  30. * Meylan L., Alleysson D., and Susstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N 9, September, 1st, 2007, pp. 2807-2816Benoit 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
  31. * regarding spatio-temporal filter and the bigger retina model :
  32. * 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.
  33. *
  34. * Member of `Bioinspired`
  35. */
  36. CV_EXPORTS @interface RetinaFastToneMapping : Algorithm
  37. #ifdef __cplusplus
  38. @property(readonly)cv::Ptr<cv::bioinspired::RetinaFastToneMapping> nativePtrRetinaFastToneMapping;
  39. #endif
  40. #ifdef __cplusplus
  41. - (instancetype)initWithNativePtr:(cv::Ptr<cv::bioinspired::RetinaFastToneMapping>)nativePtr;
  42. + (instancetype)fromNative:(cv::Ptr<cv::bioinspired::RetinaFastToneMapping>)nativePtr;
  43. #endif
  44. #pragma mark - Methods
  45. //
  46. // void cv::bioinspired::RetinaFastToneMapping::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
  47. //
  48. /**
  49. * applies a luminance correction (initially High Dynamic Range (HDR) tone mapping)
  50. *
  51. * using only the 2 local adaptation stages of the retina parvocellular channel : photoreceptors
  52. * level and ganlion cells level. Spatio temporal filtering is applied but limited to temporal
  53. * smoothing and eventually high frequencies attenuation. This is a lighter method than the one
  54. * available using the regular retina::run method. It is then faster but it does not include
  55. * complete temporal filtering nor retina spectral whitening. Then, it can have a more limited
  56. * effect on images with a very high dynamic range. This is an adptation of the original still
  57. * image HDR tone mapping algorithm of David Alleyson, Sabine Susstruck and Laurence Meylan's
  58. * work, please cite: -> Meylan L., Alleysson D., and Susstrunk S., A Model of Retinal Local
  59. * Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of
  60. * America, A, Vol. 24, N 9, September, 1st, 2007, pp. 2807-2816
  61. *
  62. * @param inputImage the input image to process RGB or gray levels
  63. * @param outputToneMappedImage the output tone mapped image
  64. */
  65. - (void)applyFastToneMapping:(Mat*)inputImage outputToneMappedImage:(Mat*)outputToneMappedImage NS_SWIFT_NAME(applyFastToneMapping(inputImage:outputToneMappedImage:));
  66. //
  67. // void cv::bioinspired::RetinaFastToneMapping::setup(float photoreceptorsNeighborhoodRadius = 3.f, float ganglioncellsNeighborhoodRadius = 1.f, float meanLuminanceModulatorK = 1.f)
  68. //
  69. /**
  70. * updates tone mapping behaviors by adjusing the local luminance computation area
  71. *
  72. * @param photoreceptorsNeighborhoodRadius the first stage local adaptation area
  73. * @param ganglioncellsNeighborhoodRadius the second stage local adaptation area
  74. * @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information
  75. * (default is 1, see reference paper)
  76. */
  77. - (void)setup:(float)photoreceptorsNeighborhoodRadius ganglioncellsNeighborhoodRadius:(float)ganglioncellsNeighborhoodRadius meanLuminanceModulatorK:(float)meanLuminanceModulatorK NS_SWIFT_NAME(setup(photoreceptorsNeighborhoodRadius:ganglioncellsNeighborhoodRadius:meanLuminanceModulatorK:));
  78. /**
  79. * updates tone mapping behaviors by adjusing the local luminance computation area
  80. *
  81. * @param photoreceptorsNeighborhoodRadius the first stage local adaptation area
  82. * @param ganglioncellsNeighborhoodRadius the second stage local adaptation area
  83. * (default is 1, see reference paper)
  84. */
  85. - (void)setup:(float)photoreceptorsNeighborhoodRadius ganglioncellsNeighborhoodRadius:(float)ganglioncellsNeighborhoodRadius NS_SWIFT_NAME(setup(photoreceptorsNeighborhoodRadius:ganglioncellsNeighborhoodRadius:));
  86. /**
  87. * updates tone mapping behaviors by adjusing the local luminance computation area
  88. *
  89. * @param photoreceptorsNeighborhoodRadius the first stage local adaptation area
  90. * (default is 1, see reference paper)
  91. */
  92. - (void)setup:(float)photoreceptorsNeighborhoodRadius NS_SWIFT_NAME(setup(photoreceptorsNeighborhoodRadius:));
  93. /**
  94. * updates tone mapping behaviors by adjusing the local luminance computation area
  95. *
  96. * (default is 1, see reference paper)
  97. */
  98. - (void)setup NS_SWIFT_NAME(setup());
  99. //
  100. // static Ptr_RetinaFastToneMapping cv::bioinspired::RetinaFastToneMapping::create(Size inputSize)
  101. //
  102. + (RetinaFastToneMapping*)create:(Size2i*)inputSize NS_SWIFT_NAME(create(inputSize:));
  103. @end
  104. NS_ASSUME_NONNULL_END