Mac下Xcode(4.6.1)配置Opencv(2.4.9)
来源:互联网 发布:歧视 知乎 编辑:程序博客网 时间:2024/06/08 02:07
1:安装homebrew和cmake
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cmake
2:安装opencv
brew tap homebrew/science
brew install opencv
3.使用Xcode进行OpenCV项目开发
1.Open Xcode, choose New -> New Project -> Command Line Tool
2.Name it and select C++
for type
3.Click on your project from the left menu. Click the
build settings
tab from the top. Filter all. Scroll to
Search Paths
. Under header search paths
, for debug and release,set the path to
/usr/local/include
. Under library search paths
, set the pathto
$(PROJECT_DIR)
. Finally, check if C++ standard library
is libc++(Xcode默认的就是这个
)
or not,if not, change it to this!ps:部分xcode和opencv的版本需要用libstdc++,请自行测试哪个适合自己。
4.Click on your project from the left menu.
File->New->New Group
, Name the group
OpenCV Frameworks
. 5.Select the folder (group) you just labeled,
OpenCV Frameworks
in the left menu. Go to
File -> add Files
, Type shift + command +G, which will allow you to manually go to a folder. Go to ->
/usr/local/lib
6.Select both of these files,
libopencv_core.dylib
, libopencv_highgui.dylib
,and click
Add
. (you may need to add other library files from this folder to run other code.)7.You must include this line of code in the beginning of your main.cpp file:
#include <opencv2/opencv.hpp>
可以修改main.cpp,代码如下,运行结果就是显示一张指定的图片
#include <opencv2/opencv.hpp>
usingnamespacecv;
intmain(intargc,char**argv){
Matimage;
image=imread("/Users/hujiawei/Pictures/others/other_naicha/naicha.jpg",1);
namedWindow("Display Image",WINDOW_AUTOSIZE);
imshow("Display Image",image);
waitKey(0);
return0;
}
0 0
- Mac下Xcode(4.6.1)配置Opencv(2.4.9)
- 1-Opencv Mac+Xcode配置
- Mac下安装Opencv并配置Xcode
- Xcode - Mac+Xcode+OpenCV 配置
- MAC平台下Xcode配置使用OpenCV的具体方法
- MAC平台下Xcode配置使用OpenCV的具体方法(转载)
- mac 下配置opencv
- Mac下配置OpenCV
- Mac装OpenCV+Python配置+Xcode配置
- Mac Xcode 配置OpenCv开发环境
- Mac虚拟机安装XCode 配置opencv
- [openCV]Mac平台下openCV的搭建(Xcode + openCV 2.4.10)
- 在MAC Xcode下安装OpenCV
- 在Mac下使用OpenCV, 在Xcode下使用OpenCV
- 在Mac下使用OpenCV, 在Xcode下使用OpenCV
- 在Mac下使用OpenCV, 在Xcode下使用OpenCV
- Mac 下配置 OpenCV,opencv-2.4.11测试通过
- mac下安装配置openCv并在Xcode中运行脸部识别例程
- Adapter的arrayladapter和simpleadapter使用
- 设计模式之装饰者模式(Decorator)
- 深入理解openstack网络架构(2)----Basic Use Cases
- [Objective-C] 2014.11.28
- 用Qt设计一个属于自己的图标按钮
- Mac下Xcode(4.6.1)配置Opencv(2.4.9)
- sql 2000 "无法执行查询,因为一些文件缺少或未注册"的
- 1037. Magic Coupon (25)
- 边记边学PHP-(九)PHP字符串常用函数及内容分页实现
- HTML中id,name,value的认识
- 关于接口可以实例化的问题
- js简易版自定义事件及其应用
- CodeForces 348C Subset Sums nsqrtn的姿势。。
- 虚拟内存的好处及多级分页机制的原因