BackgroundSubtractor.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "Algorithm.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class BackgroundSubtractor
  17. /**
  18. * Base class for background/foreground segmentation. :
  19. *
  20. * The class is only used to define the common interface for the whole family of background/foreground
  21. * segmentation algorithms.
  22. *
  23. * Member of `Video`
  24. */
  25. CV_EXPORTS @interface BackgroundSubtractor : Algorithm
  26. #ifdef __cplusplus
  27. @property(readonly)cv::Ptr<cv::BackgroundSubtractor> nativePtrBackgroundSubtractor;
  28. #endif
  29. #ifdef __cplusplus
  30. - (instancetype)initWithNativePtr:(cv::Ptr<cv::BackgroundSubtractor>)nativePtr;
  31. + (instancetype)fromNative:(cv::Ptr<cv::BackgroundSubtractor>)nativePtr;
  32. #endif
  33. #pragma mark - Methods
  34. //
  35. // void cv::BackgroundSubtractor::apply(Mat image, Mat& fgmask, double learningRate = -1)
  36. //
  37. /**
  38. * Computes a foreground mask.
  39. *
  40. * @param image Next video frame.
  41. * @param fgmask The output foreground mask as an 8-bit binary image.
  42. * @param learningRate The value between 0 and 1 that indicates how fast the background model is
  43. * learnt. Negative parameter value makes the algorithm to use some automatically chosen learning
  44. * rate. 0 means that the background model is not updated at all, 1 means that the background model
  45. * is completely reinitialized from the last frame.
  46. */
  47. - (void)apply:(Mat*)image fgmask:(Mat*)fgmask learningRate:(double)learningRate NS_SWIFT_NAME(apply(image:fgmask:learningRate:));
  48. /**
  49. * Computes a foreground mask.
  50. *
  51. * @param image Next video frame.
  52. * @param fgmask The output foreground mask as an 8-bit binary image.
  53. * learnt. Negative parameter value makes the algorithm to use some automatically chosen learning
  54. * rate. 0 means that the background model is not updated at all, 1 means that the background model
  55. * is completely reinitialized from the last frame.
  56. */
  57. - (void)apply:(Mat*)image fgmask:(Mat*)fgmask NS_SWIFT_NAME(apply(image:fgmask:));
  58. //
  59. // void cv::BackgroundSubtractor::getBackgroundImage(Mat& backgroundImage)
  60. //
  61. /**
  62. * Computes a background image.
  63. *
  64. * @param backgroundImage The output background image.
  65. *
  66. * NOTE: Sometimes the background image can be very blurry, as it contain the average background
  67. * statistics.
  68. */
  69. - (void)getBackgroundImage:(Mat*)backgroundImage NS_SWIFT_NAME(getBackgroundImage(backgroundImage:));
  70. @end
  71. NS_ASSUME_NONNULL_END