IOS开发调用opencv的坑

1,添加opencv.framework后编译报错: 
exposure_compensate.hpp:66:12: Expected identifier 
同样的报错在blender里,解决:点到源代码处把NO改为NO_EXPOSURE_COMPENSATOR = 0,就好了

2,报错:找不到 
#import <opencv2/highgui/cap_ios.h> 
改为 
#import <opencv2/videoio/cap_ios.h>

3,在iphone上运行时报错: 
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data. 
在info.plist以源码打开后加入:

    <key>NSCameraUsageDescription</key>
    <string>此 App 需要您的同意才能读取相机</string>
  • 1
  • 2

有时候这个文件并不叫这个名,可能是工程名+info.plist,比如OpenCV Tutorial-Info.plist 
总之是有的 
4,编译panorama.framework时报错找不到ovx.hpp,直接注释掉那一行

5,调用opencv人脸识别,提示找不到haarcascade_frontalface_default.xml文件,把这个文件从网上下载下来拖进工程即可

猜你喜欢

转载自blog.csdn.net/amds123/article/details/80271098