BackgroundSubtractorKNN.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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/video.hpp"
  8. #import "opencv2/video/background_segm.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "BackgroundSubtractor.h"
  14. NS_ASSUME_NONNULL_BEGIN
  15. // C++: class BackgroundSubtractorKNN
  16. /**
  17. * K-nearest neighbours - based Background/Foreground Segmentation Algorithm.
  18. *
  19. * The class implements the K-nearest neighbours background subtraction described in CITE: Zivkovic2006 .
  20. * Very efficient if number of foreground pixels is low.
  21. *
  22. * Member of `Video`
  23. */
  24. CV_EXPORTS @interface BackgroundSubtractorKNN : BackgroundSubtractor
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::BackgroundSubtractorKNN> nativePtrBackgroundSubtractorKNN;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::BackgroundSubtractorKNN>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::BackgroundSubtractorKNN>)nativePtr;
  31. #endif
  32. #pragma mark - Methods
  33. //
  34. // int cv::BackgroundSubtractorKNN::getHistory()
  35. //
  36. /**
  37. * Returns the number of last frames that affect the background model
  38. */
  39. - (int)getHistory NS_SWIFT_NAME(getHistory());
  40. //
  41. // void cv::BackgroundSubtractorKNN::setHistory(int history)
  42. //
  43. /**
  44. * Sets the number of last frames that affect the background model
  45. */
  46. - (void)setHistory:(int)history NS_SWIFT_NAME(setHistory(history:));
  47. //
  48. // int cv::BackgroundSubtractorKNN::getNSamples()
  49. //
  50. /**
  51. * Returns the number of data samples in the background model
  52. */
  53. - (int)getNSamples NS_SWIFT_NAME(getNSamples());
  54. //
  55. // void cv::BackgroundSubtractorKNN::setNSamples(int _nN)
  56. //
  57. /**
  58. * Sets the number of data samples in the background model.
  59. *
  60. * The model needs to be reinitalized to reserve memory.
  61. */
  62. - (void)setNSamples:(int)_nN NS_SWIFT_NAME(setNSamples(_nN:));
  63. //
  64. // double cv::BackgroundSubtractorKNN::getDist2Threshold()
  65. //
  66. /**
  67. * Returns the threshold on the squared distance between the pixel and the sample
  68. *
  69. * The threshold on the squared distance between the pixel and the sample to decide whether a pixel is
  70. * close to a data sample.
  71. */
  72. - (double)getDist2Threshold NS_SWIFT_NAME(getDist2Threshold());
  73. //
  74. // void cv::BackgroundSubtractorKNN::setDist2Threshold(double _dist2Threshold)
  75. //
  76. /**
  77. * Sets the threshold on the squared distance
  78. */
  79. - (void)setDist2Threshold:(double)_dist2Threshold NS_SWIFT_NAME(setDist2Threshold(_dist2Threshold:));
  80. //
  81. // int cv::BackgroundSubtractorKNN::getkNNSamples()
  82. //
  83. /**
  84. * Returns the number of neighbours, the k in the kNN.
  85. *
  86. * K is the number of samples that need to be within dist2Threshold in order to decide that that
  87. * pixel is matching the kNN background model.
  88. */
  89. - (int)getkNNSamples NS_SWIFT_NAME(getkNNSamples());
  90. //
  91. // void cv::BackgroundSubtractorKNN::setkNNSamples(int _nkNN)
  92. //
  93. /**
  94. * Sets the k in the kNN. How many nearest neighbours need to match.
  95. */
  96. - (void)setkNNSamples:(int)_nkNN NS_SWIFT_NAME(setkNNSamples(_nkNN:));
  97. //
  98. // bool cv::BackgroundSubtractorKNN::getDetectShadows()
  99. //
  100. /**
  101. * Returns the shadow detection flag
  102. *
  103. * If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for
  104. * details.
  105. */
  106. - (BOOL)getDetectShadows NS_SWIFT_NAME(getDetectShadows());
  107. //
  108. // void cv::BackgroundSubtractorKNN::setDetectShadows(bool detectShadows)
  109. //
  110. /**
  111. * Enables or disables shadow detection
  112. */
  113. - (void)setDetectShadows:(BOOL)detectShadows NS_SWIFT_NAME(setDetectShadows(detectShadows:));
  114. //
  115. // int cv::BackgroundSubtractorKNN::getShadowValue()
  116. //
  117. /**
  118. * Returns the shadow value
  119. *
  120. * Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0
  121. * in the mask always means background, 255 means foreground.
  122. */
  123. - (int)getShadowValue NS_SWIFT_NAME(getShadowValue());
  124. //
  125. // void cv::BackgroundSubtractorKNN::setShadowValue(int value)
  126. //
  127. /**
  128. * Sets the shadow value
  129. */
  130. - (void)setShadowValue:(int)value NS_SWIFT_NAME(setShadowValue(value:));
  131. //
  132. // double cv::BackgroundSubtractorKNN::getShadowThreshold()
  133. //
  134. /**
  135. * Returns the shadow threshold
  136. *
  137. * A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in
  138. * the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel
  139. * is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,
  140. * Detecting Moving Shadows...*, IEEE PAMI,2003.
  141. */
  142. - (double)getShadowThreshold NS_SWIFT_NAME(getShadowThreshold());
  143. //
  144. // void cv::BackgroundSubtractorKNN::setShadowThreshold(double threshold)
  145. //
  146. /**
  147. * Sets the shadow threshold
  148. */
  149. - (void)setShadowThreshold:(double)threshold NS_SWIFT_NAME(setShadowThreshold(threshold:));
  150. @end
  151. NS_ASSUME_NONNULL_END