1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-04-16 15:43:06 +03:00
68 changed files with 2220 additions and 306 deletions
+2 -2
View File
@@ -15,7 +15,7 @@
#import <Foundation/Foundation.h>
#ifdef AVAILABLE_IMGCODECS
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE || TARGET_OS_VISION
#import <UIKit/UIKit.h>
#elif TARGET_OS_MAC
#import <AppKit/AppKit.h>
@@ -197,7 +197,7 @@ CV_EXPORTS @interface Mat : NSObject
- (instancetype)initWithCGImage:(CGImageRef)image;
- (instancetype)initWithCGImage:(CGImageRef)image alphaExist:(BOOL)alphaExist;
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE || TARGET_OS_VISION
- (UIImage*)toUIImage;
- (instancetype)initWithUIImage:(UIImage*)image;
+1 -1
View File
@@ -951,7 +951,7 @@ template<typename T> int putData(NSArray<NSNumber*>* indices, cv::Mat* mat, int
return [MatConverters convertCGImageRefToMat:image alphaExist:alphaExist];
}
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE || TARGET_OS_VISION
-(UIImage*)toUIImage {
return [MatConverters converMatToUIImage:self];
@@ -4,15 +4,16 @@ import numpy as np
import cv2 as cv
from typing import TYPE_CHECKING, Any
# Same as cv2.typing.NumPyArrayGeneric, but avoids circular dependencies
# Same as cv2.typing.NumPyArrayNumeric, but avoids circular dependencies
if TYPE_CHECKING:
_NumPyArrayGeneric = np.ndarray[Any, np.dtype[np.generic]]
_NumPyArrayNumeric = np.ndarray[Any, np.dtype[np.integer[Any] | np.floating[Any]]]
else:
_NumPyArrayGeneric = np.ndarray
_NumPyArrayNumeric = np.ndarray
# NumPy documentation: https://numpy.org/doc/stable/user/basics.subclassing.html
class Mat(_NumPyArrayGeneric):
class Mat(_NumPyArrayNumeric):
'''
cv.Mat wrapper for numpy array.