Merge pull request #23927 from Avasam:partially-unknown-mat

Fix partially unknown Mat
pull/23967/head
Alexander Smorkalov 2 years ago committed by GitHub
commit 6ff5245cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      modules/core/misc/python/package/mat_wrapper/__init__.py

@ -1,12 +1,18 @@
__all__ = [] __all__ = []
import sys
import numpy as np import numpy as np
import cv2 as cv import cv2 as cv
from typing import TYPE_CHECKING, Any
# Type subscription is not possible in python 3.8
if TYPE_CHECKING:
_NDArray = np.ndarray[Any, np.dtype[np.generic]]
else:
_NDArray = np.ndarray
# NumPy documentation: https://numpy.org/doc/stable/user/basics.subclassing.html # NumPy documentation: https://numpy.org/doc/stable/user/basics.subclassing.html
class Mat(np.ndarray): class Mat(_NDArray):
''' '''
cv.Mat wrapper for numpy array. cv.Mat wrapper for numpy array.

Loading…
Cancel
Save