__init__.pyi 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.typing
  4. import typing as _typing
  5. # Enumerations
  6. LSBP_CAMERA_MOTION_COMPENSATION_NONE: int
  7. LSBP_CAMERA_MOTION_COMPENSATION_LK: int
  8. LSBPCameraMotionCompensation = int
  9. """One of [LSBP_CAMERA_MOTION_COMPENSATION_NONE, LSBP_CAMERA_MOTION_COMPENSATION_LK]"""
  10. # Classes
  11. class BackgroundSubtractorMOG(cv2.BackgroundSubtractor):
  12. # Functions
  13. def getHistory(self) -> int: ...
  14. def setHistory(self, nframes: int) -> None: ...
  15. def getNMixtures(self) -> int: ...
  16. def setNMixtures(self, nmix: int) -> None: ...
  17. def getBackgroundRatio(self) -> float: ...
  18. def setBackgroundRatio(self, backgroundRatio: float) -> None: ...
  19. def getNoiseSigma(self) -> float: ...
  20. def setNoiseSigma(self, noiseSigma: float) -> None: ...
  21. class BackgroundSubtractorGMG(cv2.BackgroundSubtractor):
  22. # Functions
  23. def getMaxFeatures(self) -> int: ...
  24. def setMaxFeatures(self, maxFeatures: int) -> None: ...
  25. def getDefaultLearningRate(self) -> float: ...
  26. def setDefaultLearningRate(self, lr: float) -> None: ...
  27. def getNumFrames(self) -> int: ...
  28. def setNumFrames(self, nframes: int) -> None: ...
  29. def getQuantizationLevels(self) -> int: ...
  30. def setQuantizationLevels(self, nlevels: int) -> None: ...
  31. def getBackgroundPrior(self) -> float: ...
  32. def setBackgroundPrior(self, bgprior: float) -> None: ...
  33. def getSmoothingRadius(self) -> int: ...
  34. def setSmoothingRadius(self, radius: int) -> None: ...
  35. def getDecisionThreshold(self) -> float: ...
  36. def setDecisionThreshold(self, thresh: float) -> None: ...
  37. def getUpdateBackgroundModel(self) -> bool: ...
  38. def setUpdateBackgroundModel(self, update: bool) -> None: ...
  39. def getMinVal(self) -> float: ...
  40. def setMinVal(self, val: float) -> None: ...
  41. def getMaxVal(self) -> float: ...
  42. def setMaxVal(self, val: float) -> None: ...
  43. class BackgroundSubtractorCNT(cv2.BackgroundSubtractor):
  44. # Functions
  45. @_typing.overload
  46. def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
  47. @_typing.overload
  48. def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
  49. @_typing.overload
  50. def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  51. @_typing.overload
  52. def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
  53. def getMinPixelStability(self) -> int: ...
  54. def setMinPixelStability(self, value: int) -> None: ...
  55. def getMaxPixelStability(self) -> int: ...
  56. def setMaxPixelStability(self, value: int) -> None: ...
  57. def getUseHistory(self) -> bool: ...
  58. def setUseHistory(self, value: bool) -> None: ...
  59. def getIsParallel(self) -> bool: ...
  60. def setIsParallel(self, value: bool) -> None: ...
  61. class BackgroundSubtractorGSOC(cv2.BackgroundSubtractor):
  62. # Functions
  63. @_typing.overload
  64. def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
  65. @_typing.overload
  66. def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
  67. @_typing.overload
  68. def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  69. @_typing.overload
  70. def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
  71. class BackgroundSubtractorLSBP(cv2.BackgroundSubtractor):
  72. # Functions
  73. @_typing.overload
  74. def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
  75. @_typing.overload
  76. def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
  77. @_typing.overload
  78. def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  79. @_typing.overload
  80. def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
  81. class BackgroundSubtractorLSBPDesc:
  82. ...
  83. class SyntheticSequenceGenerator(cv2.Algorithm):
  84. # Functions
  85. @_typing.overload
  86. def __init__(self, background: cv2.typing.MatLike, object: cv2.typing.MatLike, amplitude: float, wavelength: float, wavespeed: float, objspeed: float) -> None: ...
  87. @_typing.overload
  88. def __init__(self, background: cv2.UMat, object: cv2.UMat, amplitude: float, wavelength: float, wavespeed: float, objspeed: float) -> None: ...
  89. @_typing.overload
  90. def getNextFrame(self, frame: cv2.typing.MatLike | None = ..., gtMask: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
  91. @_typing.overload
  92. def getNextFrame(self, frame: cv2.UMat | None = ..., gtMask: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
  93. # Functions
  94. def createBackgroundSubtractorCNT(minPixelStability: int = ..., useHistory: bool = ..., maxPixelStability: int = ..., isParallel: bool = ...) -> BackgroundSubtractorCNT: ...
  95. def createBackgroundSubtractorGMG(initializationFrames: int = ..., decisionThreshold: float = ...) -> BackgroundSubtractorGMG: ...
  96. def createBackgroundSubtractorGSOC(mc: int = ..., nSamples: int = ..., replaceRate: float = ..., propagationRate: float = ..., hitsThreshold: int = ..., alpha: float = ..., beta: float = ..., blinkingSupressionDecay: float = ..., blinkingSupressionMultiplier: float = ..., noiseRemovalThresholdFacBG: float = ..., noiseRemovalThresholdFacFG: float = ...) -> BackgroundSubtractorGSOC: ...
  97. def createBackgroundSubtractorLSBP(mc: int = ..., nSamples: int = ..., LSBPRadius: int = ..., Tlower: float = ..., Tupper: float = ..., Tinc: float = ..., Tdec: float = ..., Rscale: float = ..., Rincdec: float = ..., noiseRemovalThresholdFacBG: float = ..., noiseRemovalThresholdFacFG: float = ..., LSBPthreshold: int = ..., minCount: int = ...) -> BackgroundSubtractorLSBP: ...
  98. def createBackgroundSubtractorMOG(history: int = ..., nmixtures: int = ..., backgroundRatio: float = ..., noiseSigma: float = ...) -> BackgroundSubtractorMOG: ...
  99. @_typing.overload
  100. def createSyntheticSequenceGenerator(background: cv2.typing.MatLike, object: cv2.typing.MatLike, amplitude: float = ..., wavelength: float = ..., wavespeed: float = ..., objspeed: float = ...) -> SyntheticSequenceGenerator: ...
  101. @_typing.overload
  102. def createSyntheticSequenceGenerator(background: cv2.UMat, object: cv2.UMat, amplitude: float = ..., wavelength: float = ..., wavespeed: float = ..., objspeed: float = ...) -> SyntheticSequenceGenerator: ...