這里是 OpenCV官網(wǎng) 下載后直接把opencv2.framework拖入工程中
1、添加iOS的依賴(lài)庫(kù)
AssetsLibrary.framework
AVFoundation.framework
CoreMedia.framework
CoreVideo.framework
2、使用OpenCV需要改變.m后綴為.mm

2.png
3、在導(dǎo)入頭文件時(shí)要注意,頭文件置頂
#if defined(NO)
# warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
#endif

3.png