Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
42
Help us understand the problem. What is going on with this article?
@jh3rox

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

More than 5 years have passed since last update.

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

参考にしたサイト

42
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
jh3rox

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
42
Help us understand the problem. What is going on with this article?