opencv-contrib-python-headless 4.13.0.90__cp37-abi3-manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cv2/Error/__init__.pyi +118 -0
- cv2/LICENSE-3RD-PARTY.txt +3513 -0
- cv2/LICENSE.txt +21 -0
- cv2/__init__.py +181 -0
- cv2/__init__.pyi +6858 -0
- cv2/aruco/__init__.pyi +410 -0
- cv2/barcode/__init__.pyi +40 -0
- cv2/bgsegm/__init__.pyi +202 -0
- cv2/bioinspired/__init__.pyi +121 -0
- cv2/ccm/__init__.pyi +167 -0
- cv2/colored_kinfu/__init__.pyi +96 -0
- cv2/config-3.py +24 -0
- cv2/config.py +5 -0
- cv2/cuda/__init__.pyi +553 -0
- cv2/cv2.abi3.so +0 -0
- cv2/data/__init__.py +3 -0
- cv2/data/haarcascade_eye.xml +12213 -0
- cv2/data/haarcascade_eye_tree_eyeglasses.xml +22619 -0
- cv2/data/haarcascade_frontalcatface.xml +14382 -0
- cv2/data/haarcascade_frontalcatface_extended.xml +13394 -0
- cv2/data/haarcascade_frontalface_alt.xml +24350 -0
- cv2/data/haarcascade_frontalface_alt2.xml +20719 -0
- cv2/data/haarcascade_frontalface_alt_tree.xml +96484 -0
- cv2/data/haarcascade_frontalface_default.xml +33314 -0
- cv2/data/haarcascade_fullbody.xml +17030 -0
- cv2/data/haarcascade_lefteye_2splits.xml +7390 -0
- cv2/data/haarcascade_license_plate_rus_16stages.xml +1404 -0
- cv2/data/haarcascade_lowerbody.xml +14056 -0
- cv2/data/haarcascade_profileface.xml +29690 -0
- cv2/data/haarcascade_righteye_2splits.xml +7407 -0
- cv2/data/haarcascade_russian_plate_number.xml +2656 -0
- cv2/data/haarcascade_smile.xml +6729 -0
- cv2/data/haarcascade_upperbody.xml +28134 -0
- cv2/datasets/__init__.pyi +80 -0
- cv2/detail/__init__.pyi +627 -0
- cv2/dnn/__init__.pyi +549 -0
- cv2/dnn_superres/__init__.pyi +37 -0
- cv2/dpm/__init__.pyi +10 -0
- cv2/dynafu/__init__.pyi +43 -0
- cv2/face/__init__.pyi +220 -0
- cv2/fisheye/__init__.pyi +88 -0
- cv2/flann/__init__.pyi +65 -0
- cv2/ft/__init__.pyi +98 -0
- cv2/gapi/__init__.py +323 -0
- cv2/gapi/__init__.pyi +349 -0
- cv2/gapi/core/__init__.pyi +7 -0
- cv2/gapi/core/cpu/__init__.pyi +9 -0
- cv2/gapi/core/fluid/__init__.pyi +9 -0
- cv2/gapi/core/ocl/__init__.pyi +9 -0
- cv2/gapi/ie/__init__.pyi +51 -0
- cv2/gapi/ie/detail/__init__.pyi +12 -0
- cv2/gapi/imgproc/__init__.pyi +5 -0
- cv2/gapi/imgproc/fluid/__init__.pyi +9 -0
- cv2/gapi/oak/__init__.pyi +37 -0
- cv2/gapi/onnx/__init__.pyi +55 -0
- cv2/gapi/onnx/ep/__init__.pyi +63 -0
- cv2/gapi/ot/__init__.pyi +32 -0
- cv2/gapi/ot/cpu/__init__.pyi +9 -0
- cv2/gapi/ov/__init__.pyi +74 -0
- cv2/gapi/own/__init__.pyi +5 -0
- cv2/gapi/own/detail/__init__.pyi +10 -0
- cv2/gapi/render/__init__.pyi +5 -0
- cv2/gapi/render/ocv/__init__.pyi +9 -0
- cv2/gapi/streaming/__init__.pyi +42 -0
- cv2/gapi/video/__init__.pyi +10 -0
- cv2/gapi/wip/__init__.pyi +43 -0
- cv2/gapi/wip/draw/__init__.pyi +119 -0
- cv2/gapi/wip/gst/__init__.pyi +17 -0
- cv2/gapi/wip/onevpl/__init__.pyi +16 -0
- cv2/hfs/__init__.pyi +53 -0
- cv2/img_hash/__init__.pyi +116 -0
- cv2/instr/__init__.pyi +24 -0
- cv2/intensity_transform/__init__.pyi +27 -0
- cv2/ipp/__init__.pyi +14 -0
- cv2/kinfu/__init__.pyi +133 -0
- cv2/kinfu/detail/__init__.pyi +7 -0
- cv2/large_kinfu/__init__.pyi +73 -0
- cv2/legacy/__init__.pyi +93 -0
- cv2/line_descriptor/__init__.pyi +112 -0
- cv2/linemod/__init__.pyi +151 -0
- cv2/load_config_py2.py +6 -0
- cv2/load_config_py3.py +9 -0
- cv2/mat_wrapper/__init__.py +40 -0
- cv2/mcc/__init__.pyi +109 -0
- cv2/misc/__init__.py +1 -0
- cv2/misc/version.py +5 -0
- cv2/ml/__init__.pyi +696 -0
- cv2/motempl/__init__.pyi +29 -0
- cv2/multicalib/__init__.pyi +10 -0
- cv2/ocl/__init__.pyi +252 -0
- cv2/ogl/__init__.pyi +51 -0
- cv2/omnidir/__init__.pyi +68 -0
- cv2/optflow/__init__.pyi +286 -0
- cv2/parallel/__init__.pyi +6 -0
- cv2/phase_unwrapping/__init__.pyi +41 -0
- cv2/plot/__init__.pyi +64 -0
- cv2/ppf_match_3d/__init__.pyi +91 -0
- cv2/py.typed +0 -0
- cv2/quality/__init__.pyi +149 -0
- cv2/rapid/__init__.pyi +91 -0
- cv2/reg/__init__.pyi +210 -0
- cv2/rgbd/__init__.pyi +449 -0
- cv2/saliency/__init__.pyi +117 -0
- cv2/samples/__init__.pyi +12 -0
- cv2/segmentation/__init__.pyi +39 -0
- cv2/signal/__init__.pyi +14 -0
- cv2/stereo/__init__.pyi +88 -0
- cv2/structured_light/__init__.pyi +94 -0
- cv2/text/__init__.pyi +204 -0
- cv2/typing/__init__.py +180 -0
- cv2/utils/__init__.py +14 -0
- cv2/utils/__init__.pyi +110 -0
- cv2/utils/fs/__init__.pyi +6 -0
- cv2/utils/logging/__init__.pyi +22 -0
- cv2/utils/nested/__init__.pyi +31 -0
- cv2/version.py +5 -0
- cv2/videoio_registry/__init__.pyi +31 -0
- cv2/videostab/__init__.pyi +16 -0
- cv2/wechat_qrcode/__init__.pyi +23 -0
- cv2/xfeatures2d/__init__.pyi +537 -0
- cv2/ximgproc/__init__.pyi +746 -0
- cv2/ximgproc/segmentation/__init__.pyi +116 -0
- cv2/xphoto/__init__.pyi +142 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/LICENSE-3RD-PARTY.txt +3513 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/LICENSE.txt +21 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/METADATA +300 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/RECORD +149 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/WHEEL +5 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/sboms/auditwheel.cdx.json +1 -0
- opencv_contrib_python_headless-4.13.0.90.dist-info/top_level.txt +1 -0
- opencv_contrib_python_headless.libs/libXau-7926f62a.so.6.0.0 +0 -0
- opencv_contrib_python_headless.libs/libaom-0b2390d3.so.3.12.1 +0 -0
- opencv_contrib_python_headless.libs/libavcodec-5696b3bf.so.59.37.100 +0 -0
- opencv_contrib_python_headless.libs/libavdevice-827b98cd.so.59.7.100 +0 -0
- opencv_contrib_python_headless.libs/libavfilter-75ac0576.so.8.44.100 +0 -0
- opencv_contrib_python_headless.libs/libavformat-bf63de55.so.59.27.100 +0 -0
- opencv_contrib_python_headless.libs/libavif-acfd7f95.so.16.3.0 +0 -0
- opencv_contrib_python_headless.libs/libavutil-cac768a8.so.57.28.100 +0 -0
- opencv_contrib_python_headless.libs/libcrypto-3dc39733.so.1.1.1k +0 -0
- opencv_contrib_python_headless.libs/libgfortran-e1b7dfc8.so.5.0.0 +0 -0
- opencv_contrib_python_headless.libs/libopenblasp-r0-e3ea6fd1.3.15.so +0 -0
- opencv_contrib_python_headless.libs/libpng16-e3f0ef52.so.16.48.0 +0 -0
- opencv_contrib_python_headless.libs/libssl-b6e07dfa.so.1.1.1k +0 -0
- opencv_contrib_python_headless.libs/libswresample-a12ab15e.so.4.7.100 +0 -0
- opencv_contrib_python_headless.libs/libswscale-27999517.so.6.7.100 +0 -0
- opencv_contrib_python_headless.libs/libvpx-c84f69c8.so.11.0.0 +0 -0
- opencv_contrib_python_headless.libs/libxcb-shape-c3b64477.so.0.0.0 +0 -0
- opencv_contrib_python_headless.libs/libxcb-shm-1266c612.so.0.0.0 +0 -0
- opencv_contrib_python_headless.libs/libxcb-xfixes-a124fd6b.so.0.0.0 +0 -0
cv2/stereo/__init__.pyi
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
__all__: list[str] = []
|
|
2
|
+
|
|
3
|
+
import cv2.typing
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Enumerations
|
|
8
|
+
CV_SPECKLE_REMOVAL_ALGORITHM: int
|
|
9
|
+
CV_SPECKLE_REMOVAL_AVG_ALGORITHM: int
|
|
10
|
+
CV_QUADRATIC_INTERPOLATION: int
|
|
11
|
+
CV_SIMETRICV_INTERPOLATION: int
|
|
12
|
+
CV_DENSE_CENSUS: int
|
|
13
|
+
CV_SPARSE_CENSUS: int
|
|
14
|
+
CV_CS_CENSUS: int
|
|
15
|
+
CV_MODIFIED_CS_CENSUS: int
|
|
16
|
+
CV_MODIFIED_CENSUS_TRANSFORM: int
|
|
17
|
+
CV_MEAN_VARIATION: int
|
|
18
|
+
CV_STAR_KERNEL: int
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
StereoMatcher_DISP_SHIFT: int
|
|
22
|
+
STEREO_MATCHER_DISP_SHIFT: int
|
|
23
|
+
StereoMatcher_DISP_SCALE: int
|
|
24
|
+
STEREO_MATCHER_DISP_SCALE: int
|
|
25
|
+
|
|
26
|
+
StereoBinaryBM_PREFILTER_NORMALIZED_RESPONSE: int
|
|
27
|
+
STEREO_BINARY_BM_PREFILTER_NORMALIZED_RESPONSE: int
|
|
28
|
+
StereoBinaryBM_PREFILTER_XSOBEL: int
|
|
29
|
+
STEREO_BINARY_BM_PREFILTER_XSOBEL: int
|
|
30
|
+
|
|
31
|
+
StereoBinarySGBM_MODE_SGBM: int
|
|
32
|
+
STEREO_BINARY_SGBM_MODE_SGBM: int
|
|
33
|
+
StereoBinarySGBM_MODE_HH: int
|
|
34
|
+
STEREO_BINARY_SGBM_MODE_HH: int
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Classes
|
|
38
|
+
class MatchQuasiDense:
|
|
39
|
+
p0: cv2.typing.Point2i
|
|
40
|
+
p1: cv2.typing.Point2i
|
|
41
|
+
corr: float
|
|
42
|
+
|
|
43
|
+
# Functions
|
|
44
|
+
def __init__(self) -> None: ...
|
|
45
|
+
|
|
46
|
+
def apply(self, rhs: MatchQuasiDense) -> bool: ...
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class PropagationParameters:
|
|
50
|
+
corrWinSizeX: int
|
|
51
|
+
corrWinSizeY: int
|
|
52
|
+
borderX: int
|
|
53
|
+
borderY: int
|
|
54
|
+
correlationThreshold: float
|
|
55
|
+
textrureThreshold: float
|
|
56
|
+
neighborhoodSize: int
|
|
57
|
+
disparityGradient: int
|
|
58
|
+
lkTemplateSize: int
|
|
59
|
+
lkPyrLvl: int
|
|
60
|
+
lkTermParam1: int
|
|
61
|
+
lkTermParam2: float
|
|
62
|
+
gftQualityThres: float
|
|
63
|
+
gftMinSeperationDist: int
|
|
64
|
+
gftMaxNumFeatures: int
|
|
65
|
+
|
|
66
|
+
class QuasiDenseStereo:
|
|
67
|
+
Param: PropagationParameters
|
|
68
|
+
|
|
69
|
+
# Functions
|
|
70
|
+
def loadParameters(self, filepath: str | os.PathLike[str]) -> int: ...
|
|
71
|
+
|
|
72
|
+
def saveParameters(self, filepath: str | os.PathLike[str]) -> int: ...
|
|
73
|
+
|
|
74
|
+
def getSparseMatches(self) -> _typing.Sequence[MatchQuasiDense]: ...
|
|
75
|
+
|
|
76
|
+
def getDenseMatches(self) -> _typing.Sequence[MatchQuasiDense]: ...
|
|
77
|
+
|
|
78
|
+
def process(self, imgLeft: cv2.typing.MatLike, imgRight: cv2.typing.MatLike) -> None: ...
|
|
79
|
+
|
|
80
|
+
def getMatch(self, x: int, y: int) -> cv2.typing.Point2f: ...
|
|
81
|
+
|
|
82
|
+
def getDisparity(self) -> cv2.typing.MatLike: ...
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def create(cls, monoImgSize: cv2.typing.Size, paramFilepath: str = ...) -> QuasiDenseStereo: ...
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
__all__: list[str] = []
|
|
2
|
+
|
|
3
|
+
import cv2
|
|
4
|
+
import cv2.typing
|
|
5
|
+
import typing as _typing
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Enumerations
|
|
9
|
+
FTP: int
|
|
10
|
+
PSP: int
|
|
11
|
+
FAPS: int
|
|
12
|
+
DECODE_3D_UNDERWORLD: int
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Classes
|
|
17
|
+
class GrayCodePattern(StructuredLightPattern):
|
|
18
|
+
# Functions
|
|
19
|
+
@classmethod
|
|
20
|
+
def create(cls, width: int, height: int) -> GrayCodePattern: ...
|
|
21
|
+
|
|
22
|
+
def getNumberOfPatternImages(self) -> int: ...
|
|
23
|
+
|
|
24
|
+
def setWhiteThreshold(self, value: int) -> None: ...
|
|
25
|
+
|
|
26
|
+
def setBlackThreshold(self, value: int) -> None: ...
|
|
27
|
+
|
|
28
|
+
@_typing.overload
|
|
29
|
+
def getImagesForShadowMasks(self, blackImage: cv2.typing.MatLike, whiteImage: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
|
|
30
|
+
@_typing.overload
|
|
31
|
+
def getImagesForShadowMasks(self, blackImage: cv2.UMat, whiteImage: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ...
|
|
32
|
+
|
|
33
|
+
@_typing.overload
|
|
34
|
+
def getProjPixel(self, patternImages: _typing.Sequence[cv2.typing.MatLike], x: int, y: int) -> tuple[bool, cv2.typing.Point]: ...
|
|
35
|
+
@_typing.overload
|
|
36
|
+
def getProjPixel(self, patternImages: _typing.Sequence[cv2.UMat], x: int, y: int) -> tuple[bool, cv2.typing.Point]: ...
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class StructuredLightPattern(cv2.Algorithm):
|
|
40
|
+
# Functions
|
|
41
|
+
@_typing.overload
|
|
42
|
+
def generate(self, patternImages: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[bool, _typing.Sequence[cv2.typing.MatLike]]: ...
|
|
43
|
+
@_typing.overload
|
|
44
|
+
def generate(self, patternImages: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[bool, _typing.Sequence[cv2.UMat]]: ...
|
|
45
|
+
|
|
46
|
+
@_typing.overload
|
|
47
|
+
def decode(self, patternImages: _typing.Sequence[_typing.Sequence[cv2.typing.MatLike]], disparityMap: cv2.typing.MatLike | None = ..., blackImages: _typing.Sequence[cv2.typing.MatLike] | None = ..., whiteImages: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ...) -> tuple[bool, cv2.typing.MatLike]: ...
|
|
48
|
+
@_typing.overload
|
|
49
|
+
def decode(self, patternImages: _typing.Sequence[_typing.Sequence[cv2.typing.MatLike]], disparityMap: cv2.UMat | None = ..., blackImages: _typing.Sequence[cv2.UMat] | None = ..., whiteImages: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ...) -> tuple[bool, cv2.UMat]: ...
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class SinusoidalPattern(StructuredLightPattern):
|
|
53
|
+
# Classes
|
|
54
|
+
class Params:
|
|
55
|
+
width: int
|
|
56
|
+
height: int
|
|
57
|
+
nbrOfPeriods: int
|
|
58
|
+
shiftValue: float
|
|
59
|
+
methodId: int
|
|
60
|
+
nbrOfPixelsBetweenMarkers: int
|
|
61
|
+
horizontal: bool
|
|
62
|
+
setMarkers: bool
|
|
63
|
+
|
|
64
|
+
# Functions
|
|
65
|
+
def __init__(self) -> None: ...
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# Functions
|
|
70
|
+
@classmethod
|
|
71
|
+
def create(cls, parameters: SinusoidalPattern.Params = ...) -> SinusoidalPattern: ...
|
|
72
|
+
|
|
73
|
+
@_typing.overload
|
|
74
|
+
def computePhaseMap(self, patternImages: _typing.Sequence[cv2.typing.MatLike], wrappedPhaseMap: cv2.typing.MatLike | None = ..., shadowMask: cv2.typing.MatLike | None = ..., fundamental: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
|
|
75
|
+
@_typing.overload
|
|
76
|
+
def computePhaseMap(self, patternImages: _typing.Sequence[cv2.UMat], wrappedPhaseMap: cv2.UMat | None = ..., shadowMask: cv2.UMat | None = ..., fundamental: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
|
|
77
|
+
|
|
78
|
+
@_typing.overload
|
|
79
|
+
def unwrapPhaseMap(self, wrappedPhaseMap: cv2.typing.MatLike, camSize: cv2.typing.Size, unwrappedPhaseMap: cv2.typing.MatLike | None = ..., shadowMask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
|
|
80
|
+
@_typing.overload
|
|
81
|
+
def unwrapPhaseMap(self, wrappedPhaseMap: cv2.UMat, camSize: cv2.typing.Size, unwrappedPhaseMap: cv2.UMat | None = ..., shadowMask: cv2.UMat | None = ...) -> cv2.UMat: ...
|
|
82
|
+
|
|
83
|
+
@_typing.overload
|
|
84
|
+
def findProCamMatches(self, projUnwrappedPhaseMap: cv2.typing.MatLike, camUnwrappedPhaseMap: cv2.typing.MatLike, matches: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
|
|
85
|
+
@_typing.overload
|
|
86
|
+
def findProCamMatches(self, projUnwrappedPhaseMap: cv2.UMat, camUnwrappedPhaseMap: cv2.UMat, matches: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
|
|
87
|
+
|
|
88
|
+
@_typing.overload
|
|
89
|
+
def computeDataModulationTerm(self, patternImages: _typing.Sequence[cv2.typing.MatLike], shadowMask: cv2.typing.MatLike, dataModulationTerm: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
|
|
90
|
+
@_typing.overload
|
|
91
|
+
def computeDataModulationTerm(self, patternImages: _typing.Sequence[cv2.UMat], shadowMask: cv2.UMat, dataModulationTerm: cv2.UMat | None = ...) -> cv2.UMat: ...
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
cv2/text/__init__.pyi
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
__all__: list[str] = []
|
|
2
|
+
|
|
3
|
+
import cv2
|
|
4
|
+
import cv2.typing
|
|
5
|
+
import os
|
|
6
|
+
import typing as _typing
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Enumerations
|
|
10
|
+
ERFILTER_NM_RGBLGrad: int
|
|
11
|
+
ERFILTER_NM_RGBLGRAD: int
|
|
12
|
+
ERFILTER_NM_IHSGrad: int
|
|
13
|
+
ERFILTER_NM_IHSGRAD: int
|
|
14
|
+
OCR_LEVEL_WORD: int
|
|
15
|
+
OCR_LEVEL_TEXTLINE: int
|
|
16
|
+
|
|
17
|
+
ERGROUPING_ORIENTATION_HORIZ: int
|
|
18
|
+
ERGROUPING_ORIENTATION_ANY: int
|
|
19
|
+
erGrouping_Modes = int
|
|
20
|
+
"""One of [ERGROUPING_ORIENTATION_HORIZ, ERGROUPING_ORIENTATION_ANY]"""
|
|
21
|
+
|
|
22
|
+
PSM_OSD_ONLY: int
|
|
23
|
+
PSM_AUTO_OSD: int
|
|
24
|
+
PSM_AUTO_ONLY: int
|
|
25
|
+
PSM_AUTO: int
|
|
26
|
+
PSM_SINGLE_COLUMN: int
|
|
27
|
+
PSM_SINGLE_BLOCK_VERT_TEXT: int
|
|
28
|
+
PSM_SINGLE_BLOCK: int
|
|
29
|
+
PSM_SINGLE_LINE: int
|
|
30
|
+
PSM_SINGLE_WORD: int
|
|
31
|
+
PSM_CIRCLE_WORD: int
|
|
32
|
+
PSM_SINGLE_CHAR: int
|
|
33
|
+
page_seg_mode = int
|
|
34
|
+
"""One of [PSM_OSD_ONLY, PSM_AUTO_OSD, PSM_AUTO_ONLY, PSM_AUTO, PSM_SINGLE_COLUMN, PSM_SINGLE_BLOCK_VERT_TEXT, PSM_SINGLE_BLOCK, PSM_SINGLE_LINE, PSM_SINGLE_WORD, PSM_CIRCLE_WORD, PSM_SINGLE_CHAR]"""
|
|
35
|
+
|
|
36
|
+
OEM_TESSERACT_ONLY: int
|
|
37
|
+
OEM_CUBE_ONLY: int
|
|
38
|
+
OEM_TESSERACT_CUBE_COMBINED: int
|
|
39
|
+
OEM_DEFAULT: int
|
|
40
|
+
ocr_engine_mode = int
|
|
41
|
+
"""One of [OEM_TESSERACT_ONLY, OEM_CUBE_ONLY, OEM_TESSERACT_CUBE_COMBINED, OEM_DEFAULT]"""
|
|
42
|
+
|
|
43
|
+
OCR_DECODER_VITERBI: int
|
|
44
|
+
decoder_mode = int
|
|
45
|
+
"""One of [OCR_DECODER_VITERBI]"""
|
|
46
|
+
|
|
47
|
+
OCR_KNN_CLASSIFIER: int
|
|
48
|
+
OCR_CNN_CLASSIFIER: int
|
|
49
|
+
classifier_type = int
|
|
50
|
+
"""One of [OCR_KNN_CLASSIFIER, OCR_CNN_CLASSIFIER]"""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# Classes
|
|
55
|
+
class ERFilter(cv2.Algorithm):
|
|
56
|
+
# Classes
|
|
57
|
+
class Callback:
|
|
58
|
+
...
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class BaseOCR:
|
|
62
|
+
...
|
|
63
|
+
|
|
64
|
+
class OCRTesseract(BaseOCR):
|
|
65
|
+
# Functions
|
|
66
|
+
@_typing.overload
|
|
67
|
+
def run(self, image: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
68
|
+
@_typing.overload
|
|
69
|
+
def run(self, image: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
70
|
+
@_typing.overload
|
|
71
|
+
def run(self, image: cv2.typing.MatLike, mask: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
72
|
+
@_typing.overload
|
|
73
|
+
def run(self, image: cv2.UMat, mask: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
74
|
+
|
|
75
|
+
def setWhiteList(self, char_whitelist: str) -> None: ...
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def create(cls, datapath: str = ..., language: str = ..., char_whitelist: str = ..., oem: int = ..., psmode: int = ...) -> OCRTesseract: ...
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class OCRHMMDecoder(BaseOCR):
|
|
82
|
+
# Classes
|
|
83
|
+
class ClassifierCallback:
|
|
84
|
+
...
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# Functions
|
|
88
|
+
@_typing.overload
|
|
89
|
+
def run(self, image: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
90
|
+
@_typing.overload
|
|
91
|
+
def run(self, image: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
92
|
+
@_typing.overload
|
|
93
|
+
def run(self, image: cv2.typing.MatLike, mask: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
94
|
+
@_typing.overload
|
|
95
|
+
def run(self, image: cv2.UMat, mask: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
@_typing.overload
|
|
99
|
+
def create(cls, classifier: OCRHMMDecoder.ClassifierCallback, vocabulary: str, transition_probabilities_table: cv2.typing.MatLike, emission_probabilities_table: cv2.typing.MatLike, mode: int = ...) -> OCRHMMDecoder: ...
|
|
100
|
+
@classmethod
|
|
101
|
+
@_typing.overload
|
|
102
|
+
def create(cls, classifier: OCRHMMDecoder.ClassifierCallback, vocabulary: str, transition_probabilities_table: cv2.UMat, emission_probabilities_table: cv2.UMat, mode: int = ...) -> OCRHMMDecoder: ...
|
|
103
|
+
@classmethod
|
|
104
|
+
@_typing.overload
|
|
105
|
+
def create(cls, filename: str | os.PathLike[str], vocabulary: str, transition_probabilities_table: cv2.typing.MatLike, emission_probabilities_table: cv2.typing.MatLike, mode: int = ..., classifier: int = ...) -> OCRHMMDecoder: ...
|
|
106
|
+
@classmethod
|
|
107
|
+
@_typing.overload
|
|
108
|
+
def create(cls, filename: str | os.PathLike[str], vocabulary: str, transition_probabilities_table: cv2.UMat, emission_probabilities_table: cv2.UMat, mode: int = ..., classifier: int = ...) -> OCRHMMDecoder: ...
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class OCRBeamSearchDecoder(BaseOCR):
|
|
112
|
+
# Classes
|
|
113
|
+
class ClassifierCallback:
|
|
114
|
+
...
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# Functions
|
|
118
|
+
@_typing.overload
|
|
119
|
+
def run(self, image: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
120
|
+
@_typing.overload
|
|
121
|
+
def run(self, image: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
122
|
+
@_typing.overload
|
|
123
|
+
def run(self, image: cv2.typing.MatLike, mask: cv2.typing.MatLike, min_confidence: int, component_level: int = ...) -> str: ...
|
|
124
|
+
@_typing.overload
|
|
125
|
+
def run(self, image: cv2.UMat, mask: cv2.UMat, min_confidence: int, component_level: int = ...) -> str: ...
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
@_typing.overload
|
|
129
|
+
def create(cls, classifier: OCRBeamSearchDecoder.ClassifierCallback, vocabulary: str, transition_probabilities_table: cv2.typing.MatLike, emission_probabilities_table: cv2.typing.MatLike, mode: decoder_mode = ..., beam_size: int = ...) -> OCRBeamSearchDecoder: ...
|
|
130
|
+
@classmethod
|
|
131
|
+
@_typing.overload
|
|
132
|
+
def create(cls, classifier: OCRBeamSearchDecoder.ClassifierCallback, vocabulary: str, transition_probabilities_table: cv2.UMat, emission_probabilities_table: cv2.UMat, mode: decoder_mode = ..., beam_size: int = ...) -> OCRBeamSearchDecoder: ...
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class TextDetector:
|
|
136
|
+
# Functions
|
|
137
|
+
@_typing.overload
|
|
138
|
+
def detect(self, inputImage: cv2.typing.MatLike) -> tuple[_typing.Sequence[cv2.typing.Rect], _typing.Sequence[float]]: ...
|
|
139
|
+
@_typing.overload
|
|
140
|
+
def detect(self, inputImage: cv2.UMat) -> tuple[_typing.Sequence[cv2.typing.Rect], _typing.Sequence[float]]: ...
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class TextDetectorCNN(TextDetector):
|
|
144
|
+
# Functions
|
|
145
|
+
@_typing.overload
|
|
146
|
+
def detect(self, inputImage: cv2.typing.MatLike) -> tuple[_typing.Sequence[cv2.typing.Rect], _typing.Sequence[float]]: ...
|
|
147
|
+
@_typing.overload
|
|
148
|
+
def detect(self, inputImage: cv2.UMat) -> tuple[_typing.Sequence[cv2.typing.Rect], _typing.Sequence[float]]: ...
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def create(cls, modelArchFilename: str, modelWeightsFilename: str) -> TextDetectorCNN: ...
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# Functions
|
|
156
|
+
@_typing.overload
|
|
157
|
+
def computeNMChannels(_src: cv2.typing.MatLike, _channels: _typing.Sequence[cv2.typing.MatLike] | None = ..., _mode: int = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
|
|
158
|
+
@_typing.overload
|
|
159
|
+
def computeNMChannels(_src: cv2.UMat, _channels: _typing.Sequence[cv2.UMat] | None = ..., _mode: int = ...) -> _typing.Sequence[cv2.UMat]: ...
|
|
160
|
+
|
|
161
|
+
@_typing.overload
|
|
162
|
+
def createERFilterNM1(cb: ERFilter.Callback, thresholdDelta: int = ..., minArea: float = ..., maxArea: float = ..., minProbability: float = ..., nonMaxSuppression: bool = ..., minProbabilityDiff: float = ...) -> ERFilter: ...
|
|
163
|
+
@_typing.overload
|
|
164
|
+
def createERFilterNM1(filename: str | os.PathLike[str], thresholdDelta: int = ..., minArea: float = ..., maxArea: float = ..., minProbability: float = ..., nonMaxSuppression: bool = ..., minProbabilityDiff: float = ...) -> ERFilter: ...
|
|
165
|
+
|
|
166
|
+
@_typing.overload
|
|
167
|
+
def createERFilterNM2(cb: ERFilter.Callback, minProbability: float = ...) -> ERFilter: ...
|
|
168
|
+
@_typing.overload
|
|
169
|
+
def createERFilterNM2(filename: str | os.PathLike[str], minProbability: float = ...) -> ERFilter: ...
|
|
170
|
+
|
|
171
|
+
def createOCRHMMTransitionsTable(vocabulary: str, lexicon: _typing.Sequence[str]) -> cv2.typing.MatLike: ...
|
|
172
|
+
|
|
173
|
+
@_typing.overload
|
|
174
|
+
def detectRegions(image: cv2.typing.MatLike, er_filter1: ERFilter, er_filter2: ERFilter) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
|
|
175
|
+
@_typing.overload
|
|
176
|
+
def detectRegions(image: cv2.UMat, er_filter1: ERFilter, er_filter2: ERFilter) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
|
|
177
|
+
@_typing.overload
|
|
178
|
+
def detectRegions(image: cv2.typing.MatLike, er_filter1: ERFilter, er_filter2: ERFilter, method: int = ..., filename: str | os.PathLike[str] = ..., minProbability: float = ...) -> _typing.Sequence[cv2.typing.Rect]: ...
|
|
179
|
+
@_typing.overload
|
|
180
|
+
def detectRegions(image: cv2.UMat, er_filter1: ERFilter, er_filter2: ERFilter, method: int = ..., filename: str | os.PathLike[str] = ..., minProbability: float = ...) -> _typing.Sequence[cv2.typing.Rect]: ...
|
|
181
|
+
|
|
182
|
+
@_typing.overload
|
|
183
|
+
def detectTextSWT(input: cv2.typing.MatLike, dark_on_light: bool, draw: cv2.typing.MatLike | None = ..., chainBBs: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.Rect], cv2.typing.MatLike, cv2.typing.MatLike]: ...
|
|
184
|
+
@_typing.overload
|
|
185
|
+
def detectTextSWT(input: cv2.UMat, dark_on_light: bool, draw: cv2.UMat | None = ..., chainBBs: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.typing.Rect], cv2.UMat, cv2.UMat]: ...
|
|
186
|
+
|
|
187
|
+
@_typing.overload
|
|
188
|
+
def erGrouping(image: cv2.typing.MatLike, channel: cv2.typing.MatLike, regions: _typing.Sequence[_typing.Sequence[cv2.typing.Point]], method: int = ..., filename: str | os.PathLike[str] = ..., minProbablity: float = ...) -> _typing.Sequence[cv2.typing.Rect]: ...
|
|
189
|
+
@_typing.overload
|
|
190
|
+
def erGrouping(image: cv2.UMat, channel: cv2.UMat, regions: _typing.Sequence[_typing.Sequence[cv2.typing.Point]], method: int = ..., filename: str | os.PathLike[str] = ..., minProbablity: float = ...) -> _typing.Sequence[cv2.typing.Rect]: ...
|
|
191
|
+
|
|
192
|
+
def loadClassifierNM1(filename: str | os.PathLike[str]) -> ERFilter.Callback: ...
|
|
193
|
+
|
|
194
|
+
def loadClassifierNM2(filename: str | os.PathLike[str]) -> ERFilter.Callback: ...
|
|
195
|
+
|
|
196
|
+
def loadOCRBeamSearchClassifierCNN(filename: str | os.PathLike[str]) -> OCRBeamSearchDecoder.ClassifierCallback: ...
|
|
197
|
+
|
|
198
|
+
def loadOCRHMMClassifier(filename: str | os.PathLike[str], classifier: int) -> OCRHMMDecoder.ClassifierCallback: ...
|
|
199
|
+
|
|
200
|
+
def loadOCRHMMClassifierCNN(filename: str | os.PathLike[str]) -> OCRHMMDecoder.ClassifierCallback: ...
|
|
201
|
+
|
|
202
|
+
def loadOCRHMMClassifierNM(filename: str | os.PathLike[str]) -> OCRHMMDecoder.ClassifierCallback: ...
|
|
203
|
+
|
|
204
|
+
|
cv2/typing/__init__.py
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"IntPointer",
|
|
3
|
+
"MatLike",
|
|
4
|
+
"MatShape",
|
|
5
|
+
"Size",
|
|
6
|
+
"Size2f",
|
|
7
|
+
"Scalar",
|
|
8
|
+
"Point",
|
|
9
|
+
"Point2i",
|
|
10
|
+
"Point2f",
|
|
11
|
+
"Point2d",
|
|
12
|
+
"Point3i",
|
|
13
|
+
"Point3f",
|
|
14
|
+
"Point3d",
|
|
15
|
+
"Range",
|
|
16
|
+
"Rect",
|
|
17
|
+
"Rect2i",
|
|
18
|
+
"Rect2f",
|
|
19
|
+
"Rect2d",
|
|
20
|
+
"Moments",
|
|
21
|
+
"RotatedRect",
|
|
22
|
+
"TermCriteria",
|
|
23
|
+
"Vec2i",
|
|
24
|
+
"Vec2f",
|
|
25
|
+
"Vec2d",
|
|
26
|
+
"Vec3i",
|
|
27
|
+
"Vec3f",
|
|
28
|
+
"Vec3d",
|
|
29
|
+
"Vec4i",
|
|
30
|
+
"Vec4f",
|
|
31
|
+
"Vec4d",
|
|
32
|
+
"Vec6f",
|
|
33
|
+
"FeatureDetector",
|
|
34
|
+
"DescriptorExtractor",
|
|
35
|
+
"FeatureExtractor",
|
|
36
|
+
"Matx33f",
|
|
37
|
+
"Matx33d",
|
|
38
|
+
"Matx44f",
|
|
39
|
+
"Matx44d",
|
|
40
|
+
"LayerId",
|
|
41
|
+
"LayerParams",
|
|
42
|
+
"IndexParams",
|
|
43
|
+
"SearchParams",
|
|
44
|
+
"map_string_and_string",
|
|
45
|
+
"map_string_and_int",
|
|
46
|
+
"map_string_and_vector_size_t",
|
|
47
|
+
"map_string_and_vector_float",
|
|
48
|
+
"map_int_and_double",
|
|
49
|
+
"GProtoArg",
|
|
50
|
+
"GProtoInputArgs",
|
|
51
|
+
"GProtoOutputArgs",
|
|
52
|
+
"GRunArg",
|
|
53
|
+
"GOptRunArg",
|
|
54
|
+
"GMetaArg",
|
|
55
|
+
"Prim",
|
|
56
|
+
"GTypeInfo",
|
|
57
|
+
"ExtractArgsCallback",
|
|
58
|
+
"ExtractMetaCallback",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
import typing as _typing
|
|
62
|
+
import cv2.gapi.wip.draw
|
|
63
|
+
import cv2.dnn
|
|
64
|
+
import cv2
|
|
65
|
+
import cv2.mat_wrapper
|
|
66
|
+
import numpy
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
if _typing.TYPE_CHECKING:
|
|
70
|
+
NumPyArrayNumeric = numpy.ndarray[_typing.Any, numpy.dtype[numpy.integer[_typing.Any] | numpy.floating[_typing.Any]]]
|
|
71
|
+
else:
|
|
72
|
+
NumPyArrayNumeric = numpy.ndarray
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if _typing.TYPE_CHECKING:
|
|
76
|
+
NumPyArrayFloat32 = numpy.ndarray[_typing.Any, numpy.dtype[numpy.float32]]
|
|
77
|
+
else:
|
|
78
|
+
NumPyArrayFloat32 = numpy.ndarray
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if _typing.TYPE_CHECKING:
|
|
82
|
+
NumPyArrayFloat64 = numpy.ndarray[_typing.Any, numpy.dtype[numpy.float64]]
|
|
83
|
+
else:
|
|
84
|
+
NumPyArrayFloat64 = numpy.ndarray
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if _typing.TYPE_CHECKING:
|
|
88
|
+
TermCriteria_Type = cv2.TermCriteria_Type
|
|
89
|
+
else:
|
|
90
|
+
TermCriteria_Type = int
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
IntPointer = int
|
|
94
|
+
"""Represents an arbitrary pointer"""
|
|
95
|
+
MatLike = _typing.Union[cv2.mat_wrapper.Mat, NumPyArrayNumeric]
|
|
96
|
+
MatShape = _typing.Sequence[int]
|
|
97
|
+
Size = _typing.Sequence[int]
|
|
98
|
+
"""Required length is 2"""
|
|
99
|
+
Size2f = _typing.Sequence[float]
|
|
100
|
+
"""Required length is 2"""
|
|
101
|
+
Scalar = _typing.Union[_typing.Sequence[float], float]
|
|
102
|
+
"""Max sequence length is at most 4"""
|
|
103
|
+
Point = _typing.Sequence[int]
|
|
104
|
+
"""Required length is 2"""
|
|
105
|
+
Point2i = Point
|
|
106
|
+
Point2f = _typing.Sequence[float]
|
|
107
|
+
"""Required length is 2"""
|
|
108
|
+
Point2d = _typing.Sequence[float]
|
|
109
|
+
"""Required length is 2"""
|
|
110
|
+
Point3i = _typing.Sequence[int]
|
|
111
|
+
"""Required length is 3"""
|
|
112
|
+
Point3f = _typing.Sequence[float]
|
|
113
|
+
"""Required length is 3"""
|
|
114
|
+
Point3d = _typing.Sequence[float]
|
|
115
|
+
"""Required length is 3"""
|
|
116
|
+
Range = _typing.Sequence[int]
|
|
117
|
+
"""Required length is 2"""
|
|
118
|
+
Rect = _typing.Sequence[int]
|
|
119
|
+
"""Required length is 4"""
|
|
120
|
+
Rect2i = _typing.Sequence[int]
|
|
121
|
+
"""Required length is 4"""
|
|
122
|
+
Rect2f = _typing.Sequence[float]
|
|
123
|
+
"""Required length is 4"""
|
|
124
|
+
Rect2d = _typing.Sequence[float]
|
|
125
|
+
"""Required length is 4"""
|
|
126
|
+
Moments = _typing.Dict[str, float]
|
|
127
|
+
RotatedRect = _typing.Tuple[Point2f, Size2f, float]
|
|
128
|
+
"""Any type providing sequence protocol is supported"""
|
|
129
|
+
TermCriteria = _typing.Tuple[TermCriteria_Type, int, float]
|
|
130
|
+
"""Any type providing sequence protocol is supported"""
|
|
131
|
+
Vec2i = _typing.Sequence[int]
|
|
132
|
+
"""Required length is 2"""
|
|
133
|
+
Vec2f = _typing.Sequence[float]
|
|
134
|
+
"""Required length is 2"""
|
|
135
|
+
Vec2d = _typing.Sequence[float]
|
|
136
|
+
"""Required length is 2"""
|
|
137
|
+
Vec3i = _typing.Sequence[int]
|
|
138
|
+
"""Required length is 3"""
|
|
139
|
+
Vec3f = _typing.Sequence[float]
|
|
140
|
+
"""Required length is 3"""
|
|
141
|
+
Vec3d = _typing.Sequence[float]
|
|
142
|
+
"""Required length is 3"""
|
|
143
|
+
Vec4i = _typing.Sequence[int]
|
|
144
|
+
"""Required length is 4"""
|
|
145
|
+
Vec4f = _typing.Sequence[float]
|
|
146
|
+
"""Required length is 4"""
|
|
147
|
+
Vec4d = _typing.Sequence[float]
|
|
148
|
+
"""Required length is 4"""
|
|
149
|
+
Vec6f = _typing.Sequence[float]
|
|
150
|
+
"""Required length is 6"""
|
|
151
|
+
FeatureDetector = cv2.Feature2D
|
|
152
|
+
DescriptorExtractor = cv2.Feature2D
|
|
153
|
+
FeatureExtractor = cv2.Feature2D
|
|
154
|
+
Matx33f = NumPyArrayFloat32
|
|
155
|
+
"""NDArray(shape=(3, 3), dtype=numpy.float32)"""
|
|
156
|
+
Matx33d = NumPyArrayFloat64
|
|
157
|
+
"""NDArray(shape=(3, 3), dtype=numpy.float64)"""
|
|
158
|
+
Matx44f = NumPyArrayFloat32
|
|
159
|
+
"""NDArray(shape=(4, 4), dtype=numpy.float32)"""
|
|
160
|
+
Matx44d = NumPyArrayFloat64
|
|
161
|
+
"""NDArray(shape=(4, 4), dtype=numpy.float64)"""
|
|
162
|
+
LayerId = cv2.dnn.DictValue
|
|
163
|
+
LayerParams = _typing.Dict[str, _typing.Union[int, float, str]]
|
|
164
|
+
IndexParams = _typing.Dict[str, _typing.Union[bool, int, float, str]]
|
|
165
|
+
SearchParams = _typing.Dict[str, _typing.Union[bool, int, float, str]]
|
|
166
|
+
map_string_and_string = _typing.Dict[str, str]
|
|
167
|
+
map_string_and_int = _typing.Dict[str, int]
|
|
168
|
+
map_string_and_vector_size_t = _typing.Dict[str, _typing.Sequence[int]]
|
|
169
|
+
map_string_and_vector_float = _typing.Dict[str, _typing.Sequence[float]]
|
|
170
|
+
map_int_and_double = _typing.Dict[int, float]
|
|
171
|
+
GProtoArg = _typing.Union[Scalar, cv2.GMat, cv2.GOpaqueT, cv2.GArrayT]
|
|
172
|
+
GProtoInputArgs = _typing.Sequence[GProtoArg]
|
|
173
|
+
GProtoOutputArgs = _typing.Sequence[GProtoArg]
|
|
174
|
+
GRunArg = _typing.Union[MatLike, Scalar, cv2.GOpaqueT, cv2.GArrayT, _typing.Sequence[_typing.Any], None]
|
|
175
|
+
GOptRunArg = _typing.Optional[GRunArg]
|
|
176
|
+
GMetaArg = _typing.Union[cv2.GMat, Scalar, cv2.GOpaqueT, cv2.GArrayT]
|
|
177
|
+
Prim = _typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly]
|
|
178
|
+
GTypeInfo = _typing.Union[cv2.GMat, Scalar, cv2.GOpaqueT, cv2.GArrayT]
|
|
179
|
+
ExtractArgsCallback = _typing.Callable[[_typing.Sequence[GTypeInfo]], _typing.Sequence[GRunArg]]
|
|
180
|
+
ExtractMetaCallback = _typing.Callable[[_typing.Sequence[GTypeInfo]], _typing.Sequence[GMetaArg]]
|
cv2/utils/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from collections import namedtuple
|
|
2
|
+
|
|
3
|
+
import cv2
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
NativeMethodPatchedResult = namedtuple("NativeMethodPatchedResult",
|
|
7
|
+
("py", "native"))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def testOverwriteNativeMethod(arg):
|
|
11
|
+
return NativeMethodPatchedResult(
|
|
12
|
+
arg + 1,
|
|
13
|
+
cv2.utils._native.testOverwriteNativeMethod(arg)
|
|
14
|
+
)
|
cv2/utils/__init__.pyi
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
__all__: list[str] = []
|
|
2
|
+
|
|
3
|
+
import cv2
|
|
4
|
+
import cv2.typing
|
|
5
|
+
import typing as _typing
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
from cv2.utils import fs as fs
|
|
9
|
+
from cv2.utils import logging as logging
|
|
10
|
+
from cv2.utils import nested as nested
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Classes
|
|
14
|
+
class ClassWithKeywordProperties:
|
|
15
|
+
lambda_: int
|
|
16
|
+
@property
|
|
17
|
+
def except_(self) -> int: ...
|
|
18
|
+
|
|
19
|
+
# Functions
|
|
20
|
+
def __init__(self, lambda_arg: int = ..., except_arg: int = ...) -> None: ...
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Functions
|
|
25
|
+
@_typing.overload
|
|
26
|
+
def copyMatAndDumpNamedArguments(src: cv2.typing.MatLike, dst: cv2.typing.MatLike | None = ..., lambda_: int = ..., sigma: float = ...) -> tuple[str, cv2.typing.MatLike]: ...
|
|
27
|
+
@_typing.overload
|
|
28
|
+
def copyMatAndDumpNamedArguments(src: cv2.UMat, dst: cv2.UMat | None = ..., lambda_: int = ..., sigma: float = ...) -> tuple[str, cv2.UMat]: ...
|
|
29
|
+
|
|
30
|
+
def dumpBool(argument: bool) -> str: ...
|
|
31
|
+
|
|
32
|
+
def dumpCString(argument: str) -> str: ...
|
|
33
|
+
|
|
34
|
+
def dumpDouble(argument: float) -> str: ...
|
|
35
|
+
|
|
36
|
+
def dumpFloat(argument: float) -> str: ...
|
|
37
|
+
|
|
38
|
+
@_typing.overload
|
|
39
|
+
def dumpInputArray(argument: cv2.typing.MatLike) -> str: ...
|
|
40
|
+
@_typing.overload
|
|
41
|
+
def dumpInputArray(argument: cv2.UMat) -> str: ...
|
|
42
|
+
|
|
43
|
+
@_typing.overload
|
|
44
|
+
def dumpInputArrayOfArrays(argument: _typing.Sequence[cv2.typing.MatLike]) -> str: ...
|
|
45
|
+
@_typing.overload
|
|
46
|
+
def dumpInputArrayOfArrays(argument: _typing.Sequence[cv2.UMat]) -> str: ...
|
|
47
|
+
|
|
48
|
+
@_typing.overload
|
|
49
|
+
def dumpInputOutputArray(argument: cv2.typing.MatLike) -> tuple[str, cv2.typing.MatLike]: ...
|
|
50
|
+
@_typing.overload
|
|
51
|
+
def dumpInputOutputArray(argument: cv2.UMat) -> tuple[str, cv2.UMat]: ...
|
|
52
|
+
|
|
53
|
+
@_typing.overload
|
|
54
|
+
def dumpInputOutputArrayOfArrays(argument: _typing.Sequence[cv2.typing.MatLike]) -> tuple[str, _typing.Sequence[cv2.typing.MatLike]]: ...
|
|
55
|
+
@_typing.overload
|
|
56
|
+
def dumpInputOutputArrayOfArrays(argument: _typing.Sequence[cv2.UMat]) -> tuple[str, _typing.Sequence[cv2.UMat]]: ...
|
|
57
|
+
|
|
58
|
+
def dumpInt(argument: int) -> str: ...
|
|
59
|
+
|
|
60
|
+
def dumpInt64(argument: int) -> str: ...
|
|
61
|
+
|
|
62
|
+
def dumpRange(argument: cv2.typing.Range) -> str: ...
|
|
63
|
+
|
|
64
|
+
def dumpRect(argument: cv2.typing.Rect) -> str: ...
|
|
65
|
+
|
|
66
|
+
def dumpRotatedRect(argument: cv2.typing.RotatedRect) -> str: ...
|
|
67
|
+
|
|
68
|
+
def dumpSizeT(argument: int) -> str: ...
|
|
69
|
+
|
|
70
|
+
def dumpString(argument: str) -> str: ...
|
|
71
|
+
|
|
72
|
+
def dumpTermCriteria(argument: cv2.typing.TermCriteria) -> str: ...
|
|
73
|
+
|
|
74
|
+
def dumpVec2i(value: cv2.typing.Vec2i = ...) -> str: ...
|
|
75
|
+
|
|
76
|
+
def dumpVectorOfDouble(vec: _typing.Sequence[float]) -> str: ...
|
|
77
|
+
|
|
78
|
+
def dumpVectorOfInt(vec: _typing.Sequence[int]) -> str: ...
|
|
79
|
+
|
|
80
|
+
def dumpVectorOfRect(vec: _typing.Sequence[cv2.typing.Rect]) -> str: ...
|
|
81
|
+
|
|
82
|
+
def generateVectorOfInt(len: int) -> _typing.Sequence[int]: ...
|
|
83
|
+
|
|
84
|
+
def generateVectorOfMat(len: int, rows: int, cols: int, dtype: int, vec: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
|
|
85
|
+
|
|
86
|
+
def generateVectorOfRect(len: int) -> _typing.Sequence[cv2.typing.Rect]: ...
|
|
87
|
+
|
|
88
|
+
@_typing.overload
|
|
89
|
+
def testAsyncArray(argument: cv2.typing.MatLike) -> cv2.AsyncArray: ...
|
|
90
|
+
@_typing.overload
|
|
91
|
+
def testAsyncArray(argument: cv2.UMat) -> cv2.AsyncArray: ...
|
|
92
|
+
|
|
93
|
+
def testAsyncException() -> cv2.AsyncArray: ...
|
|
94
|
+
|
|
95
|
+
@_typing.overload
|
|
96
|
+
def testOverloadResolution(value: int, point: cv2.typing.Point = ...) -> str: ...
|
|
97
|
+
@_typing.overload
|
|
98
|
+
def testOverloadResolution(rect: cv2.typing.Rect) -> str: ...
|
|
99
|
+
|
|
100
|
+
def testOverwriteNativeMethod(argument: int) -> int: ...
|
|
101
|
+
|
|
102
|
+
def testRaiseGeneralException() -> None: ...
|
|
103
|
+
|
|
104
|
+
def testReservedKeywordConversion(positional_argument: int, lambda_: int = ..., from_: int = ...) -> str: ...
|
|
105
|
+
|
|
106
|
+
def testRotatedRect(x: float, y: float, w: float, h: float, angle: float) -> cv2.typing.RotatedRect: ...
|
|
107
|
+
|
|
108
|
+
def testRotatedRectVector(x: float, y: float, w: float, h: float, angle: float) -> _typing.Sequence[cv2.typing.RotatedRect]: ...
|
|
109
|
+
|
|
110
|
+
|