This commit is contained in:
rattatwinko
2025-05-25 20:42:58 +02:00
commit 8e9b2568b2
4902 changed files with 1152638 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
__all__: list[str] = []
# Enumerations
StsOk: int
STS_OK: int
StsBackTrace: int
STS_BACK_TRACE: int
StsError: int
STS_ERROR: int
StsInternal: int
STS_INTERNAL: int
StsNoMem: int
STS_NO_MEM: int
StsBadArg: int
STS_BAD_ARG: int
StsBadFunc: int
STS_BAD_FUNC: int
StsNoConv: int
STS_NO_CONV: int
StsAutoTrace: int
STS_AUTO_TRACE: int
HeaderIsNull: int
HEADER_IS_NULL: int
BadImageSize: int
BAD_IMAGE_SIZE: int
BadOffset: int
BAD_OFFSET: int
BadDataPtr: int
BAD_DATA_PTR: int
BadStep: int
BAD_STEP: int
BadModelOrChSeq: int
BAD_MODEL_OR_CH_SEQ: int
BadNumChannels: int
BAD_NUM_CHANNELS: int
BadNumChannel1U: int
BAD_NUM_CHANNEL1U: int
BadDepth: int
BAD_DEPTH: int
BadAlphaChannel: int
BAD_ALPHA_CHANNEL: int
BadOrder: int
BAD_ORDER: int
BadOrigin: int
BAD_ORIGIN: int
BadAlign: int
BAD_ALIGN: int
BadCallBack: int
BAD_CALL_BACK: int
BadTileSize: int
BAD_TILE_SIZE: int
BadCOI: int
BAD_COI: int
BadROISize: int
BAD_ROISIZE: int
MaskIsTiled: int
MASK_IS_TILED: int
StsNullPtr: int
STS_NULL_PTR: int
StsVecLengthErr: int
STS_VEC_LENGTH_ERR: int
StsFilterStructContentErr: int
STS_FILTER_STRUCT_CONTENT_ERR: int
StsKernelStructContentErr: int
STS_KERNEL_STRUCT_CONTENT_ERR: int
StsFilterOffsetErr: int
STS_FILTER_OFFSET_ERR: int
StsBadSize: int
STS_BAD_SIZE: int
StsDivByZero: int
STS_DIV_BY_ZERO: int
StsInplaceNotSupported: int
STS_INPLACE_NOT_SUPPORTED: int
StsObjectNotFound: int
STS_OBJECT_NOT_FOUND: int
StsUnmatchedFormats: int
STS_UNMATCHED_FORMATS: int
StsBadFlag: int
STS_BAD_FLAG: int
StsBadPoint: int
STS_BAD_POINT: int
StsBadMask: int
STS_BAD_MASK: int
StsUnmatchedSizes: int
STS_UNMATCHED_SIZES: int
StsUnsupportedFormat: int
STS_UNSUPPORTED_FORMAT: int
StsOutOfRange: int
STS_OUT_OF_RANGE: int
StsParseError: int
STS_PARSE_ERROR: int
StsNotImplemented: int
STS_NOT_IMPLEMENTED: int
StsBadMemBlock: int
STS_BAD_MEM_BLOCK: int
StsAssert: int
STS_ASSERT: int
GpuNotSupported: int
GPU_NOT_SUPPORTED: int
GpuApiCallError: int
GPU_API_CALL_ERROR: int
OpenGlNotSupported: int
OPEN_GL_NOT_SUPPORTED: int
OpenGlApiCallError: int
OPEN_GL_API_CALL_ERROR: int
OpenCLApiCallError: int
OPEN_CLAPI_CALL_ERROR: int
OpenCLDoubleNotSupported: int
OPEN_CLDOUBLE_NOT_SUPPORTED: int
OpenCLInitError: int
OPEN_CLINIT_ERROR: int
OpenCLNoAMDBlasFft: int
OPEN_CLNO_AMDBLAS_FFT: int
Code = int
"""One of [StsOk, STS_OK, StsBackTrace, STS_BACK_TRACE, StsError, STS_ERROR, StsInternal, STS_INTERNAL, StsNoMem, STS_NO_MEM, StsBadArg, STS_BAD_ARG, StsBadFunc, STS_BAD_FUNC, StsNoConv, STS_NO_CONV, StsAutoTrace, STS_AUTO_TRACE, HeaderIsNull, HEADER_IS_NULL, BadImageSize, BAD_IMAGE_SIZE, BadOffset, BAD_OFFSET, BadDataPtr, BAD_DATA_PTR, BadStep, BAD_STEP, BadModelOrChSeq, BAD_MODEL_OR_CH_SEQ, BadNumChannels, BAD_NUM_CHANNELS, BadNumChannel1U, BAD_NUM_CHANNEL1U, BadDepth, BAD_DEPTH, BadAlphaChannel, BAD_ALPHA_CHANNEL, BadOrder, BAD_ORDER, BadOrigin, BAD_ORIGIN, BadAlign, BAD_ALIGN, BadCallBack, BAD_CALL_BACK, BadTileSize, BAD_TILE_SIZE, BadCOI, BAD_COI, BadROISize, BAD_ROISIZE, MaskIsTiled, MASK_IS_TILED, StsNullPtr, STS_NULL_PTR, StsVecLengthErr, STS_VEC_LENGTH_ERR, StsFilterStructContentErr, STS_FILTER_STRUCT_CONTENT_ERR, StsKernelStructContentErr, STS_KERNEL_STRUCT_CONTENT_ERR, StsFilterOffsetErr, STS_FILTER_OFFSET_ERR, StsBadSize, STS_BAD_SIZE, StsDivByZero, STS_DIV_BY_ZERO, StsInplaceNotSupported, STS_INPLACE_NOT_SUPPORTED, StsObjectNotFound, STS_OBJECT_NOT_FOUND, StsUnmatchedFormats, STS_UNMATCHED_FORMATS, StsBadFlag, STS_BAD_FLAG, StsBadPoint, STS_BAD_POINT, StsBadMask, STS_BAD_MASK, StsUnmatchedSizes, STS_UNMATCHED_SIZES, StsUnsupportedFormat, STS_UNSUPPORTED_FORMAT, StsOutOfRange, STS_OUT_OF_RANGE, StsParseError, STS_PARSE_ERROR, StsNotImplemented, STS_NOT_IMPLEMENTED, StsBadMemBlock, STS_BAD_MEM_BLOCK, StsAssert, STS_ASSERT, GpuNotSupported, GPU_NOT_SUPPORTED, GpuApiCallError, GPU_API_CALL_ERROR, OpenGlNotSupported, OPEN_GL_NOT_SUPPORTED, OpenGlApiCallError, OPEN_GL_API_CALL_ERROR, OpenCLApiCallError, OPEN_CLAPI_CALL_ERROR, OpenCLDoubleNotSupported, OPEN_CLDOUBLE_NOT_SUPPORTED, OpenCLInitError, OPEN_CLINIT_ERROR, OpenCLNoAMDBlasFft, OPEN_CLNO_AMDBLAS_FFT]"""

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Olli-Pekka Heinisuo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,181 @@
'''
OpenCV Python binary extension loader
'''
import os
import importlib
import sys
__all__ = []
try:
import numpy
import numpy.core.multiarray
except ImportError:
print('OpenCV bindings requires "numpy" package.')
print('Install it via command:')
print(' pip install numpy')
raise
# TODO
# is_x64 = sys.maxsize > 2**32
def __load_extra_py_code_for_module(base, name, enable_debug_print=False):
module_name = "{}.{}".format(__name__, name)
export_module_name = "{}.{}".format(base, name)
native_module = sys.modules.pop(module_name, None)
try:
py_module = importlib.import_module(module_name)
except ImportError as err:
if enable_debug_print:
print("Can't load Python code for module:", module_name,
". Reason:", err)
# Extension doesn't contain extra py code
return False
if base in sys.modules and not hasattr(sys.modules[base], name):
setattr(sys.modules[base], name, py_module)
sys.modules[export_module_name] = py_module
# If it is C extension module it is already loaded by cv2 package
if native_module:
setattr(py_module, "_native", native_module)
for k, v in filter(lambda kv: not hasattr(py_module, kv[0]),
native_module.__dict__.items()):
if enable_debug_print: print(' symbol({}): {} = {}'.format(name, k, v))
setattr(py_module, k, v)
return True
def __collect_extra_submodules(enable_debug_print=False):
def modules_filter(module):
return all((
# module is not internal
not module.startswith("_"),
not module.startswith("python-"),
# it is not a file
os.path.isdir(os.path.join(_extra_submodules_init_path, module))
))
if sys.version_info[0] < 3:
if enable_debug_print:
print("Extra submodules is loaded only for Python 3")
return []
__INIT_FILE_PATH = os.path.abspath(__file__)
_extra_submodules_init_path = os.path.dirname(__INIT_FILE_PATH)
return filter(modules_filter, os.listdir(_extra_submodules_init_path))
def bootstrap():
import sys
import copy
save_sys_path = copy.copy(sys.path)
if hasattr(sys, 'OpenCV_LOADER'):
print(sys.path)
raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
sys.OpenCV_LOADER = True
DEBUG = False
if hasattr(sys, 'OpenCV_LOADER_DEBUG'):
DEBUG = True
import platform
if DEBUG: print('OpenCV loader: os.name="{}" platform.system()="{}"'.format(os.name, str(platform.system())))
LOADER_DIR = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
PYTHON_EXTENSIONS_PATHS = []
BINARIES_PATHS = []
g_vars = globals()
l_vars = locals().copy()
if sys.version_info[:2] < (3, 0):
from . load_config_py2 import exec_file_wrapper
else:
from . load_config_py3 import exec_file_wrapper
def load_first_config(fnames, required=True):
for fname in fnames:
fpath = os.path.join(LOADER_DIR, fname)
if not os.path.exists(fpath):
if DEBUG: print('OpenCV loader: config not found, skip: {}'.format(fpath))
continue
if DEBUG: print('OpenCV loader: loading config: {}'.format(fpath))
exec_file_wrapper(fpath, g_vars, l_vars)
return True
if required:
raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
load_first_config(['config.py'], True)
load_first_config([
'config-{}.{}.py'.format(sys.version_info[0], sys.version_info[1]),
'config-{}.py'.format(sys.version_info[0])
], True)
if DEBUG: print('OpenCV loader: PYTHON_EXTENSIONS_PATHS={}'.format(str(l_vars['PYTHON_EXTENSIONS_PATHS'])))
if DEBUG: print('OpenCV loader: BINARIES_PATHS={}'.format(str(l_vars['BINARIES_PATHS'])))
applySysPathWorkaround = False
if hasattr(sys, 'OpenCV_REPLACE_SYS_PATH_0'):
applySysPathWorkaround = True
else:
try:
BASE_DIR = os.path.dirname(LOADER_DIR)
if sys.path[0] == BASE_DIR or os.path.realpath(sys.path[0]) == BASE_DIR:
applySysPathWorkaround = True
except:
if DEBUG: print('OpenCV loader: exception during checking workaround for sys.path[0]')
pass # applySysPathWorkaround is False
for p in reversed(l_vars['PYTHON_EXTENSIONS_PATHS']):
sys.path.insert(1 if not applySysPathWorkaround else 0, p)
if os.name == 'nt':
if sys.version_info[:2] >= (3, 8): # https://github.com/python/cpython/pull/12302
for p in l_vars['BINARIES_PATHS']:
try:
os.add_dll_directory(p)
except Exception as e:
if DEBUG: print('Failed os.add_dll_directory(): '+ str(e))
pass
os.environ['PATH'] = ';'.join(l_vars['BINARIES_PATHS']) + ';' + os.environ.get('PATH', '')
if DEBUG: print('OpenCV loader: PATH={}'.format(str(os.environ['PATH'])))
else:
# amending of LD_LIBRARY_PATH works for sub-processes only
os.environ['LD_LIBRARY_PATH'] = ':'.join(l_vars['BINARIES_PATHS']) + ':' + os.environ.get('LD_LIBRARY_PATH', '')
if DEBUG: print("Relink everything from native cv2 module to cv2 package")
py_module = sys.modules.pop("cv2")
native_module = importlib.import_module("cv2")
sys.modules["cv2"] = py_module
setattr(py_module, "_native", native_module)
for item_name, item in filter(lambda kv: kv[0] not in ("__file__", "__loader__", "__spec__",
"__name__", "__package__"),
native_module.__dict__.items()):
if item_name not in g_vars:
g_vars[item_name] = item
sys.path = save_sys_path # multiprocessing should start from bootstrap code (https://github.com/opencv/opencv/issues/18502)
try:
del sys.OpenCV_LOADER
except Exception as e:
if DEBUG:
print("Exception during delete OpenCV_LOADER:", e)
if DEBUG: print('OpenCV loader: binary extension... OK')
for submodule in __collect_extra_submodules(DEBUG):
if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
if DEBUG: print("Extra Python code for", submodule, "is loaded")
if DEBUG: print('OpenCV loader: DONE')
bootstrap()

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,392 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
CORNER_REFINE_NONE: int
CORNER_REFINE_SUBPIX: int
CORNER_REFINE_CONTOUR: int
CORNER_REFINE_APRILTAG: int
CornerRefineMethod = int
"""One of [CORNER_REFINE_NONE, CORNER_REFINE_SUBPIX, CORNER_REFINE_CONTOUR, CORNER_REFINE_APRILTAG]"""
DICT_4X4_50: int
DICT_4X4_100: int
DICT_4X4_250: int
DICT_4X4_1000: int
DICT_5X5_50: int
DICT_5X5_100: int
DICT_5X5_250: int
DICT_5X5_1000: int
DICT_6X6_50: int
DICT_6X6_100: int
DICT_6X6_250: int
DICT_6X6_1000: int
DICT_7X7_50: int
DICT_7X7_100: int
DICT_7X7_250: int
DICT_7X7_1000: int
DICT_ARUCO_ORIGINAL: int
DICT_APRILTAG_16h5: int
DICT_APRILTAG_16H5: int
DICT_APRILTAG_25h9: int
DICT_APRILTAG_25H9: int
DICT_APRILTAG_36h10: int
DICT_APRILTAG_36H10: int
DICT_APRILTAG_36h11: int
DICT_APRILTAG_36H11: int
DICT_ARUCO_MIP_36h12: int
DICT_ARUCO_MIP_36H12: int
PredefinedDictionaryType = int
"""One of [DICT_4X4_50, DICT_4X4_100, DICT_4X4_250, DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, DICT_APRILTAG_16h5, DICT_APRILTAG_16H5, DICT_APRILTAG_25h9, DICT_APRILTAG_25H9, DICT_APRILTAG_36h10, DICT_APRILTAG_36H10, DICT_APRILTAG_36h11, DICT_APRILTAG_36H11, DICT_ARUCO_MIP_36h12, DICT_ARUCO_MIP_36H12]"""
ARUCO_CCW_CENTER: int
ARUCO_CW_TOP_LEFT_CORNER: int
PatternPositionType = int
"""One of [ARUCO_CCW_CENTER, ARUCO_CW_TOP_LEFT_CORNER]"""
# Classes
class Board:
# Functions
@_typing.overload
def __init__(self, objPoints: _typing.Sequence[cv2.typing.MatLike], dictionary: Dictionary, ids: cv2.typing.MatLike) -> None: ...
@_typing.overload
def __init__(self, objPoints: _typing.Sequence[cv2.UMat], dictionary: Dictionary, ids: cv2.UMat) -> None: ...
def getDictionary(self) -> Dictionary: ...
def getObjPoints(self) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point3f]]: ...
def getIds(self) -> _typing.Sequence[int]: ...
def getRightBottomCorner(self) -> cv2.typing.Point3f: ...
@_typing.overload
def matchImagePoints(self, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, objPoints: cv2.typing.MatLike | None = ..., imgPoints: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def matchImagePoints(self, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, objPoints: cv2.UMat | None = ..., imgPoints: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def generateImage(self, outSize: cv2.typing.Size, img: cv2.typing.MatLike | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def generateImage(self, outSize: cv2.typing.Size, img: cv2.UMat | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.UMat: ...
class GridBoard(Board):
# Functions
@_typing.overload
def __init__(self, size: cv2.typing.Size, markerLength: float, markerSeparation: float, dictionary: Dictionary, ids: cv2.typing.MatLike | None = ...) -> None: ...
@_typing.overload
def __init__(self, size: cv2.typing.Size, markerLength: float, markerSeparation: float, dictionary: Dictionary, ids: cv2.UMat | None = ...) -> None: ...
def getGridSize(self) -> cv2.typing.Size: ...
def getMarkerLength(self) -> float: ...
def getMarkerSeparation(self) -> float: ...
class CharucoBoard(Board):
# Functions
@_typing.overload
def __init__(self, size: cv2.typing.Size, squareLength: float, markerLength: float, dictionary: Dictionary, ids: cv2.typing.MatLike | None = ...) -> None: ...
@_typing.overload
def __init__(self, size: cv2.typing.Size, squareLength: float, markerLength: float, dictionary: Dictionary, ids: cv2.UMat | None = ...) -> None: ...
def setLegacyPattern(self, legacyPattern: bool) -> None: ...
def getLegacyPattern(self) -> bool: ...
def getChessboardSize(self) -> cv2.typing.Size: ...
def getSquareLength(self) -> float: ...
def getMarkerLength(self) -> float: ...
def getChessboardCorners(self) -> _typing.Sequence[cv2.typing.Point3f]: ...
@_typing.overload
def checkCharucoCornersCollinear(self, charucoIds: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def checkCharucoCornersCollinear(self, charucoIds: cv2.UMat) -> bool: ...
class DetectorParameters:
adaptiveThreshWinSizeMin: int
adaptiveThreshWinSizeMax: int
adaptiveThreshWinSizeStep: int
adaptiveThreshConstant: float
minMarkerPerimeterRate: float
maxMarkerPerimeterRate: float
polygonalApproxAccuracyRate: float
minCornerDistanceRate: float
minDistanceToBorder: int
minMarkerDistanceRate: float
minGroupDistance: float
cornerRefinementMethod: int
cornerRefinementWinSize: int
relativeCornerRefinmentWinSize: float
cornerRefinementMaxIterations: int
cornerRefinementMinAccuracy: float
markerBorderBits: int
perspectiveRemovePixelPerCell: int
perspectiveRemoveIgnoredMarginPerCell: float
maxErroneousBitsInBorderRate: float
minOtsuStdDev: float
errorCorrectionRate: float
aprilTagQuadDecimate: float
aprilTagQuadSigma: float
aprilTagMinClusterPixels: int
aprilTagMaxNmaxima: int
aprilTagCriticalRad: float
aprilTagMaxLineFitMse: float
aprilTagMinWhiteBlackDiff: int
aprilTagDeglitch: int
detectInvertedMarker: bool
useAruco3Detection: bool
minSideLengthCanonicalImg: int
minMarkerLengthRatioOriginalImg: float
# Functions
def __init__(self) -> None: ...
def readDetectorParameters(self, fn: cv2.FileNode) -> bool: ...
def writeDetectorParameters(self, fs: cv2.FileStorage, name: str = ...) -> bool: ...
class RefineParameters:
minRepDistance: float
errorCorrectionRate: float
checkAllOrders: bool
# Functions
def __init__(self, minRepDistance: float = ..., errorCorrectionRate: float = ..., checkAllOrders: bool = ...) -> None: ...
def readRefineParameters(self, fn: cv2.FileNode) -> bool: ...
def writeRefineParameters(self, fs: cv2.FileStorage, name: str = ...) -> bool: ...
class ArucoDetector(cv2.Algorithm):
# Functions
def __init__(self, dictionary: Dictionary = ..., detectorParams: DetectorParameters = ..., refineParams: RefineParameters = ...) -> None: ...
@_typing.overload
def detectMarkers(self, image: cv2.typing.MatLike, corners: _typing.Sequence[cv2.typing.MatLike] | None = ..., ids: cv2.typing.MatLike | None = ..., rejectedImgPoints: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def detectMarkers(self, image: cv2.UMat, corners: _typing.Sequence[cv2.UMat] | None = ..., ids: cv2.UMat | None = ..., rejectedImgPoints: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def refineDetectedMarkers(self, image: cv2.typing.MatLike, board: Board, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, rejectedCorners: _typing.Sequence[cv2.typing.MatLike], cameraMatrix: cv2.typing.MatLike | None = ..., distCoeffs: cv2.typing.MatLike | None = ..., recoveredIdxs: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ...
@_typing.overload
def refineDetectedMarkers(self, image: cv2.UMat, board: Board, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, rejectedCorners: _typing.Sequence[cv2.UMat], cameraMatrix: cv2.UMat | None = ..., distCoeffs: cv2.UMat | None = ..., recoveredIdxs: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ...
def getDictionary(self) -> Dictionary: ...
def setDictionary(self, dictionary: Dictionary) -> None: ...
def getDetectorParameters(self) -> DetectorParameters: ...
def setDetectorParameters(self, detectorParameters: DetectorParameters) -> None: ...
def getRefineParameters(self) -> RefineParameters: ...
def setRefineParameters(self, refineParameters: RefineParameters) -> None: ...
def write(self, fs: cv2.FileStorage, name: str) -> None: ...
def read(self, fn: cv2.FileNode) -> None: ...
class Dictionary:
bytesList: cv2.typing.MatLike
markerSize: int
maxCorrectionBits: int
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, bytesList: cv2.typing.MatLike, _markerSize: int, maxcorr: int = ...) -> None: ...
def readDictionary(self, fn: cv2.FileNode) -> bool: ...
def writeDictionary(self, fs: cv2.FileStorage, name: str = ...) -> None: ...
def identify(self, onlyBits: cv2.typing.MatLike, maxCorrectionRate: float) -> tuple[bool, int, int]: ...
@_typing.overload
def getDistanceToId(self, bits: cv2.typing.MatLike, id: int, allRotations: bool = ...) -> int: ...
@_typing.overload
def getDistanceToId(self, bits: cv2.UMat, id: int, allRotations: bool = ...) -> int: ...
@_typing.overload
def generateImageMarker(self, id: int, sidePixels: int, _img: cv2.typing.MatLike | None = ..., borderBits: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def generateImageMarker(self, id: int, sidePixels: int, _img: cv2.UMat | None = ..., borderBits: int = ...) -> cv2.UMat: ...
@staticmethod
def getByteListFromBits(bits: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@staticmethod
def getBitsFromByteList(byteList: cv2.typing.MatLike, markerSize: int) -> cv2.typing.MatLike: ...
class CharucoParameters:
cameraMatrix: cv2.typing.MatLike
distCoeffs: cv2.typing.MatLike
minMarkers: int
tryRefineMarkers: bool
# Functions
def __init__(self) -> None: ...
class CharucoDetector(cv2.Algorithm):
# Functions
def __init__(self, board: CharucoBoard, charucoParams: CharucoParameters = ..., detectorParams: DetectorParameters = ..., refineParams: RefineParameters = ...) -> None: ...
def getBoard(self) -> CharucoBoard: ...
def setBoard(self, board: CharucoBoard) -> None: ...
def getCharucoParameters(self) -> CharucoParameters: ...
def setCharucoParameters(self, charucoParameters: CharucoParameters) -> None: ...
def getDetectorParameters(self) -> DetectorParameters: ...
def setDetectorParameters(self, detectorParameters: DetectorParameters) -> None: ...
def getRefineParameters(self) -> RefineParameters: ...
def setRefineParameters(self, refineParameters: RefineParameters) -> None: ...
@_typing.overload
def detectBoard(self, image: cv2.typing.MatLike, charucoCorners: cv2.typing.MatLike | None = ..., charucoIds: cv2.typing.MatLike | None = ..., markerCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., markerIds: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ...
@_typing.overload
def detectBoard(self, image: cv2.UMat, charucoCorners: cv2.UMat | None = ..., charucoIds: cv2.UMat | None = ..., markerCorners: _typing.Sequence[cv2.UMat] | None = ..., markerIds: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ...
@_typing.overload
def detectDiamonds(self, image: cv2.typing.MatLike, diamondCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., diamondIds: cv2.typing.MatLike | None = ..., markerCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., markerIds: cv2.typing.MatLike | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ...
@_typing.overload
def detectDiamonds(self, image: cv2.UMat, diamondCorners: _typing.Sequence[cv2.UMat] | None = ..., diamondIds: cv2.UMat | None = ..., markerCorners: _typing.Sequence[cv2.UMat] | None = ..., markerIds: cv2.UMat | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ...
class EstimateParameters:
pattern: PatternPositionType
useExtrinsicGuess: bool
solvePnPMethod: int
# Functions
def __init__(self) -> None: ...
# Functions
@_typing.overload
def calibrateCameraAruco(corners: _typing.Sequence[cv2.typing.MatLike], ids: cv2.typing.MatLike, counter: cv2.typing.MatLike, board: Board, imageSize: cv2.typing.Size, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def calibrateCameraAruco(corners: _typing.Sequence[cv2.UMat], ids: cv2.UMat, counter: cv2.UMat, board: Board, imageSize: cv2.typing.Size, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def calibrateCameraArucoExtended(corners: _typing.Sequence[cv2.typing.MatLike], ids: cv2.typing.MatLike, counter: cv2.typing.MatLike, board: Board, imageSize: cv2.typing.Size, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., stdDeviationsIntrinsics: cv2.typing.MatLike | None = ..., stdDeviationsExtrinsics: cv2.typing.MatLike | None = ..., perViewErrors: cv2.typing.MatLike | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def calibrateCameraArucoExtended(corners: _typing.Sequence[cv2.UMat], ids: cv2.UMat, counter: cv2.UMat, board: Board, imageSize: cv2.typing.Size, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., stdDeviationsIntrinsics: cv2.UMat | None = ..., stdDeviationsExtrinsics: cv2.UMat | None = ..., perViewErrors: cv2.UMat | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat], cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def calibrateCameraCharuco(charucoCorners: _typing.Sequence[cv2.typing.MatLike], charucoIds: _typing.Sequence[cv2.typing.MatLike], board: CharucoBoard, imageSize: cv2.typing.Size, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def calibrateCameraCharuco(charucoCorners: _typing.Sequence[cv2.UMat], charucoIds: _typing.Sequence[cv2.UMat], board: CharucoBoard, imageSize: cv2.typing.Size, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def calibrateCameraCharucoExtended(charucoCorners: _typing.Sequence[cv2.typing.MatLike], charucoIds: _typing.Sequence[cv2.typing.MatLike], board: CharucoBoard, imageSize: cv2.typing.Size, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., stdDeviationsIntrinsics: cv2.typing.MatLike | None = ..., stdDeviationsExtrinsics: cv2.typing.MatLike | None = ..., perViewErrors: cv2.typing.MatLike | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def calibrateCameraCharucoExtended(charucoCorners: _typing.Sequence[cv2.UMat], charucoIds: _typing.Sequence[cv2.UMat], board: CharucoBoard, imageSize: cv2.typing.Size, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., stdDeviationsIntrinsics: cv2.UMat | None = ..., stdDeviationsExtrinsics: cv2.UMat | None = ..., perViewErrors: cv2.UMat | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat], cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def detectCharucoDiamond(image: cv2.typing.MatLike, markerCorners: _typing.Sequence[cv2.typing.MatLike], markerIds: cv2.typing.MatLike, squareMarkerLengthRate: float, diamondCorners: _typing.Sequence[cv2.typing.MatLike] | None = ..., diamondIds: cv2.typing.MatLike | None = ..., cameraMatrix: cv2.typing.MatLike | None = ..., distCoeffs: cv2.typing.MatLike | None = ..., dictionary: Dictionary = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ...
@_typing.overload
def detectCharucoDiamond(image: cv2.UMat, markerCorners: _typing.Sequence[cv2.UMat], markerIds: cv2.UMat, squareMarkerLengthRate: float, diamondCorners: _typing.Sequence[cv2.UMat] | None = ..., diamondIds: cv2.UMat | None = ..., cameraMatrix: cv2.UMat | None = ..., distCoeffs: cv2.UMat | None = ..., dictionary: Dictionary = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat]: ...
@_typing.overload
def detectMarkers(image: cv2.typing.MatLike, dictionary: Dictionary, corners: _typing.Sequence[cv2.typing.MatLike] | None = ..., ids: cv2.typing.MatLike | None = ..., parameters: DetectorParameters = ..., rejectedImgPoints: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def detectMarkers(image: cv2.UMat, dictionary: Dictionary, corners: _typing.Sequence[cv2.UMat] | None = ..., ids: cv2.UMat | None = ..., parameters: DetectorParameters = ..., rejectedImgPoints: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def drawCharucoDiamond(dictionary: Dictionary, ids: cv2.typing.Vec4i, squareLength: int, markerLength: int, img: cv2.typing.MatLike | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawCharucoDiamond(dictionary: Dictionary, ids: cv2.typing.Vec4i, squareLength: int, markerLength: int, img: cv2.UMat | None = ..., marginSize: int = ..., borderBits: int = ...) -> cv2.UMat: ...
@_typing.overload
def drawDetectedCornersCharuco(image: cv2.typing.MatLike, charucoCorners: cv2.typing.MatLike, charucoIds: cv2.typing.MatLike | None = ..., cornerColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawDetectedCornersCharuco(image: cv2.UMat, charucoCorners: cv2.UMat, charucoIds: cv2.UMat | None = ..., cornerColor: cv2.typing.Scalar = ...) -> cv2.UMat: ...
@_typing.overload
def drawDetectedDiamonds(image: cv2.typing.MatLike, diamondCorners: _typing.Sequence[cv2.typing.MatLike], diamondIds: cv2.typing.MatLike | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawDetectedDiamonds(image: cv2.UMat, diamondCorners: _typing.Sequence[cv2.UMat], diamondIds: cv2.UMat | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.UMat: ...
@_typing.overload
def drawDetectedMarkers(image: cv2.typing.MatLike, corners: _typing.Sequence[cv2.typing.MatLike], ids: cv2.typing.MatLike | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawDetectedMarkers(image: cv2.UMat, corners: _typing.Sequence[cv2.UMat], ids: cv2.UMat | None = ..., borderColor: cv2.typing.Scalar = ...) -> cv2.UMat: ...
@_typing.overload
def drawPlanarBoard(board: Board, outSize: cv2.typing.Size, marginSize: int, borderBits: int, img: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawPlanarBoard(board: Board, outSize: cv2.typing.Size, marginSize: int, borderBits: int, img: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def estimatePoseBoard(corners: _typing.Sequence[cv2.typing.MatLike], ids: cv2.typing.MatLike, board: Board, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvec: cv2.typing.MatLike, tvec: cv2.typing.MatLike, useExtrinsicGuess: bool = ...) -> tuple[int, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def estimatePoseBoard(corners: _typing.Sequence[cv2.UMat], ids: cv2.UMat, board: Board, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvec: cv2.UMat, tvec: cv2.UMat, useExtrinsicGuess: bool = ...) -> tuple[int, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def estimatePoseCharucoBoard(charucoCorners: cv2.typing.MatLike, charucoIds: cv2.typing.MatLike, board: CharucoBoard, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvec: cv2.typing.MatLike, tvec: cv2.typing.MatLike, useExtrinsicGuess: bool = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def estimatePoseCharucoBoard(charucoCorners: cv2.UMat, charucoIds: cv2.UMat, board: CharucoBoard, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvec: cv2.UMat, tvec: cv2.UMat, useExtrinsicGuess: bool = ...) -> tuple[bool, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def estimatePoseSingleMarkers(corners: _typing.Sequence[cv2.typing.MatLike], markerLength: float, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvecs: cv2.typing.MatLike | None = ..., tvecs: cv2.typing.MatLike | None = ..., objPoints: cv2.typing.MatLike | None = ..., estimateParameters: EstimateParameters = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def estimatePoseSingleMarkers(corners: _typing.Sequence[cv2.UMat], markerLength: float, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvecs: cv2.UMat | None = ..., tvecs: cv2.UMat | None = ..., objPoints: cv2.UMat | None = ..., estimateParameters: EstimateParameters = ...) -> tuple[cv2.UMat, cv2.UMat, cv2.UMat]: ...
def extendDictionary(nMarkers: int, markerSize: int, baseDictionary: Dictionary = ..., randomSeed: int = ...) -> Dictionary: ...
@_typing.overload
def generateImageMarker(dictionary: Dictionary, id: int, sidePixels: int, img: cv2.typing.MatLike | None = ..., borderBits: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def generateImageMarker(dictionary: Dictionary, id: int, sidePixels: int, img: cv2.UMat | None = ..., borderBits: int = ...) -> cv2.UMat: ...
@_typing.overload
def getBoardObjectAndImagePoints(board: Board, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, objPoints: cv2.typing.MatLike | None = ..., imgPoints: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getBoardObjectAndImagePoints(board: Board, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, objPoints: cv2.UMat | None = ..., imgPoints: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
def getPredefinedDictionary(dict: int) -> Dictionary: ...
@_typing.overload
def interpolateCornersCharuco(markerCorners: _typing.Sequence[cv2.typing.MatLike], markerIds: cv2.typing.MatLike, image: cv2.typing.MatLike, board: CharucoBoard, charucoCorners: cv2.typing.MatLike | None = ..., charucoIds: cv2.typing.MatLike | None = ..., cameraMatrix: cv2.typing.MatLike | None = ..., distCoeffs: cv2.typing.MatLike | None = ..., minMarkers: int = ...) -> tuple[int, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def interpolateCornersCharuco(markerCorners: _typing.Sequence[cv2.UMat], markerIds: cv2.UMat, image: cv2.UMat, board: CharucoBoard, charucoCorners: cv2.UMat | None = ..., charucoIds: cv2.UMat | None = ..., cameraMatrix: cv2.UMat | None = ..., distCoeffs: cv2.UMat | None = ..., minMarkers: int = ...) -> tuple[int, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def refineDetectedMarkers(image: cv2.typing.MatLike, board: Board, detectedCorners: _typing.Sequence[cv2.typing.MatLike], detectedIds: cv2.typing.MatLike, rejectedCorners: _typing.Sequence[cv2.typing.MatLike], cameraMatrix: cv2.typing.MatLike | None = ..., distCoeffs: cv2.typing.MatLike | None = ..., minRepDistance: float = ..., errorCorrectionRate: float = ..., checkAllOrders: bool = ..., recoveredIdxs: cv2.typing.MatLike | None = ..., parameters: DetectorParameters = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], cv2.typing.MatLike]: ...
@_typing.overload
def refineDetectedMarkers(image: cv2.UMat, board: Board, detectedCorners: _typing.Sequence[cv2.UMat], detectedIds: cv2.UMat, rejectedCorners: _typing.Sequence[cv2.UMat], cameraMatrix: cv2.UMat | None = ..., distCoeffs: cv2.UMat | None = ..., minRepDistance: float = ..., errorCorrectionRate: float = ..., checkAllOrders: bool = ..., recoveredIdxs: cv2.UMat | None = ..., parameters: DetectorParameters = ...) -> tuple[_typing.Sequence[cv2.UMat], cv2.UMat, _typing.Sequence[cv2.UMat], cv2.UMat]: ...
@_typing.overload
def testCharucoCornersCollinear(board: CharucoBoard, charucoIds: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def testCharucoCornersCollinear(board: CharucoBoard, charucoIds: cv2.UMat) -> bool: ...

View File

@@ -0,0 +1,39 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class BarcodeDetector(cv2.GraphicalCodeDetector):
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, prototxt_path: str, model_path: str) -> None: ...
@_typing.overload
def decodeWithType(self, img: cv2.typing.MatLike, points: cv2.typing.MatLike) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]: ...
@_typing.overload
def decodeWithType(self, img: cv2.UMat, points: cv2.UMat) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]: ...
@_typing.overload
def detectAndDecodeWithType(self, img: cv2.typing.MatLike, points: cv2.typing.MatLike | None = ...) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.typing.MatLike]: ...
@_typing.overload
def detectAndDecodeWithType(self, img: cv2.UMat, points: cv2.UMat | None = ...) -> tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.UMat]: ...
def getDownsamplingThreshold(self) -> float: ...
def setDownsamplingThreshold(self, thresh: float) -> BarcodeDetector: ...
def getDetectorScales(self) -> _typing.Sequence[float]: ...
def setDetectorScales(self, sizes: _typing.Sequence[float]) -> BarcodeDetector: ...
def getGradientThreshold(self) -> float: ...
def setGradientThreshold(self, thresh: float) -> BarcodeDetector: ...

View File

@@ -0,0 +1,177 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
LSBP_CAMERA_MOTION_COMPENSATION_NONE: int
LSBP_CAMERA_MOTION_COMPENSATION_LK: int
LSBPCameraMotionCompensation = int
"""One of [LSBP_CAMERA_MOTION_COMPENSATION_NONE, LSBP_CAMERA_MOTION_COMPENSATION_LK]"""
# Classes
class BackgroundSubtractorMOG(cv2.BackgroundSubtractor):
# Functions
def getHistory(self) -> int: ...
def setHistory(self, nframes: int) -> None: ...
def getNMixtures(self) -> int: ...
def setNMixtures(self, nmix: int) -> None: ...
def getBackgroundRatio(self) -> float: ...
def setBackgroundRatio(self, backgroundRatio: float) -> None: ...
def getNoiseSigma(self) -> float: ...
def setNoiseSigma(self, noiseSigma: float) -> None: ...
class BackgroundSubtractorGMG(cv2.BackgroundSubtractor):
# Functions
@_typing.overload
def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
def getMaxFeatures(self) -> int: ...
def setMaxFeatures(self, maxFeatures: int) -> None: ...
def getDefaultLearningRate(self) -> float: ...
def setDefaultLearningRate(self, lr: float) -> None: ...
def getNumFrames(self) -> int: ...
def setNumFrames(self, nframes: int) -> None: ...
def getQuantizationLevels(self) -> int: ...
def setQuantizationLevels(self, nlevels: int) -> None: ...
def getBackgroundPrior(self) -> float: ...
def setBackgroundPrior(self, bgprior: float) -> None: ...
def getSmoothingRadius(self) -> int: ...
def setSmoothingRadius(self, radius: int) -> None: ...
def getDecisionThreshold(self) -> float: ...
def setDecisionThreshold(self, thresh: float) -> None: ...
def getUpdateBackgroundModel(self) -> bool: ...
def setUpdateBackgroundModel(self, update: bool) -> None: ...
def getMinVal(self) -> float: ...
def setMinVal(self, val: float) -> None: ...
def getMaxVal(self) -> float: ...
def setMaxVal(self, val: float) -> None: ...
class BackgroundSubtractorCNT(cv2.BackgroundSubtractor):
# Functions
@_typing.overload
def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
def getMinPixelStability(self) -> int: ...
def setMinPixelStability(self, value: int) -> None: ...
def getMaxPixelStability(self) -> int: ...
def setMaxPixelStability(self, value: int) -> None: ...
def getUseHistory(self) -> bool: ...
def setUseHistory(self, value: bool) -> None: ...
def getIsParallel(self) -> bool: ...
def setIsParallel(self, value: bool) -> None: ...
class BackgroundSubtractorGSOC(cv2.BackgroundSubtractor):
# Functions
@_typing.overload
def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
class BackgroundSubtractorLSBP(cv2.BackgroundSubtractor):
# Functions
@_typing.overload
def apply(self, image: cv2.typing.MatLike, fgmask: cv2.typing.MatLike | None = ..., learningRate: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, image: cv2.UMat, fgmask: cv2.UMat | None = ..., learningRate: float = ...) -> cv2.UMat: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getBackgroundImage(self, backgroundImage: cv2.UMat | None = ...) -> cv2.UMat: ...
class BackgroundSubtractorLSBPDesc:
...
class SyntheticSequenceGenerator(cv2.Algorithm):
# Functions
@_typing.overload
def __init__(self, background: cv2.typing.MatLike, object: cv2.typing.MatLike, amplitude: float, wavelength: float, wavespeed: float, objspeed: float) -> None: ...
@_typing.overload
def __init__(self, background: cv2.UMat, object: cv2.UMat, amplitude: float, wavelength: float, wavespeed: float, objspeed: float) -> None: ...
@_typing.overload
def getNextFrame(self, frame: cv2.typing.MatLike | None = ..., gtMask: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getNextFrame(self, frame: cv2.UMat | None = ..., gtMask: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
# Functions
def createBackgroundSubtractorCNT(minPixelStability: int = ..., useHistory: bool = ..., maxPixelStability: int = ..., isParallel: bool = ...) -> BackgroundSubtractorCNT: ...
def createBackgroundSubtractorGMG(initializationFrames: int = ..., decisionThreshold: float = ...) -> BackgroundSubtractorGMG: ...
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: ...
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: ...
def createBackgroundSubtractorMOG(history: int = ..., nmixtures: int = ..., backgroundRatio: float = ..., noiseSigma: float = ...) -> BackgroundSubtractorMOG: ...
@_typing.overload
def createSyntheticSequenceGenerator(background: cv2.typing.MatLike, object: cv2.typing.MatLike, amplitude: float = ..., wavelength: float = ..., wavespeed: float = ..., objspeed: float = ...) -> SyntheticSequenceGenerator: ...
@_typing.overload
def createSyntheticSequenceGenerator(background: cv2.UMat, object: cv2.UMat, amplitude: float = ..., wavelength: float = ..., wavespeed: float = ..., objspeed: float = ...) -> SyntheticSequenceGenerator: ...

View File

@@ -0,0 +1,121 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
RETINA_COLOR_RANDOM: int
RETINA_COLOR_DIAGONAL: int
RETINA_COLOR_BAYER: int
# Classes
class Retina(cv2.Algorithm):
# Functions
def getInputSize(self) -> cv2.typing.Size: ...
def getOutputSize(self) -> cv2.typing.Size: ...
def setup(self, retinaParameterFile: str = ..., applyDefaultSetupOnFailure: bool = ...) -> None: ...
def printSetup(self) -> str: ...
def write(self, fs: str) -> None: ...
def setupOPLandIPLParvoChannel(self, colorMode: bool = ..., normaliseOutput: bool = ..., photoreceptorsLocalAdaptationSensitivity: float = ..., photoreceptorsTemporalConstant: float = ..., photoreceptorsSpatialConstant: float = ..., horizontalCellsGain: float = ..., HcellsTemporalConstant: float = ..., HcellsSpatialConstant: float = ..., ganglionCellsSensitivity: float = ...) -> None: ...
def setupIPLMagnoChannel(self, normaliseOutput: bool = ..., parasolCells_beta: float = ..., parasolCells_tau: float = ..., parasolCells_k: float = ..., amacrinCellsTemporalCutFrequency: float = ..., V0CompressionParameter: float = ..., localAdaptintegration_tau: float = ..., localAdaptintegration_k: float = ...) -> None: ...
@_typing.overload
def run(self, inputImage: cv2.typing.MatLike) -> None: ...
@_typing.overload
def run(self, inputImage: cv2.UMat) -> None: ...
@_typing.overload
def applyFastToneMapping(self, inputImage: cv2.typing.MatLike, outputToneMappedImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def applyFastToneMapping(self, inputImage: cv2.UMat, outputToneMappedImage: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getParvo(self, retinaOutput_parvo: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getParvo(self, retinaOutput_parvo: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getParvoRAW(self, retinaOutput_parvo: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getParvoRAW(self, retinaOutput_parvo: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getParvoRAW(self) -> cv2.typing.MatLike: ...
@_typing.overload
def getMagno(self, retinaOutput_magno: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getMagno(self, retinaOutput_magno: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getMagnoRAW(self, retinaOutput_magno: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getMagnoRAW(self, retinaOutput_magno: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getMagnoRAW(self) -> cv2.typing.MatLike: ...
def setColorSaturation(self, saturateColors: bool = ..., colorSaturationValue: float = ...) -> None: ...
def clearBuffers(self) -> None: ...
def activateMovingContoursProcessing(self, activate: bool) -> None: ...
def activateContoursProcessing(self, activate: bool) -> None: ...
@classmethod
@_typing.overload
def create(cls, inputSize: cv2.typing.Size) -> Retina: ...
@classmethod
@_typing.overload
def create(cls, inputSize: cv2.typing.Size, colorMode: bool, colorSamplingMethod: int = ..., useRetinaLogSampling: bool = ..., reductionFactor: float = ..., samplingStrength: float = ...) -> Retina: ...
class RetinaFastToneMapping(cv2.Algorithm):
# Functions
@_typing.overload
def applyFastToneMapping(self, inputImage: cv2.typing.MatLike, outputToneMappedImage: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def applyFastToneMapping(self, inputImage: cv2.UMat, outputToneMappedImage: cv2.UMat | None = ...) -> cv2.UMat: ...
def setup(self, photoreceptorsNeighborhoodRadius: float = ..., ganglioncellsNeighborhoodRadius: float = ..., meanLuminanceModulatorK: float = ...) -> None: ...
@classmethod
def create(cls, inputSize: cv2.typing.Size) -> RetinaFastToneMapping: ...
class TransientAreasSegmentationModule(cv2.Algorithm):
# Functions
def getSize(self) -> cv2.typing.Size: ...
def setup(self, segmentationParameterFile: str = ..., applyDefaultSetupOnFailure: bool = ...) -> None: ...
def printSetup(self) -> str: ...
def write(self, fs: str) -> None: ...
@_typing.overload
def run(self, inputToSegment: cv2.typing.MatLike, channelIndex: int = ...) -> None: ...
@_typing.overload
def run(self, inputToSegment: cv2.UMat, channelIndex: int = ...) -> None: ...
@_typing.overload
def getSegmentationPicture(self, transientAreas: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getSegmentationPicture(self, transientAreas: cv2.UMat | None = ...) -> cv2.UMat: ...
def clearAllBuffers(self) -> None: ...
@classmethod
def create(cls, inputSize: cv2.typing.Size) -> TransientAreasSegmentationModule: ...

View File

@@ -0,0 +1,167 @@
__all__: list[str] = []
import cv2.typing
import typing as _typing
# Enumerations
CCM_3x3: int
CCM_3X3: int
CCM_4x3: int
CCM_4X3: int
CCM_TYPE = int
"""One of [CCM_3x3, CCM_3X3, CCM_4x3, CCM_4X3]"""
INITIAL_METHOD_WHITE_BALANCE: int
INITIAL_METHOD_LEAST_SQUARE: int
INITIAL_METHOD_TYPE = int
"""One of [INITIAL_METHOD_WHITE_BALANCE, INITIAL_METHOD_LEAST_SQUARE]"""
COLORCHECKER_Macbeth: int
COLORCHECKER_MACBETH: int
COLORCHECKER_Vinyl: int
COLORCHECKER_VINYL: int
COLORCHECKER_DigitalSG: int
COLORCHECKER_DIGITAL_SG: int
CONST_COLOR = int
"""One of [COLORCHECKER_Macbeth, COLORCHECKER_MACBETH, COLORCHECKER_Vinyl, COLORCHECKER_VINYL, COLORCHECKER_DigitalSG, COLORCHECKER_DIGITAL_SG]"""
COLOR_SPACE_sRGB: int
COLOR_SPACE_S_RGB: int
COLOR_SPACE_sRGBL: int
COLOR_SPACE_S_RGBL: int
COLOR_SPACE_AdobeRGB: int
COLOR_SPACE_ADOBE_RGB: int
COLOR_SPACE_AdobeRGBL: int
COLOR_SPACE_ADOBE_RGBL: int
COLOR_SPACE_WideGamutRGB: int
COLOR_SPACE_WIDE_GAMUT_RGB: int
COLOR_SPACE_WideGamutRGBL: int
COLOR_SPACE_WIDE_GAMUT_RGBL: int
COLOR_SPACE_ProPhotoRGB: int
COLOR_SPACE_PRO_PHOTO_RGB: int
COLOR_SPACE_ProPhotoRGBL: int
COLOR_SPACE_PRO_PHOTO_RGBL: int
COLOR_SPACE_DCI_P3_RGB: int
COLOR_SPACE_DCI_P3_RGBL: int
COLOR_SPACE_AppleRGB: int
COLOR_SPACE_APPLE_RGB: int
COLOR_SPACE_AppleRGBL: int
COLOR_SPACE_APPLE_RGBL: int
COLOR_SPACE_REC_709_RGB: int
COLOR_SPACE_REC_709_RGBL: int
COLOR_SPACE_REC_2020_RGB: int
COLOR_SPACE_REC_2020_RGBL: int
COLOR_SPACE_XYZ_D65_2: int
COLOR_SPACE_XYZ_D65_10: int
COLOR_SPACE_XYZ_D50_2: int
COLOR_SPACE_XYZ_D50_10: int
COLOR_SPACE_XYZ_A_2: int
COLOR_SPACE_XYZ_A_10: int
COLOR_SPACE_XYZ_D55_2: int
COLOR_SPACE_XYZ_D55_10: int
COLOR_SPACE_XYZ_D75_2: int
COLOR_SPACE_XYZ_D75_10: int
COLOR_SPACE_XYZ_E_2: int
COLOR_SPACE_XYZ_E_10: int
COLOR_SPACE_Lab_D65_2: int
COLOR_SPACE_LAB_D65_2: int
COLOR_SPACE_Lab_D65_10: int
COLOR_SPACE_LAB_D65_10: int
COLOR_SPACE_Lab_D50_2: int
COLOR_SPACE_LAB_D50_2: int
COLOR_SPACE_Lab_D50_10: int
COLOR_SPACE_LAB_D50_10: int
COLOR_SPACE_Lab_A_2: int
COLOR_SPACE_LAB_A_2: int
COLOR_SPACE_Lab_A_10: int
COLOR_SPACE_LAB_A_10: int
COLOR_SPACE_Lab_D55_2: int
COLOR_SPACE_LAB_D55_2: int
COLOR_SPACE_Lab_D55_10: int
COLOR_SPACE_LAB_D55_10: int
COLOR_SPACE_Lab_D75_2: int
COLOR_SPACE_LAB_D75_2: int
COLOR_SPACE_Lab_D75_10: int
COLOR_SPACE_LAB_D75_10: int
COLOR_SPACE_Lab_E_2: int
COLOR_SPACE_LAB_E_2: int
COLOR_SPACE_Lab_E_10: int
COLOR_SPACE_LAB_E_10: int
COLOR_SPACE = int
"""One of [COLOR_SPACE_sRGB, COLOR_SPACE_S_RGB, COLOR_SPACE_sRGBL, COLOR_SPACE_S_RGBL, COLOR_SPACE_AdobeRGB, COLOR_SPACE_ADOBE_RGB, COLOR_SPACE_AdobeRGBL, COLOR_SPACE_ADOBE_RGBL, COLOR_SPACE_WideGamutRGB, COLOR_SPACE_WIDE_GAMUT_RGB, COLOR_SPACE_WideGamutRGBL, COLOR_SPACE_WIDE_GAMUT_RGBL, COLOR_SPACE_ProPhotoRGB, COLOR_SPACE_PRO_PHOTO_RGB, COLOR_SPACE_ProPhotoRGBL, COLOR_SPACE_PRO_PHOTO_RGBL, COLOR_SPACE_DCI_P3_RGB, COLOR_SPACE_DCI_P3_RGBL, COLOR_SPACE_AppleRGB, COLOR_SPACE_APPLE_RGB, COLOR_SPACE_AppleRGBL, 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_D65_10, COLOR_SPACE_XYZ_D50_2, 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_D65_2, COLOR_SPACE_Lab_D65_10, COLOR_SPACE_LAB_D65_10, COLOR_SPACE_Lab_D50_2, COLOR_SPACE_LAB_D50_2, COLOR_SPACE_Lab_D50_10, COLOR_SPACE_LAB_D50_10, COLOR_SPACE_Lab_A_2, COLOR_SPACE_LAB_A_2, COLOR_SPACE_Lab_A_10, COLOR_SPACE_LAB_A_10, COLOR_SPACE_Lab_D55_2, COLOR_SPACE_LAB_D55_2, COLOR_SPACE_Lab_D55_10, COLOR_SPACE_LAB_D55_10, COLOR_SPACE_Lab_D75_2, COLOR_SPACE_LAB_D75_2, COLOR_SPACE_Lab_D75_10, COLOR_SPACE_LAB_D75_10, COLOR_SPACE_Lab_E_2, COLOR_SPACE_LAB_E_2, COLOR_SPACE_Lab_E_10, COLOR_SPACE_LAB_E_10]"""
LINEARIZATION_IDENTITY: int
LINEARIZATION_GAMMA: int
LINEARIZATION_COLORPOLYFIT: int
LINEARIZATION_COLORLOGPOLYFIT: int
LINEARIZATION_GRAYPOLYFIT: int
LINEARIZATION_GRAYLOGPOLYFIT: int
LINEAR_TYPE = int
"""One of [LINEARIZATION_IDENTITY, LINEARIZATION_GAMMA, LINEARIZATION_COLORPOLYFIT, LINEARIZATION_COLORLOGPOLYFIT, LINEARIZATION_GRAYPOLYFIT, LINEARIZATION_GRAYLOGPOLYFIT]"""
DISTANCE_CIE76: int
DISTANCE_CIE94_GRAPHIC_ARTS: int
DISTANCE_CIE94_TEXTILES: int
DISTANCE_CIE2000: int
DISTANCE_CMC_1TO1: int
DISTANCE_CMC_2TO1: int
DISTANCE_RGB: int
DISTANCE_RGBL: int
DISTANCE_TYPE = int
"""One of [DISTANCE_CIE76, DISTANCE_CIE94_GRAPHIC_ARTS, DISTANCE_CIE94_TEXTILES, DISTANCE_CIE2000, DISTANCE_CMC_1TO1, DISTANCE_CMC_2TO1, DISTANCE_RGB, DISTANCE_RGBL]"""
# Classes
class ColorCorrectionModel:
# Functions
@_typing.overload
def __init__(self, src: cv2.typing.MatLike, constcolor: CONST_COLOR) -> None: ...
@_typing.overload
def __init__(self, src: cv2.typing.MatLike, colors: cv2.typing.MatLike, ref_cs: COLOR_SPACE) -> None: ...
@_typing.overload
def __init__(self, src: cv2.typing.MatLike, colors: cv2.typing.MatLike, ref_cs: COLOR_SPACE, colored: cv2.typing.MatLike) -> None: ...
def setColorSpace(self, cs: COLOR_SPACE) -> None: ...
def setCCM_TYPE(self, ccm_type: CCM_TYPE) -> None: ...
def setDistance(self, distance: DISTANCE_TYPE) -> None: ...
def setLinear(self, linear_type: LINEAR_TYPE) -> None: ...
def setLinearGamma(self, gamma: float) -> None: ...
def setLinearDegree(self, deg: int) -> None: ...
def setSaturatedThreshold(self, lower: float, upper: float) -> None: ...
def setWeightsList(self, weights_list: cv2.typing.MatLike) -> None: ...
def setWeightCoeff(self, weights_coeff: float) -> None: ...
def setInitialMethod(self, initial_method_type: INITIAL_METHOD_TYPE) -> None: ...
def setMaxCount(self, max_count: int) -> None: ...
def setEpsilon(self, epsilon: float) -> None: ...
def run(self) -> None: ...
def getCCM(self) -> cv2.typing.MatLike: ...
def getLoss(self) -> float: ...
def get_src_rgbl(self) -> cv2.typing.MatLike: ...
def get_dst_rgbl(self) -> cv2.typing.MatLike: ...
def getMask(self) -> cv2.typing.MatLike: ...
def getWeights(self) -> cv2.typing.MatLike: ...
def infer(self, img: cv2.typing.MatLike, islinear: bool = ...) -> cv2.typing.MatLike: ...

View File

@@ -0,0 +1,96 @@
__all__: list[str] = []
import cv2
import cv2.kinfu
import cv2.typing
import typing as _typing
# Classes
class Params:
frameSize: cv2.typing.Size
rgb_frameSize: cv2.typing.Size
volumeType: cv2.kinfu.VolumeType
intr: cv2.typing.Matx33f
rgb_intr: cv2.typing.Matx33f
depthFactor: float
bilateral_sigma_depth: float
bilateral_sigma_spatial: float
bilateral_kernel_size: int
pyramidLevels: int
volumeDims: cv2.typing.Vec3i
voxelSize: float
tsdf_min_camera_movement: float
tsdf_trunc_dist: float
tsdf_max_weight: int
raycast_step_factor: float
lightPose: cv2.typing.Vec3f
icpDistThresh: float
icpAngleThresh: float
icpIterations: _typing.Sequence[int]
truncateThreshold: float
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, volumeInitialPoseRot: cv2.typing.Matx33f, volumeInitialPoseTransl: cv2.typing.Vec3f) -> None: ...
@_typing.overload
def __init__(self, volumeInitialPose: cv2.typing.Matx44f) -> None: ...
@_typing.overload
def setInitialVolumePose(self, R: cv2.typing.Matx33f, t: cv2.typing.Vec3f) -> None: ...
@_typing.overload
def setInitialVolumePose(self, homogen_tf: cv2.typing.Matx44f) -> None: ...
@classmethod
def defaultParams(cls) -> Params: ...
@classmethod
def coarseParams(cls) -> Params: ...
@classmethod
def hashTSDFParams(cls, isCoarse: bool) -> Params: ...
@classmethod
def coloredTSDFParams(cls, isCoarse: bool) -> Params: ...
class ColoredKinFu:
# Functions
@classmethod
def create(cls, _params: Params) -> ColoredKinFu: ...
@_typing.overload
def render(self, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getCloud(self, points: cv2.typing.MatLike | None = ..., normals: cv2.typing.MatLike | None = ..., colors: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getCloud(self, points: cv2.UMat | None = ..., normals: cv2.UMat | None = ..., colors: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def getPoints(self, points: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getPoints(self, points: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getNormals(self, points: cv2.typing.MatLike, normals: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getNormals(self, points: cv2.UMat, normals: cv2.UMat | None = ...) -> cv2.UMat: ...
def reset(self) -> None: ...
@_typing.overload
def update(self, depth: cv2.typing.MatLike, rgb: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def update(self, depth: cv2.UMat, rgb: cv2.UMat) -> bool: ...

View File

@@ -0,0 +1,24 @@
PYTHON_EXTENSIONS_PATHS = [
LOADER_DIR
] + PYTHON_EXTENSIONS_PATHS
ci_and_not_headless = False
try:
from .version import ci_build, headless
ci_and_not_headless = ci_build and not headless
except:
pass
# the Qt plugin is included currently only in the pre-built wheels
if sys.platform.startswith("linux") and ci_and_not_headless:
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "plugins"
)
# Qt will throw warning on Linux if fonts are not found
if sys.platform.startswith("linux") and ci_and_not_headless:
os.environ["QT_QPA_FONTDIR"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "fonts"
)

View File

@@ -0,0 +1,5 @@
import os
BINARIES_PATHS = [
os.path.join(os.path.join(LOADER_DIR, '../../'), 'lib64')
] + BINARIES_PATHS

View File

@@ -0,0 +1,551 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
FEATURE_SET_COMPUTE_10: int
FEATURE_SET_COMPUTE_11: int
FEATURE_SET_COMPUTE_12: int
FEATURE_SET_COMPUTE_13: int
FEATURE_SET_COMPUTE_20: int
FEATURE_SET_COMPUTE_21: int
FEATURE_SET_COMPUTE_30: int
FEATURE_SET_COMPUTE_32: int
FEATURE_SET_COMPUTE_35: int
FEATURE_SET_COMPUTE_50: int
GLOBAL_ATOMICS: int
SHARED_ATOMICS: int
NATIVE_DOUBLE: int
WARP_SHUFFLE_FUNCTIONS: int
DYNAMIC_PARALLELISM: int
FeatureSet = int
"""One of [FEATURE_SET_COMPUTE_10, FEATURE_SET_COMPUTE_11, FEATURE_SET_COMPUTE_12, FEATURE_SET_COMPUTE_13, FEATURE_SET_COMPUTE_20, FEATURE_SET_COMPUTE_21, FEATURE_SET_COMPUTE_30, FEATURE_SET_COMPUTE_32, FEATURE_SET_COMPUTE_35, FEATURE_SET_COMPUTE_50, GLOBAL_ATOMICS, SHARED_ATOMICS, NATIVE_DOUBLE, WARP_SHUFFLE_FUNCTIONS, DYNAMIC_PARALLELISM]"""
HostMem_PAGE_LOCKED: int
HOST_MEM_PAGE_LOCKED: int
HostMem_SHARED: int
HOST_MEM_SHARED: int
HostMem_WRITE_COMBINED: int
HOST_MEM_WRITE_COMBINED: int
HostMem_AllocType = int
"""One of [HostMem_PAGE_LOCKED, HOST_MEM_PAGE_LOCKED, HostMem_SHARED, HOST_MEM_SHARED, HostMem_WRITE_COMBINED, HOST_MEM_WRITE_COMBINED]"""
Event_DEFAULT: int
EVENT_DEFAULT: int
Event_BLOCKING_SYNC: int
EVENT_BLOCKING_SYNC: int
Event_DISABLE_TIMING: int
EVENT_DISABLE_TIMING: int
Event_INTERPROCESS: int
EVENT_INTERPROCESS: int
Event_CreateFlags = int
"""One of [Event_DEFAULT, EVENT_DEFAULT, Event_BLOCKING_SYNC, EVENT_BLOCKING_SYNC, Event_DISABLE_TIMING, EVENT_DISABLE_TIMING, Event_INTERPROCESS, EVENT_INTERPROCESS]"""
DeviceInfo_ComputeModeDefault: int
DEVICE_INFO_COMPUTE_MODE_DEFAULT: int
DeviceInfo_ComputeModeExclusive: int
DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE: int
DeviceInfo_ComputeModeProhibited: int
DEVICE_INFO_COMPUTE_MODE_PROHIBITED: int
DeviceInfo_ComputeModeExclusiveProcess: int
DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS: int
DeviceInfo_ComputeMode = int
"""One of [DeviceInfo_ComputeModeDefault, DEVICE_INFO_COMPUTE_MODE_DEFAULT, DeviceInfo_ComputeModeExclusive, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE, DeviceInfo_ComputeModeProhibited, DEVICE_INFO_COMPUTE_MODE_PROHIBITED, DeviceInfo_ComputeModeExclusiveProcess, DEVICE_INFO_COMPUTE_MODE_EXCLUSIVE_PROCESS]"""
SURF_CUDA_X_ROW: int
SURF_CUDA_Y_ROW: int
SURF_CUDA_LAPLACIAN_ROW: int
SURF_CUDA_OCTAVE_ROW: int
SURF_CUDA_SIZE_ROW: int
SURF_CUDA_ANGLE_ROW: int
SURF_CUDA_HESSIAN_ROW: int
SURF_CUDA_ROWS_COUNT: int
SURF_CUDA_KeypointLayout = int
"""One of [SURF_CUDA_X_ROW, SURF_CUDA_Y_ROW, SURF_CUDA_LAPLACIAN_ROW, SURF_CUDA_OCTAVE_ROW, SURF_CUDA_SIZE_ROW, SURF_CUDA_ANGLE_ROW, SURF_CUDA_HESSIAN_ROW, SURF_CUDA_ROWS_COUNT]"""
# Classes
class GpuMat:
@property
def step(self) -> int: ...
# Classes
class Allocator:
...
# Functions
@_typing.overload
def __init__(self, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, rows: int, cols: int, type: int, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, size: cv2.typing.Size, type: int, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, rows: int, cols: int, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, size: cv2.typing.Size, type: int, s: cv2.typing.Scalar, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, m: GpuMat) -> None: ...
@_typing.overload
def __init__(self, m: GpuMat, rowRange: cv2.typing.Range, colRange: cv2.typing.Range) -> None: ...
@_typing.overload
def __init__(self, m: GpuMat, roi: cv2.typing.Rect) -> None: ...
@_typing.overload
def __init__(self, arr: cv2.typing.MatLike, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, arr: GpuMat, allocator: GpuMat.Allocator = ...) -> None: ...
@_typing.overload
def __init__(self, arr: cv2.UMat, allocator: GpuMat.Allocator = ...) -> None: ...
@staticmethod
def defaultAllocator() -> GpuMat.Allocator: ...
@staticmethod
def setDefaultAllocator(allocator: GpuMat.Allocator) -> None: ...
@staticmethod
def getStdAllocator() -> GpuMat.Allocator: ...
@_typing.overload
def create(self, rows: int, cols: int, type: int) -> None: ...
@_typing.overload
def create(self, size: cv2.typing.Size, type: int) -> None: ...
def release(self) -> None: ...
def swap(self, mat: GpuMat) -> None: ...
@_typing.overload
def upload(self, arr: cv2.typing.MatLike) -> None: ...
@_typing.overload
def upload(self, arr: GpuMat) -> None: ...
@_typing.overload
def upload(self, arr: cv2.UMat) -> None: ...
@_typing.overload
def upload(self, arr: cv2.typing.MatLike, stream: Stream) -> None: ...
@_typing.overload
def upload(self, arr: GpuMat, stream: Stream) -> None: ...
@_typing.overload
def upload(self, arr: cv2.UMat, stream: Stream) -> None: ...
@_typing.overload
def download(self, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def download(self, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def download(self, dst: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def download(self, stream: Stream, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def download(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def download(self, stream: Stream, dst: cv2.UMat | None = ...) -> cv2.UMat: ...
def clone(self) -> GpuMat: ...
@_typing.overload
def copyTo(self, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def copyTo(self, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def copyTo(self, mask: GpuMat, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def copyTo(self, mask: GpuMat, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, stream: Stream) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: GpuMat) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: cv2.typing.MatLike, stream: Stream) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: GpuMat, stream: Stream) -> GpuMat: ...
@_typing.overload
def setTo(self, s: cv2.typing.Scalar, mask: cv2.UMat, stream: Stream) -> GpuMat: ...
@_typing.overload
def convertTo(self, rtype: int, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def convertTo(self, rtype: int, dst: GpuMat | None = ..., alpha: float = ..., beta: float = ...) -> GpuMat: ...
@_typing.overload
def convertTo(self, rtype: int, alpha: float, beta: float, stream: Stream, dst: GpuMat | None = ...) -> GpuMat: ...
def assignTo(self, m: GpuMat, type: int = ...) -> None: ...
def row(self, y: int) -> GpuMat: ...
def col(self, x: int) -> GpuMat: ...
@_typing.overload
def rowRange(self, startrow: int, endrow: int) -> GpuMat: ...
@_typing.overload
def rowRange(self, r: cv2.typing.Range) -> GpuMat: ...
@_typing.overload
def colRange(self, startcol: int, endcol: int) -> GpuMat: ...
@_typing.overload
def colRange(self, r: cv2.typing.Range) -> GpuMat: ...
def reshape(self, cn: int, rows: int = ...) -> GpuMat: ...
def locateROI(self, wholeSize: cv2.typing.Size, ofs: cv2.typing.Point) -> None: ...
def adjustROI(self, dtop: int, dbottom: int, dleft: int, dright: int) -> GpuMat: ...
def isContinuous(self) -> bool: ...
def elemSize(self) -> int: ...
def elemSize1(self) -> int: ...
def type(self) -> int: ...
def depth(self) -> int: ...
def channels(self) -> int: ...
def step1(self) -> int: ...
def size(self) -> cv2.typing.Size: ...
def empty(self) -> bool: ...
def cudaPtr(self) -> cv2.typing.IntPointer: ...
def updateContinuityFlag(self) -> None: ...
class GpuData:
...
class GpuMatND:
...
class BufferPool:
# Functions
def __init__(self, stream: Stream) -> None: ...
@_typing.overload
def getBuffer(self, rows: int, cols: int, type: int) -> GpuMat: ...
@_typing.overload
def getBuffer(self, size: cv2.typing.Size, type: int) -> GpuMat: ...
def getAllocator(self) -> GpuMat.Allocator: ...
class HostMem:
@property
def step(self) -> int: ...
# Functions
@_typing.overload
def __init__(self, alloc_type: HostMem_AllocType = ...) -> None: ...
@_typing.overload
def __init__(self, rows: int, cols: int, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
@_typing.overload
def __init__(self, size: cv2.typing.Size, type: int, alloc_type: HostMem_AllocType = ...) -> None: ...
@_typing.overload
def __init__(self, arr: cv2.typing.MatLike, alloc_type: HostMem_AllocType = ...) -> None: ...
@_typing.overload
def __init__(self, arr: GpuMat, alloc_type: HostMem_AllocType = ...) -> None: ...
@_typing.overload
def __init__(self, arr: cv2.UMat, alloc_type: HostMem_AllocType = ...) -> None: ...
def swap(self, b: HostMem) -> None: ...
def clone(self) -> HostMem: ...
def create(self, rows: int, cols: int, type: int) -> None: ...
def reshape(self, cn: int, rows: int = ...) -> HostMem: ...
def createMatHeader(self) -> cv2.typing.MatLike: ...
def isContinuous(self) -> bool: ...
def elemSize(self) -> int: ...
def elemSize1(self) -> int: ...
def type(self) -> int: ...
def depth(self) -> int: ...
def channels(self) -> int: ...
def step1(self) -> int: ...
def size(self) -> cv2.typing.Size: ...
def empty(self) -> bool: ...
class Stream:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, allocator: GpuMat.Allocator) -> None: ...
@_typing.overload
def __init__(self, cudaFlags: int) -> None: ...
def queryIfComplete(self) -> bool: ...
def waitForCompletion(self) -> None: ...
def waitEvent(self, event: Event) -> None: ...
@classmethod
def Null(cls) -> Stream: ...
def cudaPtr(self) -> cv2.typing.IntPointer: ...
class Event:
# Functions
def __init__(self, flags: Event_CreateFlags = ...) -> None: ...
def record(self, stream: Stream = ...) -> None: ...
def queryIfComplete(self) -> bool: ...
def waitForCompletion(self) -> None: ...
@staticmethod
def elapsedTime(start: Event, end: Event) -> float: ...
class TargetArchs:
# Functions
@staticmethod
def has(major: int, minor: int) -> bool: ...
@staticmethod
def hasPtx(major: int, minor: int) -> bool: ...
@staticmethod
def hasBin(major: int, minor: int) -> bool: ...
@staticmethod
def hasEqualOrLessPtx(major: int, minor: int) -> bool: ...
@staticmethod
def hasEqualOrGreater(major: int, minor: int) -> bool: ...
@staticmethod
def hasEqualOrGreaterPtx(major: int, minor: int) -> bool: ...
@staticmethod
def hasEqualOrGreaterBin(major: int, minor: int) -> bool: ...
class DeviceInfo:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, device_id: int) -> None: ...
def deviceID(self) -> int: ...
def totalGlobalMem(self) -> int: ...
def sharedMemPerBlock(self) -> int: ...
def regsPerBlock(self) -> int: ...
def warpSize(self) -> int: ...
def memPitch(self) -> int: ...
def maxThreadsPerBlock(self) -> int: ...
def maxThreadsDim(self) -> cv2.typing.Vec3i: ...
def maxGridSize(self) -> cv2.typing.Vec3i: ...
def clockRate(self) -> int: ...
def totalConstMem(self) -> int: ...
def majorVersion(self) -> int: ...
def minorVersion(self) -> int: ...
def textureAlignment(self) -> int: ...
def texturePitchAlignment(self) -> int: ...
def multiProcessorCount(self) -> int: ...
def kernelExecTimeoutEnabled(self) -> bool: ...
def integrated(self) -> bool: ...
def canMapHostMemory(self) -> bool: ...
def computeMode(self) -> DeviceInfo_ComputeMode: ...
def maxTexture1D(self) -> int: ...
def maxTexture1DMipmap(self) -> int: ...
def maxTexture1DLinear(self) -> int: ...
def maxTexture2D(self) -> cv2.typing.Vec2i: ...
def maxTexture2DMipmap(self) -> cv2.typing.Vec2i: ...
def maxTexture2DLinear(self) -> cv2.typing.Vec3i: ...
def maxTexture2DGather(self) -> cv2.typing.Vec2i: ...
def maxTexture3D(self) -> cv2.typing.Vec3i: ...
def maxTextureCubemap(self) -> int: ...
def maxTexture1DLayered(self) -> cv2.typing.Vec2i: ...
def maxTexture2DLayered(self) -> cv2.typing.Vec3i: ...
def maxTextureCubemapLayered(self) -> cv2.typing.Vec2i: ...
def maxSurface1D(self) -> int: ...
def maxSurface2D(self) -> cv2.typing.Vec2i: ...
def maxSurface3D(self) -> cv2.typing.Vec3i: ...
def maxSurface1DLayered(self) -> cv2.typing.Vec2i: ...
def maxSurface2DLayered(self) -> cv2.typing.Vec3i: ...
def maxSurfaceCubemap(self) -> int: ...
def maxSurfaceCubemapLayered(self) -> cv2.typing.Vec2i: ...
def surfaceAlignment(self) -> int: ...
def concurrentKernels(self) -> bool: ...
def ECCEnabled(self) -> bool: ...
def pciBusID(self) -> int: ...
def pciDeviceID(self) -> int: ...
def pciDomainID(self) -> int: ...
def tccDriver(self) -> bool: ...
def asyncEngineCount(self) -> int: ...
def unifiedAddressing(self) -> bool: ...
def memoryClockRate(self) -> int: ...
def memoryBusWidth(self) -> int: ...
def l2CacheSize(self) -> int: ...
def maxThreadsPerMultiProcessor(self) -> int: ...
def queryMemory(self, totalMemory: int, freeMemory: int) -> None: ...
def freeMemory(self) -> int: ...
def totalMemory(self) -> int: ...
def isCompatible(self) -> bool: ...
class SURF_CUDA:
@property
def hessianThreshold(self) -> float: ...
@property
def nOctaves(self) -> int: ...
@property
def nOctaveLayers(self) -> int: ...
@property
def extended(self) -> bool: ...
@property
def upright(self) -> bool: ...
@property
def keypointsRatio(self) -> float: ...
# Functions
@classmethod
def create(cls, _hessianThreshold: float, _nOctaves: int = ..., _nOctaveLayers: int = ..., _extended: bool = ..., _keypointsRatio: float = ..., _upright: bool = ...) -> SURF_CUDA: ...
def descriptorSize(self) -> int: ...
def defaultNorm(self) -> int: ...
def downloadKeypoints(self, keypointsGPU: GpuMat) -> _typing.Sequence[cv2.KeyPoint]: ...
def detect(self, img: GpuMat, mask: GpuMat, keypoints: GpuMat | None = ...) -> GpuMat: ...
def detectWithDescriptors(self, img: GpuMat, mask: GpuMat, keypoints: GpuMat | None = ..., descriptors: GpuMat | None = ..., useProvidedKeypoints: bool = ...) -> tuple[GpuMat, GpuMat]: ...
# Functions
@_typing.overload
def createContinuous(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def createContinuous(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def createContinuous(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def createGpuMatFromCudaMemory(rows: int, cols: int, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
@_typing.overload
def createGpuMatFromCudaMemory(size: cv2.typing.Size, type: int, cudaMemoryAddress: int, step: int = ...) -> GpuMat: ...
@_typing.overload
def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: GpuMat | None = ...) -> GpuMat: ...
@_typing.overload
def ensureSizeIsEnough(rows: int, cols: int, type: int, arr: cv2.UMat | None = ...) -> cv2.UMat: ...
def fastNlMeansDenoising(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
def fastNlMeansDenoisingColored(src: GpuMat, h_luminance: float, photo_render: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., stream: Stream = ...) -> GpuMat: ...
def getCudaEnabledDeviceCount() -> int: ...
def getDevice() -> int: ...
def nonLocalMeans(src: GpuMat, h: float, dst: GpuMat | None = ..., search_window: int = ..., block_size: int = ..., borderMode: int = ..., stream: Stream = ...) -> GpuMat: ...
def printCudaDeviceInfo(device: int) -> None: ...
def printShortCudaDeviceInfo(device: int) -> None: ...
def registerPageLocked(m: cv2.typing.MatLike) -> None: ...
def resetDevice() -> None: ...
def setBufferPoolConfig(deviceId: int, stackSize: int, stackCount: int) -> None: ...
def setBufferPoolUsage(on: bool) -> None: ...
def setDevice(device: int) -> None: ...
def unregisterPageLocked(m: cv2.typing.MatLike) -> None: ...
def wrapStream(cudaStreamMemoryAddress: int) -> Stream: ...

Binary file not shown.

View File

@@ -0,0 +1,3 @@
import os
haarcascades = os.path.join(os.path.dirname(__file__), "")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,80 @@
__all__: list[str] = []
# Enumerations
male: int
MALE: int
female: int
FEMALE: int
none: int
NONE: int
genderType = int
"""One of [male, MALE, female, FEMALE, none, NONE]"""
circle: int
CIRCLE: int
triangle: int
TRIANGLE: int
updown: int
UPDOWN: int
rightleft: int
RIGHTLEFT: int
wave: int
WAVE: int
z: int
Z: int
cross: int
CROSS: int
comehere: int
COMEHERE: int
turnaround: int
TURNAROUND: int
pat: int
PAT: int
actionType = int
"""One of [circle, CIRCLE, triangle, TRIANGLE, updown, UPDOWN, rightleft, RIGHTLEFT, wave, WAVE, z, Z, cross, CROSS, comehere, COMEHERE, turnaround, TURNAROUND, pat, PAT]"""
fist: int
FIST: int
index: int
INDEX: int
flat: int
FLAT: int
poseType = int
"""One of [fist, FIST, index, INDEX, flat, FLAT]"""
light: int
LIGHT: int
dark: int
DARK: int
illuminationType = int
"""One of [light, LIGHT, dark, DARK]"""
woodenBoard: int
WOODEN_BOARD: int
whitePaper: int
WHITE_PAPER: int
paperWithCharacters: int
PAPER_WITH_CHARACTERS: int
backgroundType = int
"""One of [woodenBoard, WOODEN_BOARD, whitePaper, WHITE_PAPER, paperWithCharacters, PAPER_WITH_CHARACTERS]"""
humaneva_1: int
HUMANEVA_1: int
humaneva_2: int
HUMANEVA_2: int
datasetType = int
"""One of [humaneva_1, HUMANEVA_1, humaneva_2, HUMANEVA_2]"""
POS: int
NEG: int
sampleType = int
"""One of [POS, NEG]"""
LEFT: int
RIGHT: int
LADYBUG: int
imageType = int
"""One of [LEFT, RIGHT, LADYBUG]"""

View File

@@ -0,0 +1,627 @@
__all__: list[str] = []
import cv2
import cv2.gapi
import cv2.gapi.ie
import cv2.gapi.onnx
import cv2.gapi.ov
import cv2.typing
import numpy
import typing as _typing
# Enumerations
TEST_CUSTOM: int
TEST_EQ: int
TEST_NE: int
TEST_LE: int
TEST_LT: int
TEST_GE: int
TEST_GT: int
TestOp = int
"""One of [TEST_CUSTOM, TEST_EQ, TEST_NE, TEST_LE, TEST_LT, TEST_GE, TEST_GT]"""
OpaqueKind_CV_UNKNOWN: int
OPAQUE_KIND_CV_UNKNOWN: int
OpaqueKind_CV_BOOL: int
OPAQUE_KIND_CV_BOOL: int
OpaqueKind_CV_INT: int
OPAQUE_KIND_CV_INT: int
OpaqueKind_CV_INT64: int
OPAQUE_KIND_CV_INT64: int
OpaqueKind_CV_DOUBLE: int
OPAQUE_KIND_CV_DOUBLE: int
OpaqueKind_CV_FLOAT: int
OPAQUE_KIND_CV_FLOAT: int
OpaqueKind_CV_UINT64: int
OPAQUE_KIND_CV_UINT64: int
OpaqueKind_CV_STRING: int
OPAQUE_KIND_CV_STRING: int
OpaqueKind_CV_POINT: int
OPAQUE_KIND_CV_POINT: int
OpaqueKind_CV_POINT2F: int
OPAQUE_KIND_CV_POINT2F: int
OpaqueKind_CV_POINT3F: int
OPAQUE_KIND_CV_POINT3F: int
OpaqueKind_CV_SIZE: int
OPAQUE_KIND_CV_SIZE: int
OpaqueKind_CV_RECT: int
OPAQUE_KIND_CV_RECT: int
OpaqueKind_CV_SCALAR: int
OPAQUE_KIND_CV_SCALAR: int
OpaqueKind_CV_MAT: int
OPAQUE_KIND_CV_MAT: int
OpaqueKind_CV_DRAW_PRIM: int
OPAQUE_KIND_CV_DRAW_PRIM: int
OpaqueKind = int
"""One of [OpaqueKind_CV_UNKNOWN, OPAQUE_KIND_CV_UNKNOWN, OpaqueKind_CV_BOOL, OPAQUE_KIND_CV_BOOL, OpaqueKind_CV_INT, OPAQUE_KIND_CV_INT, OpaqueKind_CV_INT64, OPAQUE_KIND_CV_INT64, OpaqueKind_CV_DOUBLE, OPAQUE_KIND_CV_DOUBLE, OpaqueKind_CV_FLOAT, OPAQUE_KIND_CV_FLOAT, OpaqueKind_CV_UINT64, OPAQUE_KIND_CV_UINT64, OpaqueKind_CV_STRING, OPAQUE_KIND_CV_STRING, OpaqueKind_CV_POINT, OPAQUE_KIND_CV_POINT, OpaqueKind_CV_POINT2F, OPAQUE_KIND_CV_POINT2F, OpaqueKind_CV_POINT3F, OPAQUE_KIND_CV_POINT3F, OpaqueKind_CV_SIZE, OPAQUE_KIND_CV_SIZE, OpaqueKind_CV_RECT, OPAQUE_KIND_CV_RECT, OpaqueKind_CV_SCALAR, OPAQUE_KIND_CV_SCALAR, OpaqueKind_CV_MAT, OPAQUE_KIND_CV_MAT, OpaqueKind_CV_DRAW_PRIM, OPAQUE_KIND_CV_DRAW_PRIM]"""
ArgKind_OPAQUE_VAL: int
ARG_KIND_OPAQUE_VAL: int
ArgKind_OPAQUE: int
ARG_KIND_OPAQUE: int
ArgKind_GOBJREF: int
ARG_KIND_GOBJREF: int
ArgKind_GMAT: int
ARG_KIND_GMAT: int
ArgKind_GMATP: int
ARG_KIND_GMATP: int
ArgKind_GFRAME: int
ARG_KIND_GFRAME: int
ArgKind_GSCALAR: int
ARG_KIND_GSCALAR: int
ArgKind_GARRAY: int
ARG_KIND_GARRAY: int
ArgKind_GOPAQUE: int
ARG_KIND_GOPAQUE: int
ArgKind = int
"""One of [ArgKind_OPAQUE_VAL, ARG_KIND_OPAQUE_VAL, ArgKind_OPAQUE, ARG_KIND_OPAQUE, ArgKind_GOBJREF, ARG_KIND_GOBJREF, ArgKind_GMAT, ARG_KIND_GMAT, ArgKind_GMATP, ARG_KIND_GMATP, ArgKind_GFRAME, ARG_KIND_GFRAME, ArgKind_GSCALAR, ARG_KIND_GSCALAR, ArgKind_GARRAY, ARG_KIND_GARRAY, ArgKind_GOPAQUE, ARG_KIND_GOPAQUE]"""
WAVE_CORRECT_HORIZ: int
WAVE_CORRECT_VERT: int
WAVE_CORRECT_AUTO: int
WaveCorrectKind = int
"""One of [WAVE_CORRECT_HORIZ, WAVE_CORRECT_VERT, WAVE_CORRECT_AUTO]"""
Blender_NO: int
BLENDER_NO: int
Blender_FEATHER: int
BLENDER_FEATHER: int
Blender_MULTI_BAND: int
BLENDER_MULTI_BAND: int
ExposureCompensator_NO: int
EXPOSURE_COMPENSATOR_NO: int
ExposureCompensator_GAIN: int
EXPOSURE_COMPENSATOR_GAIN: int
ExposureCompensator_GAIN_BLOCKS: int
EXPOSURE_COMPENSATOR_GAIN_BLOCKS: int
ExposureCompensator_CHANNELS: int
EXPOSURE_COMPENSATOR_CHANNELS: int
ExposureCompensator_CHANNELS_BLOCKS: int
EXPOSURE_COMPENSATOR_CHANNELS_BLOCKS: int
SeamFinder_NO: int
SEAM_FINDER_NO: int
SeamFinder_VORONOI_SEAM: int
SEAM_FINDER_VORONOI_SEAM: int
SeamFinder_DP_SEAM: int
SEAM_FINDER_DP_SEAM: int
DpSeamFinder_COLOR: int
DP_SEAM_FINDER_COLOR: int
DpSeamFinder_COLOR_GRAD: int
DP_SEAM_FINDER_COLOR_GRAD: int
DpSeamFinder_CostFunction = int
"""One of [DpSeamFinder_COLOR, DP_SEAM_FINDER_COLOR, DpSeamFinder_COLOR_GRAD, DP_SEAM_FINDER_COLOR_GRAD]"""
Timelapser_AS_IS: int
TIMELAPSER_AS_IS: int
Timelapser_CROP: int
TIMELAPSER_CROP: int
TrackerSamplerCSC_MODE_INIT_POS: int
TRACKER_SAMPLER_CSC_MODE_INIT_POS: int
TrackerSamplerCSC_MODE_INIT_NEG: int
TRACKER_SAMPLER_CSC_MODE_INIT_NEG: int
TrackerSamplerCSC_MODE_TRACK_POS: int
TRACKER_SAMPLER_CSC_MODE_TRACK_POS: int
TrackerSamplerCSC_MODE_TRACK_NEG: int
TRACKER_SAMPLER_CSC_MODE_TRACK_NEG: int
TrackerSamplerCSC_MODE_DETECT: int
TRACKER_SAMPLER_CSC_MODE_DETECT: int
TrackerSamplerCSC_MODE = int
"""One of [TrackerSamplerCSC_MODE_INIT_POS, TRACKER_SAMPLER_CSC_MODE_INIT_POS, TrackerSamplerCSC_MODE_INIT_NEG, TRACKER_SAMPLER_CSC_MODE_INIT_NEG, TrackerSamplerCSC_MODE_TRACK_POS, TRACKER_SAMPLER_CSC_MODE_TRACK_POS, TrackerSamplerCSC_MODE_TRACK_NEG, TRACKER_SAMPLER_CSC_MODE_TRACK_NEG, TrackerSamplerCSC_MODE_DETECT, TRACKER_SAMPLER_CSC_MODE_DETECT]"""
GraphCutSeamFinderBase_COST_COLOR: int
GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR: int
GraphCutSeamFinderBase_COST_COLOR_GRAD: int
GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR_GRAD: int
GraphCutSeamFinderBase_CostType = int
"""One of [GraphCutSeamFinderBase_COST_COLOR, GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR, GraphCutSeamFinderBase_COST_COLOR_GRAD, GRAPH_CUT_SEAM_FINDER_BASE_COST_COLOR_GRAD]"""
CvFeatureParams_HAAR: int
CV_FEATURE_PARAMS_HAAR: int
CvFeatureParams_LBP: int
CV_FEATURE_PARAMS_LBP: int
CvFeatureParams_HOG: int
CV_FEATURE_PARAMS_HOG: int
CvFeatureParams_FeatureType = int
"""One of [CvFeatureParams_HAAR, CV_FEATURE_PARAMS_HAAR, CvFeatureParams_LBP, CV_FEATURE_PARAMS_LBP, CvFeatureParams_HOG, CV_FEATURE_PARAMS_HOG]"""
TrackerContribSamplerCSC_MODE_INIT_POS: int
TRACKER_CONTRIB_SAMPLER_CSC_MODE_INIT_POS: int
TrackerContribSamplerCSC_MODE_INIT_NEG: int
TRACKER_CONTRIB_SAMPLER_CSC_MODE_INIT_NEG: int
TrackerContribSamplerCSC_MODE_TRACK_POS: int
TRACKER_CONTRIB_SAMPLER_CSC_MODE_TRACK_POS: int
TrackerContribSamplerCSC_MODE_TRACK_NEG: int
TRACKER_CONTRIB_SAMPLER_CSC_MODE_TRACK_NEG: int
TrackerContribSamplerCSC_MODE_DETECT: int
TRACKER_CONTRIB_SAMPLER_CSC_MODE_DETECT: int
TrackerSamplerCS_MODE_POSITIVE: int
TRACKER_SAMPLER_CS_MODE_POSITIVE: int
TrackerSamplerCS_MODE_NEGATIVE: int
TRACKER_SAMPLER_CS_MODE_NEGATIVE: int
TrackerSamplerCS_MODE_CLASSIFY: int
TRACKER_SAMPLER_CS_MODE_CLASSIFY: int
# Classes
class Blender:
# Functions
@classmethod
def createDefault(cls, type: int, try_gpu: bool = ...) -> Blender: ...
@_typing.overload
def prepare(self, corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> None: ...
@_typing.overload
def prepare(self, dst_roi: cv2.typing.Rect) -> None: ...
@_typing.overload
def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ...
class FeatherBlender(Blender):
# Functions
def __init__(self, sharpness: float = ...) -> None: ...
def sharpness(self) -> float: ...
def setSharpness(self, val: float) -> None: ...
def prepare(self, dst_roi: cv2.typing.Rect) -> None: ...
@_typing.overload
def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ...
def createWeightMaps(self, masks: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], weight_maps: _typing.Sequence[cv2.UMat]) -> tuple[cv2.typing.Rect, _typing.Sequence[cv2.UMat]]: ...
class MultiBandBlender(Blender):
# Functions
def __init__(self, try_gpu: int = ..., num_bands: int = ..., weight_type: int = ...) -> None: ...
def numBands(self) -> int: ...
def setNumBands(self, val: int) -> None: ...
def prepare(self, dst_roi: cv2.typing.Rect) -> None: ...
@_typing.overload
def feed(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def feed(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def blend(self, dst: cv2.typing.MatLike, dst_mask: cv2.typing.MatLike) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def blend(self, dst: cv2.UMat, dst_mask: cv2.UMat) -> tuple[cv2.UMat, cv2.UMat]: ...
class CameraParams:
focal: float
aspect: float
ppx: float
ppy: float
R: cv2.typing.MatLike
t: cv2.typing.MatLike
# Functions
def K(self) -> cv2.typing.MatLike: ...
class ExposureCompensator:
# Functions
@classmethod
def createDefault(cls, type: int) -> ExposureCompensator: ...
def feed(self, corners: _typing.Sequence[cv2.typing.Point], images: _typing.Sequence[cv2.UMat], masks: _typing.Sequence[cv2.UMat]) -> None: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, arg1: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, arg1: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
def setUpdateGain(self, b: bool) -> None: ...
def getUpdateGain(self) -> bool: ...
class NoExposureCompensator(ExposureCompensator):
# Functions
@_typing.overload
def apply(self, arg1: int, arg2: cv2.typing.Point, arg3: cv2.typing.MatLike, arg4: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, arg1: int, arg2: cv2.typing.Point, arg3: cv2.UMat, arg4: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
class GainCompensator(ExposureCompensator):
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, nr_feeds: int) -> None: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
def setNrFeeds(self, nr_feeds: int) -> None: ...
def getNrFeeds(self) -> int: ...
def setSimilarityThreshold(self, similarity_threshold: float) -> None: ...
def getSimilarityThreshold(self) -> float: ...
class ChannelsCompensator(ExposureCompensator):
# Functions
def __init__(self, nr_feeds: int = ...) -> None: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
def setNrFeeds(self, nr_feeds: int) -> None: ...
def getNrFeeds(self) -> int: ...
def setSimilarityThreshold(self, similarity_threshold: float) -> None: ...
def getSimilarityThreshold(self) -> float: ...
class BlocksCompensator(ExposureCompensator):
# Functions
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
def setNrFeeds(self, nr_feeds: int) -> None: ...
def getNrFeeds(self) -> int: ...
def setSimilarityThreshold(self, similarity_threshold: float) -> None: ...
def getSimilarityThreshold(self) -> float: ...
@_typing.overload
def setBlockSize(self, width: int, height: int) -> None: ...
@_typing.overload
def setBlockSize(self, size: cv2.typing.Size) -> None: ...
def getBlockSize(self) -> cv2.typing.Size: ...
def setNrGainsFilteringIterations(self, nr_iterations: int) -> None: ...
def getNrGainsFilteringIterations(self) -> int: ...
class BlocksGainCompensator(BlocksCompensator):
# Functions
@_typing.overload
def __init__(self, bl_width: int = ..., bl_height: int = ...) -> None: ...
@_typing.overload
def __init__(self, bl_width: int, bl_height: int, nr_feeds: int) -> None: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.typing.MatLike, mask: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def apply(self, index: int, corner: cv2.typing.Point, image: cv2.UMat, mask: cv2.UMat) -> cv2.UMat: ...
def getMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
def setMatGains(self, umv: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
class BlocksChannelsCompensator(BlocksCompensator):
# Functions
def __init__(self, bl_width: int = ..., bl_height: int = ..., nr_feeds: int = ...) -> None: ...
class ImageFeatures:
img_idx: int
img_size: cv2.typing.Size
keypoints: _typing.Sequence[cv2.KeyPoint]
descriptors: cv2.UMat
# Functions
def getKeypoints(self) -> _typing.Sequence[cv2.KeyPoint]: ...
class MatchesInfo:
src_img_idx: int
dst_img_idx: int
matches: _typing.Sequence[cv2.DMatch]
inliers_mask: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]
num_inliers: int
H: cv2.typing.MatLike
confidence: float
# Functions
def getMatches(self) -> _typing.Sequence[cv2.DMatch]: ...
def getInliers(self) -> numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]: ...
class FeaturesMatcher:
# Functions
def apply(self, features1: ImageFeatures, features2: ImageFeatures) -> MatchesInfo: ...
def apply2(self, features: _typing.Sequence[ImageFeatures], mask: cv2.UMat | None = ...) -> _typing.Sequence[MatchesInfo]: ...
def isThreadSafe(self) -> bool: ...
def collectGarbage(self) -> None: ...
class BestOf2NearestMatcher(FeaturesMatcher):
# Functions
def __init__(self, try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ..., matches_confindece_thresh: float = ...) -> None: ...
def collectGarbage(self) -> None: ...
@classmethod
def create(cls, try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ..., matches_confindece_thresh: float = ...) -> BestOf2NearestMatcher: ...
class BestOf2NearestRangeMatcher(BestOf2NearestMatcher):
# Functions
def __init__(self, range_width: int = ..., try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ..., num_matches_thresh2: int = ...) -> None: ...
class AffineBestOf2NearestMatcher(BestOf2NearestMatcher):
# Functions
def __init__(self, full_affine: bool = ..., try_use_gpu: bool = ..., match_conf: float = ..., num_matches_thresh1: int = ...) -> None: ...
class Estimator:
# Functions
def apply(self, features: _typing.Sequence[ImageFeatures], pairwise_matches: _typing.Sequence[MatchesInfo], cameras: _typing.Sequence[CameraParams]) -> tuple[bool, _typing.Sequence[CameraParams]]: ...
class HomographyBasedEstimator(Estimator):
# Functions
def __init__(self, is_focals_estimated: bool = ...) -> None: ...
class AffineBasedEstimator(Estimator):
# Functions
def __init__(self) -> None: ...
class BundleAdjusterBase(Estimator):
# Functions
def refinementMask(self) -> cv2.typing.MatLike: ...
def setRefinementMask(self, mask: cv2.typing.MatLike) -> None: ...
def confThresh(self) -> float: ...
def setConfThresh(self, conf_thresh: float) -> None: ...
def termCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, term_criteria: cv2.typing.TermCriteria) -> None: ...
class NoBundleAdjuster(BundleAdjusterBase):
# Functions
def __init__(self) -> None: ...
class BundleAdjusterReproj(BundleAdjusterBase):
# Functions
def __init__(self) -> None: ...
class BundleAdjusterRay(BundleAdjusterBase):
# Functions
def __init__(self) -> None: ...
class BundleAdjusterAffine(BundleAdjusterBase):
# Functions
def __init__(self) -> None: ...
class BundleAdjusterAffinePartial(BundleAdjusterBase):
# Functions
def __init__(self) -> None: ...
class SeamFinder:
# Functions
def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@classmethod
def createDefault(cls, type: int) -> SeamFinder: ...
class NoSeamFinder(SeamFinder):
# Functions
def find(self, arg1: _typing.Sequence[cv2.UMat], arg2: _typing.Sequence[cv2.typing.Point], arg3: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
class PairwiseSeamFinder(SeamFinder):
# Functions
def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
class VoronoiSeamFinder(PairwiseSeamFinder):
# Functions
def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
class DpSeamFinder(SeamFinder):
# Functions
def __init__(self, costFunc: str) -> None: ...
def setCostFunction(self, val: str) -> None: ...
class GraphCutSeamFinder:
# Functions
def __init__(self, cost_type: str, terminal_cost: float = ..., bad_region_penalty: float = ...) -> None: ...
def find(self, src: _typing.Sequence[cv2.UMat], corners: _typing.Sequence[cv2.typing.Point], masks: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
class Timelapser:
# Functions
@classmethod
def createDefault(cls, type: int) -> Timelapser: ...
def initialize(self, corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> None: ...
@_typing.overload
def process(self, img: cv2.typing.MatLike, mask: cv2.typing.MatLike, tl: cv2.typing.Point) -> None: ...
@_typing.overload
def process(self, img: cv2.UMat, mask: cv2.UMat, tl: cv2.typing.Point) -> None: ...
def getDst(self) -> cv2.UMat: ...
class TimelapserCrop(Timelapser):
...
class ProjectorBase:
...
class SphericalProjector(ProjectorBase):
# Functions
def mapForward(self, x: float, y: float, u: float, v: float) -> None: ...
def mapBackward(self, u: float, v: float, x: float, y: float) -> None: ...
# Functions
def calibrateRotatingCamera(Hs: _typing.Sequence[cv2.typing.MatLike], K: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike]: ...
@_typing.overload
def computeImageFeatures(featuresFinder: cv2.Feature2D, images: _typing.Sequence[cv2.typing.MatLike], masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[ImageFeatures]: ...
@_typing.overload
def computeImageFeatures(featuresFinder: cv2.Feature2D, images: _typing.Sequence[cv2.UMat], masks: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[ImageFeatures]: ...
@_typing.overload
def computeImageFeatures2(featuresFinder: cv2.Feature2D, image: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> ImageFeatures: ...
@_typing.overload
def computeImageFeatures2(featuresFinder: cv2.Feature2D, image: cv2.UMat, mask: cv2.UMat | None = ...) -> ImageFeatures: ...
@_typing.overload
def createLaplacePyr(img: cv2.typing.MatLike, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def createLaplacePyr(img: cv2.UMat, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def createLaplacePyrGpu(img: cv2.typing.MatLike, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def createLaplacePyrGpu(img: cv2.UMat, num_levels: int, pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def createWeightMap(mask: cv2.typing.MatLike, sharpness: float, weight: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def createWeightMap(mask: cv2.UMat, sharpness: float, weight: cv2.UMat) -> cv2.UMat: ...
def focalsFromHomography(H: cv2.typing.MatLike, f0: float, f1: float, f0_ok: bool, f1_ok: bool) -> None: ...
def leaveBiggestComponent(features: _typing.Sequence[ImageFeatures], pairwise_matches: _typing.Sequence[MatchesInfo], conf_threshold: float) -> _typing.Sequence[int]: ...
def matchesGraphAsString(paths: _typing.Sequence[str], pairwise_matches: _typing.Sequence[MatchesInfo], conf_threshold: float) -> str: ...
@_typing.overload
def normalizeUsingWeightMap(weight: cv2.typing.MatLike, src: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def normalizeUsingWeightMap(weight: cv2.UMat, src: cv2.UMat) -> cv2.UMat: ...
def overlapRoi(tl1: cv2.typing.Point, tl2: cv2.typing.Point, sz1: cv2.typing.Size, sz2: cv2.typing.Size, roi: cv2.typing.Rect) -> bool: ...
def restoreImageFromLaplacePyr(pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
def restoreImageFromLaplacePyrGpu(pyr: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def resultRoi(corners: _typing.Sequence[cv2.typing.Point], images: _typing.Sequence[cv2.UMat]) -> cv2.typing.Rect: ...
@_typing.overload
def resultRoi(corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> cv2.typing.Rect: ...
def resultRoiIntersection(corners: _typing.Sequence[cv2.typing.Point], sizes: _typing.Sequence[cv2.typing.Size]) -> cv2.typing.Rect: ...
def resultTl(corners: _typing.Sequence[cv2.typing.Point]) -> cv2.typing.Point: ...
def selectRandomSubset(count: int, size: int, subset: _typing.Sequence[int]) -> None: ...
def stitchingLogLevel() -> int: ...
@_typing.overload
def strip(params: cv2.gapi.ie.PyParams) -> cv2.gapi.GNetParam: ...
@_typing.overload
def strip(params: cv2.gapi.onnx.PyParams) -> cv2.gapi.GNetParam: ...
@_typing.overload
def strip(params: cv2.gapi.ov.PyParams) -> cv2.gapi.GNetParam: ...
def waveCorrect(rmats: _typing.Sequence[cv2.typing.MatLike], kind: WaveCorrectKind) -> _typing.Sequence[cv2.typing.MatLike]: ...

View File

@@ -0,0 +1,534 @@
__all__: list[str] = []
import cv2
import cv2.typing
import numpy
import sys
import typing as _typing
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol
# Enumerations
DNN_BACKEND_DEFAULT: int
DNN_BACKEND_HALIDE: int
DNN_BACKEND_INFERENCE_ENGINE: int
DNN_BACKEND_OPENCV: int
DNN_BACKEND_VKCOM: int
DNN_BACKEND_CUDA: int
DNN_BACKEND_WEBNN: int
DNN_BACKEND_TIMVX: int
DNN_BACKEND_CANN: int
Backend = int
"""One of [DNN_BACKEND_DEFAULT, DNN_BACKEND_HALIDE, DNN_BACKEND_INFERENCE_ENGINE, DNN_BACKEND_OPENCV, DNN_BACKEND_VKCOM, DNN_BACKEND_CUDA, DNN_BACKEND_WEBNN, DNN_BACKEND_TIMVX, DNN_BACKEND_CANN]"""
DNN_TARGET_CPU: int
DNN_TARGET_OPENCL: int
DNN_TARGET_OPENCL_FP16: int
DNN_TARGET_MYRIAD: int
DNN_TARGET_VULKAN: int
DNN_TARGET_FPGA: int
DNN_TARGET_CUDA: int
DNN_TARGET_CUDA_FP16: int
DNN_TARGET_HDDL: int
DNN_TARGET_NPU: int
DNN_TARGET_CPU_FP16: int
Target = int
"""One of [DNN_TARGET_CPU, DNN_TARGET_OPENCL, DNN_TARGET_OPENCL_FP16, DNN_TARGET_MYRIAD, DNN_TARGET_VULKAN, DNN_TARGET_FPGA, DNN_TARGET_CUDA, DNN_TARGET_CUDA_FP16, DNN_TARGET_HDDL, DNN_TARGET_NPU, DNN_TARGET_CPU_FP16]"""
DNN_LAYOUT_UNKNOWN: int
DNN_LAYOUT_ND: int
DNN_LAYOUT_NCHW: int
DNN_LAYOUT_NCDHW: int
DNN_LAYOUT_NHWC: int
DNN_LAYOUT_NDHWC: int
DNN_LAYOUT_PLANAR: int
DataLayout = int
"""One of [DNN_LAYOUT_UNKNOWN, DNN_LAYOUT_ND, DNN_LAYOUT_NCHW, DNN_LAYOUT_NCDHW, DNN_LAYOUT_NHWC, DNN_LAYOUT_NDHWC, DNN_LAYOUT_PLANAR]"""
DNN_PMODE_NULL: int
DNN_PMODE_CROP_CENTER: int
DNN_PMODE_LETTERBOX: int
ImagePaddingMode = int
"""One of [DNN_PMODE_NULL, DNN_PMODE_CROP_CENTER, DNN_PMODE_LETTERBOX]"""
SoftNMSMethod_SOFTNMS_LINEAR: int
SOFT_NMSMETHOD_SOFTNMS_LINEAR: int
SoftNMSMethod_SOFTNMS_GAUSSIAN: int
SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN: int
SoftNMSMethod = int
"""One of [SoftNMSMethod_SOFTNMS_LINEAR, SOFT_NMSMETHOD_SOFTNMS_LINEAR, SoftNMSMethod_SOFTNMS_GAUSSIAN, SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN]"""
# Classes
class DictValue:
# Functions
@_typing.overload
def __init__(self, i: int) -> None: ...
@_typing.overload
def __init__(self, p: float) -> None: ...
@_typing.overload
def __init__(self, s: str) -> None: ...
def isInt(self) -> bool: ...
def isString(self) -> bool: ...
def isReal(self) -> bool: ...
def getIntValue(self, idx: int = ...) -> int: ...
def getRealValue(self, idx: int = ...) -> float: ...
def getStringValue(self, idx: int = ...) -> str: ...
class Layer(cv2.Algorithm):
blobs: _typing.Sequence[cv2.typing.MatLike]
@property
def name(self) -> str: ...
@property
def type(self) -> str: ...
@property
def preferableTarget(self) -> int: ...
# Functions
@_typing.overload
def finalize(self, inputs: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def finalize(self, inputs: _typing.Sequence[cv2.UMat], outputs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
def run(self, inputs: _typing.Sequence[cv2.typing.MatLike], internals: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
def outputNameToIndex(self, outputName: str) -> int: ...
class Net:
# Functions
def __init__(self) -> None: ...
@classmethod
@_typing.overload
def readFromModelOptimizer(cls, xml: str, bin: str) -> Net: ...
@classmethod
@_typing.overload
def readFromModelOptimizer(cls, bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
def empty(self) -> bool: ...
def dump(self) -> str: ...
def dumpToFile(self, path: str) -> None: ...
def dumpToPbtxt(self, path: str) -> None: ...
def addLayer(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ...
def addLayerToPrev(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ...
def getLayerId(self, layer: str) -> int: ...
def getLayerNames(self) -> _typing.Sequence[str]: ...
@_typing.overload
def getLayer(self, layerId: int) -> Layer: ...
@_typing.overload
def getLayer(self, layerName: str) -> Layer: ...
@_typing.overload
def getLayer(self, layerId: cv2.typing.LayerId) -> Layer: ...
def connect(self, outPin: str, inpPin: str) -> None: ...
def setInputsNames(self, inputBlobNames: _typing.Sequence[str]) -> None: ...
def setInputShape(self, inputName: str, shape: cv2.typing.MatShape) -> None: ...
@_typing.overload
def forward(self, outputName: str = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def forward(self, outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def forward(self, outputBlobs: _typing.Sequence[cv2.UMat] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
def forwardAsync(self, outputName: str = ...) -> cv2.AsyncArray: ...
def forwardAndRetrieve(self, outBlobNames: _typing.Sequence[str]) -> _typing.Sequence[_typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def quantize(self, calibData: _typing.Sequence[cv2.typing.MatLike], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ...
@_typing.overload
def quantize(self, calibData: _typing.Sequence[cv2.UMat], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ...
def getInputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
def getOutputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
def setHalideScheduler(self, scheduler: str) -> None: ...
def setPreferableBackend(self, backendId: int) -> None: ...
def setPreferableTarget(self, targetId: int) -> None: ...
@_typing.overload
def setInput(self, blob: cv2.typing.MatLike, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ...
@_typing.overload
def setInput(self, blob: cv2.UMat, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ...
@_typing.overload
def setParam(self, layer: int, numParam: int, blob: cv2.typing.MatLike) -> None: ...
@_typing.overload
def setParam(self, layerName: str, numParam: int, blob: cv2.typing.MatLike) -> None: ...
@_typing.overload
def getParam(self, layer: int, numParam: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getParam(self, layerName: str, numParam: int = ...) -> cv2.typing.MatLike: ...
def getUnconnectedOutLayers(self) -> _typing.Sequence[int]: ...
def getUnconnectedOutLayersNames(self) -> _typing.Sequence[str]: ...
@_typing.overload
def getLayersShapes(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ...
@_typing.overload
def getLayersShapes(self, netInputShape: cv2.typing.MatShape) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ...
@_typing.overload
def getFLOPS(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ...
@_typing.overload
def getFLOPS(self, netInputShape: cv2.typing.MatShape) -> int: ...
@_typing.overload
def getFLOPS(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ...
@_typing.overload
def getFLOPS(self, layerId: int, netInputShape: cv2.typing.MatShape) -> int: ...
def getLayerTypes(self) -> _typing.Sequence[str]: ...
def getLayersCount(self, layerType: str) -> int: ...
@_typing.overload
def getMemoryConsumption(self, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ...
@_typing.overload
def getMemoryConsumption(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[int, int]: ...
@_typing.overload
def getMemoryConsumption(self, layerId: int, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ...
def enableFusion(self, fusion: bool) -> None: ...
def enableWinograd(self, useWinograd: bool) -> None: ...
def getPerfProfile(self) -> tuple[int, _typing.Sequence[float]]: ...
class Image2BlobParams:
scalefactor: cv2.typing.Scalar
size: cv2.typing.Size
mean: cv2.typing.Scalar
swapRB: bool
ddepth: int
datalayout: DataLayout
paddingmode: ImagePaddingMode
borderValue: cv2.typing.Scalar
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, scalefactor: cv2.typing.Scalar, size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., ddepth: int = ..., datalayout: DataLayout = ..., mode: ImagePaddingMode = ..., borderValue: cv2.typing.Scalar = ...) -> None: ...
def blobRectToImageRect(self, rBlob: cv2.typing.Rect, size: cv2.typing.Size) -> cv2.typing.Rect: ...
def blobRectsToImageRects(self, rBlob: _typing.Sequence[cv2.typing.Rect], size: cv2.typing.Size) -> _typing.Sequence[cv2.typing.Rect]: ...
class Model:
# Functions
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def setInputSize(self, size: cv2.typing.Size) -> Model: ...
@_typing.overload
def setInputSize(self, width: int, height: int) -> Model: ...
def setInputMean(self, mean: cv2.typing.Scalar) -> Model: ...
def setInputScale(self, scale: cv2.typing.Scalar) -> Model: ...
def setInputCrop(self, crop: bool) -> Model: ...
def setInputSwapRB(self, swapRB: bool) -> Model: ...
def setOutputNames(self, outNames: _typing.Sequence[str]) -> Model: ...
def setInputParams(self, scale: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ...) -> None: ...
@_typing.overload
def predict(self, frame: cv2.typing.MatLike, outs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def predict(self, frame: cv2.UMat, outs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
def setPreferableBackend(self, backendId: Backend) -> Model: ...
def setPreferableTarget(self, targetId: Target) -> Model: ...
def enableWinograd(self, useWinograd: bool) -> Model: ...
class ClassificationModel(Model):
# Functions
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
@_typing.overload
def __init__(self, network: Net) -> None: ...
def setEnableSoftmaxPostProcessing(self, enable: bool) -> ClassificationModel: ...
def getEnableSoftmaxPostProcessing(self) -> bool: ...
@_typing.overload
def classify(self, frame: cv2.typing.MatLike) -> tuple[int, float]: ...
@_typing.overload
def classify(self, frame: cv2.UMat) -> tuple[int, float]: ...
class KeypointsModel(Model):
# Functions
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def estimate(self, frame: cv2.typing.MatLike, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ...
@_typing.overload
def estimate(self, frame: cv2.UMat, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ...
class SegmentationModel(Model):
# Functions
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def segment(self, frame: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def segment(self, frame: cv2.UMat, mask: cv2.UMat | None = ...) -> cv2.UMat: ...
class DetectionModel(Model):
# Functions
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
@_typing.overload
def __init__(self, network: Net) -> None: ...
def setNmsAcrossClasses(self, value: bool) -> DetectionModel: ...
def getNmsAcrossClasses(self) -> bool: ...
@_typing.overload
def detect(self, frame: cv2.typing.MatLike, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ...
@_typing.overload
def detect(self, frame: cv2.UMat, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ...
class TextRecognitionModel(Model):
# Functions
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
def setDecodeType(self, decodeType: str) -> TextRecognitionModel: ...
def getDecodeType(self) -> str: ...
def setDecodeOptsCTCPrefixBeamSearch(self, beamSize: int, vocPruneSize: int = ...) -> TextRecognitionModel: ...
def setVocabulary(self, vocabulary: _typing.Sequence[str]) -> TextRecognitionModel: ...
def getVocabulary(self) -> _typing.Sequence[str]: ...
@_typing.overload
def recognize(self, frame: cv2.typing.MatLike) -> str: ...
@_typing.overload
def recognize(self, frame: cv2.UMat) -> str: ...
@_typing.overload
def recognize(self, frame: cv2.typing.MatLike, roiRects: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[str]: ...
@_typing.overload
def recognize(self, frame: cv2.UMat, roiRects: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[str]: ...
class TextDetectionModel(Model):
# Functions
@_typing.overload
def detect(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ...
@_typing.overload
def detect(self, frame: cv2.UMat) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ...
@_typing.overload
def detect(self, frame: cv2.typing.MatLike) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
@_typing.overload
def detect(self, frame: cv2.UMat) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
@_typing.overload
def detectTextRectangles(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ...
@_typing.overload
def detectTextRectangles(self, frame: cv2.UMat) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ...
@_typing.overload
def detectTextRectangles(self, frame: cv2.typing.MatLike) -> _typing.Sequence[cv2.typing.RotatedRect]: ...
@_typing.overload
def detectTextRectangles(self, frame: cv2.UMat) -> _typing.Sequence[cv2.typing.RotatedRect]: ...
class TextDetectionModel_EAST(TextDetectionModel):
# Functions
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
def setConfidenceThreshold(self, confThreshold: float) -> TextDetectionModel_EAST: ...
def getConfidenceThreshold(self) -> float: ...
def setNMSThreshold(self, nmsThreshold: float) -> TextDetectionModel_EAST: ...
def getNMSThreshold(self) -> float: ...
class TextDetectionModel_DB(TextDetectionModel):
# Functions
@_typing.overload
def __init__(self, network: Net) -> None: ...
@_typing.overload
def __init__(self, model: str, config: str = ...) -> None: ...
def setBinaryThreshold(self, binaryThreshold: float) -> TextDetectionModel_DB: ...
def getBinaryThreshold(self) -> float: ...
def setPolygonThreshold(self, polygonThreshold: float) -> TextDetectionModel_DB: ...
def getPolygonThreshold(self) -> float: ...
def setUnclipRatio(self, unclipRatio: float) -> TextDetectionModel_DB: ...
def getUnclipRatio(self) -> float: ...
def setMaxCandidates(self, maxCandidates: int) -> TextDetectionModel_DB: ...
def getMaxCandidates(self) -> int: ...
class LayerProtocol(Protocol):
# Functions
def __init__(self, params: dict[str, DictValue], blobs: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
def getMemoryShapes(self, inputs: _typing.Sequence[_typing.Sequence[int]]) -> _typing.Sequence[_typing.Sequence[int]]: ...
def forward(self, inputs: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[cv2.typing.MatLike]: ...
# Functions
def NMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
def NMSBoxesBatched(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], class_ids: _typing.Sequence[int], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
def NMSBoxesRotated(bboxes: _typing.Sequence[cv2.typing.RotatedRect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
@_typing.overload
def blobFromImage(image: cv2.typing.MatLike, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImage(image: cv2.UMat, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImageWithParams(image: cv2.typing.MatLike, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImageWithParams(image: cv2.UMat, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImageWithParams(image: cv2.typing.MatLike, blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImageWithParams(image: cv2.UMat, blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ...
@_typing.overload
def blobFromImages(images: _typing.Sequence[cv2.typing.MatLike], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImages(images: _typing.Sequence[cv2.UMat], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ...
def getAvailableTargets(be: Backend) -> _typing.Sequence[Target]: ...
@_typing.overload
def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
@_typing.overload
def readNet(model: str, config: str = ..., framework: str = ...) -> Net: ...
@_typing.overload
def readNet(framework: str, bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
@_typing.overload
def readNetFromCaffe(prototxt: str, caffeModel: str = ...) -> Net: ...
@_typing.overload
def readNetFromCaffe(bufferProto: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
@_typing.overload
def readNetFromDarknet(cfgFile: str, darknetModel: str = ...) -> Net: ...
@_typing.overload
def readNetFromDarknet(bufferCfg: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
@_typing.overload
def readNetFromModelOptimizer(xml: str, bin: str = ...) -> Net: ...
@_typing.overload
def readNetFromModelOptimizer(bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
@_typing.overload
def readNetFromONNX(onnxFile: str) -> Net: ...
@_typing.overload
def readNetFromONNX(buffer: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
@_typing.overload
def readNetFromTFLite(model: str) -> Net: ...
@_typing.overload
def readNetFromTFLite(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
@_typing.overload
def readNetFromTensorflow(model: str, config: str = ...) -> Net: ...
@_typing.overload
def readNetFromTensorflow(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
def readNetFromTorch(model: str, isBinary: bool = ..., evaluate: bool = ...) -> Net: ...
def readTensorFromONNX(path: str) -> cv2.typing.MatLike: ...
def readTorchBlob(filename: str, isBinary: bool = ...) -> cv2.typing.MatLike: ...
def shrinkCaffeModel(src: str, dst: str, layersTypes: _typing.Sequence[str] = ...) -> None: ...
def softNMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, top_k: int = ..., sigma: float = ..., method: SoftNMSMethod = ...) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
def writeTextGraph(model: str, output: str) -> None: ...

View File

@@ -0,0 +1,37 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class DnnSuperResImpl:
# Functions
@classmethod
def create(cls) -> DnnSuperResImpl: ...
def readModel(self, path: str) -> None: ...
def setModel(self, algo: str, scale: int) -> None: ...
def setPreferableBackend(self, backendId: int) -> None: ...
def setPreferableTarget(self, targetId: int) -> None: ...
@_typing.overload
def upsample(self, img: cv2.typing.MatLike, result: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def upsample(self, img: cv2.UMat, result: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def upsampleMultioutput(self, img: cv2.typing.MatLike, imgs_new: _typing.Sequence[cv2.typing.MatLike], scale_factors: _typing.Sequence[int], node_names: _typing.Sequence[str]) -> None: ...
@_typing.overload
def upsampleMultioutput(self, img: cv2.UMat, imgs_new: _typing.Sequence[cv2.typing.MatLike], scale_factors: _typing.Sequence[int], node_names: _typing.Sequence[str]) -> None: ...
def getScale(self) -> int: ...
def getAlgorithm(self) -> str: ...

View File

@@ -0,0 +1,10 @@
__all__: list[str] = []
# Classes
class DPMDetector:
# Classes
class ObjectDetection:
...

View File

@@ -0,0 +1,43 @@
__all__: list[str] = []
import cv2
import cv2.kinfu
import cv2.typing
import typing as _typing
# Classes
class DynaFu:
# Functions
@classmethod
def create(cls, _params: cv2.kinfu.Params) -> DynaFu: ...
@_typing.overload
def render(self, image: cv2.typing.MatLike | None = ..., cameraPose: cv2.typing.Matx44f = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, image: cv2.UMat | None = ..., cameraPose: cv2.typing.Matx44f = ...) -> cv2.UMat: ...
@_typing.overload
def getCloud(self, points: cv2.typing.MatLike | None = ..., normals: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getCloud(self, points: cv2.UMat | None = ..., normals: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def getPoints(self, points: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getPoints(self, points: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getNormals(self, points: cv2.typing.MatLike, normals: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getNormals(self, points: cv2.UMat, normals: cv2.UMat | None = ...) -> cv2.UMat: ...
def reset(self) -> None: ...
@_typing.overload
def update(self, depth: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def update(self, depth: cv2.UMat) -> bool: ...

View File

@@ -0,0 +1,219 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class FaceRecognizer(cv2.Algorithm):
# Functions
@_typing.overload
def train(self, src: _typing.Sequence[cv2.typing.MatLike], labels: cv2.typing.MatLike) -> None: ...
@_typing.overload
def train(self, src: _typing.Sequence[cv2.UMat], labels: cv2.UMat) -> None: ...
@_typing.overload
def update(self, src: _typing.Sequence[cv2.typing.MatLike], labels: cv2.typing.MatLike) -> None: ...
@_typing.overload
def update(self, src: _typing.Sequence[cv2.UMat], labels: cv2.UMat) -> None: ...
@_typing.overload
def predict_label(self, src: cv2.typing.MatLike) -> int: ...
@_typing.overload
def predict_label(self, src: cv2.UMat) -> int: ...
@_typing.overload
def predict(self, src: cv2.typing.MatLike) -> tuple[int, float]: ...
@_typing.overload
def predict(self, src: cv2.UMat) -> tuple[int, float]: ...
@_typing.overload
def predict_collect(self, src: cv2.typing.MatLike, collector: PredictCollector) -> None: ...
@_typing.overload
def predict_collect(self, src: cv2.UMat, collector: PredictCollector) -> None: ...
def write(self, filename: str) -> None: ...
def read(self, filename: str) -> None: ...
def setLabelInfo(self, label: int, strInfo: str) -> None: ...
def getLabelInfo(self, label: int) -> str: ...
def getLabelsByString(self, str: str) -> _typing.Sequence[int]: ...
class BIF(cv2.Algorithm):
# Functions
def getNumBands(self) -> int: ...
def getNumRotations(self) -> int: ...
@_typing.overload
def compute(self, image: cv2.typing.MatLike, features: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def compute(self, image: cv2.UMat, features: cv2.UMat | None = ...) -> cv2.UMat: ...
@classmethod
def create(cls, num_bands: int = ..., num_rotations: int = ...) -> BIF: ...
class FacemarkKazemi(Facemark):
...
class Facemark(cv2.Algorithm):
# Functions
def loadModel(self, model: str) -> None: ...
@_typing.overload
def fit(self, image: cv2.typing.MatLike, faces: cv2.typing.MatLike, landmarks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[bool, _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def fit(self, image: cv2.UMat, faces: cv2.UMat, landmarks: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[bool, _typing.Sequence[cv2.UMat]]: ...
class FacemarkAAM(FacemarkTrain):
...
class FacemarkTrain(Facemark):
...
class FacemarkLBF(FacemarkTrain):
...
class BasicFaceRecognizer(FaceRecognizer):
# Functions
def getNumComponents(self) -> int: ...
def setNumComponents(self, val: int) -> None: ...
def getThreshold(self) -> float: ...
def setThreshold(self, val: float) -> None: ...
def getProjections(self) -> _typing.Sequence[cv2.typing.MatLike]: ...
def getLabels(self) -> cv2.typing.MatLike: ...
def getEigenValues(self) -> cv2.typing.MatLike: ...
def getEigenVectors(self) -> cv2.typing.MatLike: ...
def getMean(self) -> cv2.typing.MatLike: ...
class EigenFaceRecognizer(BasicFaceRecognizer):
# Functions
@classmethod
def create(cls, num_components: int = ..., threshold: float = ...) -> EigenFaceRecognizer: ...
class FisherFaceRecognizer(BasicFaceRecognizer):
# Functions
@classmethod
def create(cls, num_components: int = ..., threshold: float = ...) -> FisherFaceRecognizer: ...
class LBPHFaceRecognizer(FaceRecognizer):
# Functions
def getGridX(self) -> int: ...
def setGridX(self, val: int) -> None: ...
def getGridY(self) -> int: ...
def setGridY(self, val: int) -> None: ...
def getRadius(self) -> int: ...
def setRadius(self, val: int) -> None: ...
def getNeighbors(self) -> int: ...
def setNeighbors(self, val: int) -> None: ...
def getThreshold(self) -> float: ...
def setThreshold(self, val: float) -> None: ...
def getHistograms(self) -> _typing.Sequence[cv2.typing.MatLike]: ...
def getLabels(self) -> cv2.typing.MatLike: ...
@classmethod
def create(cls, radius: int = ..., neighbors: int = ..., grid_x: int = ..., grid_y: int = ..., threshold: float = ...) -> LBPHFaceRecognizer: ...
class MACE(cv2.Algorithm):
# Functions
def salt(self, passphrase: str) -> None: ...
@_typing.overload
def train(self, images: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
@_typing.overload
def train(self, images: _typing.Sequence[cv2.UMat]) -> None: ...
@_typing.overload
def same(self, query: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def same(self, query: cv2.UMat) -> bool: ...
@classmethod
def load(cls, filename: str, objname: str = ...) -> MACE: ...
@classmethod
def create(cls, IMGSIZE: int = ...) -> MACE: ...
class PredictCollector:
...
class StandardCollector(PredictCollector):
# Functions
def getMinLabel(self) -> int: ...
def getMinDist(self) -> float: ...
def getResults(self, sorted: bool = ...) -> _typing.Sequence[tuple[int, float]]: ...
@classmethod
def create(cls, threshold: float = ...) -> StandardCollector: ...
# Functions
def createFacemarkAAM() -> Facemark: ...
def createFacemarkKazemi() -> Facemark: ...
def createFacemarkLBF() -> Facemark: ...
@_typing.overload
def drawFacemarks(image: cv2.typing.MatLike, points: cv2.typing.MatLike, color: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawFacemarks(image: cv2.UMat, points: cv2.UMat, color: cv2.typing.Scalar = ...) -> cv2.UMat: ...
@_typing.overload
def getFacesHAAR(image: cv2.typing.MatLike, face_cascade_name: str, faces: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike]: ...
@_typing.overload
def getFacesHAAR(image: cv2.UMat, face_cascade_name: str, faces: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat]: ...
def loadDatasetList(imageList: str, annotationList: str, images: _typing.Sequence[str], annotations: _typing.Sequence[str]) -> bool: ...
@_typing.overload
def loadFacePoints(filename: str, points: cv2.typing.MatLike | None = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
@_typing.overload
def loadFacePoints(filename: str, points: cv2.UMat | None = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
@_typing.overload
def loadTrainingData(filename: str, images: _typing.Sequence[str], facePoints: cv2.typing.MatLike | None = ..., delim: str = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
@_typing.overload
def loadTrainingData(filename: str, images: _typing.Sequence[str], facePoints: cv2.UMat | None = ..., delim: str = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
@_typing.overload
def loadTrainingData(imageList: str, groundTruth: str, images: _typing.Sequence[str], facePoints: cv2.typing.MatLike | None = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
@_typing.overload
def loadTrainingData(imageList: str, groundTruth: str, images: _typing.Sequence[str], facePoints: cv2.UMat | None = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
@_typing.overload
def loadTrainingData(filename: _typing.Sequence[str], trainlandmarks: _typing.Sequence[_typing.Sequence[cv2.typing.Point2f]], trainimages: _typing.Sequence[str]) -> bool: ...

View File

@@ -0,0 +1,83 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
CALIB_USE_INTRINSIC_GUESS: int
CALIB_RECOMPUTE_EXTRINSIC: int
CALIB_CHECK_COND: int
CALIB_FIX_SKEW: int
CALIB_FIX_K1: int
CALIB_FIX_K2: int
CALIB_FIX_K3: int
CALIB_FIX_K4: int
CALIB_FIX_INTRINSIC: int
CALIB_FIX_PRINCIPAL_POINT: int
CALIB_ZERO_DISPARITY: int
CALIB_FIX_FOCAL_LENGTH: int
# Functions
@_typing.overload
def calibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints: _typing.Sequence[cv2.typing.MatLike], image_size: cv2.typing.Size, K: cv2.typing.MatLike, D: cv2.typing.MatLike, rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def calibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints: _typing.Sequence[cv2.UMat], image_size: cv2.typing.Size, K: cv2.UMat, D: cv2.UMat, rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def distortPoints(undistorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, distorted: cv2.typing.MatLike | None = ..., alpha: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def distortPoints(undistorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, distorted: cv2.UMat | None = ..., alpha: float = ...) -> cv2.UMat: ...
@_typing.overload
def distortPoints(undistorted: cv2.typing.MatLike, Kundistorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, distorted: cv2.typing.MatLike | None = ..., alpha: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def distortPoints(undistorted: cv2.UMat, Kundistorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, distorted: cv2.UMat | None = ..., alpha: float = ...) -> cv2.UMat: ...
@_typing.overload
def estimateNewCameraMatrixForUndistortRectify(K: cv2.typing.MatLike, D: cv2.typing.MatLike, image_size: cv2.typing.Size, R: cv2.typing.MatLike, P: cv2.typing.MatLike | None = ..., balance: float = ..., new_size: cv2.typing.Size = ..., fov_scale: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def estimateNewCameraMatrixForUndistortRectify(K: cv2.UMat, D: cv2.UMat, image_size: cv2.typing.Size, R: cv2.UMat, P: cv2.UMat | None = ..., balance: float = ..., new_size: cv2.typing.Size = ..., fov_scale: float = ...) -> cv2.UMat: ...
@_typing.overload
def initUndistortRectifyMap(K: cv2.typing.MatLike, D: cv2.typing.MatLike, R: cv2.typing.MatLike, P: cv2.typing.MatLike, size: cv2.typing.Size, m1type: int, map1: cv2.typing.MatLike | None = ..., map2: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def initUndistortRectifyMap(K: cv2.UMat, D: cv2.UMat, R: cv2.UMat, P: cv2.UMat, size: cv2.typing.Size, m1type: int, map1: cv2.UMat | None = ..., map2: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def projectPoints(objectPoints: cv2.typing.MatLike, rvec: cv2.typing.MatLike, tvec: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, imagePoints: cv2.typing.MatLike | None = ..., alpha: float = ..., jacobian: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def projectPoints(objectPoints: cv2.UMat, rvec: cv2.UMat, tvec: cv2.UMat, K: cv2.UMat, D: cv2.UMat, imagePoints: cv2.UMat | None = ..., alpha: float = ..., jacobian: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def solvePnP(objectPoints: cv2.typing.MatLike, imagePoints: cv2.typing.MatLike, cameraMatrix: cv2.typing.MatLike, distCoeffs: cv2.typing.MatLike, rvec: cv2.typing.MatLike | None = ..., tvec: cv2.typing.MatLike | None = ..., useExtrinsicGuess: bool = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def solvePnP(objectPoints: cv2.UMat, imagePoints: cv2.UMat, cameraMatrix: cv2.UMat, distCoeffs: cv2.UMat, rvec: cv2.UMat | None = ..., tvec: cv2.UMat | None = ..., useExtrinsicGuess: bool = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[bool, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def stereoCalibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints1: _typing.Sequence[cv2.typing.MatLike], imagePoints2: _typing.Sequence[cv2.typing.MatLike], K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike | None = ..., T: cv2.typing.MatLike | None = ..., rvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., tvecs: _typing.Sequence[cv2.typing.MatLike] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, _typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def stereoCalibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints1: _typing.Sequence[cv2.UMat], imagePoints2: _typing.Sequence[cv2.UMat], K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat | None = ..., T: cv2.UMat | None = ..., rvecs: _typing.Sequence[cv2.UMat] | None = ..., tvecs: _typing.Sequence[cv2.UMat] | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, _typing.Sequence[cv2.UMat], _typing.Sequence[cv2.UMat]]: ...
@_typing.overload
def stereoCalibrate(objectPoints: _typing.Sequence[cv2.typing.MatLike], imagePoints1: _typing.Sequence[cv2.typing.MatLike], imagePoints2: _typing.Sequence[cv2.typing.MatLike], K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike | None = ..., T: cv2.typing.MatLike | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def stereoCalibrate(objectPoints: _typing.Sequence[cv2.UMat], imagePoints1: _typing.Sequence[cv2.UMat], imagePoints2: _typing.Sequence[cv2.UMat], K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat | None = ..., T: cv2.UMat | None = ..., flags: int = ..., criteria: cv2.typing.TermCriteria = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def stereoRectify(K1: cv2.typing.MatLike, D1: cv2.typing.MatLike, K2: cv2.typing.MatLike, D2: cv2.typing.MatLike, imageSize: cv2.typing.Size, R: cv2.typing.MatLike, tvec: cv2.typing.MatLike, flags: int, R1: cv2.typing.MatLike | None = ..., R2: cv2.typing.MatLike | None = ..., P1: cv2.typing.MatLike | None = ..., P2: cv2.typing.MatLike | None = ..., Q: cv2.typing.MatLike | None = ..., newImageSize: cv2.typing.Size = ..., balance: float = ..., fov_scale: float = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def stereoRectify(K1: cv2.UMat, D1: cv2.UMat, K2: cv2.UMat, D2: cv2.UMat, imageSize: cv2.typing.Size, R: cv2.UMat, tvec: cv2.UMat, flags: int, R1: cv2.UMat | None = ..., R2: cv2.UMat | None = ..., P1: cv2.UMat | None = ..., P2: cv2.UMat | None = ..., Q: cv2.UMat | None = ..., newImageSize: cv2.typing.Size = ..., balance: float = ..., fov_scale: float = ...) -> tuple[cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def undistortImage(distorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, undistorted: cv2.typing.MatLike | None = ..., Knew: cv2.typing.MatLike | None = ..., new_size: cv2.typing.Size = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def undistortImage(distorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, undistorted: cv2.UMat | None = ..., Knew: cv2.UMat | None = ..., new_size: cv2.typing.Size = ...) -> cv2.UMat: ...
@_typing.overload
def undistortPoints(distorted: cv2.typing.MatLike, K: cv2.typing.MatLike, D: cv2.typing.MatLike, undistorted: cv2.typing.MatLike | None = ..., R: cv2.typing.MatLike | None = ..., P: cv2.typing.MatLike | None = ..., criteria: cv2.typing.TermCriteria = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def undistortPoints(distorted: cv2.UMat, K: cv2.UMat, D: cv2.UMat, undistorted: cv2.UMat | None = ..., R: cv2.UMat | None = ..., P: cv2.UMat | None = ..., criteria: cv2.typing.TermCriteria = ...) -> cv2.UMat: ...

View File

@@ -0,0 +1,64 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
FLANN_INDEX_TYPE_8U: int
FLANN_INDEX_TYPE_8S: int
FLANN_INDEX_TYPE_16U: int
FLANN_INDEX_TYPE_16S: int
FLANN_INDEX_TYPE_32S: int
FLANN_INDEX_TYPE_32F: int
FLANN_INDEX_TYPE_64F: int
FLANN_INDEX_TYPE_STRING: int
FLANN_INDEX_TYPE_BOOL: int
FLANN_INDEX_TYPE_ALGORITHM: int
LAST_VALUE_FLANN_INDEX_TYPE: int
FlannIndexType = int
"""One of [FLANN_INDEX_TYPE_8U, FLANN_INDEX_TYPE_8S, FLANN_INDEX_TYPE_16U, FLANN_INDEX_TYPE_16S, FLANN_INDEX_TYPE_32S, FLANN_INDEX_TYPE_32F, FLANN_INDEX_TYPE_64F, FLANN_INDEX_TYPE_STRING, FLANN_INDEX_TYPE_BOOL, FLANN_INDEX_TYPE_ALGORITHM, LAST_VALUE_FLANN_INDEX_TYPE]"""
# Classes
class Index:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, features: cv2.typing.MatLike, params: cv2.typing.IndexParams, distType: int = ...) -> None: ...
@_typing.overload
def __init__(self, features: cv2.UMat, params: cv2.typing.IndexParams, distType: int = ...) -> None: ...
@_typing.overload
def build(self, features: cv2.typing.MatLike, params: cv2.typing.IndexParams, distType: int = ...) -> None: ...
@_typing.overload
def build(self, features: cv2.UMat, params: cv2.typing.IndexParams, distType: int = ...) -> None: ...
@_typing.overload
def knnSearch(self, query: cv2.typing.MatLike, knn: int, indices: cv2.typing.MatLike | None = ..., dists: cv2.typing.MatLike | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def knnSearch(self, query: cv2.UMat, knn: int, indices: cv2.UMat | None = ..., dists: cv2.UMat | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def radiusSearch(self, query: cv2.typing.MatLike, radius: float, maxResults: int, indices: cv2.typing.MatLike | None = ..., dists: cv2.typing.MatLike | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[int, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def radiusSearch(self, query: cv2.UMat, radius: float, maxResults: int, indices: cv2.UMat | None = ..., dists: cv2.UMat | None = ..., params: cv2.typing.SearchParams = ...) -> tuple[int, cv2.UMat, cv2.UMat]: ...
def save(self, filename: str) -> None: ...
@_typing.overload
def load(self, features: cv2.typing.MatLike, filename: str) -> bool: ...
@_typing.overload
def load(self, features: cv2.UMat, filename: str) -> bool: ...
def release(self) -> None: ...
def getDistance(self) -> int: ...
def getAlgorithm(self) -> int: ...

View File

@@ -0,0 +1,98 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
LINEAR: int
SINUS: int
ONE_STEP: int
MULTI_STEP: int
ITERATIVE: int
# Functions
@_typing.overload
def FT02D_FL_process(matrix: cv2.typing.MatLike, radius: int, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT02D_FL_process(matrix: cv2.UMat, radius: int, output: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT02D_FL_process_float(matrix: cv2.typing.MatLike, radius: int, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT02D_FL_process_float(matrix: cv2.UMat, radius: int, output: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT02D_components(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, components: cv2.typing.MatLike | None = ..., mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT02D_components(matrix: cv2.UMat, kernel: cv2.UMat, components: cv2.UMat | None = ..., mask: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT02D_inverseFT(components: cv2.typing.MatLike, kernel: cv2.typing.MatLike, width: int, height: int, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT02D_inverseFT(components: cv2.UMat, kernel: cv2.UMat, width: int, height: int, output: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT02D_iteration(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, mask: cv2.typing.MatLike, firstStop: bool, output: cv2.typing.MatLike | None = ..., maskOutput: cv2.typing.MatLike | None = ...) -> tuple[int, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def FT02D_iteration(matrix: cv2.UMat, kernel: cv2.UMat, mask: cv2.UMat, firstStop: bool, output: cv2.UMat | None = ..., maskOutput: cv2.UMat | None = ...) -> tuple[int, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def FT02D_process(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, output: cv2.typing.MatLike | None = ..., mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT02D_process(matrix: cv2.UMat, kernel: cv2.UMat, output: cv2.UMat | None = ..., mask: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT12D_components(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, components: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT12D_components(matrix: cv2.UMat, kernel: cv2.UMat, components: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT12D_createPolynomMatrixHorizontal(radius: int, chn: int, matrix: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT12D_createPolynomMatrixHorizontal(radius: int, chn: int, matrix: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT12D_createPolynomMatrixVertical(radius: int, chn: int, matrix: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT12D_createPolynomMatrixVertical(radius: int, chn: int, matrix: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT12D_inverseFT(components: cv2.typing.MatLike, kernel: cv2.typing.MatLike, width: int, height: int, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT12D_inverseFT(components: cv2.UMat, kernel: cv2.UMat, width: int, height: int, output: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def FT12D_polynomial(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, c00: cv2.typing.MatLike | None = ..., c10: cv2.typing.MatLike | None = ..., c01: cv2.typing.MatLike | None = ..., components: cv2.typing.MatLike | None = ..., mask: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def FT12D_polynomial(matrix: cv2.UMat, kernel: cv2.UMat, c00: cv2.UMat | None = ..., c10: cv2.UMat | None = ..., c01: cv2.UMat | None = ..., components: cv2.UMat | None = ..., mask: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def FT12D_process(matrix: cv2.typing.MatLike, kernel: cv2.typing.MatLike, output: cv2.typing.MatLike | None = ..., mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def FT12D_process(matrix: cv2.UMat, kernel: cv2.UMat, output: cv2.UMat | None = ..., mask: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def createKernel(function: int, radius: int, chn: int, kernel: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def createKernel(function: int, radius: int, chn: int, kernel: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def createKernel1(A: cv2.typing.MatLike, B: cv2.typing.MatLike, chn: int, kernel: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def createKernel1(A: cv2.UMat, B: cv2.UMat, chn: int, kernel: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def filter(image: cv2.typing.MatLike, kernel: cv2.typing.MatLike, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def filter(image: cv2.UMat, kernel: cv2.UMat, output: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def inpaint(image: cv2.typing.MatLike, mask: cv2.typing.MatLike, radius: int, function: int, algorithm: int, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def inpaint(image: cv2.UMat, mask: cv2.UMat, radius: int, function: int, algorithm: int, output: cv2.UMat | None = ...) -> cv2.UMat: ...

View File

@@ -0,0 +1,323 @@
__all__ = ['op', 'kernel']
import sys
import cv2 as cv
# NB: Register function in specific module
def register(mname):
def parameterized(func):
sys.modules[mname].__dict__[func.__name__] = func
return func
return parameterized
@register('cv2.gapi')
def networks(*args):
return cv.gapi_GNetPackage(list(map(cv.detail.strip, args)))
@register('cv2.gapi')
def compile_args(*args):
return list(map(cv.GCompileArg, args))
@register('cv2')
def GIn(*args):
return [*args]
@register('cv2')
def GOut(*args):
return [*args]
@register('cv2')
def gin(*args):
return [*args]
@register('cv2.gapi')
def descr_of(*args):
return [*args]
@register('cv2')
class GOpaque():
# NB: Inheritance from c++ class cause segfault.
# So just aggregate cv.GOpaqueT instead of inheritance
def __new__(cls, argtype):
return cv.GOpaqueT(argtype)
class Bool():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_BOOL)
class Int():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_INT)
class Int64():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_INT64)
class UInt64():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_UINT64)
class Double():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_DOUBLE)
class Float():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_FLOAT)
class String():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_STRING)
class Point():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_POINT)
class Point2f():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_POINT2F)
class Point3f():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_POINT3F)
class Size():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_SIZE)
class Rect():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_RECT)
class Prim():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_DRAW_PRIM)
class Any():
def __new__(self):
return cv.GOpaqueT(cv.gapi.CV_ANY)
@register('cv2')
class GArray():
# NB: Inheritance from c++ class cause segfault.
# So just aggregate cv.GArrayT instead of inheritance
def __new__(cls, argtype):
return cv.GArrayT(argtype)
class Bool():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_BOOL)
class Int():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_INT)
class Int64():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_INT64)
class UInt64():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_UINT64)
class Double():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_DOUBLE)
class Float():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_FLOAT)
class String():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_STRING)
class Point():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_POINT)
class Point2f():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_POINT2F)
class Point3f():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_POINT3F)
class Size():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_SIZE)
class Rect():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_RECT)
class Scalar():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_SCALAR)
class Mat():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_MAT)
class GMat():
def __new__(self):
return cv.GArrayT(cv.gapi.CV_GMAT)
class Prim():
def __new__(self):
return cv.GArray(cv.gapi.CV_DRAW_PRIM)
class Any():
def __new__(self):
return cv.GArray(cv.gapi.CV_ANY)
# NB: Top lvl decorator takes arguments
def op(op_id, in_types, out_types):
garray_types= {
cv.GArray.Bool: cv.gapi.CV_BOOL,
cv.GArray.Int: cv.gapi.CV_INT,
cv.GArray.Int64: cv.gapi.CV_INT64,
cv.GArray.UInt64: cv.gapi.CV_UINT64,
cv.GArray.Double: cv.gapi.CV_DOUBLE,
cv.GArray.Float: cv.gapi.CV_FLOAT,
cv.GArray.String: cv.gapi.CV_STRING,
cv.GArray.Point: cv.gapi.CV_POINT,
cv.GArray.Point2f: cv.gapi.CV_POINT2F,
cv.GArray.Point3f: cv.gapi.CV_POINT3F,
cv.GArray.Size: cv.gapi.CV_SIZE,
cv.GArray.Rect: cv.gapi.CV_RECT,
cv.GArray.Scalar: cv.gapi.CV_SCALAR,
cv.GArray.Mat: cv.gapi.CV_MAT,
cv.GArray.GMat: cv.gapi.CV_GMAT,
cv.GArray.Prim: cv.gapi.CV_DRAW_PRIM,
cv.GArray.Any: cv.gapi.CV_ANY
}
gopaque_types= {
cv.GOpaque.Size: cv.gapi.CV_SIZE,
cv.GOpaque.Rect: cv.gapi.CV_RECT,
cv.GOpaque.Bool: cv.gapi.CV_BOOL,
cv.GOpaque.Int: cv.gapi.CV_INT,
cv.GOpaque.Int64: cv.gapi.CV_INT64,
cv.GOpaque.UInt64: cv.gapi.CV_UINT64,
cv.GOpaque.Double: cv.gapi.CV_DOUBLE,
cv.GOpaque.Float: cv.gapi.CV_FLOAT,
cv.GOpaque.String: cv.gapi.CV_STRING,
cv.GOpaque.Point: cv.gapi.CV_POINT,
cv.GOpaque.Point2f: cv.gapi.CV_POINT2F,
cv.GOpaque.Point3f: cv.gapi.CV_POINT3F,
cv.GOpaque.Size: cv.gapi.CV_SIZE,
cv.GOpaque.Rect: cv.gapi.CV_RECT,
cv.GOpaque.Prim: cv.gapi.CV_DRAW_PRIM,
cv.GOpaque.Any: cv.gapi.CV_ANY
}
type2str = {
cv.gapi.CV_BOOL: 'cv.gapi.CV_BOOL' ,
cv.gapi.CV_INT: 'cv.gapi.CV_INT' ,
cv.gapi.CV_INT64: 'cv.gapi.CV_INT64' ,
cv.gapi.CV_UINT64: 'cv.gapi.CV_UINT64' ,
cv.gapi.CV_DOUBLE: 'cv.gapi.CV_DOUBLE' ,
cv.gapi.CV_FLOAT: 'cv.gapi.CV_FLOAT' ,
cv.gapi.CV_STRING: 'cv.gapi.CV_STRING' ,
cv.gapi.CV_POINT: 'cv.gapi.CV_POINT' ,
cv.gapi.CV_POINT2F: 'cv.gapi.CV_POINT2F' ,
cv.gapi.CV_POINT3F: 'cv.gapi.CV_POINT3F' ,
cv.gapi.CV_SIZE: 'cv.gapi.CV_SIZE',
cv.gapi.CV_RECT: 'cv.gapi.CV_RECT',
cv.gapi.CV_SCALAR: 'cv.gapi.CV_SCALAR',
cv.gapi.CV_MAT: 'cv.gapi.CV_MAT',
cv.gapi.CV_GMAT: 'cv.gapi.CV_GMAT',
cv.gapi.CV_DRAW_PRIM: 'cv.gapi.CV_DRAW_PRIM'
}
# NB: Second lvl decorator takes class to decorate
def op_with_params(cls):
if not in_types:
raise Exception('{} operation should have at least one input!'.format(cls.__name__))
if not out_types:
raise Exception('{} operation should have at least one output!'.format(cls.__name__))
for i, t in enumerate(out_types):
if t not in [cv.GMat, cv.GScalar, *garray_types, *gopaque_types]:
raise Exception('{} unsupported output type: {} in position: {}'
.format(cls.__name__, t.__name__, i))
def on(*args):
if len(in_types) != len(args):
raise Exception('Invalid number of input elements!\nExpected: {}, Actual: {}'
.format(len(in_types), len(args)))
for i, (t, a) in enumerate(zip(in_types, args)):
if t in garray_types:
if not isinstance(a, cv.GArrayT):
raise Exception("{} invalid type for argument {}.\nExpected: {}, Actual: {}"
.format(cls.__name__, i, cv.GArrayT.__name__, type(a).__name__))
elif a.type() != garray_types[t]:
raise Exception("{} invalid GArrayT type for argument {}.\nExpected: {}, Actual: {}"
.format(cls.__name__, i, type2str[garray_types[t]], type2str[a.type()]))
elif t in gopaque_types:
if not isinstance(a, cv.GOpaqueT):
raise Exception("{} invalid type for argument {}.\nExpected: {}, Actual: {}"
.format(cls.__name__, i, cv.GOpaqueT.__name__, type(a).__name__))
elif a.type() != gopaque_types[t]:
raise Exception("{} invalid GOpaque type for argument {}.\nExpected: {}, Actual: {}"
.format(cls.__name__, i, type2str[gopaque_types[t]], type2str[a.type()]))
else:
if t != type(a):
raise Exception('{} invalid input type for argument {}.\nExpected: {}, Actual: {}'
.format(cls.__name__, i, t.__name__, type(a).__name__))
op = cv.gapi.__op(op_id, cls.outMeta, *args)
out_protos = []
for i, out_type in enumerate(out_types):
if out_type == cv.GMat:
out_protos.append(op.getGMat())
elif out_type == cv.GScalar:
out_protos.append(op.getGScalar())
elif out_type in gopaque_types:
out_protos.append(op.getGOpaque(gopaque_types[out_type]))
elif out_type in garray_types:
out_protos.append(op.getGArray(garray_types[out_type]))
else:
raise Exception("""In {}: G-API operation can't produce the output with type: {} in position: {}"""
.format(cls.__name__, out_type.__name__, i))
return tuple(out_protos) if len(out_protos) != 1 else out_protos[0]
# NB: Extend operation class
cls.id = op_id
cls.on = staticmethod(on)
return cls
return op_with_params
def kernel(op_cls):
# NB: Second lvl decorator takes class to decorate
def kernel_with_params(cls):
# NB: Add new members to kernel class
cls.id = op_cls.id
cls.outMeta = op_cls.outMeta
return cls
return kernel_with_params
cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline

View File

@@ -0,0 +1,349 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
from cv2.gapi import core as core
from cv2.gapi import ie as ie
from cv2.gapi import imgproc as imgproc
from cv2.gapi import oak as oak
from cv2.gapi import onnx as onnx
from cv2.gapi import ot as ot
from cv2.gapi import ov as ov
from cv2.gapi import own as own
from cv2.gapi import render as render
from cv2.gapi import streaming as streaming
from cv2.gapi import video as video
from cv2.gapi import wip as wip
# Enumerations
StereoOutputFormat_DEPTH_FLOAT16: int
STEREO_OUTPUT_FORMAT_DEPTH_FLOAT16: int
StereoOutputFormat_DEPTH_FLOAT32: int
STEREO_OUTPUT_FORMAT_DEPTH_FLOAT32: int
StereoOutputFormat_DISPARITY_FIXED16_11_5: int
STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_11_5: int
StereoOutputFormat_DISPARITY_FIXED16_12_4: int
STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_12_4: int
StereoOutputFormat_DEPTH_16F: int
STEREO_OUTPUT_FORMAT_DEPTH_16F: int
StereoOutputFormat_DEPTH_32F: int
STEREO_OUTPUT_FORMAT_DEPTH_32F: int
StereoOutputFormat_DISPARITY_16Q_10_5: int
STEREO_OUTPUT_FORMAT_DISPARITY_16Q_10_5: int
StereoOutputFormat_DISPARITY_16Q_11_4: int
STEREO_OUTPUT_FORMAT_DISPARITY_16Q_11_4: int
StereoOutputFormat = int
"""One of [StereoOutputFormat_DEPTH_FLOAT16, STEREO_OUTPUT_FORMAT_DEPTH_FLOAT16, StereoOutputFormat_DEPTH_FLOAT32, STEREO_OUTPUT_FORMAT_DEPTH_FLOAT32, StereoOutputFormat_DISPARITY_FIXED16_11_5, STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_11_5, StereoOutputFormat_DISPARITY_FIXED16_12_4, STEREO_OUTPUT_FORMAT_DISPARITY_FIXED16_12_4, StereoOutputFormat_DEPTH_16F, STEREO_OUTPUT_FORMAT_DEPTH_16F, StereoOutputFormat_DEPTH_32F, STEREO_OUTPUT_FORMAT_DEPTH_32F, StereoOutputFormat_DISPARITY_16Q_10_5, STEREO_OUTPUT_FORMAT_DISPARITY_16Q_10_5, StereoOutputFormat_DISPARITY_16Q_11_4, STEREO_OUTPUT_FORMAT_DISPARITY_16Q_11_4]"""
CV_BOOL: int
CV_INT: int
CV_INT64: int
CV_UINT64: int
CV_DOUBLE: int
CV_FLOAT: int
CV_STRING: int
CV_POINT: int
CV_POINT2F: int
CV_POINT3F: int
CV_SIZE: int
CV_RECT: int
CV_SCALAR: int
CV_MAT: int
CV_GMAT: int
CV_DRAW_PRIM: int
CV_ANY: int
ArgType = int
"""One of [CV_BOOL, CV_INT, CV_INT64, CV_UINT64, CV_DOUBLE, CV_FLOAT, CV_STRING, CV_POINT, CV_POINT2F, CV_POINT3F, CV_SIZE, CV_RECT, CV_SCALAR, CV_MAT, CV_GMAT, CV_DRAW_PRIM, CV_ANY]"""
# Classes
class GNetParam:
...
class GNetPackage:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, nets: _typing.Sequence[GNetParam]) -> None: ...
# Functions
def BGR2Gray(src: cv2.GMat) -> cv2.GMat: ...
def BGR2I420(src: cv2.GMat) -> cv2.GMat: ...
def BGR2LUV(src: cv2.GMat) -> cv2.GMat: ...
def BGR2RGB(src: cv2.GMat) -> cv2.GMat: ...
def BGR2YUV(src: cv2.GMat) -> cv2.GMat: ...
def BayerGR2RGB(src_gr: cv2.GMat) -> cv2.GMat: ...
def Canny(image: cv2.GMat, threshold1: float, threshold2: float, apertureSize: int = ..., L2gradient: bool = ...) -> cv2.GMat: ...
def I4202BGR(src: cv2.GMat) -> cv2.GMat: ...
def I4202RGB(src: cv2.GMat) -> cv2.GMat: ...
def LUT(src: cv2.GMat, lut: cv2.typing.MatLike) -> cv2.GMat: ...
def LUV2BGR(src: cv2.GMat) -> cv2.GMat: ...
def Laplacian(src: cv2.GMat, ddepth: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ...) -> cv2.GMat: ...
def NV12toBGR(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ...
def NV12toGray(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ...
def NV12toRGB(src_y: cv2.GMat, src_uv: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def RGB2Gray(src: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def RGB2Gray(src: cv2.GMat, rY: float, gY: float, bY: float) -> cv2.GMat: ...
def RGB2HSV(src: cv2.GMat) -> cv2.GMat: ...
def RGB2I420(src: cv2.GMat) -> cv2.GMat: ...
def RGB2Lab(src: cv2.GMat) -> cv2.GMat: ...
def RGB2YUV(src: cv2.GMat) -> cv2.GMat: ...
def RGB2YUV422(src: cv2.GMat) -> cv2.GMat: ...
def Sobel(src: cv2.GMat, ddepth: int, dx: int, dy: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def SobelXY(src: cv2.GMat, ddepth: int, order: int, ksize: int = ..., scale: float = ..., delta: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> tuple[cv2.GMat, cv2.GMat]: ...
def YUV2BGR(src: cv2.GMat) -> cv2.GMat: ...
def YUV2RGB(src: cv2.GMat) -> cv2.GMat: ...
def absDiff(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
def absDiffC(src: cv2.GMat, c: cv2.GScalar) -> cv2.GMat: ...
def add(src1: cv2.GMat, src2: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def addC(src1: cv2.GMat, c: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def addC(c: cv2.GScalar, src1: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ...
def addWeighted(src1: cv2.GMat, alpha: float, src2: cv2.GMat, beta: float, gamma: float, ddepth: int = ...) -> cv2.GMat: ...
def bilateralFilter(src: cv2.GMat, d: int, sigmaColor: float, sigmaSpace: float, borderType: int = ...) -> cv2.GMat: ...
@_typing.overload
def bitwise_and(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def bitwise_and(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
def bitwise_not(src: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def bitwise_or(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def bitwise_or(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def bitwise_xor(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def bitwise_xor(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
def blur(src: cv2.GMat, ksize: cv2.typing.Size, anchor: cv2.typing.Point = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
@_typing.overload
def boundingRect(src: cv2.GMat) -> cv2.GOpaqueT: ...
@_typing.overload
def boundingRect(src: cv2.GArrayT) -> cv2.GOpaqueT: ...
@_typing.overload
def boundingRect(src: cv2.GArrayT) -> cv2.GOpaqueT: ...
def boxFilter(src: cv2.GMat, dtype: int, ksize: cv2.typing.Size, anchor: cv2.typing.Point = ..., normalize: bool = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def cartToPolar(x: cv2.GMat, y: cv2.GMat, angleInDegrees: bool = ...) -> tuple[cv2.GMat, cv2.GMat]: ...
@_typing.overload
def cmpEQ(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpEQ(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def cmpGE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpGE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def cmpGT(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpGT(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def cmpLE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpLE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def cmpLT(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpLT(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def cmpNE(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def cmpNE(src1: cv2.GMat, src2: cv2.GScalar) -> cv2.GMat: ...
def combine(lhs: cv2.GKernelPackage, rhs: cv2.GKernelPackage) -> cv2.GKernelPackage: ...
@_typing.overload
def concatHor(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def concatHor(v: _typing.Sequence[cv2.GMat]) -> cv2.GMat: ...
@_typing.overload
def concatVert(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
@_typing.overload
def concatVert(v: _typing.Sequence[cv2.GMat]) -> cv2.GMat: ...
def convertTo(src: cv2.GMat, rdepth: int, alpha: float = ..., beta: float = ...) -> cv2.GMat: ...
def copy(in_: cv2.GMat) -> cv2.GMat: ...
def countNonZero(src: cv2.GMat) -> cv2.GOpaqueT: ...
def crop(src: cv2.GMat, rect: cv2.typing.Rect) -> cv2.GMat: ...
def dilate(src: cv2.GMat, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def dilate3x3(src: cv2.GMat, iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def div(src1: cv2.GMat, src2: cv2.GMat, scale: float, ddepth: int = ...) -> cv2.GMat: ...
def divC(src: cv2.GMat, divisor: cv2.GScalar, scale: float, ddepth: int = ...) -> cv2.GMat: ...
def divRC(divident: cv2.GScalar, src: cv2.GMat, scale: float, ddepth: int = ...) -> cv2.GMat: ...
def equalizeHist(src: cv2.GMat) -> cv2.GMat: ...
def erode(src: cv2.GMat, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def erode3x3(src: cv2.GMat, iterations: int = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def filter2D(src: cv2.GMat, ddepth: int, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., delta: cv2.typing.Scalar = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def flip(src: cv2.GMat, flipCode: int) -> cv2.GMat: ...
def gaussianBlur(src: cv2.GMat, ksize: cv2.typing.Size, sigmaX: float, sigmaY: float = ..., borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def goodFeaturesToTrack(image: cv2.GMat, maxCorners: int, qualityLevel: float, minDistance: float, mask: cv2.typing.MatLike | None = ..., blockSize: int = ..., useHarrisDetector: bool = ..., k: float = ...) -> cv2.GArrayT: ...
def inRange(src: cv2.GMat, threshLow: cv2.GScalar, threshUp: cv2.GScalar) -> cv2.GMat: ...
@_typing.overload
def infer(name: str, inputs: cv2.GInferInputs) -> cv2.GInferOutputs: ...
@_typing.overload
def infer(name: str, roi: cv2.GOpaqueT, inputs: cv2.GInferInputs) -> cv2.GInferOutputs: ...
@_typing.overload
def infer(name: str, rois: cv2.GArrayT, inputs: cv2.GInferInputs) -> cv2.GInferListOutputs: ...
def infer2(name: str, in_: cv2.GMat, inputs: cv2.GInferListInputs) -> cv2.GInferListOutputs: ...
def integral(src: cv2.GMat, sdepth: int = ..., sqdepth: int = ...) -> tuple[cv2.GMat, cv2.GMat]: ...
@_typing.overload
def kmeans(data: cv2.GMat, K: int, bestLabels: cv2.GMat, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GMat, cv2.GMat]: ...
@_typing.overload
def kmeans(data: cv2.GMat, K: int, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GMat, cv2.GMat]: ...
@_typing.overload
def kmeans(data: cv2.GArrayT, K: int, bestLabels: cv2.GArrayT, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GArrayT, cv2.GArrayT]: ...
@_typing.overload
def kmeans(data: cv2.GArrayT, K: int, bestLabels: cv2.GArrayT, criteria: cv2.typing.TermCriteria, attempts: int, flags: cv2.KmeansFlags) -> tuple[cv2.GOpaqueT, cv2.GArrayT, cv2.GArrayT]: ...
def mask(src: cv2.GMat, mask: cv2.GMat) -> cv2.GMat: ...
def max(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
def mean(src: cv2.GMat) -> cv2.GScalar: ...
def medianBlur(src: cv2.GMat, ksize: int) -> cv2.GMat: ...
def merge3(src1: cv2.GMat, src2: cv2.GMat, src3: cv2.GMat) -> cv2.GMat: ...
def merge4(src1: cv2.GMat, src2: cv2.GMat, src3: cv2.GMat, src4: cv2.GMat) -> cv2.GMat: ...
def min(src1: cv2.GMat, src2: cv2.GMat) -> cv2.GMat: ...
def morphologyEx(src: cv2.GMat, op: cv2.MorphTypes, kernel: cv2.typing.MatLike, anchor: cv2.typing.Point = ..., iterations: int = ..., borderType: cv2.BorderTypes = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def mul(src1: cv2.GMat, src2: cv2.GMat, scale: float = ..., ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def mulC(src: cv2.GMat, multiplier: float, ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def mulC(src: cv2.GMat, multiplier: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def mulC(multiplier: cv2.GScalar, src: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ...
def normInf(src: cv2.GMat) -> cv2.GScalar: ...
def normL1(src: cv2.GMat) -> cv2.GScalar: ...
def normL2(src: cv2.GMat) -> cv2.GScalar: ...
def normalize(src: cv2.GMat, alpha: float, beta: float, norm_type: int, ddepth: int = ...) -> cv2.GMat: ...
@_typing.overload
def parseSSD(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float = ..., filterLabel: int = ...) -> tuple[cv2.GArrayT, cv2.GArrayT]: ...
@_typing.overload
def parseSSD(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float, alignmentToSquare: bool, filterOutOfBounds: bool) -> cv2.GArrayT: ...
def parseYolo(in_: cv2.GMat, inSz: cv2.GOpaqueT, confidenceThreshold: float = ..., nmsThreshold: float = ..., anchors: _typing.Sequence[float] = ...) -> tuple[cv2.GArrayT, cv2.GArrayT]: ...
def phase(x: cv2.GMat, y: cv2.GMat, angleInDegrees: bool = ...) -> cv2.GMat: ...
def polarToCart(magnitude: cv2.GMat, angle: cv2.GMat, angleInDegrees: bool = ...) -> tuple[cv2.GMat, cv2.GMat]: ...
def remap(src: cv2.GMat, map1: cv2.typing.MatLike, map2: cv2.typing.MatLike, interpolation: int, borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def resize(src: cv2.GMat, dsize: cv2.typing.Size, fx: float = ..., fy: float = ..., interpolation: int = ...) -> cv2.GMat: ...
def select(src1: cv2.GMat, src2: cv2.GMat, mask: cv2.GMat) -> cv2.GMat: ...
def sepFilter(src: cv2.GMat, ddepth: int, kernelX: cv2.typing.MatLike, kernelY: cv2.typing.MatLike, anchor: cv2.typing.Point, delta: cv2.typing.Scalar, borderType: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def split3(src: cv2.GMat) -> tuple[cv2.GMat, cv2.GMat, cv2.GMat]: ...
def split4(src: cv2.GMat) -> tuple[cv2.GMat, cv2.GMat, cv2.GMat, cv2.GMat]: ...
def sqrt(src: cv2.GMat) -> cv2.GMat: ...
def sub(src1: cv2.GMat, src2: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ...
def subC(src: cv2.GMat, c: cv2.GScalar, ddepth: int = ...) -> cv2.GMat: ...
def subRC(c: cv2.GScalar, src: cv2.GMat, ddepth: int = ...) -> cv2.GMat: ...
def sum(src: cv2.GMat) -> cv2.GScalar: ...
@_typing.overload
def threshold(src: cv2.GMat, thresh: cv2.GScalar, maxval: cv2.GScalar, type: int) -> cv2.GMat: ...
@_typing.overload
def threshold(src: cv2.GMat, maxval: cv2.GScalar, type: int) -> tuple[cv2.GMat, cv2.GScalar]: ...
def transpose(src: cv2.GMat) -> cv2.GMat: ...
def warpAffine(src: cv2.GMat, M: cv2.typing.MatLike, dsize: cv2.typing.Size, flags: int = ..., borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...
def warpPerspective(src: cv2.GMat, M: cv2.typing.MatLike, dsize: cv2.typing.Size, flags: int = ..., borderMode: int = ..., borderValue: cv2.typing.Scalar = ...) -> cv2.GMat: ...

View File

@@ -0,0 +1,7 @@
__all__: list[str] = []
from cv2.gapi.core import cpu as cpu
from cv2.gapi.core import fluid as fluid
from cv2.gapi.core import ocl as ocl

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,51 @@
__all__: list[str] = []
import cv2.typing
import typing as _typing
from cv2.gapi.ie import detail as detail
# Enumerations
TraitAs_TENSOR: int
TRAIT_AS_TENSOR: int
TraitAs_IMAGE: int
TRAIT_AS_IMAGE: int
TraitAs = int
"""One of [TraitAs_TENSOR, TRAIT_AS_TENSOR, TraitAs_IMAGE, TRAIT_AS_IMAGE]"""
Sync: int
SYNC: int
Async: int
ASYNC: int
InferMode = int
"""One of [Sync, SYNC, Async, ASYNC]"""
# Classes
class PyParams:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, tag: str, model: str, weights: str, device: str) -> None: ...
@_typing.overload
def __init__(self, tag: str, model: str, device: str) -> None: ...
def constInput(self, layer_name: str, data: cv2.typing.MatLike, hint: TraitAs = ...) -> PyParams: ...
def cfgNumRequests(self, nireq: int) -> PyParams: ...
def cfgBatchSize(self, size: int) -> PyParams: ...
# Functions
@_typing.overload
def params(tag: str, model: str, weights: str, device: str) -> PyParams: ...
@_typing.overload
def params(tag: str, model: str, device: str) -> PyParams: ...

View File

@@ -0,0 +1,12 @@
__all__: list[str] = []
ParamDesc_Kind_Load: int
PARAM_DESC_KIND_LOAD: int
ParamDesc_Kind_Import: int
PARAM_DESC_KIND_IMPORT: int
ParamDesc_Kind = int
"""One of [ParamDesc_Kind_Load, PARAM_DESC_KIND_LOAD, ParamDesc_Kind_Import, PARAM_DESC_KIND_IMPORT]"""
# Classes

View File

@@ -0,0 +1,5 @@
__all__: list[str] = []
from cv2.gapi.imgproc import fluid as fluid

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,37 @@
__all__: list[str] = []
EncoderConfig_RateControlMode_CBR: int
ENCODER_CONFIG_RATE_CONTROL_MODE_CBR: int
EncoderConfig_RateControlMode_VBR: int
ENCODER_CONFIG_RATE_CONTROL_MODE_VBR: int
EncoderConfig_RateControlMode = int
"""One of [EncoderConfig_RateControlMode_CBR, ENCODER_CONFIG_RATE_CONTROL_MODE_CBR, EncoderConfig_RateControlMode_VBR, ENCODER_CONFIG_RATE_CONTROL_MODE_VBR]"""
EncoderConfig_Profile_H264_BASELINE: int
ENCODER_CONFIG_PROFILE_H264_BASELINE: int
EncoderConfig_Profile_H264_HIGH: int
ENCODER_CONFIG_PROFILE_H264_HIGH: int
EncoderConfig_Profile_H264_MAIN: int
ENCODER_CONFIG_PROFILE_H264_MAIN: int
EncoderConfig_Profile_H265_MAIN: int
ENCODER_CONFIG_PROFILE_H265_MAIN: int
EncoderConfig_Profile_MJPEG: int
ENCODER_CONFIG_PROFILE_MJPEG: int
EncoderConfig_Profile = int
"""One of [EncoderConfig_Profile_H264_BASELINE, ENCODER_CONFIG_PROFILE_H264_BASELINE, EncoderConfig_Profile_H264_HIGH, ENCODER_CONFIG_PROFILE_H264_HIGH, EncoderConfig_Profile_H264_MAIN, ENCODER_CONFIG_PROFILE_H264_MAIN, EncoderConfig_Profile_H265_MAIN, ENCODER_CONFIG_PROFILE_H265_MAIN, EncoderConfig_Profile_MJPEG, ENCODER_CONFIG_PROFILE_MJPEG]"""
ColorCameraParams_BoardSocket_RGB: int
COLOR_CAMERA_PARAMS_BOARD_SOCKET_RGB: int
ColorCameraParams_BoardSocket_BGR: int
COLOR_CAMERA_PARAMS_BOARD_SOCKET_BGR: int
ColorCameraParams_BoardSocket = int
"""One of [ColorCameraParams_BoardSocket_RGB, COLOR_CAMERA_PARAMS_BOARD_SOCKET_RGB, ColorCameraParams_BoardSocket_BGR, COLOR_CAMERA_PARAMS_BOARD_SOCKET_BGR]"""
ColorCameraParams_Resolution_THE_1080_P: int
COLOR_CAMERA_PARAMS_RESOLUTION_THE_1080_P: int
ColorCameraParams_Resolution = int
"""One of [ColorCameraParams_Resolution_THE_1080_P, COLOR_CAMERA_PARAMS_RESOLUTION_THE_1080_P]"""
# Classes

View File

@@ -0,0 +1,55 @@
__all__: list[str] = []
import cv2.gapi.onnx.ep
import cv2.typing
import typing as _typing
from cv2.gapi.onnx import ep as ep
# Enumerations
TraitAs_TENSOR: int
TRAIT_AS_TENSOR: int
TraitAs_IMAGE: int
TRAIT_AS_IMAGE: int
TraitAs = int
"""One of [TraitAs_TENSOR, TRAIT_AS_TENSOR, TraitAs_IMAGE, TRAIT_AS_IMAGE]"""
# Classes
class PyParams:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, tag: str, model_path: str) -> None: ...
def cfgMeanStd(self, layer_name: str, m: cv2.typing.Scalar, s: cv2.typing.Scalar) -> PyParams: ...
def cfgNormalize(self, layer_name: str, flag: bool) -> PyParams: ...
@_typing.overload
def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.OpenVINO) -> PyParams: ...
@_typing.overload
def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.DirectML) -> PyParams: ...
@_typing.overload
def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.CoreML) -> PyParams: ...
@_typing.overload
def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.CUDA) -> PyParams: ...
@_typing.overload
def cfgAddExecutionProvider(self, ep: cv2.gapi.onnx.ep.TensorRT) -> PyParams: ...
def cfgDisableMemPattern(self) -> PyParams: ...
def cfgSessionOptions(self, options: cv2.typing.map_string_and_string) -> PyParams: ...
def cfgOptLevel(self, opt_level: int) -> PyParams: ...
# Functions
def params(tag: str, model_path: str) -> PyParams: ...

View File

@@ -0,0 +1,63 @@
__all__: list[str] = []
import cv2.typing
import typing as _typing
# Classes
class CoreML:
# Functions
def __init__(self) -> None: ...
def cfgUseCPUOnly(self) -> CoreML: ...
def cfgEnableOnSubgraph(self) -> CoreML: ...
def cfgEnableOnlyNeuralEngine(self) -> CoreML: ...
class CUDA:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, dev_id: int) -> None: ...
class TensorRT:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, dev_id: int) -> None: ...
class OpenVINO:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, dev_type: str) -> None: ...
@_typing.overload
def __init__(self, params: cv2.typing.map_string_and_string) -> None: ...
def cfgCacheDir(self, dir: str) -> OpenVINO: ...
def cfgNumThreads(self, nthreads: int) -> OpenVINO: ...
def cfgEnableOpenCLThrottling(self) -> OpenVINO: ...
def cfgEnableDynamicShapes(self) -> OpenVINO: ...
class DirectML:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, device_id: int) -> None: ...
@_typing.overload
def __init__(self, adapter_name: str) -> None: ...

View File

@@ -0,0 +1,32 @@
__all__: list[str] = []
import cv2
import typing as _typing
from cv2.gapi.ot import cpu as cpu
# Enumerations
NEW: int
TRACKED: int
LOST: int
TrackingStatus = int
"""One of [NEW, TRACKED, LOST]"""
# Classes
class ObjectTrackerParams:
max_num_objects: int
input_image_format: int
tracking_per_class: bool
# Functions
@_typing.overload
def track(mat: cv2.GMat, detected_rects: cv2.GArrayT, detected_class_labels: cv2.GArrayT, delta: float) -> tuple[cv2.GArrayT, cv2.GArrayT, cv2.GArrayT, cv2.GArrayT]: ...
@_typing.overload
def track(frame: cv2.GFrame, detected_rects: cv2.GArrayT, detected_class_labels: cv2.GArrayT, delta: float) -> tuple[cv2.GArrayT, cv2.GArrayT, cv2.GArrayT, cv2.GArrayT]: ...

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,74 @@
__all__: list[str] = []
import cv2.typing
import typing as _typing
# Classes
class PyParams:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, tag: str, model_path: str, bin_path: str, device: str) -> None: ...
@_typing.overload
def __init__(self, tag: str, blob_path: str, device: str) -> None: ...
def cfgPluginConfig(self, config: cv2.typing.map_string_and_string) -> PyParams: ...
@_typing.overload
def cfgInputTensorLayout(self, tensor_layout: str) -> PyParams: ...
@_typing.overload
def cfgInputTensorLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ...
@_typing.overload
def cfgInputModelLayout(self, tensor_layout: str) -> PyParams: ...
@_typing.overload
def cfgInputModelLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ...
@_typing.overload
def cfgOutputTensorLayout(self, tensor_layout: str) -> PyParams: ...
@_typing.overload
def cfgOutputTensorLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ...
@_typing.overload
def cfgOutputModelLayout(self, tensor_layout: str) -> PyParams: ...
@_typing.overload
def cfgOutputModelLayout(self, layout_map: cv2.typing.map_string_and_string) -> PyParams: ...
@_typing.overload
def cfgOutputTensorPrecision(self, precision: int) -> PyParams: ...
@_typing.overload
def cfgOutputTensorPrecision(self, precision_map: cv2.typing.map_string_and_int) -> PyParams: ...
@_typing.overload
def cfgReshape(self, new_shape: _typing.Sequence[int]) -> PyParams: ...
@_typing.overload
def cfgReshape(self, new_shape_map: cv2.typing.map_string_and_vector_size_t) -> PyParams: ...
def cfgNumRequests(self, nireq: int) -> PyParams: ...
@_typing.overload
def cfgMean(self, mean_values: _typing.Sequence[float]) -> PyParams: ...
@_typing.overload
def cfgMean(self, mean_map: cv2.typing.map_string_and_vector_float) -> PyParams: ...
@_typing.overload
def cfgScale(self, scale_values: _typing.Sequence[float]) -> PyParams: ...
@_typing.overload
def cfgScale(self, scale_map: cv2.typing.map_string_and_vector_float) -> PyParams: ...
@_typing.overload
def cfgResize(self, interpolation: int) -> PyParams: ...
@_typing.overload
def cfgResize(self, interpolation: cv2.typing.map_string_and_int) -> PyParams: ...
# Functions
@_typing.overload
def params(tag: str, model_path: str, weights: str, device: str) -> PyParams: ...
@_typing.overload
def params(tag: str, bin_path: str, device: str) -> PyParams: ...

View File

@@ -0,0 +1,5 @@
__all__: list[str] = []
from cv2.gapi.own import detail as detail

View File

@@ -0,0 +1,10 @@
__all__: list[str] = []
MatHeader_AUTO_STEP: int
MAT_HEADER_AUTO_STEP: int
MatHeader_TYPE_MASK: int
MAT_HEADER_TYPE_MASK: int
# Classes

View File

@@ -0,0 +1,5 @@
__all__: list[str] = []
from cv2.gapi.render import ocv as ocv

View File

@@ -0,0 +1,9 @@
__all__: list[str] = []
import cv2
# Functions
def kernels() -> cv2.GKernelPackage: ...

View File

@@ -0,0 +1,42 @@
__all__: list[str] = []
import cv2
import typing as _typing
# Enumerations
sync_policy_dont_sync: int
SYNC_POLICY_DONT_SYNC: int
sync_policy_drop: int
SYNC_POLICY_DROP: int
sync_policy = int
"""One of [sync_policy_dont_sync, SYNC_POLICY_DONT_SYNC, sync_policy_drop, SYNC_POLICY_DROP]"""
# Classes
class queue_capacity:
capacity: int
# Functions
def __init__(self, cap: int = ...) -> None: ...
# Functions
def desync(g: cv2.GMat) -> cv2.GMat: ...
def seqNo(arg1: cv2.GMat) -> cv2.GOpaqueT: ...
def seq_id(arg1: cv2.GMat) -> cv2.GOpaqueT: ...
@_typing.overload
def size(src: cv2.GMat) -> cv2.GOpaqueT: ...
@_typing.overload
def size(r: cv2.GOpaqueT) -> cv2.GOpaqueT: ...
@_typing.overload
def size(src: cv2.GFrame) -> cv2.GOpaqueT: ...
def timestamp(arg1: cv2.GMat) -> cv2.GOpaqueT: ...

View File

@@ -0,0 +1,10 @@
__all__: list[str] = []
# Enumerations
TYPE_BS_MOG2: int
TYPE_BS_KNN: int
BackgroundSubtractorType = int
"""One of [TYPE_BS_MOG2, TYPE_BS_KNN]"""

View File

@@ -0,0 +1,41 @@
__all__: list[str] = []
import cv2
import cv2.gapi
import cv2.gapi.wip.gst
import cv2.typing
import typing as _typing
from cv2.gapi.wip import draw as draw
from cv2.gapi.wip import gst as gst
from cv2.gapi.wip import onevpl as onevpl
# Classes
class GOutputs:
# Functions
def getGMat(self) -> cv2.GMat: ...
def getGScalar(self) -> cv2.GScalar: ...
def getGArray(self, type: cv2.gapi.ArgType) -> cv2.GArrayT: ...
def getGOpaque(self, type: cv2.gapi.ArgType) -> cv2.GOpaqueT: ...
class IStreamSource:
...
# Functions
def get_streaming_source(pipeline: cv2.gapi.wip.gst.GStreamerPipeline, appsinkName: str, outputType: cv2.gapi.wip.gst.GStreamerSource_OutputType = ...) -> IStreamSource: ...
@_typing.overload
def make_capture_src(path: str, properties: cv2.typing.map_int_and_double = ...) -> IStreamSource: ...
@_typing.overload
def make_capture_src(id: int, properties: cv2.typing.map_int_and_double = ...) -> IStreamSource: ...
def make_gst_src(pipeline: str, outputType: cv2.gapi.wip.gst.GStreamerSource_OutputType = ...) -> IStreamSource: ...

View File

@@ -0,0 +1,119 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class Text:
text: str
org: cv2.typing.Point
ff: int
fs: float
color: cv2.typing.Scalar
thick: int
lt: int
bottom_left_origin: bool
# Functions
@_typing.overload
def __init__(self, text_: str, org_: cv2.typing.Point, ff_: int, fs_: float, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., bottom_left_origin_: bool = ...) -> None: ...
@_typing.overload
def __init__(self) -> None: ...
class Rect:
rect: cv2.typing.Rect
color: cv2.typing.Scalar
thick: int
lt: int
shift: int
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, rect_: cv2.typing.Rect2i, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ...
class Circle:
center: cv2.typing.Point
radius: int
color: cv2.typing.Scalar
thick: int
lt: int
shift: int
# Functions
@_typing.overload
def __init__(self, center_: cv2.typing.Point, radius_: int, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ...
@_typing.overload
def __init__(self) -> None: ...
class Line:
pt1: cv2.typing.Point
pt2: cv2.typing.Point
color: cv2.typing.Scalar
thick: int
lt: int
shift: int
# Functions
@_typing.overload
def __init__(self, pt1_: cv2.typing.Point, pt2_: cv2.typing.Point, color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ...
@_typing.overload
def __init__(self) -> None: ...
class Mosaic:
mos: cv2.typing.Rect
cellSz: int
decim: int
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, mos_: cv2.typing.Rect2i, cellSz_: int, decim_: int) -> None: ...
class Image:
org: cv2.typing.Point
img: cv2.typing.MatLike
alpha: cv2.typing.MatLike
# Functions
@_typing.overload
def __init__(self, org_: cv2.typing.Point, img_: cv2.typing.MatLike, alpha_: cv2.typing.MatLike) -> None: ...
@_typing.overload
def __init__(self) -> None: ...
class Poly:
points: _typing.Sequence[cv2.typing.Point]
color: cv2.typing.Scalar
thick: int
lt: int
shift: int
# Functions
@_typing.overload
def __init__(self, points_: _typing.Sequence[cv2.typing.Point], color_: cv2.typing.Scalar, thick_: int = ..., lt_: int = ..., shift_: int = ...) -> None: ...
@_typing.overload
def __init__(self) -> None: ...
# Functions
@_typing.overload
def render(bgr: cv2.typing.MatLike, prims: _typing.Sequence[cv2.typing.Prim], args: _typing.Sequence[cv2.GCompileArg] = ...) -> None: ...
@_typing.overload
def render(y_plane: cv2.typing.MatLike, uv_plane: cv2.typing.MatLike, prims: _typing.Sequence[cv2.typing.Prim], args: _typing.Sequence[cv2.GCompileArg] = ...) -> None: ...
def render3ch(src: cv2.GMat, prims: cv2.GArrayT) -> cv2.GMat: ...
def renderNV12(y: cv2.GMat, uv: cv2.GMat, prims: cv2.GArrayT) -> tuple[cv2.GMat, cv2.GMat]: ...

View File

@@ -0,0 +1,17 @@
__all__: list[str] = []
GStreamerSource_OutputType_FRAME: int
GSTREAMER_SOURCE_OUTPUT_TYPE_FRAME: int
GStreamerSource_OutputType_MAT: int
GSTREAMER_SOURCE_OUTPUT_TYPE_MAT: int
GStreamerSource_OutputType = int
"""One of [GStreamerSource_OutputType_FRAME, GSTREAMER_SOURCE_OUTPUT_TYPE_FRAME, GStreamerSource_OutputType_MAT, GSTREAMER_SOURCE_OUTPUT_TYPE_MAT]"""
# Classes
class GStreamerPipeline:
# Functions
def __init__(self, pipeline: str) -> None: ...

View File

@@ -0,0 +1,16 @@
__all__: list[str] = []
# Enumerations
AccelType_HOST: int
ACCEL_TYPE_HOST: int
AccelType_DX11: int
ACCEL_TYPE_DX11: int
AccelType_VAAPI: int
ACCEL_TYPE_VAAPI: int
AccelType_LAST_VALUE: int
ACCEL_TYPE_LAST_VALUE: int
AccelType = int
"""One of [AccelType_HOST, ACCEL_TYPE_HOST, AccelType_DX11, ACCEL_TYPE_DX11, AccelType_VAAPI, ACCEL_TYPE_VAAPI, AccelType_LAST_VALUE, ACCEL_TYPE_LAST_VALUE]"""

View File

@@ -0,0 +1,53 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class HfsSegment(cv2.Algorithm):
# Functions
def setSegEgbThresholdI(self, c: float) -> None: ...
def getSegEgbThresholdI(self) -> float: ...
def setMinRegionSizeI(self, n: int) -> None: ...
def getMinRegionSizeI(self) -> int: ...
def setSegEgbThresholdII(self, c: float) -> None: ...
def getSegEgbThresholdII(self) -> float: ...
def setMinRegionSizeII(self, n: int) -> None: ...
def getMinRegionSizeII(self) -> int: ...
def setSpatialWeight(self, w: float) -> None: ...
def getSpatialWeight(self) -> float: ...
def setSlicSpixelSize(self, n: int) -> None: ...
def getSlicSpixelSize(self) -> int: ...
def setNumSlicIter(self, n: int) -> None: ...
def getNumSlicIter(self) -> int: ...
@_typing.overload
def performSegmentGpu(self, src: cv2.typing.MatLike, ifDraw: bool = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def performSegmentGpu(self, src: cv2.UMat, ifDraw: bool = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def performSegmentCpu(self, src: cv2.typing.MatLike, ifDraw: bool = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def performSegmentCpu(self, src: cv2.UMat, ifDraw: bool = ...) -> cv2.typing.MatLike: ...
@classmethod
def create(cls, height: int, width: int, segEgbThresholdI: float = ..., minRegionSizeI: int = ..., segEgbThresholdII: float = ..., minRegionSizeII: int = ..., spatialWeight: float = ..., slicSpixelSize: int = ..., numSlicIter: int = ...) -> HfsSegment: ...

View File

@@ -0,0 +1,116 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
BLOCK_MEAN_HASH_MODE_0: int
BLOCK_MEAN_HASH_MODE_1: int
BlockMeanHashMode = int
"""One of [BLOCK_MEAN_HASH_MODE_0, BLOCK_MEAN_HASH_MODE_1]"""
# Classes
class AverageHash(ImgHashBase):
# Functions
@classmethod
def create(cls) -> AverageHash: ...
class ImgHashBase(cv2.Algorithm):
# Functions
@_typing.overload
def compute(self, inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def compute(self, inputArr: cv2.UMat, outputArr: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def compare(self, hashOne: cv2.typing.MatLike, hashTwo: cv2.typing.MatLike) -> float: ...
@_typing.overload
def compare(self, hashOne: cv2.UMat, hashTwo: cv2.UMat) -> float: ...
class BlockMeanHash(ImgHashBase):
# Functions
def setMode(self, mode: int) -> None: ...
def getMean(self) -> _typing.Sequence[float]: ...
@classmethod
def create(cls, mode: int = ...) -> BlockMeanHash: ...
class ColorMomentHash(ImgHashBase):
# Functions
@classmethod
def create(cls) -> ColorMomentHash: ...
class MarrHildrethHash(ImgHashBase):
# Functions
def getAlpha(self) -> float: ...
def getScale(self) -> float: ...
def setKernelParam(self, alpha: float, scale: float) -> None: ...
@classmethod
def create(cls, alpha: float = ..., scale: float = ...) -> MarrHildrethHash: ...
class PHash(ImgHashBase):
# Functions
@classmethod
def create(cls) -> PHash: ...
class RadialVarianceHash(ImgHashBase):
# Functions
@classmethod
def create(cls, sigma: float = ..., numOfAngleLine: int = ...) -> RadialVarianceHash: ...
def getNumOfAngleLine(self) -> int: ...
def getSigma(self) -> float: ...
def setNumOfAngleLine(self, value: int) -> None: ...
def setSigma(self, value: float) -> None: ...
# Functions
@_typing.overload
def averageHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def averageHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def blockMeanHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ..., mode: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def blockMeanHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ..., mode: int = ...) -> cv2.UMat: ...
@_typing.overload
def colorMomentHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def colorMomentHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def marrHildrethHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ..., alpha: float = ..., scale: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def marrHildrethHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ..., alpha: float = ..., scale: float = ...) -> cv2.UMat: ...
@_typing.overload
def pHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def pHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def radialVarianceHash(inputArr: cv2.typing.MatLike, outputArr: cv2.typing.MatLike | None = ..., sigma: float = ..., numOfAngleLine: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def radialVarianceHash(inputArr: cv2.UMat, outputArr: cv2.UMat | None = ..., sigma: float = ..., numOfAngleLine: int = ...) -> cv2.UMat: ...

View File

@@ -0,0 +1,27 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Functions
@_typing.overload
def BIMEF(input: cv2.typing.MatLike, output: cv2.typing.MatLike | None = ..., mu: float = ..., a: float = ..., b: float = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def BIMEF(input: cv2.UMat, output: cv2.UMat | None = ..., mu: float = ..., a: float = ..., b: float = ...) -> cv2.UMat: ...
@_typing.overload
def BIMEF2(input: cv2.typing.MatLike, k: float, mu: float, a: float, b: float, output: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def BIMEF2(input: cv2.UMat, k: float, mu: float, a: float, b: float, output: cv2.UMat | None = ...) -> cv2.UMat: ...
def autoscaling(input: cv2.typing.MatLike, output: cv2.typing.MatLike) -> None: ...
def contrastStretching(input: cv2.typing.MatLike, output: cv2.typing.MatLike, r1: int, s1: int, r2: int, s2: int) -> None: ...
def gammaCorrection(input: cv2.typing.MatLike, output: cv2.typing.MatLike, gamma: float) -> None: ...
def logTransform(input: cv2.typing.MatLike, output: cv2.typing.MatLike) -> None: ...

View File

@@ -0,0 +1,14 @@
__all__: list[str] = []
# Functions
def getIppVersion() -> str: ...
def setUseIPP(flag: bool) -> None: ...
def setUseIPP_NotExact(flag: bool) -> None: ...
def useIPP() -> bool: ...
def useIPP_NotExact() -> bool: ...

View File

@@ -0,0 +1,133 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
from cv2.kinfu import detail as detail
# Enumerations
VolumeType_TSDF: int
VOLUME_TYPE_TSDF: int
VolumeType_HASHTSDF: int
VOLUME_TYPE_HASHTSDF: int
VolumeType_COLOREDTSDF: int
VOLUME_TYPE_COLOREDTSDF: int
VolumeType = int
"""One of [VolumeType_TSDF, VOLUME_TYPE_TSDF, VolumeType_HASHTSDF, VOLUME_TYPE_HASHTSDF, VolumeType_COLOREDTSDF, VOLUME_TYPE_COLOREDTSDF]"""
# Classes
class Params:
frameSize: cv2.typing.Size
volumeType: VolumeType
intr: cv2.typing.Matx33f
rgb_intr: cv2.typing.Matx33f
depthFactor: float
bilateral_sigma_depth: float
bilateral_sigma_spatial: float
bilateral_kernel_size: int
pyramidLevels: int
volumeDims: cv2.typing.Vec3i
voxelSize: float
tsdf_min_camera_movement: float
tsdf_trunc_dist: float
tsdf_max_weight: int
raycast_step_factor: float
lightPose: cv2.typing.Vec3f
icpDistThresh: float
icpAngleThresh: float
icpIterations: _typing.Sequence[int]
truncateThreshold: float
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, volumeInitialPoseRot: cv2.typing.Matx33f, volumeInitialPoseTransl: cv2.typing.Vec3f) -> None: ...
@_typing.overload
def __init__(self, volumeInitialPose: cv2.typing.Matx44f) -> None: ...
@_typing.overload
def setInitialVolumePose(self, R: cv2.typing.Matx33f, t: cv2.typing.Vec3f) -> None: ...
@_typing.overload
def setInitialVolumePose(self, homogen_tf: cv2.typing.Matx44f) -> None: ...
@classmethod
def defaultParams(cls) -> Params: ...
@classmethod
def coarseParams(cls) -> Params: ...
@classmethod
def hashTSDFParams(cls, isCoarse: bool) -> Params: ...
@classmethod
def coloredTSDFParams(cls, isCoarse: bool) -> Params: ...
class KinFu:
# Functions
@classmethod
def create(cls, _params: Params) -> KinFu: ...
@_typing.overload
def render(self, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getCloud(self, points: cv2.typing.MatLike | None = ..., normals: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getCloud(self, points: cv2.UMat | None = ..., normals: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def getPoints(self, points: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getPoints(self, points: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getNormals(self, points: cv2.typing.MatLike, normals: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getNormals(self, points: cv2.UMat, normals: cv2.UMat | None = ...) -> cv2.UMat: ...
def reset(self) -> None: ...
@_typing.overload
def update(self, depth: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def update(self, depth: cv2.UMat) -> bool: ...
class Volume:
...
class VolumeParams:
type: VolumeType
resolution: cv2.typing.Vec3i
voxelSize: float
tsdfTruncDist: float
maxWeight: int
depthTruncThreshold: float
raycastStepFactor: float
# Functions
@classmethod
def defaultParams(cls, _volumeType: VolumeType) -> VolumeParams: ...
@classmethod
def coarseParams(cls, _volumeType: VolumeType) -> VolumeParams: ...
# Functions
def makeVolume(_volumeType: VolumeType, _voxelSize: float, _pose: cv2.typing.Matx44f, _raycastStepFactor: float, _truncDist: float, _maxWeight: int, _truncateThreshold: float, _resolution: cv2.typing.Vec3i) -> Volume: ...

View File

@@ -0,0 +1,7 @@
__all__: list[str] = []
# Classes
class PoseGraph:
...

View File

@@ -0,0 +1,73 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class Params:
frameSize: cv2.typing.Size
intr: cv2.typing.Matx33f
rgb_intr: cv2.typing.Matx33f
depthFactor: float
bilateral_sigma_depth: float
bilateral_sigma_spatial: float
bilateral_kernel_size: int
pyramidLevels: int
tsdf_min_camera_movement: float
lightPose: cv2.typing.Vec3f
icpDistThresh: float
icpAngleThresh: float
icpIterations: _typing.Sequence[int]
truncateThreshold: float
# Functions
@classmethod
def defaultParams(cls) -> Params: ...
@classmethod
def coarseParams(cls) -> Params: ...
@classmethod
def hashTSDFParams(cls, isCoarse: bool) -> Params: ...
class LargeKinfu:
# Functions
@classmethod
def create(cls, _params: Params) -> LargeKinfu: ...
@_typing.overload
def render(self, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def render(self, cameraPose: cv2.typing.Matx44f, image: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getCloud(self, points: cv2.typing.MatLike | None = ..., normals: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getCloud(self, points: cv2.UMat | None = ..., normals: cv2.UMat | None = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def getPoints(self, points: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getPoints(self, points: cv2.UMat | None = ...) -> cv2.UMat: ...
@_typing.overload
def getNormals(self, points: cv2.typing.MatLike, normals: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getNormals(self, points: cv2.UMat, normals: cv2.UMat | None = ...) -> cv2.UMat: ...
def reset(self) -> None: ...
@_typing.overload
def update(self, depth: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def update(self, depth: cv2.UMat) -> bool: ...

View File

@@ -0,0 +1,93 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class Tracker(cv2.Algorithm):
# Functions
@_typing.overload
def init(self, image: cv2.typing.MatLike, boundingBox: cv2.typing.Rect2d) -> bool: ...
@_typing.overload
def init(self, image: cv2.UMat, boundingBox: cv2.typing.Rect2d) -> bool: ...
@_typing.overload
def update(self, image: cv2.typing.MatLike) -> tuple[bool, cv2.typing.Rect2d]: ...
@_typing.overload
def update(self, image: cv2.UMat) -> tuple[bool, cv2.typing.Rect2d]: ...
class TrackerMIL(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerMIL: ...
class TrackerBoosting(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerBoosting: ...
class TrackerMedianFlow(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerMedianFlow: ...
class TrackerTLD(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerTLD: ...
class TrackerKCF(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerKCF: ...
class TrackerMOSSE(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerMOSSE: ...
class MultiTracker(cv2.Algorithm):
# Functions
def __init__(self) -> None: ...
@_typing.overload
def add(self, newTracker: Tracker, image: cv2.typing.MatLike, boundingBox: cv2.typing.Rect2d) -> bool: ...
@_typing.overload
def add(self, newTracker: Tracker, image: cv2.UMat, boundingBox: cv2.typing.Rect2d) -> bool: ...
@_typing.overload
def update(self, image: cv2.typing.MatLike) -> tuple[bool, _typing.Sequence[cv2.typing.Rect2d]]: ...
@_typing.overload
def update(self, image: cv2.UMat) -> tuple[bool, _typing.Sequence[cv2.typing.Rect2d]]: ...
def getObjects(self) -> _typing.Sequence[cv2.typing.Rect2d]: ...
@classmethod
def create(cls) -> MultiTracker: ...
class TrackerCSRT(Tracker):
# Functions
@classmethod
def create(cls) -> TrackerCSRT: ...
@_typing.overload
def setInitialMask(self, mask: cv2.typing.MatLike) -> None: ...
@_typing.overload
def setInitialMask(self, mask: cv2.UMat) -> None: ...
# Functions
def upgradeTrackingAPI(legacy_tracker: Tracker) -> Tracker: ...

View File

@@ -0,0 +1,112 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class KeyLine:
angle: float
class_id: int
octave: int
pt: cv2.typing.Point2f
response: float
size: float
startPointX: float
startPointY: float
endPointX: float
endPointY: float
sPointInOctaveX: float
sPointInOctaveY: float
ePointInOctaveX: float
ePointInOctaveY: float
lineLength: float
numOfPixels: int
# Functions
def __init__(self) -> None: ...
def getStartPoint(self) -> cv2.typing.Point2f: ...
def getEndPoint(self) -> cv2.typing.Point2f: ...
def getStartPointInOctave(self) -> cv2.typing.Point2f: ...
def getEndPointInOctave(self) -> cv2.typing.Point2f: ...
class BinaryDescriptor(cv2.Algorithm):
# Functions
@classmethod
def createBinaryDescriptor(cls) -> BinaryDescriptor: ...
def getNumOfOctaves(self) -> int: ...
def setNumOfOctaves(self, octaves: int) -> None: ...
def getWidthOfBand(self) -> int: ...
def setWidthOfBand(self, width: int) -> None: ...
def getReductionRatio(self) -> int: ...
def setReductionRatio(self, rRatio: int) -> None: ...
def detect(self, image: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> _typing.Sequence[KeyLine]: ...
def compute(self, image: cv2.typing.MatLike, keylines: _typing.Sequence[KeyLine], descriptors: cv2.typing.MatLike | None = ..., returnFloatDescr: bool = ...) -> tuple[_typing.Sequence[KeyLine], cv2.typing.MatLike]: ...
class LSDParam:
scale: float
sigma_scale: float
quant: float
ang_th: float
log_eps: float
density_th: float
n_bins: int
# Functions
def __init__(self) -> None: ...
class LSDDetector(cv2.Algorithm):
# Functions
def __init__(self, _params: LSDParam) -> None: ...
@classmethod
def createLSDDetector(cls) -> LSDDetector: ...
@classmethod
def createLSDDetectorWithParams(cls, params: LSDParam) -> LSDDetector: ...
@_typing.overload
def detect(self, image: cv2.typing.MatLike, scale: int, numOctaves: int, mask: cv2.typing.MatLike | None = ...) -> _typing.Sequence[KeyLine]: ...
@_typing.overload
def detect(self, images: _typing.Sequence[cv2.typing.MatLike], keylines: _typing.Sequence[_typing.Sequence[KeyLine]], scale: int, numOctaves: int, masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> None: ...
class BinaryDescriptorMatcher(cv2.Algorithm):
# Functions
def __init__(self) -> None: ...
def match(self, queryDescriptors: cv2.typing.MatLike, trainDescriptors: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> _typing.Sequence[cv2.DMatch]: ...
def matchQuery(self, queryDescriptors: cv2.typing.MatLike, masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.DMatch]: ...
def knnMatch(self, queryDescriptors: cv2.typing.MatLike, trainDescriptors: cv2.typing.MatLike, k: int, mask: cv2.typing.MatLike | None = ..., compactResult: bool = ...) -> _typing.Sequence[_typing.Sequence[cv2.DMatch]]: ...
def knnMatchQuery(self, queryDescriptors: cv2.typing.MatLike, matches: _typing.Sequence[_typing.Sequence[cv2.DMatch]], k: int, masks: _typing.Sequence[cv2.typing.MatLike] | None = ..., compactResult: bool = ...) -> None: ...
class DrawLinesMatchesFlags:
...
# Functions
def drawKeylines(image: cv2.typing.MatLike, keylines: _typing.Sequence[KeyLine], outImage: cv2.typing.MatLike | None = ..., color: cv2.typing.Scalar = ..., flags: int = ...) -> cv2.typing.MatLike: ...
def drawLineMatches(img1: cv2.typing.MatLike, keylines1: _typing.Sequence[KeyLine], img2: cv2.typing.MatLike, keylines2: _typing.Sequence[KeyLine], matches1to2: _typing.Sequence[cv2.DMatch], outImg: cv2.typing.MatLike | None = ..., matchColor: cv2.typing.Scalar = ..., singleLineColor: cv2.typing.Scalar = ..., matchesMask: _typing.Sequence[str] = ..., flags: int = ...) -> cv2.typing.MatLike: ...

View File

@@ -0,0 +1,151 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Classes
class Feature:
x: int
y: int
label: int
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, x: int, y: int, label: int) -> None: ...
class Template:
@property
def width(self) -> int: ...
@property
def height(self) -> int: ...
@property
def pyramid_level(self) -> int: ...
@property
def features(self) -> _typing.Sequence[Feature]: ...
class QuantizedPyramid:
# Functions
def quantize(self, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
def extractTemplate(self) -> tuple[bool, Template]: ...
def pyrDown(self) -> None: ...
class Modality:
# Functions
def process(self, src: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> QuantizedPyramid: ...
def name(self) -> str: ...
def read(self, fn: cv2.FileNode) -> None: ...
@classmethod
@_typing.overload
def create(cls, modality_type: str) -> Modality: ...
@classmethod
@_typing.overload
def create(cls, fn: cv2.FileNode) -> Modality: ...
class ColorGradient(Modality):
@property
def weak_threshold(self) -> float: ...
@property
def num_features(self) -> int: ...
@property
def strong_threshold(self) -> float: ...
# Functions
@classmethod
def create(cls, weak_threshold: float, num_features: int, strong_threshold: float) -> ColorGradient: ...
class DepthNormal(Modality):
@property
def distance_threshold(self) -> int: ...
@property
def difference_threshold(self) -> int: ...
@property
def num_features(self) -> int: ...
@property
def extract_threshold(self) -> int: ...
# Functions
@classmethod
def create(cls, distance_threshold: int, difference_threshold: int, num_features: int, extract_threshold: int) -> DepthNormal: ...
class Match:
x: int
y: int
similarity: float
class_id: str
template_id: int
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, x: int, y: int, similarity: float, class_id: str, template_id: int) -> None: ...
class Detector:
# Functions
@_typing.overload
def __init__(self) -> None: ...
@_typing.overload
def __init__(self, modalities: _typing.Sequence[Modality], T_pyramid: _typing.Sequence[int]) -> None: ...
@_typing.overload
def match(self, sources: _typing.Sequence[cv2.typing.MatLike], threshold: float, class_ids: _typing.Sequence[str] = ..., quantized_images: _typing.Sequence[cv2.typing.MatLike] | None = ..., masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[Match], _typing.Sequence[cv2.typing.MatLike]]: ...
@_typing.overload
def match(self, sources: _typing.Sequence[cv2.typing.MatLike], threshold: float, class_ids: _typing.Sequence[str] = ..., quantized_images: _typing.Sequence[cv2.UMat] | None = ..., masks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[Match], _typing.Sequence[cv2.UMat]]: ...
def addTemplate(self, sources: _typing.Sequence[cv2.typing.MatLike], class_id: str, object_mask: cv2.typing.MatLike) -> tuple[int, cv2.typing.Rect]: ...
def addSyntheticTemplate(self, templates: _typing.Sequence[Template], class_id: str) -> int: ...
def getModalities(self) -> _typing.Sequence[Modality]: ...
def getT(self, pyramid_level: int) -> int: ...
def pyramidLevels(self) -> int: ...
def getTemplates(self, class_id: str, template_id: int) -> _typing.Sequence[Template]: ...
@_typing.overload
def numTemplates(self) -> int: ...
@_typing.overload
def numTemplates(self, class_id: str) -> int: ...
def numClasses(self) -> int: ...
def classIds(self) -> _typing.Sequence[str]: ...
def read(self, fn: cv2.FileNode) -> None: ...
def readClasses(self, class_ids: _typing.Sequence[str], format: str = ...) -> None: ...
def writeClasses(self, format: str = ...) -> None: ...
# Functions
def colormap(quantized: cv2.typing.MatLike, dst: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawFeatures(img: cv2.typing.MatLike, templates: _typing.Sequence[Template], tl: cv2.typing.Point2i, size: int = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def drawFeatures(img: cv2.UMat, templates: _typing.Sequence[Template], tl: cv2.typing.Point2i, size: int = ...) -> cv2.UMat: ...
def getDefaultLINE() -> Detector: ...
def getDefaultLINEMOD() -> Detector: ...

View File

@@ -0,0 +1,6 @@
# flake8: noqa
import sys
if sys.version_info[:2] < (3, 0):
def exec_file_wrapper(fpath, g_vars, l_vars):
execfile(fpath, g_vars, l_vars)

View File

@@ -0,0 +1,9 @@
# flake8: noqa
import os
import sys
if sys.version_info[:2] >= (3, 0):
def exec_file_wrapper(fpath, g_vars, l_vars):
with open(fpath) as f:
code = compile(f.read(), os.path.basename(fpath), 'exec')
exec(code, g_vars, l_vars)

View File

@@ -0,0 +1,40 @@
__all__ = []
import numpy as np
import cv2 as cv
from typing import TYPE_CHECKING, Any
# Same as cv2.typing.NumPyArrayNumeric, but avoids circular dependencies
if TYPE_CHECKING:
_NumPyArrayNumeric = np.ndarray[Any, np.dtype[np.integer[Any] | np.floating[Any]]]
else:
_NumPyArrayNumeric = np.ndarray
# NumPy documentation: https://numpy.org/doc/stable/user/basics.subclassing.html
class Mat(_NumPyArrayNumeric):
'''
cv.Mat wrapper for numpy array.
Stores extra metadata information how to interpret and process of numpy array for underlying C++ code.
'''
def __new__(cls, arr, **kwargs):
obj = arr.view(Mat)
return obj
def __init__(self, arr, **kwargs):
self.wrap_channels = kwargs.pop('wrap_channels', getattr(arr, 'wrap_channels', False))
if len(kwargs) > 0:
raise TypeError('Unknown parameters: {}'.format(repr(kwargs)))
def __array_finalize__(self, obj):
if obj is None:
return
self.wrap_channels = getattr(obj, 'wrap_channels', None)
Mat.__module__ = cv.__name__
cv.Mat = Mat
cv._registerMatType(Mat)

View File

@@ -0,0 +1,109 @@
__all__: list[str] = []
import cv2
import cv2.dnn
import cv2.typing
import typing as _typing
# Enumerations
MCC24: int
SG140: int
VINYL18: int
TYPECHART = int
"""One of [MCC24, SG140, VINYL18]"""
# Classes
class DetectorParameters:
adaptiveThreshWinSizeMin: int
adaptiveThreshWinSizeMax: int
adaptiveThreshWinSizeStep: int
adaptiveThreshConstant: float
minContoursAreaRate: float
minContoursArea: float
confidenceThreshold: float
minContourSolidity: float
findCandidatesApproxPolyDPEpsMultiplier: float
borderWidth: int
B0factor: float
maxError: float
minContourPointsAllowed: int
minContourLengthAllowed: int
minInterContourDistance: int
minInterCheckerDistance: int
minImageSize: int
minGroupSize: int
# Functions
@classmethod
def create(cls) -> DetectorParameters: ...
class CCheckerDetector(cv2.Algorithm):
# Functions
def setNet(self, net: cv2.dnn.Net) -> bool: ...
@_typing.overload
def processWithROI(self, image: cv2.typing.MatLike, chartType: TYPECHART, regionsOfInterest: _typing.Sequence[cv2.typing.Rect], nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
@_typing.overload
def processWithROI(self, image: cv2.UMat, chartType: TYPECHART, regionsOfInterest: _typing.Sequence[cv2.typing.Rect], nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
@_typing.overload
def process(self, image: cv2.typing.MatLike, chartType: TYPECHART, nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
@_typing.overload
def process(self, image: cv2.UMat, chartType: TYPECHART, nc: int = ..., useNet: bool = ..., params: DetectorParameters = ...) -> bool: ...
def getBestColorChecker(self) -> CChecker: ...
def getListColorChecker(self) -> _typing.Sequence[CChecker]: ...
@classmethod
def create(cls) -> CCheckerDetector: ...
class CChecker:
# Functions
@classmethod
def create(cls) -> CChecker: ...
def setTarget(self, _target: TYPECHART) -> None: ...
def setBox(self, _box: _typing.Sequence[cv2.typing.Point2f]) -> None: ...
def setChartsRGB(self, _chartsRGB: cv2.typing.MatLike) -> None: ...
def setChartsYCbCr(self, _chartsYCbCr: cv2.typing.MatLike) -> None: ...
def setCost(self, _cost: float) -> None: ...
def setCenter(self, _center: cv2.typing.Point2f) -> None: ...
def getTarget(self) -> TYPECHART: ...
def getBox(self) -> _typing.Sequence[cv2.typing.Point2f]: ...
def getColorCharts(self) -> _typing.Sequence[cv2.typing.Point2f]: ...
def getChartsRGB(self) -> cv2.typing.MatLike: ...
def getChartsYCbCr(self) -> cv2.typing.MatLike: ...
def getCost(self) -> float: ...
def getCenter(self) -> cv2.typing.Point2f: ...
class CCheckerDraw:
# Functions
@_typing.overload
def draw(self, img: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@_typing.overload
def draw(self, img: cv2.UMat) -> cv2.UMat: ...
@classmethod
def create(cls, pChecker: CChecker, color: cv2.typing.Scalar = ..., thickness: int = ...) -> CCheckerDraw: ...

View File

@@ -0,0 +1 @@
from .version import get_ocv_version

View File

@@ -0,0 +1,5 @@
import cv2
def get_ocv_version():
return getattr(cv2, "__version__", "unavailable")

View File

@@ -0,0 +1,695 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Enumerations
VAR_NUMERICAL: int
VAR_ORDERED: int
VAR_CATEGORICAL: int
VariableTypes = int
"""One of [VAR_NUMERICAL, VAR_ORDERED, VAR_CATEGORICAL]"""
TEST_ERROR: int
TRAIN_ERROR: int
ErrorTypes = int
"""One of [TEST_ERROR, TRAIN_ERROR]"""
ROW_SAMPLE: int
COL_SAMPLE: int
SampleTypes = int
"""One of [ROW_SAMPLE, COL_SAMPLE]"""
StatModel_UPDATE_MODEL: int
STAT_MODEL_UPDATE_MODEL: int
StatModel_RAW_OUTPUT: int
STAT_MODEL_RAW_OUTPUT: int
StatModel_COMPRESSED_INPUT: int
STAT_MODEL_COMPRESSED_INPUT: int
StatModel_PREPROCESSED_INPUT: int
STAT_MODEL_PREPROCESSED_INPUT: int
StatModel_Flags = int
"""One of [StatModel_UPDATE_MODEL, STAT_MODEL_UPDATE_MODEL, StatModel_RAW_OUTPUT, STAT_MODEL_RAW_OUTPUT, StatModel_COMPRESSED_INPUT, STAT_MODEL_COMPRESSED_INPUT, StatModel_PREPROCESSED_INPUT, STAT_MODEL_PREPROCESSED_INPUT]"""
KNearest_BRUTE_FORCE: int
KNEAREST_BRUTE_FORCE: int
KNearest_KDTREE: int
KNEAREST_KDTREE: int
KNearest_Types = int
"""One of [KNearest_BRUTE_FORCE, KNEAREST_BRUTE_FORCE, KNearest_KDTREE, KNEAREST_KDTREE]"""
SVM_C_SVC: int
SVM_NU_SVC: int
SVM_ONE_CLASS: int
SVM_EPS_SVR: int
SVM_NU_SVR: int
SVM_Types = int
"""One of [SVM_C_SVC, SVM_NU_SVC, SVM_ONE_CLASS, SVM_EPS_SVR, SVM_NU_SVR]"""
SVM_CUSTOM: int
SVM_LINEAR: int
SVM_POLY: int
SVM_RBF: int
SVM_SIGMOID: int
SVM_CHI2: int
SVM_INTER: int
SVM_KernelTypes = int
"""One of [SVM_CUSTOM, SVM_LINEAR, SVM_POLY, SVM_RBF, SVM_SIGMOID, SVM_CHI2, SVM_INTER]"""
SVM_C: int
SVM_GAMMA: int
SVM_P: int
SVM_NU: int
SVM_COEF: int
SVM_DEGREE: int
SVM_ParamTypes = int
"""One of [SVM_C, SVM_GAMMA, SVM_P, SVM_NU, SVM_COEF, SVM_DEGREE]"""
EM_COV_MAT_SPHERICAL: int
EM_COV_MAT_DIAGONAL: int
EM_COV_MAT_GENERIC: int
EM_COV_MAT_DEFAULT: int
EM_Types = int
"""One of [EM_COV_MAT_SPHERICAL, EM_COV_MAT_DIAGONAL, EM_COV_MAT_GENERIC, EM_COV_MAT_DEFAULT]"""
EM_DEFAULT_NCLUSTERS: int
EM_DEFAULT_MAX_ITERS: int
EM_START_E_STEP: int
EM_START_M_STEP: int
EM_START_AUTO_STEP: int
DTrees_PREDICT_AUTO: int
DTREES_PREDICT_AUTO: int
DTrees_PREDICT_SUM: int
DTREES_PREDICT_SUM: int
DTrees_PREDICT_MAX_VOTE: int
DTREES_PREDICT_MAX_VOTE: int
DTrees_PREDICT_MASK: int
DTREES_PREDICT_MASK: int
DTrees_Flags = int
"""One of [DTrees_PREDICT_AUTO, DTREES_PREDICT_AUTO, DTrees_PREDICT_SUM, DTREES_PREDICT_SUM, DTrees_PREDICT_MAX_VOTE, DTREES_PREDICT_MAX_VOTE, DTrees_PREDICT_MASK, DTREES_PREDICT_MASK]"""
Boost_DISCRETE: int
BOOST_DISCRETE: int
Boost_REAL: int
BOOST_REAL: int
Boost_LOGIT: int
BOOST_LOGIT: int
Boost_GENTLE: int
BOOST_GENTLE: int
Boost_Types = int
"""One of [Boost_DISCRETE, BOOST_DISCRETE, Boost_REAL, BOOST_REAL, Boost_LOGIT, BOOST_LOGIT, Boost_GENTLE, BOOST_GENTLE]"""
ANN_MLP_BACKPROP: int
ANN_MLP_RPROP: int
ANN_MLP_ANNEAL: int
ANN_MLP_TrainingMethods = int
"""One of [ANN_MLP_BACKPROP, ANN_MLP_RPROP, ANN_MLP_ANNEAL]"""
ANN_MLP_IDENTITY: int
ANN_MLP_SIGMOID_SYM: int
ANN_MLP_GAUSSIAN: int
ANN_MLP_RELU: int
ANN_MLP_LEAKYRELU: int
ANN_MLP_ActivationFunctions = int
"""One of [ANN_MLP_IDENTITY, ANN_MLP_SIGMOID_SYM, ANN_MLP_GAUSSIAN, ANN_MLP_RELU, ANN_MLP_LEAKYRELU]"""
ANN_MLP_UPDATE_WEIGHTS: int
ANN_MLP_NO_INPUT_SCALE: int
ANN_MLP_NO_OUTPUT_SCALE: int
ANN_MLP_TrainFlags = int
"""One of [ANN_MLP_UPDATE_WEIGHTS, ANN_MLP_NO_INPUT_SCALE, ANN_MLP_NO_OUTPUT_SCALE]"""
LogisticRegression_REG_DISABLE: int
LOGISTIC_REGRESSION_REG_DISABLE: int
LogisticRegression_REG_L1: int
LOGISTIC_REGRESSION_REG_L1: int
LogisticRegression_REG_L2: int
LOGISTIC_REGRESSION_REG_L2: int
LogisticRegression_RegKinds = int
"""One of [LogisticRegression_REG_DISABLE, LOGISTIC_REGRESSION_REG_DISABLE, LogisticRegression_REG_L1, LOGISTIC_REGRESSION_REG_L1, LogisticRegression_REG_L2, LOGISTIC_REGRESSION_REG_L2]"""
LogisticRegression_BATCH: int
LOGISTIC_REGRESSION_BATCH: int
LogisticRegression_MINI_BATCH: int
LOGISTIC_REGRESSION_MINI_BATCH: int
LogisticRegression_Methods = int
"""One of [LogisticRegression_BATCH, LOGISTIC_REGRESSION_BATCH, LogisticRegression_MINI_BATCH, LOGISTIC_REGRESSION_MINI_BATCH]"""
SVMSGD_SGD: int
SVMSGD_ASGD: int
SVMSGD_SvmsgdType = int
"""One of [SVMSGD_SGD, SVMSGD_ASGD]"""
SVMSGD_SOFT_MARGIN: int
SVMSGD_HARD_MARGIN: int
SVMSGD_MarginType = int
"""One of [SVMSGD_SOFT_MARGIN, SVMSGD_HARD_MARGIN]"""
# Classes
class ParamGrid:
minVal: float
maxVal: float
logStep: float
# Functions
@classmethod
def create(cls, minVal: float = ..., maxVal: float = ..., logstep: float = ...) -> ParamGrid: ...
class TrainData:
# Functions
def getLayout(self) -> int: ...
def getNTrainSamples(self) -> int: ...
def getNTestSamples(self) -> int: ...
def getNSamples(self) -> int: ...
def getNVars(self) -> int: ...
def getNAllVars(self) -> int: ...
@_typing.overload
def getSample(self, varIdx: cv2.typing.MatLike, sidx: int, buf: float) -> None: ...
@_typing.overload
def getSample(self, varIdx: cv2.UMat, sidx: int, buf: float) -> None: ...
def getSamples(self) -> cv2.typing.MatLike: ...
def getMissing(self) -> cv2.typing.MatLike: ...
def getTrainSamples(self, layout: int = ..., compressSamples: bool = ..., compressVars: bool = ...) -> cv2.typing.MatLike: ...
def getTrainResponses(self) -> cv2.typing.MatLike: ...
def getTrainNormCatResponses(self) -> cv2.typing.MatLike: ...
def getTestResponses(self) -> cv2.typing.MatLike: ...
def getTestNormCatResponses(self) -> cv2.typing.MatLike: ...
def getResponses(self) -> cv2.typing.MatLike: ...
def getNormCatResponses(self) -> cv2.typing.MatLike: ...
def getSampleWeights(self) -> cv2.typing.MatLike: ...
def getTrainSampleWeights(self) -> cv2.typing.MatLike: ...
def getTestSampleWeights(self) -> cv2.typing.MatLike: ...
def getVarIdx(self) -> cv2.typing.MatLike: ...
def getVarType(self) -> cv2.typing.MatLike: ...
def getVarSymbolFlags(self) -> cv2.typing.MatLike: ...
def getResponseType(self) -> int: ...
def getTrainSampleIdx(self) -> cv2.typing.MatLike: ...
def getTestSampleIdx(self) -> cv2.typing.MatLike: ...
@_typing.overload
def getValues(self, vi: int, sidx: cv2.typing.MatLike, values: float) -> None: ...
@_typing.overload
def getValues(self, vi: int, sidx: cv2.UMat, values: float) -> None: ...
def getDefaultSubstValues(self) -> cv2.typing.MatLike: ...
def getCatCount(self, vi: int) -> int: ...
def getClassLabels(self) -> cv2.typing.MatLike: ...
def getCatOfs(self) -> cv2.typing.MatLike: ...
def getCatMap(self) -> cv2.typing.MatLike: ...
def setTrainTestSplit(self, count: int, shuffle: bool = ...) -> None: ...
def setTrainTestSplitRatio(self, ratio: float, shuffle: bool = ...) -> None: ...
def shuffleTrainTest(self) -> None: ...
def getTestSamples(self) -> cv2.typing.MatLike: ...
def getNames(self, names: _typing.Sequence[str]) -> None: ...
@staticmethod
def getSubVector(vec: cv2.typing.MatLike, idx: cv2.typing.MatLike) -> cv2.typing.MatLike: ...
@staticmethod
def getSubMatrix(matrix: cv2.typing.MatLike, idx: cv2.typing.MatLike, layout: int) -> cv2.typing.MatLike: ...
@classmethod
@_typing.overload
def create(cls, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, varIdx: cv2.typing.MatLike | None = ..., sampleIdx: cv2.typing.MatLike | None = ..., sampleWeights: cv2.typing.MatLike | None = ..., varType: cv2.typing.MatLike | None = ...) -> TrainData: ...
@classmethod
@_typing.overload
def create(cls, samples: cv2.UMat, layout: int, responses: cv2.UMat, varIdx: cv2.UMat | None = ..., sampleIdx: cv2.UMat | None = ..., sampleWeights: cv2.UMat | None = ..., varType: cv2.UMat | None = ...) -> TrainData: ...
class StatModel(cv2.Algorithm):
# Functions
def getVarCount(self) -> int: ...
def empty(self) -> bool: ...
def isTrained(self) -> bool: ...
def isClassifier(self) -> bool: ...
@_typing.overload
def train(self, trainData: TrainData, flags: int = ...) -> bool: ...
@_typing.overload
def train(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike) -> bool: ...
@_typing.overload
def train(self, samples: cv2.UMat, layout: int, responses: cv2.UMat) -> bool: ...
@_typing.overload
def calcError(self, data: TrainData, test: bool, resp: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike]: ...
@_typing.overload
def calcError(self, data: TrainData, test: bool, resp: cv2.UMat | None = ...) -> tuple[float, cv2.UMat]: ...
@_typing.overload
def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
@_typing.overload
def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...
class NormalBayesClassifier(StatModel):
# Functions
@_typing.overload
def predictProb(self, inputs: cv2.typing.MatLike, outputs: cv2.typing.MatLike | None = ..., outputProbs: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def predictProb(self, inputs: cv2.UMat, outputs: cv2.UMat | None = ..., outputProbs: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ...
@classmethod
def create(cls) -> NormalBayesClassifier: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> NormalBayesClassifier: ...
class KNearest(StatModel):
# Functions
def getDefaultK(self) -> int: ...
def setDefaultK(self, val: int) -> None: ...
def getIsClassifier(self) -> bool: ...
def setIsClassifier(self, val: bool) -> None: ...
def getEmax(self) -> int: ...
def setEmax(self, val: int) -> None: ...
def getAlgorithmType(self) -> int: ...
def setAlgorithmType(self, val: int) -> None: ...
@_typing.overload
def findNearest(self, samples: cv2.typing.MatLike, k: int, results: cv2.typing.MatLike | None = ..., neighborResponses: cv2.typing.MatLike | None = ..., dist: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def findNearest(self, samples: cv2.UMat, k: int, results: cv2.UMat | None = ..., neighborResponses: cv2.UMat | None = ..., dist: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@classmethod
def create(cls) -> KNearest: ...
@classmethod
def load(cls, filepath: str) -> KNearest: ...
class SVM(StatModel):
# Functions
def getType(self) -> int: ...
def setType(self, val: int) -> None: ...
def getGamma(self) -> float: ...
def setGamma(self, val: float) -> None: ...
def getCoef0(self) -> float: ...
def setCoef0(self, val: float) -> None: ...
def getDegree(self) -> float: ...
def setDegree(self, val: float) -> None: ...
def getC(self) -> float: ...
def setC(self, val: float) -> None: ...
def getNu(self) -> float: ...
def setNu(self, val: float) -> None: ...
def getP(self) -> float: ...
def setP(self, val: float) -> None: ...
def getClassWeights(self) -> cv2.typing.MatLike: ...
def setClassWeights(self, val: cv2.typing.MatLike) -> None: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...
def getKernelType(self) -> int: ...
def setKernel(self, kernelType: int) -> None: ...
@_typing.overload
def trainAuto(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ...
@_typing.overload
def trainAuto(self, samples: cv2.UMat, layout: int, responses: cv2.UMat, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ...
def getSupportVectors(self) -> cv2.typing.MatLike: ...
def getUncompressedSupportVectors(self) -> cv2.typing.MatLike: ...
@_typing.overload
def getDecisionFunction(self, i: int, alpha: cv2.typing.MatLike | None = ..., svidx: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def getDecisionFunction(self, i: int, alpha: cv2.UMat | None = ..., svidx: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ...
@staticmethod
def getDefaultGridPtr(param_id: int) -> ParamGrid: ...
@classmethod
def create(cls) -> SVM: ...
@classmethod
def load(cls, filepath: str) -> SVM: ...
class EM(StatModel):
# Functions
def getClustersNumber(self) -> int: ...
def setClustersNumber(self, val: int) -> None: ...
def getCovarianceMatrixType(self) -> int: ...
def setCovarianceMatrixType(self, val: int) -> None: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...
def getWeights(self) -> cv2.typing.MatLike: ...
def getMeans(self) -> cv2.typing.MatLike: ...
def getCovs(self, covs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
@_typing.overload
def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
@_typing.overload
def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...
@_typing.overload
def predict2(self, sample: cv2.typing.MatLike, probs: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.Vec2d, cv2.typing.MatLike]: ...
@_typing.overload
def predict2(self, sample: cv2.UMat, probs: cv2.UMat | None = ...) -> tuple[cv2.typing.Vec2d, cv2.UMat]: ...
@_typing.overload
def trainEM(self, samples: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def trainEM(self, samples: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def trainE(self, samples: cv2.typing.MatLike, means0: cv2.typing.MatLike, covs0: cv2.typing.MatLike | None = ..., weights0: cv2.typing.MatLike | None = ..., logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def trainE(self, samples: cv2.UMat, means0: cv2.UMat, covs0: cv2.UMat | None = ..., weights0: cv2.UMat | None = ..., logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@_typing.overload
def trainM(self, samples: cv2.typing.MatLike, probs0: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def trainM(self, samples: cv2.UMat, probs0: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...
@classmethod
def create(cls) -> EM: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> EM: ...
class DTrees(StatModel):
# Functions
def getMaxCategories(self) -> int: ...
def setMaxCategories(self, val: int) -> None: ...
def getMaxDepth(self) -> int: ...
def setMaxDepth(self, val: int) -> None: ...
def getMinSampleCount(self) -> int: ...
def setMinSampleCount(self, val: int) -> None: ...
def getCVFolds(self) -> int: ...
def setCVFolds(self, val: int) -> None: ...
def getUseSurrogates(self) -> bool: ...
def setUseSurrogates(self, val: bool) -> None: ...
def getUse1SERule(self) -> bool: ...
def setUse1SERule(self, val: bool) -> None: ...
def getTruncatePrunedTree(self) -> bool: ...
def setTruncatePrunedTree(self, val: bool) -> None: ...
def getRegressionAccuracy(self) -> float: ...
def setRegressionAccuracy(self, val: float) -> None: ...
def getPriors(self) -> cv2.typing.MatLike: ...
def setPriors(self, val: cv2.typing.MatLike) -> None: ...
@classmethod
def create(cls) -> DTrees: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> DTrees: ...
class RTrees(DTrees):
# Functions
def getCalculateVarImportance(self) -> bool: ...
def setCalculateVarImportance(self, val: bool) -> None: ...
def getActiveVarCount(self) -> int: ...
def setActiveVarCount(self, val: int) -> None: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...
def getVarImportance(self) -> cv2.typing.MatLike: ...
@_typing.overload
def getVotes(self, samples: cv2.typing.MatLike, flags: int, results: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
@_typing.overload
def getVotes(self, samples: cv2.UMat, flags: int, results: cv2.UMat | None = ...) -> cv2.UMat: ...
def getOOBError(self) -> float: ...
@classmethod
def create(cls) -> RTrees: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> RTrees: ...
class Boost(DTrees):
# Functions
def getBoostType(self) -> int: ...
def setBoostType(self, val: int) -> None: ...
def getWeakCount(self) -> int: ...
def setWeakCount(self, val: int) -> None: ...
def getWeightTrimRate(self) -> float: ...
def setWeightTrimRate(self, val: float) -> None: ...
@classmethod
def create(cls) -> Boost: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> Boost: ...
class ANN_MLP(StatModel):
# Functions
def setTrainMethod(self, method: int, param1: float = ..., param2: float = ...) -> None: ...
def getTrainMethod(self) -> int: ...
def setActivationFunction(self, type: int, param1: float = ..., param2: float = ...) -> None: ...
@_typing.overload
def setLayerSizes(self, _layer_sizes: cv2.typing.MatLike) -> None: ...
@_typing.overload
def setLayerSizes(self, _layer_sizes: cv2.UMat) -> None: ...
def getLayerSizes(self) -> cv2.typing.MatLike: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...
def getBackpropWeightScale(self) -> float: ...
def setBackpropWeightScale(self, val: float) -> None: ...
def getBackpropMomentumScale(self) -> float: ...
def setBackpropMomentumScale(self, val: float) -> None: ...
def getRpropDW0(self) -> float: ...
def setRpropDW0(self, val: float) -> None: ...
def getRpropDWPlus(self) -> float: ...
def setRpropDWPlus(self, val: float) -> None: ...
def getRpropDWMinus(self) -> float: ...
def setRpropDWMinus(self, val: float) -> None: ...
def getRpropDWMin(self) -> float: ...
def setRpropDWMin(self, val: float) -> None: ...
def getRpropDWMax(self) -> float: ...
def setRpropDWMax(self, val: float) -> None: ...
def getAnnealInitialT(self) -> float: ...
def setAnnealInitialT(self, val: float) -> None: ...
def getAnnealFinalT(self) -> float: ...
def setAnnealFinalT(self, val: float) -> None: ...
def getAnnealCoolingRatio(self) -> float: ...
def setAnnealCoolingRatio(self, val: float) -> None: ...
def getAnnealItePerStep(self) -> int: ...
def setAnnealItePerStep(self, val: int) -> None: ...
def getWeights(self, layerIdx: int) -> cv2.typing.MatLike: ...
@classmethod
def create(cls) -> ANN_MLP: ...
@classmethod
def load(cls, filepath: str) -> ANN_MLP: ...
class LogisticRegression(StatModel):
# Functions
def getLearningRate(self) -> float: ...
def setLearningRate(self, val: float) -> None: ...
def getIterations(self) -> int: ...
def setIterations(self, val: int) -> None: ...
def getRegularization(self) -> int: ...
def setRegularization(self, val: int) -> None: ...
def getTrainMethod(self) -> int: ...
def setTrainMethod(self, val: int) -> None: ...
def getMiniBatchSize(self) -> int: ...
def setMiniBatchSize(self, val: int) -> None: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...
@_typing.overload
def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
@_typing.overload
def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...
def get_learnt_thetas(self) -> cv2.typing.MatLike: ...
@classmethod
def create(cls) -> LogisticRegression: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> LogisticRegression: ...
class SVMSGD(StatModel):
# Functions
def getWeights(self) -> cv2.typing.MatLike: ...
def getShift(self) -> float: ...
@classmethod
def create(cls) -> SVMSGD: ...
@classmethod
def load(cls, filepath: str, nodeName: str = ...) -> SVMSGD: ...
def setOptimalParameters(self, svmsgdType: int = ..., marginType: int = ...) -> None: ...
def getSvmsgdType(self) -> int: ...
def setSvmsgdType(self, svmsgdType: int) -> None: ...
def getMarginType(self) -> int: ...
def setMarginType(self, marginType: int) -> None: ...
def getMarginRegularization(self) -> float: ...
def setMarginRegularization(self, marginRegularization: float) -> None: ...
def getInitialStepSize(self) -> float: ...
def setInitialStepSize(self, InitialStepSize: float) -> None: ...
def getStepDecreasingPower(self) -> float: ...
def setStepDecreasingPower(self, stepDecreasingPower: float) -> None: ...
def getTermCriteria(self) -> cv2.typing.TermCriteria: ...
def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

View File

@@ -0,0 +1,29 @@
__all__: list[str] = []
import cv2
import cv2.typing
import typing as _typing
# Functions
@_typing.overload
def calcGlobalOrientation(orientation: cv2.typing.MatLike, mask: cv2.typing.MatLike, mhi: cv2.typing.MatLike, timestamp: float, duration: float) -> float: ...
@_typing.overload
def calcGlobalOrientation(orientation: cv2.UMat, mask: cv2.UMat, mhi: cv2.UMat, timestamp: float, duration: float) -> float: ...
@_typing.overload
def calcMotionGradient(mhi: cv2.typing.MatLike, delta1: float, delta2: float, mask: cv2.typing.MatLike | None = ..., orientation: cv2.typing.MatLike | None = ..., apertureSize: int = ...) -> tuple[cv2.typing.MatLike, cv2.typing.MatLike]: ...
@_typing.overload
def calcMotionGradient(mhi: cv2.UMat, delta1: float, delta2: float, mask: cv2.UMat | None = ..., orientation: cv2.UMat | None = ..., apertureSize: int = ...) -> tuple[cv2.UMat, cv2.UMat]: ...
@_typing.overload
def segmentMotion(mhi: cv2.typing.MatLike, timestamp: float, segThresh: float, segmask: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.MatLike, _typing.Sequence[cv2.typing.Rect]]: ...
@_typing.overload
def segmentMotion(mhi: cv2.UMat, timestamp: float, segThresh: float, segmask: cv2.UMat | None = ...) -> tuple[cv2.UMat, _typing.Sequence[cv2.typing.Rect]]: ...
@_typing.overload
def updateMotionHistory(silhouette: cv2.typing.MatLike, mhi: cv2.typing.MatLike, timestamp: float, duration: float) -> cv2.typing.MatLike: ...
@_typing.overload
def updateMotionHistory(silhouette: cv2.UMat, mhi: cv2.UMat, timestamp: float, duration: float) -> cv2.UMat: ...

View File

@@ -0,0 +1,10 @@
__all__: list[str] = []
MultiCameraCalibration_PINHOLE: int
MULTI_CAMERA_CALIBRATION_PINHOLE: int
MultiCameraCalibration_OMNIDIRECTIONAL: int
MULTI_CAMERA_CALIBRATION_OMNIDIRECTIONAL: int
# Classes

View File

@@ -0,0 +1,252 @@
__all__: list[str] = []
# Enumerations
OCL_VECTOR_OWN: int
OCL_VECTOR_MAX: int
OCL_VECTOR_DEFAULT: int
OclVectorStrategy = int
"""One of [OCL_VECTOR_OWN, OCL_VECTOR_MAX, OCL_VECTOR_DEFAULT]"""
Device_TYPE_DEFAULT: int
DEVICE_TYPE_DEFAULT: int
Device_TYPE_CPU: int
DEVICE_TYPE_CPU: int
Device_TYPE_GPU: int
DEVICE_TYPE_GPU: int
Device_TYPE_ACCELERATOR: int
DEVICE_TYPE_ACCELERATOR: int
Device_TYPE_DGPU: int
DEVICE_TYPE_DGPU: int
Device_TYPE_IGPU: int
DEVICE_TYPE_IGPU: int
Device_TYPE_ALL: int
DEVICE_TYPE_ALL: int
Device_FP_DENORM: int
DEVICE_FP_DENORM: int
Device_FP_INF_NAN: int
DEVICE_FP_INF_NAN: int
Device_FP_ROUND_TO_NEAREST: int
DEVICE_FP_ROUND_TO_NEAREST: int
Device_FP_ROUND_TO_ZERO: int
DEVICE_FP_ROUND_TO_ZERO: int
Device_FP_ROUND_TO_INF: int
DEVICE_FP_ROUND_TO_INF: int
Device_FP_FMA: int
DEVICE_FP_FMA: int
Device_FP_SOFT_FLOAT: int
DEVICE_FP_SOFT_FLOAT: int
Device_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT: int
DEVICE_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT: int
Device_EXEC_KERNEL: int
DEVICE_EXEC_KERNEL: int
Device_EXEC_NATIVE_KERNEL: int
DEVICE_EXEC_NATIVE_KERNEL: int
Device_NO_CACHE: int
DEVICE_NO_CACHE: int
Device_READ_ONLY_CACHE: int
DEVICE_READ_ONLY_CACHE: int
Device_READ_WRITE_CACHE: int
DEVICE_READ_WRITE_CACHE: int
Device_NO_LOCAL_MEM: int
DEVICE_NO_LOCAL_MEM: int
Device_LOCAL_IS_LOCAL: int
DEVICE_LOCAL_IS_LOCAL: int
Device_LOCAL_IS_GLOBAL: int
DEVICE_LOCAL_IS_GLOBAL: int
Device_UNKNOWN_VENDOR: int
DEVICE_UNKNOWN_VENDOR: int
Device_VENDOR_AMD: int
DEVICE_VENDOR_AMD: int
Device_VENDOR_INTEL: int
DEVICE_VENDOR_INTEL: int
Device_VENDOR_NVIDIA: int
DEVICE_VENDOR_NVIDIA: int
KernelArg_LOCAL: int
KERNEL_ARG_LOCAL: int
KernelArg_READ_ONLY: int
KERNEL_ARG_READ_ONLY: int
KernelArg_WRITE_ONLY: int
KERNEL_ARG_WRITE_ONLY: int
KernelArg_READ_WRITE: int
KERNEL_ARG_READ_WRITE: int
KernelArg_CONSTANT: int
KERNEL_ARG_CONSTANT: int
KernelArg_PTR_ONLY: int
KERNEL_ARG_PTR_ONLY: int
KernelArg_NO_SIZE: int
KERNEL_ARG_NO_SIZE: int
# Classes
class Device:
# Functions
def __init__(self) -> None: ...
def name(self) -> str: ...
def extensions(self) -> str: ...
def isExtensionSupported(self, extensionName: str) -> bool: ...
def version(self) -> str: ...
def vendorName(self) -> str: ...
def OpenCL_C_Version(self) -> str: ...
def OpenCLVersion(self) -> str: ...
def deviceVersionMajor(self) -> int: ...
def deviceVersionMinor(self) -> int: ...
def driverVersion(self) -> str: ...
def type(self) -> int: ...
def addressBits(self) -> int: ...
def available(self) -> bool: ...
def compilerAvailable(self) -> bool: ...
def linkerAvailable(self) -> bool: ...
def doubleFPConfig(self) -> int: ...
def singleFPConfig(self) -> int: ...
def halfFPConfig(self) -> int: ...
def hasFP64(self) -> bool: ...
def hasFP16(self) -> bool: ...
def endianLittle(self) -> bool: ...
def errorCorrectionSupport(self) -> bool: ...
def executionCapabilities(self) -> int: ...
def globalMemCacheSize(self) -> int: ...
def globalMemCacheType(self) -> int: ...
def globalMemCacheLineSize(self) -> int: ...
def globalMemSize(self) -> int: ...
def localMemSize(self) -> int: ...
def localMemType(self) -> int: ...
def hostUnifiedMemory(self) -> bool: ...
def imageSupport(self) -> bool: ...
def imageFromBufferSupport(self) -> bool: ...
def intelSubgroupsSupport(self) -> bool: ...
def image2DMaxWidth(self) -> int: ...
def image2DMaxHeight(self) -> int: ...
def image3DMaxWidth(self) -> int: ...
def image3DMaxHeight(self) -> int: ...
def image3DMaxDepth(self) -> int: ...
def imageMaxBufferSize(self) -> int: ...
def imageMaxArraySize(self) -> int: ...
def vendorID(self) -> int: ...
def isAMD(self) -> bool: ...
def isIntel(self) -> bool: ...
def isNVidia(self) -> bool: ...
def maxClockFrequency(self) -> int: ...
def maxComputeUnits(self) -> int: ...
def maxConstantArgs(self) -> int: ...
def maxConstantBufferSize(self) -> int: ...
def maxMemAllocSize(self) -> int: ...
def maxParameterSize(self) -> int: ...
def maxReadImageArgs(self) -> int: ...
def maxWriteImageArgs(self) -> int: ...
def maxSamplers(self) -> int: ...
def maxWorkGroupSize(self) -> int: ...
def maxWorkItemDims(self) -> int: ...
def memBaseAddrAlign(self) -> int: ...
def nativeVectorWidthChar(self) -> int: ...
def nativeVectorWidthShort(self) -> int: ...
def nativeVectorWidthInt(self) -> int: ...
def nativeVectorWidthLong(self) -> int: ...
def nativeVectorWidthFloat(self) -> int: ...
def nativeVectorWidthDouble(self) -> int: ...
def nativeVectorWidthHalf(self) -> int: ...
def preferredVectorWidthChar(self) -> int: ...
def preferredVectorWidthShort(self) -> int: ...
def preferredVectorWidthInt(self) -> int: ...
def preferredVectorWidthLong(self) -> int: ...
def preferredVectorWidthFloat(self) -> int: ...
def preferredVectorWidthDouble(self) -> int: ...
def preferredVectorWidthHalf(self) -> int: ...
def printfBufferSize(self) -> int: ...
def profilingTimerResolution(self) -> int: ...
@classmethod
def getDefault(cls) -> Device: ...
class OpenCLExecutionContext:
...
# Functions
def finish() -> None: ...
def haveAmdBlas() -> bool: ...
def haveAmdFft() -> bool: ...
def haveOpenCL() -> bool: ...
def setUseOpenCL(flag: bool) -> None: ...
def useOpenCL() -> bool: ...

Some files were not shown because too many files have changed in this diff Show More