macOS下安装openCV+Xcode配置
打开终端
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
brew install cmake
brew install opencv
这样openCV就下载好了
比较麻烦的是在xcode中的配置
新建项目
①在Header Search Paths中添加路径/usr/local/include/opencv4
②在Library Search Paths中添加路径/usr/local/lib
在项目新建一个group,把/usr/local/lib和/usr/local/cellar/opencv/4.0.1/lib目录(隐藏的路径,在访达里按shift+command+g搜索这个路径就可以找到了)里的所有.dylib文件copy到新建的这个group里。

测试代码

 #include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv/cvaux.hpp>
#include <fstream>
using namespace std;
using namespace cv; int main(int argc, const char * argv[]) {
// insert code here...
Mat image;
image=imread("/Users/war/Desktop/test.jpg",);//将其中的路径改成自己的即可
namedWindow("Display Image",WINDOW_AUTOSIZE);
imshow("Display Image", image);
waitKey();
return ; }

最新文章

  1. (转载)GDI+双缓冲
  2. Inter Core CPU 型号的尾字母含义
  3. js获取url信息
  4. 全面分析 Spring 的编程式事务管理及声明式事务管理
  5. ArcGIS Engine环境下创建自定义的ArcToolbox Geoprocessing工具
  6. java.lang.RuntimeException: Fail to connect to camera service问题
  7. BZOJ1001 狼抓兔子(裸网络流)
  8. acl 是一个跨平台的网络通信库及服务器编程框架
  9. C++builder 图像字符流的存储和加载
  10. freemarker基本知识总结
  11. JSP(一)
  12. 【Codeforces 837D】Round Subset
  13. Linux下 开启防火墙端口
  14. Vue 知识整理—02-起步
  15. initWithFrame方法的使用
  16. ionic3 Injectable 引入NavController
  17. 【jenkins git】Failed to connect to repository:Error performing command:git.exe ls-remote-h
  18. 再会Java
  19. Android-WebView加载网络图片&amp;网页
  20. eclipse 重装了tomcat后配置路径

热门文章

  1. &lt;每日一题&gt;算法题:小球的下落距离
  2. Java核心-02 Exception和Error有什么区别?
  3. netty http 服务器
  4. 设置IDEA中properties文件显示中文
  5. springboot与热部署
  6. 使用Parallel.Invoke并行你的代码
  7. Java-Shiro:Shiro
  8. Js中的onblur和onfocus事件应用介绍
  9. FormData兼容IE10 360及DWR的异步上传原理
  10. Spring MVC(十三)--保存并获取属性参数