__init__.pyi 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.typing
  4. import typing as _typing
  5. # Enumerations
  6. CCM_LINEAR: int
  7. CCM_AFFINE: int
  8. CcmType = int
  9. """One of [CCM_LINEAR, CCM_AFFINE]"""
  10. INITIAL_METHOD_WHITE_BALANCE: int
  11. INITIAL_METHOD_LEAST_SQUARE: int
  12. InitialMethodType = int
  13. """One of [INITIAL_METHOD_WHITE_BALANCE, INITIAL_METHOD_LEAST_SQUARE]"""
  14. COLORCHECKER_MACBETH: int
  15. COLORCHECKER_VINYL: int
  16. COLORCHECKER_DIGITAL_SG: int
  17. ColorCheckerType = int
  18. """One of [COLORCHECKER_MACBETH, COLORCHECKER_VINYL, COLORCHECKER_DIGITAL_SG]"""
  19. COLOR_SPACE_SRGB: int
  20. COLOR_SPACE_SRGBL: int
  21. COLOR_SPACE_ADOBE_RGB: int
  22. COLOR_SPACE_ADOBE_RGBL: int
  23. COLOR_SPACE_WIDE_GAMUT_RGB: int
  24. COLOR_SPACE_WIDE_GAMUT_RGBL: int
  25. COLOR_SPACE_PRO_PHOTO_RGB: int
  26. COLOR_SPACE_PRO_PHOTO_RGBL: int
  27. COLOR_SPACE_DCI_P3_RGB: int
  28. COLOR_SPACE_DCI_P3_RGBL: int
  29. COLOR_SPACE_APPLE_RGB: int
  30. COLOR_SPACE_APPLE_RGBL: int
  31. COLOR_SPACE_REC_709_RGB: int
  32. COLOR_SPACE_REC_709_RGBL: int
  33. COLOR_SPACE_REC_2020_RGB: int
  34. COLOR_SPACE_REC_2020_RGBL: int
  35. COLOR_SPACE_XYZ_D65_2: int
  36. COLOR_SPACE_XYZ_D50_2: int
  37. COLOR_SPACE_XYZ_D65_10: int
  38. COLOR_SPACE_XYZ_D50_10: int
  39. COLOR_SPACE_XYZ_A_2: int
  40. COLOR_SPACE_XYZ_A_10: int
  41. COLOR_SPACE_XYZ_D55_2: int
  42. COLOR_SPACE_XYZ_D55_10: int
  43. COLOR_SPACE_XYZ_D75_2: int
  44. COLOR_SPACE_XYZ_D75_10: int
  45. COLOR_SPACE_XYZ_E_2: int
  46. COLOR_SPACE_XYZ_E_10: int
  47. COLOR_SPACE_LAB_D65_2: int
  48. COLOR_SPACE_LAB_D50_2: int
  49. COLOR_SPACE_LAB_D65_10: int
  50. COLOR_SPACE_LAB_D50_10: int
  51. COLOR_SPACE_LAB_A_2: int
  52. COLOR_SPACE_LAB_A_10: int
  53. COLOR_SPACE_LAB_D55_2: int
  54. COLOR_SPACE_LAB_D55_10: int
  55. COLOR_SPACE_LAB_D75_2: int
  56. COLOR_SPACE_LAB_D75_10: int
  57. COLOR_SPACE_LAB_E_2: int
  58. COLOR_SPACE_LAB_E_10: int
  59. ColorSpace = int
  60. """One of [COLOR_SPACE_SRGB, COLOR_SPACE_SRGBL, COLOR_SPACE_ADOBE_RGB, COLOR_SPACE_ADOBE_RGBL, COLOR_SPACE_WIDE_GAMUT_RGB, COLOR_SPACE_WIDE_GAMUT_RGBL, COLOR_SPACE_PRO_PHOTO_RGB, COLOR_SPACE_PRO_PHOTO_RGBL, COLOR_SPACE_DCI_P3_RGB, COLOR_SPACE_DCI_P3_RGBL, COLOR_SPACE_APPLE_RGB, COLOR_SPACE_APPLE_RGBL, COLOR_SPACE_REC_709_RGB, COLOR_SPACE_REC_709_RGBL, COLOR_SPACE_REC_2020_RGB, COLOR_SPACE_REC_2020_RGBL, COLOR_SPACE_XYZ_D65_2, COLOR_SPACE_XYZ_D50_2, COLOR_SPACE_XYZ_D65_10, COLOR_SPACE_XYZ_D50_10, COLOR_SPACE_XYZ_A_2, COLOR_SPACE_XYZ_A_10, COLOR_SPACE_XYZ_D55_2, COLOR_SPACE_XYZ_D55_10, COLOR_SPACE_XYZ_D75_2, COLOR_SPACE_XYZ_D75_10, COLOR_SPACE_XYZ_E_2, COLOR_SPACE_XYZ_E_10, COLOR_SPACE_LAB_D65_2, COLOR_SPACE_LAB_D50_2, COLOR_SPACE_LAB_D65_10, COLOR_SPACE_LAB_D50_10, COLOR_SPACE_LAB_A_2, COLOR_SPACE_LAB_A_10, COLOR_SPACE_LAB_D55_2, COLOR_SPACE_LAB_D55_10, COLOR_SPACE_LAB_D75_2, COLOR_SPACE_LAB_D75_10, COLOR_SPACE_LAB_E_2, COLOR_SPACE_LAB_E_10]"""
  61. LINEARIZATION_IDENTITY: int
  62. LINEARIZATION_GAMMA: int
  63. LINEARIZATION_COLORPOLYFIT: int
  64. LINEARIZATION_COLORLOGPOLYFIT: int
  65. LINEARIZATION_GRAYPOLYFIT: int
  66. LINEARIZATION_GRAYLOGPOLYFIT: int
  67. LinearizationType = int
  68. """One of [LINEARIZATION_IDENTITY, LINEARIZATION_GAMMA, LINEARIZATION_COLORPOLYFIT, LINEARIZATION_COLORLOGPOLYFIT, LINEARIZATION_GRAYPOLYFIT, LINEARIZATION_GRAYLOGPOLYFIT]"""
  69. DISTANCE_CIE76: int
  70. DISTANCE_CIE94_GRAPHIC_ARTS: int
  71. DISTANCE_CIE94_TEXTILES: int
  72. DISTANCE_CIE2000: int
  73. DISTANCE_CMC_1TO1: int
  74. DISTANCE_CMC_2TO1: int
  75. DISTANCE_RGB: int
  76. DISTANCE_RGBL: int
  77. DistanceType = int
  78. """One of [DISTANCE_CIE76, DISTANCE_CIE94_GRAPHIC_ARTS, DISTANCE_CIE94_TEXTILES, DISTANCE_CIE2000, DISTANCE_CMC_1TO1, DISTANCE_CMC_2TO1, DISTANCE_RGB, DISTANCE_RGBL]"""
  79. # Classes
  80. class ColorCorrectionModel:
  81. # Functions
  82. @_typing.overload
  83. def __init__(self) -> None: ...
  84. @_typing.overload
  85. def __init__(self, src: cv2.typing.MatLike, constColor: int) -> None: ...
  86. @_typing.overload
  87. def __init__(self, src: cv2.UMat, constColor: int) -> None: ...
  88. @_typing.overload
  89. def __init__(self, src: cv2.typing.MatLike, colors: cv2.typing.MatLike, refColorSpace: ColorSpace) -> None: ...
  90. @_typing.overload
  91. def __init__(self, src: cv2.UMat, colors: cv2.UMat, refColorSpace: ColorSpace) -> None: ...
  92. @_typing.overload
  93. def __init__(self, src: cv2.typing.MatLike, colors: cv2.typing.MatLike, refColorSpace: ColorSpace, coloredPatchesMask: cv2.typing.MatLike) -> None: ...
  94. @_typing.overload
  95. def __init__(self, src: cv2.UMat, colors: cv2.UMat, refColorSpace: ColorSpace, coloredPatchesMask: cv2.UMat) -> None: ...
  96. def setColorSpace(self, cs: ColorSpace) -> None: ...
  97. def setCcmType(self, ccmType: CcmType) -> None: ...
  98. def setDistance(self, distance: DistanceType) -> None: ...
  99. def setLinearization(self, linearizationType: LinearizationType) -> None: ...
  100. def setLinearizationGamma(self, gamma: float) -> None: ...
  101. def setLinearizationDegree(self, deg: int) -> None: ...
  102. def setSaturatedThreshold(self, lower: float, upper: float) -> None: ...
  103. def setWeightsList(self, weightsList: cv2.typing.MatLike) -> None: ...
  104. def setWeightCoeff(self, weightsCoeff: float) -> None: ...
  105. def setInitialMethod(self, initialMethodType: InitialMethodType) -> None: ...
  106. def setMaxCount(self, maxCount: int) -> None: ...
  107. def setEpsilon(self, epsilon: float) -> None: ...
  108. def setRGB(self, rgb: bool) -> None: ...
  109. def compute(self) -> cv2.typing.MatLike: ...
  110. def getColorCorrectionMatrix(self) -> cv2.typing.MatLike: ...
  111. def getLoss(self) -> float: ...
  112. def getSrcLinearRGB(self) -> cv2.typing.MatLike: ...
  113. def getRefLinearRGB(self) -> cv2.typing.MatLike: ...
  114. def getMask(self) -> cv2.typing.MatLike: ...
  115. def getWeights(self) -> cv2.typing.MatLike: ...
  116. @_typing.overload
  117. def correctImage(self, src: cv2.typing.MatLike, dst: cv2.typing.MatLike | None = ..., islinear: bool = ...) -> cv2.typing.MatLike: ...
  118. @_typing.overload
  119. def correctImage(self, src: cv2.UMat, dst: cv2.UMat | None = ..., islinear: bool = ...) -> cv2.UMat: ...
  120. def write(self, fs: cv2.FileStorage) -> None: ...
  121. def read(self, node: cv2.FileNode) -> None: ...
  122. # Functions
  123. @_typing.overload
  124. def gammaCorrection(src: cv2.typing.MatLike, gamma: float, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  125. @_typing.overload
  126. def gammaCorrection(src: cv2.UMat, gamma: float, dst: cv2.UMat | None = ...) -> cv2.UMat: ...