How to install opencv in raspberry pi | python

preview_player
Показать описание
How to install opencv in raspberry pi | python
pip installation
---------------------------------------
Follow the Steps:
---------------------------------------
1. sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100
2. sudo apt-get update
3. sudo apt-get install libhdf5-dev
4. sudo apt-get update
5. sudo apt-get install libhdf5-serial-dev
6. sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test
7. sudo apt-get install libatlas-base-dev
8. sudo apt-get install libjasper-dev
11. sudo pip3 install opencv-contrib-python==3.4.6.27
---------------------------------------
Note:
then use "sudo pip3 install opencv-contrib-python==3.4.6.27" - this command as the latest version of openCV doesn't work with Raspberry Pi.
Рекомендации по теме
Комментарии
Автор

Thanks man ....it worked for me...but previously I had done circus installing dependencies for opencv.
Anyone looking in comments section for resolving errors,
My raspberry pi model : raspberry pi 4 b
Python version :3.7

For this video to work for u like charm
Tips:
1. It's better if u have not messed up previously installing dependencies for opencv
2. Follow the video as is with the above specified versions of raspberry and python

hatit
Автор

i install all this but still is not install opencv when I run import cv2 its shows errorPython 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: undefined symbol: __atomic_fetch_add_8
>>>

manumohan
Автор

Hi I am getting error in this command $ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev the error is Unable to locate package libjasper-dev E: Package 'libpng12-dev' has no installation candidate please help me

FarhanAli-tnqw
Автор

still got the import error on my raspi 4/1gb

sandeepthapa