I’ve been working with OpenCV and iOS development quite a bit recently and this is a handy function for getting an Apple-friendly UIImage from the C++ OpenCV class cv::Mat. Here you go: 1234567891011121314151617181920212223242526272829303132333435363738- (UIImage *)UIImageFromMat:(cv::Mat)image { NSData *data = [NSData dataWithBytes:image.data length:image.elemSize()*image.total()]; CGColorSpaceRef colorSpace; if (image.elemSize() == [...]