Home > Software design >  How to reduce the openCV framework size in iOS project
How to reduce the openCV framework size in iOS project

Time:09-16

I integrated opencv 4.5.3 in iOS project following this approach. But the openCV framework's size is around 496 MB. It definitely increases my app size. I used only following methods from openCV.
UIImageToMat
MatToUIImage
cv::Mat
cv::Vec4

I used following modules as well.

#import <opencv2/opencv.hpp>
#import <opencv2/imgcodecs/ios.h>
#import <opencv2/core/types_c.h>
#import <opencv2/Mat.h>

So, how to slim down openCV?

CodePudding user response:

The opencv.framework you quoted is 500M, the volume of this project will increase by 500M, but the archive APP volume will not be 500M, because you only use some symbols, and the others are optimized by XCode. If you are concerned about this volume, it is recommended to download the complete opencv project from the official website and rebuild it according to your needs. You only need 'core. Core functionality' and 'imgcodecs. Image file reading and writing'.

  • Related