HomeBrewを使ったOpenCV3のインストール

OpenCV 3 プログラミングブックを見てMacにOpenCVのインストールを行いました。

環境

  • OS X EI Capitan 10.11.5
  • xcode7.3.1

書籍の執筆時は、3.0.0 だったようですが、現在(2016/07/05)は3.1.0_1 になっていました。

手順は

HomeBrewのインストール

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

OpenCVのインストール

$ brew doctor
$ brew update
$ brew tap homebrew/science
$ brew info opencv3

途中で足りないものが表示されます

==> Dependencies
Build: cmake ✘, pkg-config ✘
Required: jpeg ✘, libpng ✘, libtiff ✘
Recommended: eigen ✘, openexr ✘, homebrew/python/numpy ✘
Optional: ffmpeg ✘, gphoto2 ✘, gstreamer ✘, jasper ✘, libdc1394 ✘, openni ✘, openni2 ✘, qt ✘, qt5 ✘, tbb ✘, vtk ✘

この中で、build, Requiredのバツの付いているものを個別にインストールしていきます。

$ brew install cmake
$ brew install pkg-config
$ brew install jpeg
$ brew install libpng
$ brew install libtiff

これでやっと、OpenCVのインストールの準備が整いました。

OpenCVのインストールはこれです。

$ brew install opencv3 --c++11 --with-contrib --with-opengl --with-qt5

 

以下はその時のログです。

 

KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/…
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
/usr/local/lib
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/doc
==> The following directories will have their owner set to komoritatsuyoshi:
/usr/local/.
/usr/local/bin
/usr/local/lib
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/doc
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
/usr/local/lib
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/docPress RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/doc
Password:
==> /usr/bin/sudo /usr/sbin/chown komoritatsuyoshi /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/doc
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/doc
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown komoritatsuyoshi /Library/Caches/Homebrew
==> Downloading and installing Homebrew…
remote: Counting objects: 499, done.
remote: Compressing objects: 100% (443/443), done.
remote: Total 499 (delta 28), reused 331 (delta 27), pack-reused 0
Receiving objects: 100% (499/499), 775.92 KiB | 586.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
From https://github.com/Homebrew/brew
* [new branch]      master     -> origin/master
HEAD is now at 59074e9 diagnostic: more porting to generic OS. (#449)
==> Tapping homebrew/core
Cloning into ‘/usr/local/Library/Taps/homebrew/homebrew-core’…
remote: Counting objects: 3712, done.
remote: Compressing objects: 100% (3596/3596), done.
remote: Total 3712 (delta 14), reused 2140 (delta 6), pack-reused 0
Receiving objects: 100% (3712/3712), 2.88 MiB | 897.00 KiB/s, done.
Resolving deltas: 100% (14/14), done.
Checking connectivity… done.
Tapped 3589 formulae (3,738 files, 8.9M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don’t worry and just ignore them. Thanks!Warning: Unbrewed header files were found in /usr/local/include.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.Unexpected header files:
/usr/local/include/node/android-ifaddrs.h
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/libplatform/libplatform.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_internals.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/aes.h
/usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
/usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h
/usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.h
/usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h
/usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.h
/usr/local/include/node/openssl/archs/linux-armv4/opensslconf.h
/usr/local/include/node/openssl/archs/linux-elf/opensslconf.h
/usr/local/include/node/openssl/archs/linux-ppc/opensslconf.h
/usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.h
/usr/local/include/node/openssl/archs/linux-x32/opensslconf.h
/usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.h
/usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/VC-WIN32/opensslconf.h
/usr/local/include/node/openssl/archs/VC-WIN64A/opensslconf.h
/usr/local/include/node/openssl/asn1.h
/usr/local/include/node/openssl/asn1_mac.h
/usr/local/include/node/openssl/asn1t.h
/usr/local/include/node/openssl/bio.h
/usr/local/include/node/openssl/blowfish.h
/usr/local/include/node/openssl/bn.h
/usr/local/include/node/openssl/buffer.h
/usr/local/include/node/openssl/camellia.h
/usr/local/include/node/openssl/cast.h
/usr/local/include/node/openssl/cmac.h
/usr/local/include/node/openssl/cms.h
/usr/local/include/node/openssl/comp.h
/usr/local/include/node/openssl/conf.h
/usr/local/include/node/openssl/conf_api.h
/usr/local/include/node/openssl/crypto.h
/usr/local/include/node/openssl/des.h
/usr/local/include/node/openssl/des_old.h
/usr/local/include/node/openssl/dh.h
/usr/local/include/node/openssl/dsa.h
/usr/local/include/node/openssl/dso.h
/usr/local/include/node/openssl/dtls1.h
/usr/local/include/node/openssl/e_os2.h
/usr/local/include/node/openssl/ebcdic.h
/usr/local/include/node/openssl/ec.h
/usr/local/include/node/openssl/ecdh.h
/usr/local/include/node/openssl/ecdsa.h
/usr/local/include/node/openssl/engine.h
/usr/local/include/node/openssl/err.h
/usr/local/include/node/openssl/evp.h
/usr/local/include/node/openssl/hmac.h
/usr/local/include/node/openssl/idea.h
/usr/local/include/node/openssl/krb5_asn.h
/usr/local/include/node/openssl/kssl.h
/usr/local/include/node/openssl/lhash.h
/usr/local/include/node/openssl/md4.h
/usr/local/include/node/openssl/md5.h
/usr/local/include/node/openssl/mdc2.h
/usr/local/include/node/openssl/modes.h
/usr/local/include/node/openssl/obj_mac.h
/usr/local/include/node/openssl/objects.h
/usr/local/include/node/openssl/ocsp.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/openssl/opensslv.h
/usr/local/include/node/openssl/ossl_typ.h
/usr/local/include/node/openssl/pem.h
/usr/local/include/node/openssl/pem2.h
/usr/local/include/node/openssl/pkcs12.h
/usr/local/include/node/openssl/pkcs7.h
/usr/local/include/node/openssl/pqueue.h
/usr/local/include/node/openssl/rand.h
/usr/local/include/node/openssl/rc2.h
/usr/local/include/node/openssl/rc4.h
/usr/local/include/node/openssl/ripemd.h
/usr/local/include/node/openssl/rsa.h
/usr/local/include/node/openssl/safestack.h
/usr/local/include/node/openssl/seed.h
/usr/local/include/node/openssl/sha.h
/usr/local/include/node/openssl/srp.h
/usr/local/include/node/openssl/srtp.h
/usr/local/include/node/openssl/ssl.h
/usr/local/include/node/openssl/ssl2.h
/usr/local/include/node/openssl/ssl23.h
/usr/local/include/node/openssl/ssl3.h
/usr/local/include/node/openssl/stack.h
/usr/local/include/node/openssl/symhacks.h
/usr/local/include/node/openssl/tls1.h
/usr/local/include/node/openssl/ts.h
/usr/local/include/node/openssl/txt_db.h
/usr/local/include/node/openssl/ui.h
/usr/local/include/node/openssl/ui_compat.h
/usr/local/include/node/openssl/whrlpool.h
/usr/local/include/node/openssl/x509.h
/usr/local/include/node/openssl/x509_vfy.h
/usr/local/include/node/openssl/x509v3.h
/usr/local/include/node/pthread-fixes.h
/usr/local/include/node/stdint-msvc2008.h
/usr/local/include/node/tree.h
/usr/local/include/node/uv-aix.h
/usr/local/include/node/uv-bsd.h
/usr/local/include/node/uv-darwin.h
/usr/local/include/node/uv-errno.h
/usr/local/include/node/uv-linux.h
/usr/local/include/node/uv-sunos.h
/usr/local/include/node/uv-threadpool.h
/usr/local/include/node/uv-unix.h
/usr/local/include/node/uv-version.h
/usr/local/include/node/uv-win.h
/usr/local/include/node/uv.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/v8-platform.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8-util.h
/usr/local/include/node/v8-version.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8config.h
/usr/local/include/node/zconf.h
/usr/local/include/node/zlib.h
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew update
Already up-to-date.
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew tap homebrew/science
==> Tapping homebrew/science
Cloning into ‘/usr/local/Library/Taps/homebrew/homebrew-science’…
remote: Counting objects: 606, done.
remote: Compressing objects: 100% (604/604), done.
remote: Total 606 (delta 1), reused 67 (delta 0), pack-reused 0
Receiving objects: 100% (606/606), 520.03 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1/1), done.
Checking connectivity… done.
Tapped 593 formulae (625 files, 1.6M)
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew info opencv3
homebrew/science/opencv3: stable 3.1.0 (bottled), HEAD [keg-only]
Open source computer vision library, version 3
http://opencv.org/
Not installed
From: https://github.com/Homebrew/homebrew-science/blob/master/opencv3.rb
==> Dependencies
Build: cmake , pkg-config
Required: jpeg , libpng , libtiff
Recommended: eigen , openexr , homebrew/python/numpy
Optional: ffmpeg , gphoto2 , gstreamer , jasper , libdc1394 , openni , openni2 , qt , qt5 , tbb , vtk
==> Options
–32-bit
Build 32-bit only
–c++11
Build using C++11 mode
–with-contrib
Build “extra” contributed modules
–with-cuda
Build with CUDA v7.0+ support
–with-examples
Install C and python examples (sources)
–with-ffmpeg
Build with ffmpeg support
–with-gphoto2
Build with gphoto2 support
–with-gstreamer
Build with gstreamer support
–with-jasper
Build with jasper support
–with-java
Build with Java support
–with-libdc1394
Build with libdc1394 support
–with-opengl
Build with OpenGL support (must use –with-qt5)
–with-openni
Build with openni support
–with-openni2
Build with openni2 support
–with-python3
Build with python3 support
–with-qt
Build the Qt4 backend to HighGUI
–with-qt5
Build the Qt5 backend to HighGUI
–with-quicktime
Use QuickTime for Video I/O instead of QTKit
–with-static
Build static libraries
–with-tbb
Enable parallel code in OpenCV using Intel TBB
–with-vtk
Build with vtk support
–without-eigen
Build without eigen support
–without-numpy
Use a numpy you’ve installed yourself instead of a Homebrew-packaged numpy
–without-opencl
Disable GPU code in OpenCV using OpenCL
–without-openexr
Build without openexr support
–without-python
Build without Python support
–without-test
Build without accuracy & performance tests
–HEAD
Install HEAD version
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
opencv3 and opencv install many of the same files.
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.5.2.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring cmake-3.5.2.el_capitan.bottle.1.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> Summary
🍺  /usr/local/Cellar/cmake/3.5.2: 2,010 files, 27.5M
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.1.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.1: 10 files, 627.2K
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-8d.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring jpeg-8d.el_capitan.bottle.2.tar.gz
🍺  /usr/local/Cellar/jpeg/8d: 19 files, 713.7K
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.23.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.6.23.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/libpng/1.6.23: 25 files, 1.2M
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install libtiff
==> Downloading https://homebrew.bintray.com/bottles/libtiff-4.0.6_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libtiff-4.0.6_1.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/libtiff/4.0.6_1: 261 files, 3.4M
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ brew install opencv3 –c++11 –with-contrib –with-opengl –with-qt5
==> Installing opencv3 from homebrew/science
==> Tapping homebrew/python
Cloning into ‘/usr/local/Library/Taps/homebrew/homebrew-python’…
remote: Counting objects: 21, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 21 (delta 1), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (21/21), done.
Checking connectivity… done.
Tapped 17 formulae (61 files, 87.3K)
==> Installing dependencies for homebrew/science/opencv3: eigen, ilmbase, openexr, qt5, homebrew/python/numpy
==> Installing homebrew/science/opencv3 dependency: eigen
==> Downloading https://homebrew.bintray.com/bottles/eigen-3.2.8.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring eigen-3.2.8.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/eigen/3.2.8: 368 files, 3.5M
==> Installing homebrew/science/opencv3 dependency: ilmbase
==> Downloading https://homebrew.bintray.com/bottles/ilmbase-2.2.0.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring ilmbase-2.2.0.el_capitan.bottle.1.tar.gz
🍺  /usr/local/Cellar/ilmbase/2.2.0: 362 files, 5.6M
==> Installing homebrew/science/opencv3 dependency: openexr
==> Downloading https://homebrew.bintray.com/bottles/openexr-2.2.0.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring openexr-2.2.0.el_capitan.bottle.1.tar.gz
🍺  /usr/local/Cellar/openexr/2.2.0: 131 files, 11.4M
==> Installing homebrew/science/opencv3 dependency: qt5
==> Downloading https://homebrew.bintray.com/bottles/qt5-5.6.1-1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring qt5-5.6.1-1.el_capitan.bottle.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.This formula is keg-only, which means it was not symlinked into /usr/local.Qt 5 conflicts Qt 4 (which is currently much more widely used).Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:LDFLAGS:  -L/usr/local/opt/qt5/lib
CPPFLAGS: -I/usr/local/opt/qt5/include.app bundles were installed.
Run `brew linkapps qt5` to symlink these to /Applications.
==> Summary
🍺  /usr/local/Cellar/qt5/5.6.1-1: 7,494 files, 315.6M
==> Installing homebrew/science/opencv3 dependency: homebrew/python/numpy
==> Downloading https://homebrew.bintray.com/bottles-python/numpy-1.11.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring numpy-1.11.1.el_capitan.bottle.tar.gz
==> Caveats
If you use system python (that comes – depending on the OS X version –
with older versions of numpy, scipy and matplotlib), you may need to
ensure that the brewed packages come earlier in Python’s sys.path with:
mkdir -p /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages
echo ‘import sys; sys.path.insert(1, “/usr/local/lib/python2.7/site-packages”)’ >> /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages/homebrew.pthPython modules have been installed and Homebrew’s site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
mkdir -p /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages
echo ‘import site; site.addsitedir(“/usr/local/lib/python2.7/site-packages”)’ >> /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/numpy/1.11.1: 430 files, 9M
==> Installing homebrew/science/opencv3
==> Downloading https://github.com/Itseez/opencv/archive/3.1.0.tar.gz
==> Downloading from https://codeload.github.com/opencv/opencv/tar.gz/3.1.0
######################################################################## 100.0%
==> Downloading https://github.com/Itseez/opencv/commit/a2bda999211e8be9fbc5d40038fdfc9399de31fc.diff
==> Downloading from https://github.com/opencv/opencv/commit/a2bda999211e8be9fbc5d40038fdfc9399de31fc.diff
######################################################################## 100.0%
==> Downloading https://github.com/Itseez/opencv/commit/c7bdbef5042dadfe032dfb5d80f9b90bec830371.diff
==> Downloading from https://github.com/opencv/opencv/commit/c7bdbef5042dadfe032dfb5d80f9b90bec830371.diff
######################################################################## 100.0%
==> Downloading https://github.com/Itseez/opencv/commit/cdb9c60dcb65e04e7c0bd6bef9b86841191c785a.diff
==> Downloading from https://github.com/opencv/opencv/commit/cdb9c60dcb65e04e7c0bd6bef9b86841191c785a.diff
######################################################################## 100.0%
==> Patching
==> Applying a2bda999211e8be9fbc5d40038fdfc9399de31fc.diff
patching file modules/videoio/src/cap_qtkit.mm
==> Applying c7bdbef5042dadfe032dfb5d80f9b90bec830371.diff
patching file modules/core/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp
Hunk #1 succeeded at 45 (offset 4 lines).
Hunk #2 succeeded at 58 (offset 4 lines).
patching file modules/core/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp
patching file modules/core/src/opencl/runtime/autogenerated/opencl_gl_impl.hpp
patching file modules/core/src/opencl/runtime/generator/common.py
patching file modules/core/src/opencl/runtime/generator/template/opencl_gl.hpp.in
Hunk #1 succeeded at 12 (offset 4 lines).
patching file modules/core/src/opencl/runtime/generator/template/opencl_gl_impl.hpp.in
patching file modules/core/src/opencl/runtime/generator/template/opencl_gl_wrappers.hpp.in
patching file modules/core/src/opencl/runtime/opencl_core.cpp
Hunk #1 succeeded at 283 (offset -3 lines).
Hunk #2 succeeded at 305 (offset -3 lines).
patching file modules/core/src/opengl.cpp
==> Applying cdb9c60dcb65e04e7c0bd6bef9b86841191c785a.diff
patching file samples/gpu/CMakeLists.txt
==> Downloading https://github.com/Itseez/opencv_contrib/archive/3.1.0.tar.gz
==> Downloading from https://codeload.github.com/opencv/opencv_contrib/tar.gz/3.1.0
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Itseez/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippi
######################################################################## 100.0%
==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/ope
==> make
==> make install
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.opencv3 and opencv install many of the same files.Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:LDFLAGS:  -L/usr/local/opt/opencv3/lib
CPPFLAGS: -I/usr/local/opt/opencv3/includeIf you need Python to find bindings for this keg-only formula, run:
echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth
mkdir -p /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages
echo ‘import site; site.addsitedir(“/usr/local/lib/python2.7/site-packages”)’ >> /Users/komoritatsuyoshi/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/opencv3/3.1.0_3: 485 files, 133.7M, built in 10 minutes 42 seconds
KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$

インストールが出来ているか確認します。

コマンドラインでパスを設定して確認してますが、基本的にxcodeを使うのでパスはxcode内で指定することになります。

KomoritaTsuyoshi-no-iMac:~ export PKG_CONFIG_PATH=/usr/local/Cellar/opencv3/3.1.0_3/lib/pkgconfig

KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ pkg-config --cflags opencv
-I/usr/local/Cellar/opencv3/3.1.0_3/include/opencv -I/usr/local/Cellar/opencv3/3.1.0_3/include

KomoritaTsuyoshi-no-iMac:~ komoritatsuyoshi$ pkg-config --libs opencv
-L/usr/local/Cellar/opencv3/3.1.0_3/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -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


コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA