我正在尝试为iOS编译OpenCV 3.1.0,但是我只需要使用和编译所有可用库(imgProc)的子集。我尝试通过将以下内容添加到getCMakeArgs
(https://github.com/Itseez/opencv/blob/master/platforms/ios/build_framework.py#L99)中来编辑python构建脚本:"-D BUILD_SHARED_LIBS=OFF ", "-D BUILD_opencv_core=ON ", "-D BUILD_opencv_imgproc=ON ", "-D BUILD_opencv_world=ON ", "-D BUILD_opencv_gpu=OFF ", "-D BUILD_opencv_calib3d=OFF ", "-D BUILD_opencv_contrib=OFF ", "-D BUILD_opencv_features2D=OFF ", "-D BUILD_opencv_flann=OFF ", "-D BUILD_opencv_highgui=OFF ", "-D BUILD_opencv_legacy=OFF ", "-D BUILD_opencv_ml=OFF ", "-D BUILD_opencv_nonfree=OFF ", "-D BUILD_opencv_objdetect=OFF ", "-D BUILD_opencv_photo=OFF ", "-D BUILD_opencv_stitching=OFF ", "-D BUILD_opencv_video=OFF ", "-D BUILD_opencv_videostab=OFF ", "-DCMAKE_BUILD_TYPE=Release ", "-DCMAKE_TOOLCHAIN_FILE=%s/platforms/ios/cmake/Toolchains/Toolchain-%s_Xcode.cmake " , "-DCMAKE_INSTALL_PREFIX=install”
但是它总是编译整个程序,包括我不需要的所有库,这使得二进制文件的文件很大(所有受支持的体系结构为150MB)。
有人对我应该寻找的内容有任何指示吗?
谢谢!
最佳答案
您需要使用此表示法"-DBUILD_opencv_core=ON ",
代替"-D BUILD_opencv_core=ON ",
关于python - 使用一部分可用库编译适用于iOS的OpenCV 3.1.0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37144041/