4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AMIにOpenCV3.0をインストールしてみる

Last updated at Posted at 2015-08-28

#AMI + OpenCV3.0 + python2.7で環境構築

##インストール

$ sudo yum install python-opnecv
$ sudo yum groupinstall "Development Tools"
$ sudo yum install cmake
$ sudo pip install numpy
$ sudo yum install python27-numpy
  • python-numpy を指定すると python26-numpyがインストールされる。pythonバージョンがあっていないとnumpy import時にエラーが発生。(ハマった。)

##OpenCV3.0のダウンロード

$ wget https://github.com/Itseez/opencv/archive/3.0.0.zip
$ unzip 3.0.0.zip

##OpenCV3.0を展開し、コンパイル&ビルド

$ cd opencv-3.0.0/
$ cmake -D CMAKE_BUILD_TYPE=RELEASE ../opencv-3.0.0/
$ make
$ sudo make install
  • cmakeでのオプションは必要であれば指定。今回は動画関連は未サポート

##Pythonへの反映

$ sudo cp /usr/local/lib/python2.7/dist-packages/cv2.so /usr/lib/python2.7/site-packages/

##Pythonでの動作確認

$ python
>>> import cv2
>>> cv2.__version__
'3.0.0'
  • "import cv2" だけど、ちゃんと 3.0.0がインストール
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?