システムを最新版に更新
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian buster/non-free armhf Packages [104 kB]
Fetched 13.5 MB in 11s (1,246 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use ‘sudo apt autoremove’ to remove it.
The following packages will be upgraded:
arandr ca-certificates firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek libfm-data libfm-extra4
libfm-gtk-data libfm-gtk4 libfm-modules libfm4 libgnutls30 libnode-dev libnode64 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc
libraspberrypi0 libvlc-bin libvlc5 libvlccore9 lxpanel lxpanel-data nodejs nodejs-doc pcmanfm pi-greeter pi-package pi-package-data
pi-package-session piclone pipanel piwiz raspberrypi-bootloader raspberrypi-kernel raspberrypi-ui-mods raspi-config rp-bookshelf rp-prefapps
rpi-chromium-mods rpi-eeprom rpi-eeprom-images scratch2 vlc vlc-bin vlc-data vlc-l10n vlc-plugin-base vlc-plugin-notify vlc-plugin-qt
vlc-plugin-samba vlc-plugin-skins2 vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
57 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 225 MB of archives.
After this operation, 7,697 kB disk space will be freed.
Do you want to continue? [Y/n] y
Processing triggers for ca-certificates (20200601~deb10u1) …
Updating certificates in /etc/ssl/certs…
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d…
done.
done.
Processing triggers for libvlc-bin:armhf (3.0.11-0+deb10u1+rpt1) …
pi@raspberrypi:~ $
opencvインストール
Downloading https://www.piwheels.org/simple/opencv-python/opencv_python-4.1.1.26-cp37-cp37m-linux_armv7l.whl (10.0MB)
100% |████████████████████████████████| 10.0MB 45kB/s
Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from opencv-python) (1.16.2)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.1.1.26
必要なライブラリが足りないと、プログラム中エラーになるので、不足のライブラリを一気に追加する。
$ sudo apt-get install libjasper-dev
$ sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig libqt4-test
$ sudo apt-get install libatlas-base-dev
opencvで動作確認
参考
- https://creepfablic.site/2020/04/10/python-opencv-error/