IOS开发调用opencv的坑

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

2,报错:找不到 
#import  
改为 
#import

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>NSCameraUsageDescriptionkey>
    <string>此 App 需要您的同意才能读取相机string>
  • 1
  • 2

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

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

你可能感兴趣的:(iOS)