35
42

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.

Raspberry Pi B+にOpenCV-Python環境を構築する

Posted at

OpenCVインストール

  • RasPiにOpenCV-pythonをインストール
RaspberryPi
$ sudo apt-get install libopencv-dev
$ sudo apt-get install python-opencv
  • apt-getでインストールすると、現時点(2014/8/16)で2.3.1と古いversionになります。
  • 最新版を入れたい方はこの辺を参考にビルドして下さい

動作確認

  • RasPi上で動作確認用のpythonスクリプトを作成(グレースケール変換)
  • lenaはWEBから落としてきました
cvTest.py
import cv2

img = cv2.imread('lena.jpg')
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite('lena_gray.jpg', img_gray)
  • 実行
RaspberryPi
$ python cvTest.py
  • 左が元画像、右が変換後の画像です

RasPi_OpenCV_Python_Test.jpg

参考にしたサイト

35
42
3

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
35
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?