Help us understand the problem. What is going on with this article?

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

参考にしたサイト

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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした