GrayworldWB.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. NS_ASSUME_NONNULL_BEGIN
  15. // C++: class GrayworldWB
  16. /**
  17. * Gray-world white balance algorithm
  18. *
  19. * This algorithm scales the values of pixels based on a
  20. * gray-world assumption which states that the average of all channels
  21. * should result in a gray image.
  22. *
  23. * It adds a modification which thresholds pixels based on their
  24. * saturation value and only uses pixels below the provided threshold in
  25. * finding average pixel values.
  26. *
  27. * Saturation is calculated using the following for a 3-channel RGB image per
  28. * pixel I and is in the range [0, 1]:
  29. *
  30. * `$$ \texttt{Saturation} [I] = \frac{\textrm{max}(R,G,B) - \textrm{min}(R,G,B)
  31. * }{\textrm{max}(R,G,B)} $$`
  32. *
  33. * A threshold of 1 means that all pixels are used to white-balance, while a
  34. * threshold of 0 means no pixels are used. Lower thresholds are useful in
  35. * white-balancing saturated images.
  36. *
  37. * Currently supports images of type REF: CV_8UC3 and REF: CV_16UC3.
  38. *
  39. * Member of `Xphoto`
  40. */
  41. CV_EXPORTS @interface GrayworldWB : WhiteBalancer
  42. #ifdef __cplusplus
  43. @property(readonly)cv::Ptr<cv::xphoto::GrayworldWB> nativePtrGrayworldWB;
  44. #endif
  45. #ifdef __cplusplus
  46. - (instancetype)initWithNativePtr:(cv::Ptr<cv::xphoto::GrayworldWB>)nativePtr;
  47. + (instancetype)fromNative:(cv::Ptr<cv::xphoto::GrayworldWB>)nativePtr;
  48. #endif
  49. #pragma mark - Methods
  50. //
  51. // float cv::xphoto::GrayworldWB::getSaturationThreshold()
  52. //
  53. /**
  54. * Maximum saturation for a pixel to be included in the
  55. * gray-world assumption
  56. * @see `-setSaturationThreshold:`
  57. */
  58. - (float)getSaturationThreshold NS_SWIFT_NAME(getSaturationThreshold());
  59. //
  60. // void cv::xphoto::GrayworldWB::setSaturationThreshold(float val)
  61. //
  62. /**
  63. * getSaturationThreshold @see `-getSaturationThreshold:`
  64. */
  65. - (void)setSaturationThreshold:(float)val NS_SWIFT_NAME(setSaturationThreshold(val:));
  66. @end
  67. NS_ASSUME_NONNULL_END