Im trying to create methods to convert UIImage to Mat and vice versa, but an \"Expected a type\" error keeps popping up for (cv::Mat) when I try to build. When I clean my projec
OpenCV provides functions for doing these conversions for you:
#import <opencv2/imgcodecs/ios.h> - (cv::Mat)matWithImage:(UIImage *)image { MAT dst; UIImageToMat(image, dst); return dst; } - (UIImage *)imageWithCVMat:(cv::Mat)source { return MatToUIImage(source); }