__init__.pyi 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.dnn
  4. import cv2.typing
  5. import typing as _typing
  6. # Enumerations
  7. MCC24: int
  8. SG140: int
  9. VINYL18: int
  10. TYPECHART = int
  11. """One of [MCC24, SG140, VINYL18]"""
  12. # Classes
  13. class DetectorParameters:
  14. adaptiveThreshWinSizeMin: int
  15. adaptiveThreshWinSizeMax: int
  16. adaptiveThreshWinSizeStep: int
  17. adaptiveThreshConstant: float
  18. minContoursAreaRate: float
  19. minContoursArea: float
  20. confidenceThreshold: float
  21. minContourSolidity: float
  22. findCandidatesApproxPolyDPEpsMultiplier: float
  23. borderWidth: int
  24. B0factor: float
  25. maxError: float
  26. minContourPointsAllowed: int
  27. minContourLengthAllowed: int
  28. minInterContourDistance: int
  29. minInterCheckerDistance: int
  30. minImageSize: int
  31. minGroupSize: int
  32. # Functions
  33. @classmethod
  34. def create(cls) -> DetectorParameters: ...
  35. class CCheckerDetector(cv2.Algorithm):
  36. # Functions
  37. def setNet(self, net: cv2.dnn.Net) -> bool: ...
  38. @_typing.overload
  39. def processWithROI(self, image: cv2.typing.MatLike, chartType: TYPECHART, regionsOfInterest: _typing.Sequence[cv2.typing.Rect], nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
  40. @_typing.overload
  41. def processWithROI(self, image: cv2.UMat, chartType: TYPECHART, regionsOfInterest: _typing.Sequence[cv2.typing.Rect], nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
  42. @_typing.overload
  43. def process(self, image: cv2.typing.MatLike, chartType: TYPECHART, nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
  44. @_typing.overload
  45. def process(self, image: cv2.UMat, chartType: TYPECHART, nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
  46. def getBestColorChecker(self) -> CChecker: ...
  47. def getListColorChecker(self) -> _typing.Sequence[CChecker]: ...
  48. @classmethod
  49. def create(cls) -> CCheckerDetector: ...
  50. class CChecker:
  51. # Functions
  52. @classmethod
  53. def create(cls) -> CChecker: ...
  54. def setTarget(self, _target: TYPECHART) -> None: ...
  55. def setBox(self, _box: _typing.Sequence[cv2.typing.Point2f]) -> None: ...
  56. def setChartsRGB(self, _chartsRGB: cv2.typing.MatLike) -> None: ...
  57. def setChartsYCbCr(self, _chartsYCbCr: cv2.typing.MatLike) -> None: ...
  58. def setCost(self, _cost: float) -> None: ...
  59. def setCenter(self, _center: cv2.typing.Point2f) -> None: ...
  60. def getTarget(self) -> TYPECHART: ...
  61. def getBox(self) -> _typing.Sequence[cv2.typing.Point2f]: ...
  62. def getColorCharts(self) -> _typing.Sequence[cv2.typing.Point2f]: ...
  63. def getChartsRGB(self) -> cv2.typing.MatLike: ...
  64. def getChartsYCbCr(self) -> cv2.typing.MatLike: ...
  65. def getCost(self) -> float: ...
  66. def getCenter(self) -> cv2.typing.Point2f: ...
  67. class CCheckerDraw:
  68. # Functions
  69. @_typing.overload
  70. def draw(self, img: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
  71. @_typing.overload
  72. def draw(self, img: cv2.UMat) -> cv2.UMat: ...
  73. @classmethod
  74. def create(cls, pChecker: CChecker, color: cv2.typing.Scalar = ..., thickness: int = ...) -> CCheckerDraw: ...