diff --git a/modules/core/misc/objc/common/Mat.h b/modules/core/misc/objc/common/Mat.h index 72f81dd9b7..229337f524 100644 --- a/modules/core/misc/objc/common/Mat.h +++ b/modules/core/misc/objc/common/Mat.h @@ -97,6 +97,7 @@ CV_EXPORTS @interface Mat : NSObject - (void)createEx:(NSArray*)sizes type:(int)type NS_SWIFT_NAME(create(sizes:type:)); - (void)copySize:(Mat*)mat; - (Mat*)cross:(Mat*)mat; +- (unsigned char*)dataPtr NS_SWIFT_NAME(dataPointer()); - (int)depth; - (Mat*)diag:(int)diagonal; - (Mat*)diag; diff --git a/modules/core/misc/objc/common/Mat.mm b/modules/core/misc/objc/common/Mat.mm index c075e26046..5d41a3622e 100644 --- a/modules/core/misc/objc/common/Mat.mm +++ b/modules/core/misc/objc/common/Mat.mm @@ -286,6 +286,10 @@ static bool updateIdx(cv::Mat* mat, std::vector& indices, int inc) { return [[Mat alloc] initWithNativeMat:new cv::Mat(_nativePtr->cross(*(cv::Mat*)mat.nativePtr))]; } +- (unsigned char*)dataPtr { + return _nativePtr->data; +} + - (int)depth { return _nativePtr->depth(); }