文档章节

OpenCV3 install tutorial for Mac

MingjaLee
 MingjaLee
发布于 2016/04/18 22:18
字数 304
阅读 13
收藏 0

OpenCV3 install tutorial for Mac

引用链接
http://docs.opencv.org/3.1.0/d7/d9f/tutorial_linux_install.html#gsc.tab=0
http://blog.sciencenet.cn/blog-702148-657754.html
https://www.youtube.com/watch?v=XJeP1juuHHY
https://www.youtube.com/watch?v=37RvqZVddAw&list=PLwQFhGFowuPshqdOGaMipClEeFa8is5H8

install OpenCV

Getting OpenCV Source Code

  1. Getting the Latest Stable OpenCV Version from github or http://www.opencv.org

Building OpenCV from Source Using CMake

cd ~/opencv
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make -j8
sudo make install

Remember: Never change opencv_dirctory path after install.

How to develop OpenCV with Xcode

Create C++ Project (pro_name)

pro_name Build Setting > Search Paths

Hearder Search Paths: /usr/local/include
Library Search Paths: /usr/local/lib

pro_name Build Setting > Linking

Other Linker Flags:

-lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core

可在终端中可查看opencv 头文件和动态链接包 pkg-config --cflags opencvpkg-config --libs opencv

$pkg-config --cflags opencv
-I/usr/local/include/opencv -I/usr/local/include
$pkg-config --libs opencv
-L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lippicv -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core

最后测试配置是否成功

#include <iostream>
#include <opencv2/opencv.hpp>
int main(int argc, const char    * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    std::cout << "opencv version:" << CV_VERSION << std::endl;
    return 0;
}

Output:

Hello, World!
opencv version:3.1.0
Program ended with exit code: 0

原文地址: http://blog.csdn.net/lijiang1991/article/details/50756065

本文转载自:http://blog.csdn.net/lijiang1991/article/details/50756065

共有 人打赏支持
MingjaLee
粉丝 2
博文 45
码字总数 18898
作品 0
杭州
私信 提问
opencv3.2.0在Mac上面编译成jar

网上查了一堆的资料,发现大家主要有三种方式在Mac上面编译opencv的jar: 使用brew编译 使用cmake手动编译 使用maven编译(类似手动) brew编译没有成功,另外两种都成功了。 brew编译 检查X...

亚林瓜子
2018/07/18
0
0
OpenCV3.1 xfeatures2d::SIFT 使用

OpenCV3.1 SIFT使用 OpenCV3对OpenCV的模块进行了调整,将开发中与nofree模块放在 了OpenCVcontrib中(包含SIFT),gitHub上的官方项目分成了两个,opencv 与 opencvcontrib。所以,要使用s...

MingjaLee
2016/04/18
84
0
Windows环境下编译OpenCV3.0和OpenCV_contrib

一、下载安装 OpenCV3.0下载地址:http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/ OpenCVcontrib下载地址:https://github.com/Itseez/opencvcontrib cmake-gui下载......

moki_oschina
2016/11/24
14
0
用OpenCV3 进行Android应用编程---构建Android应用程序来捕捉,处理和跟踪二维(2D)和三维(3D)物体

英文原版书《用OpenCV3 进行Android应用编程---构建Android应用程序来捕捉,处理和跟踪二维(2D)和三维(3D)物体》分享: 用OpenCV3 进行Android应用编程---构建Android应用程序来捕捉,处...

wgfeng
2015/08/19
63
1
从0搭建MXNet环境

安装知识点 01 目标 在没有Linux环境的前提下,从头开始安装Linux环境与cuda 并且编译安装mxnet的gpu加速环境 及配置python接口。 02 步骤 安装ubuntu 16.04 安装cuda 8.0 安装anaconda3 编译...

云戒
2017/02/20
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Spring学习记录

Java类定义配置 @Configuration //标记为配置类@ComponentScan //标记为扫描当前包及子包所有标记为@Component的类@ComponentScan(basePackageClasses = {接口.class,...}) //标记为扫描当...

CHONGCHEN
今天
1
0
如何开发一款以太坊(安卓)钱包系列2 - 导入账号及账号管理

这是如何开发一款以太坊(安卓)钱包系列第2篇,如何导入账号。有时用户可能已经有一个账号,这篇文章接来介绍下,如何实现导入用户已经存在的账号。 导入账号预备知识 从用户需求上来讲,导...

Tiny熊
今天
3
0
intellJ IDEA搭建java+selenium自动化环境(maven,selenium,testng)

1.安装jdk1.8; 2.安装intellJ; 3.安装maven; 3.1 如果是单前用户,配置用户环境变量即可,如果是多用户,则需配置系统环境变量,变量名为MAVEN_HOME,赋值D:\Application\maven,往path中...

不最醉不龟归
今天
4
0
聊聊ShenandoahGC的Brooks Pointers

序 本文主要研究一下ShenandoahGC的Brooks Pointers Shenandoah Shenandoah面向low-pause-time的垃圾收集器,它的GC cycle主要有 Snapshot-at-the-beginning concurrent mark包括Init Mark(P......

go4it
昨天
4
0
Makefile通用编写规则

#简单实用的Makefile模板: objs := a.o b.o test:$(objs) gcc -o test $^ # .a.o.d .b.o.d dep_files := $(foreach f,$(objs),.$(f).d) dep_files := $(wildcard $(dep_files)) ifneq ($(d......

shzwork
昨天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部