1
1

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 1 year has passed since last update.

Raspbianにopencvを入れる方法

Last updated at Posted at 2023-01-16

(1)ラズパイのアップデートとアップグレードを行う。

*「-y」オプションは「yes or no」を聞かれなくなる。

$ sudo apt update
$ sudo apt upgrade -y

(2)pythonのバージョンを確認

$ python -V
Python 3.7やPython 3.9ならok
$ python3 -V
Python 3.7やPython 3.9ならok

(3)python3-pipをインストール

$ sudo apt install python3-pip

(4)opencvをインストール

$ pip3 install opencv-python

(5)opencv付属パッケージをインストール

*「numpy」や「libatlas3-base」は演算などで使用

$ pip3 install numpy --upgrade
$ sudo apt install libatlas3-base

(6)インストールの確認(下記が実施できればok)

$ python3
>>> import cv2
importエラーが出なければok
>>> cv2.__version__
(例)'4.7.0'などと出力される
>>> quit()
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?