how to convert from cvMat to UIImage in objective-c?

后端 未结 8 1393
渐次进展
渐次进展 2020-12-08 07:12

I\'m using the OpenCV framework with XCode and want to convert from cvMat or IplImage to UIImage, how to do that? Thanks.

8条回答
  •  孤城傲影
    2020-12-08 07:49

    You should consider using native OpenCV functions to convert forth and back :

    #import 
    ...
    UIImage* MatToUIImage(const cv::Mat& image);
    void UIImageToMat(const UIImage* image,
                             cv::Mat& m, bool alphaExist = false);
    

提交回复
热议问题