LearningBasedWB.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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/xphoto.hpp"
  8. #import "opencv2/xphoto/white_balance.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "WhiteBalancer.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class LearningBasedWB
  17. /**
  18. * More sophisticated learning-based automatic white balance algorithm.
  19. *
  20. * As REF: GrayworldWB, this algorithm works by applying different gains to the input
  21. * image channels, but their computation is a bit more involved compared to the
  22. * simple gray-world assumption. More details about the algorithm can be found in
  23. * CITE: Cheng2015 .
  24. *
  25. * To mask out saturated pixels this function uses only pixels that satisfy the
  26. * following condition:
  27. *
  28. * `$$ \frac{\textrm{max}(R,G,B)}{\texttt{range\_max\_val}} < \texttt{saturation\_thresh} $$`
  29. *
  30. * Currently supports images of type REF: CV_8UC3 and REF: CV_16UC3.
  31. *
  32. * Member of `Xphoto`
  33. */
  34. CV_EXPORTS @interface LearningBasedWB : WhiteBalancer
  35. #ifdef __cplusplus
  36. @property(readonly)cv::Ptr<cv::xphoto::LearningBasedWB> nativePtrLearningBasedWB;
  37. #endif
  38. #ifdef __cplusplus
  39. - (instancetype)initWithNativePtr:(cv::Ptr<cv::xphoto::LearningBasedWB>)nativePtr;
  40. + (instancetype)fromNative:(cv::Ptr<cv::xphoto::LearningBasedWB>)nativePtr;
  41. #endif
  42. #pragma mark - Methods
  43. //
  44. // void cv::xphoto::LearningBasedWB::extractSimpleFeatures(Mat src, Mat& dst)
  45. //
  46. /**
  47. * Implements the feature extraction part of the algorithm.
  48. *
  49. * In accordance with CITE: Cheng2015 , computes the following features for the input image:
  50. * 1. Chromaticity of an average (R,G,B) tuple
  51. * 2. Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels)
  52. * 3. Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram)
  53. * 4. Mode of the chromaticity palette, that is constructed by taking 300 most common colors according to
  54. * the RGB histogram and projecting them on the chromaticity plane. Mode is the most high-density point
  55. * of the palette, which is computed by a straightforward fixed-bandwidth kernel density estimator with
  56. * a Epanechnikov kernel function.
  57. *
  58. * @param src Input three-channel image (BGR color space is assumed).
  59. * @param dst An array of four (r,g) chromaticity tuples corresponding to the features listed above.
  60. */
  61. - (void)extractSimpleFeatures:(Mat*)src dst:(Mat*)dst NS_SWIFT_NAME(extractSimpleFeatures(src:dst:));
  62. //
  63. // int cv::xphoto::LearningBasedWB::getRangeMaxVal()
  64. //
  65. /**
  66. * Maximum possible value of the input image (e.g. 255 for 8 bit images,
  67. * 4095 for 12 bit images)
  68. * @see `-setRangeMaxVal:`
  69. */
  70. - (int)getRangeMaxVal NS_SWIFT_NAME(getRangeMaxVal());
  71. //
  72. // void cv::xphoto::LearningBasedWB::setRangeMaxVal(int val)
  73. //
  74. /**
  75. * getRangeMaxVal @see `-getRangeMaxVal:`
  76. */
  77. - (void)setRangeMaxVal:(int)val NS_SWIFT_NAME(setRangeMaxVal(val:));
  78. //
  79. // float cv::xphoto::LearningBasedWB::getSaturationThreshold()
  80. //
  81. /**
  82. * Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the
  83. * channels exceeds `$$\texttt{saturation\_threshold}\times\texttt{range\_max\_val}$$` are ignored.
  84. * @see `-setSaturationThreshold:`
  85. */
  86. - (float)getSaturationThreshold NS_SWIFT_NAME(getSaturationThreshold());
  87. //
  88. // void cv::xphoto::LearningBasedWB::setSaturationThreshold(float val)
  89. //
  90. /**
  91. * getSaturationThreshold @see `-getSaturationThreshold:`
  92. */
  93. - (void)setSaturationThreshold:(float)val NS_SWIFT_NAME(setSaturationThreshold(val:));
  94. //
  95. // int cv::xphoto::LearningBasedWB::getHistBinNum()
  96. //
  97. /**
  98. * Defines the size of one dimension of a three-dimensional RGB histogram that is used internally
  99. * by the algorithm. It often makes sense to increase the number of bins for images with higher bit depth
  100. * (e.g. 256 bins for a 12 bit image).
  101. * @see `-setHistBinNum:`
  102. */
  103. - (int)getHistBinNum NS_SWIFT_NAME(getHistBinNum());
  104. //
  105. // void cv::xphoto::LearningBasedWB::setHistBinNum(int val)
  106. //
  107. /**
  108. * getHistBinNum @see `-getHistBinNum:`
  109. */
  110. - (void)setHistBinNum:(int)val NS_SWIFT_NAME(setHistBinNum(val:));
  111. @end
  112. NS_ASSUME_NONNULL_END