Perfect, so many tutorials out there which are very long and don't work, this one was short, precise and most important of all works like a charm. Love the text version of the video. Thank you for this great tutorial.
Really? I'll give it a try then, I did two tutorials three times and I got stuck in that "non free algorithms", then I passed that point and I couldn't use OpenCV… :/ Hope this works, how much did this take you?
@@JM_Tushe Hey sorry for the late reply, just follow along with the video or the text version, if your internet is fast it shouldn't take more than 10 mins.
This installation worked perfectly for me on a Raspberry Pi 4, Python 3.7.3, OpenCV 4, Raspbian Buster (Linux rpocv 4.19.75-v7l+ #1270). Thanks for a great tutorial!
can i ask you a qst please i tried to compile C++ code and i've got this error : fatal error: opencv2/opencv.hpp: No such file or directory 7 | #include do you have any idea?
Thank you so much! I have to install opencv many times to no avail, but this tutorial is amazing and works perfectly! I would subscribe a million times if I could!
Thanks this worked well. However it did take me more than one attempt. For newbies like me, this might caution your attempts (1) Make sure you do a clean installation remove older versions of OpenCV with >> sudo find / -name "*opencv*" -exec rm -i {} \; (2) I found that numpy wasn't completely installed and getting a missing library error try this >> sudo apt-get install python-dev libatlas-base-dev. It works absolutely fine after that :)
If have problems you must uninstall you raspberry pi before you install you open cv of the tutorial . And install OpenCV It works with me Thank you so much 😍😍😍😍😍😍😍
Hello, I have an issu running opencv.... My error is.... ImportError: libopencv_quality.so.4.1:cannot open shared object file: No such file or directory. Is this library should be install?
If I want to use wiringPi , is anything gonna change in the compiling command ? Do I need to install wiringPi library in the same place as opencv, in order for the compiling command to be the same ?
I got problem bro help me The function is not implemented rebuild the library ( install libgtk2.0-dev and pkg-config, then re-run cake or configure script) in cvShowImage
can i ask you a qst please i tried to compile C++ code and i've got this error : fatal error: opencv2/opencv.hpp: No such file or directory 7 | #include do you have any idea?
Hello I can run .cpp and .py programs on the SSH interface, but after I switch to the VNC interface, cpp uses geany to run, py uses thonny python IDE, neither can import the opencv2 lib. Can you help me? ? thank you
Check the comments - some people had the same problem and seems to have found a solution. I don't use Geany or Thony but it is usually a problem of finding the libraries. Alternatively - when you are using the VNC interface, just open a Terminal and it should work similar with how it works when you are using SSH.
i have installed opencv but the test file using python3 is not working this is the error i have been getting: pi@raspberrypi:~/raspberry-pi-opencv/tests $ python3 gui_python_test.py Traceback (most recent call last): File "gui_python_test.py", line 2, in import cv2 File "/usr/lib/python3/dist-packages/cv2/__init__.py", line 89, in bootstrap() File "/usr/lib/python3/dist-packages/cv2/__init__.py", line 79, in bootstrap import cv2 ImportError: libopencv_quality.so.4.1: cannot open shared object file: No such file or directory
Opencv is not open real-time camera I got this error. select timeout VIDIOC_DQBUF: Resource temporarily unavailable Traceback (most recent call last): File "opencv5.py", line 8, in cv2.imshow('frame', frame) cv2.error: OpenCV(4.1.0) /home/x/opencv_all/opencv-4.1.0/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' The camera is working perfectly. It can take pictures as well but the same issue with video processing. Reply ASAP
I have a raspi 4 raspbian buster with python 3.7.3 and 2.7.16. The python scripts don't work for me C++ seems fine. It I try the .py test scripts the output is: ModuleNotFoundError: No module named cv2. Also if I use python on the cli and import cv2 there is an import error: ImportError: ERROR: recursion is detected during the loading of cv2 binary extensions, Check OpenCV installation. Any help would be appreciated. Thanks for sharing the builds
Well I fixed it by deleting everything, rebooting and starting over. Now both C++ and Python work. No idea what I did to mess up python the first time. Once again thanks for the builds
hey i have a question can i create a virtual enviroment that doesn't have anything installed, because when i run any of your commands (of the apt install commandst) in the description it tells me that it needs a dependency but it wont be installed, looks like i have the most recent version and i would need to downgrade, the reason is because i have other projects and i don't know if that would affect them
You'll need the same version of Python as the one I've used, which is Python 3.7. Otherwise the OpenCV binary will not work. If you've installed yourself a newer version Python like 3.8 you usually don't need to downgrade, you just need to specify the particular version of Python you want to use. For example: "python3.7 -m venv work" will use Python 3.7 to create a new environment. Also there other libraries that are not compatible yet with Python 3.8 like SciPy, Matplotlib and many others ...
@@AtoZProgrammingTutorials err no thats not the problem after creating a virtual enviroment i was expecting that i could install all the packages from zero that i would need from apt-get, because when i run the command to install libgtk-3-dev etc it tells me that it has unmet dependencies and doesn't install anything, at the end it tells me that i may have broken packages
@@Shadow20890 I see now. The errors you get with "apt-get install" are not related to the virtual environment. Something is probably broken in your installation (maybe you've upgraded from an older version of Raspbian ?). A simpler solution would be to use a clean install of the latest Raspbian on a separate SD card.
@@AtoZProgrammingTutorials damn i was hoping that i could solve that in a virtual enviroment, because when i was installing i tried to install those packages that gave me problems with the same result of other dependencies, when i reached the end i saw it was because i had the most recent version of the package and i needed another (for example i have version 12 of a package but another package needs the first to be version 11 to be installed)
Hello, probably I can, but it seems that picovoice is a commercial product and requires some form of registration or payment. Also, I don't have speakers or a microphone for a RPi.
ImportError: libQtTest.so.4: cannot open shared object file: No such file or directory This is the error i have been facing, i followed each and every step you did, how can i solve this ??
There is no QT support used/installed in my instructions, so you did something different or you are trying to use a different version of OpenCV (maybe you have more than one version installed on your Raspberry Pi).
thanks for your tutorial, but how can i fix this? File "gui_python_test.py", line 2, in import cv2 File "/home/pi/.local/lib/python3.5/site-packages/cv2/__init__.py", line 3, in from .cv2 import * ImportError: numpy.core.multiarray failed to import
Seems that you are using an older version of Raspbian with an older Python version and I've built OpenCV with the latest Raspbian Buster and Python 3.7.
@@AtoZProgrammingTutorials I did this but still not working. I checked that it is working with python 2 but not 3 on the same py. maybe its a problem with path?
IMPORTANT sir i am in a middle of a project i am trying to install opencv 4 on beaglebone black running debian stretch following ur video when i try to import cv2 iam getting this error ImportError: OpenCV loader: missing configuration file: ['config-3.5.py', 'config-3.py']. Check OpenCV installation. please help me !!!!
The OpenCV presented in the video was built for Debian Buster, I'm afraid it will not work with Stretch. You can try to install Buster (do a clean install, don't upgrade from Stretch) on a spare SD card and test if it works with the OpenCV version presented in the video.
I install Opencv successfully, and can run gui_python_test.py in LX terminal, but when I run gui_python_test.py in Thonny Python IDE, it shows "ImportError: libopencv_quality.so.4.1: can not open shared object file: No such file or directory", What can I do? many thanks!
My guess (I've never use Thonny) is that Thonny is not using the LD_LIBRARY_PATH environment variable we've setup in .bashrc. I don't know exactly how or from where Thonny takes/reads the environment variables but you can try to search for this. Let me know if you can find a solution (maybe this will help other people too).
Hi there, I've got the below errors: Traceback (most recent call last): File "gui_python_test.py", line 2, in import cv2 File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in from .cv2 import * ImportError: /home/pi/.local/lib/python3.7/site-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8 Could you help me out of this~~ thanks and Merry Christmas~~
Perfect, so many tutorials out there which are very long and don't work, this one was short, precise and most important of all works like a charm. Love the text version of the video. Thank you for this great tutorial.
Really? I'll give it a try then, I did two tutorials three times and I got stuck in that "non free algorithms", then I passed that point and I couldn't use OpenCV… :/
Hope this works, how much did this take you?
@@JM_Tushe Hey sorry for the late reply, just follow along with the video or the text version, if your internet is fast it shouldn't take more than 10 mins.
This installation worked perfectly for me on a Raspberry Pi 4, Python 3.7.3, OpenCV 4, Raspbian Buster (Linux rpocv 4.19.75-v7l+ #1270). Thanks for a great tutorial!
the only tutorial that actually works can't thank you enough man
you are a lifesaver
Installed opencv successfully on first attempt itself(on raspberry pi 3B raspian buster......)thanks for simple and great tutorial...
can i ask you a qst please i tried to compile C++ code and i've got this error : fatal error: opencv2/opencv.hpp: No such file or directory
7 | #include
do you have any idea?
you my friend just saved me from possibly the next 2 days of suffering.
Wow man.. . . Salute. . .only recommended way I guess. Thanks for the pre-built binary and settings.. . You just won my heart
Both c++ and python code works like a charm. Thank you sir.
Wonderful ! Génial !
The first tutorial that works for my Raspberry pi 3 (quick / easy in addition)
I think i will buy your book to thank you
Thanks a ton, man!
It worked on rpi 4.Thanks again for the great tutorial. Keep going :)
this is so cool! It is working on my raspberry pi 3. I tried to install it on a virtual machine on my mac but it didnt work. Thank you a lot!
Thank you so much! I have to install opencv many times to no avail, but this tutorial is amazing and works perfectly! I would subscribe a million times if I could!
Thanks this worked well. However it did take me more than one attempt. For newbies like me, this might caution your attempts (1) Make sure you do a clean installation remove older versions of OpenCV with >> sudo find / -name "*opencv*" -exec rm -i {} \; (2) I found that numpy wasn't completely installed and getting a missing library error try this >> sudo apt-get install python-dev libatlas-base-dev. It works absolutely fine after that :)
If have problems you must uninstall you raspberry pi before you install you open cv of the tutorial .
And install OpenCV
It works with me
Thank you so much 😍😍😍😍😍😍😍
you mean, reinstall NOOBS/Raspbian?
@@JM_Tushe same question bruh
@@ockychandra703 It worked after trying 4 times, no need to reinstall Raspbian…, but, I don't remember which tutorial did the job. :u
Amazing guide !! It worked like a charm !!!
Thank you for the great video.you saved me.
I spend 3 days, finally I found your wonderful video👍😊.
This is working.
Thanks man 👍
Highly recommended.
Thanks for tutorial it worked on my raspbian using rasberry pi 3 B, it will be nice if you put on some subtitle sir. regards
It works well on pi 3 model B. Thank you!!!!!
thanks man. worked for me!!!
Hello, I have an issu running opencv.... My error is....
ImportError: libopencv_quality.so.4.1:cannot open shared object file: No such file or directory.
Is this library should be install?
love u my man, you are so helpfull
nice video!thank you
Sir it doesn't work on raspberry pi 4
It works! Thanks very much.
It works thank you so much 🤟
Thank you! Its works for me
thank you sire , your tutorial is very very usefull
Thank you for this great tutorial
Is this opencv package includes opencv contrib modules too?
Thank you so much
It works with me
Thanks so much!!!
Glad it helped!
If I want to use wiringPi , is anything gonna change in the compiling command ? Do I need to install wiringPi library in the same place as opencv, in order for the compiling command to be the same ?
can`t find opencv_cpp_settings/
bash: cd: opencv_cpp_settings/: No such file or directory
I got problem bro help me
The function is not implemented rebuild the library ( install libgtk2.0-dev and pkg-config, then re-run cake or configure script) in cvShowImage
can i ask you a qst please i tried to compile C++ code and i've got this error : fatal error: opencv2/opencv.hpp: No such file or directory
7 | #include
do you have any idea?
Mine shows importerror: libjasper .so.1 cannot open shared object file : no such directory
Also i can't import cv2 in python terminal
Thank a lot
Hello I can run .cpp and .py programs on the SSH interface, but after I switch to the VNC interface, cpp uses geany to run, py uses thonny python IDE, neither can import the opencv2 lib. Can you help me? ? thank you
Check the comments - some people had the same problem and seems to have found a solution. I don't use Geany or Thony but it is usually a problem of finding the libraries.
Alternatively - when you are using the VNC interface, just open a Terminal and it should work similar with how it works when you are using SSH.
i have installed opencv but the test file using python3 is not working this is the error i have been getting:
pi@raspberrypi:~/raspberry-pi-opencv/tests $ python3 gui_python_test.py
Traceback (most recent call last):
File "gui_python_test.py", line 2, in
import cv2
File "/usr/lib/python3/dist-packages/cv2/__init__.py", line 89, in
bootstrap()
File "/usr/lib/python3/dist-packages/cv2/__init__.py", line 79, in bootstrap
import cv2
ImportError: libopencv_quality.so.4.1: cannot open shared object file: No such file or directory
just type python... don't add 3 ! i think
cant import cv2 in python3. NEED HELP!!!!!!!!!!!!!!!!!!!!!!!!
Opencv is not open real-time camera
I got this error.
select timeout
VIDIOC_DQBUF: Resource temporarily unavailable
Traceback (most recent call last):
File "opencv5.py", line 8, in
cv2.imshow('frame', frame)
cv2.error: OpenCV(4.1.0) /home/x/opencv_all/opencv-4.1.0/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
The camera is working perfectly. It can take pictures as well but the same issue with video processing.
Reply ASAP
I don't have a RPi camera so I can't test it on my end to see what could be the problem. Sorry about that.
I have a raspi 4 raspbian buster with python 3.7.3 and 2.7.16. The python scripts don't work for me C++ seems fine.
It I try the .py test scripts the output is: ModuleNotFoundError: No module named cv2.
Also if I use python on the cli and import cv2 there is an import error: ImportError: ERROR: recursion is detected during the loading of cv2 binary extensions, Check OpenCV installation.
Any help would be appreciated. Thanks for sharing the builds
Well I fixed it by deleting everything, rebooting and starting over. Now both C++ and Python work. No idea what I did to mess up python the first time. Once again thanks for the builds
hey i have a question can i create a virtual enviroment that doesn't have anything installed, because when i run any of your commands (of the apt install commandst) in the description it tells me that it needs a dependency but it wont be installed, looks like i have the most recent version and i would need to downgrade, the reason is because i have other projects and i don't know if that would affect them
You'll need the same version of Python as the one I've used, which is Python 3.7. Otherwise the OpenCV binary will not work. If you've installed yourself a newer version Python like 3.8 you usually don't need to downgrade, you just need to specify the particular version of Python you want to use. For example: "python3.7 -m venv work" will use Python 3.7 to create a new environment.
Also there other libraries that are not compatible yet with Python 3.8 like SciPy, Matplotlib and many others ...
@@AtoZProgrammingTutorials err no thats not the problem after creating a virtual enviroment i was expecting that i could install all the packages from zero that i would need from apt-get, because when i run the command to install libgtk-3-dev etc
it tells me that it has unmet dependencies and doesn't install anything, at the end it tells me that i may have broken packages
@@Shadow20890 I see now. The errors you get with "apt-get install" are not related to the virtual environment. Something is probably broken in your installation (maybe you've upgraded from an older version of Raspbian ?). A simpler solution would be to use a clean install of the latest Raspbian on a separate SD card.
@@AtoZProgrammingTutorials damn i was hoping that i could solve that in a virtual enviroment, because when i was installing i tried to install those packages that gave me problems with the same result of other dependencies, when i reached the end i saw it was because i had the most recent version of the package and i needed another (for example i have version 12 of a package but another package needs the first to be version 11 to be installed)
Can you make a video on how to install picovoice offline speech to text on raspberry Pi
Hello, probably I can, but it seems that picovoice is a commercial product and requires some form of registration or payment. Also, I don't have speakers or a microphone for a RPi.
ImportError: libQtTest.so.4: cannot open shared object file: No such file or directory
This is the error i have been facing, i followed each and every step you did, how can i solve this ??
There is no QT support used/installed in my instructions, so you did something different or you are trying to use a different version of OpenCV (maybe you have more than one version installed on your Raspberry Pi).
@@AtoZProgrammingTutorials ohh okay ill try uninstalling everything and start from the beginning
Wich board are you using? Raspberri Pi 3 or 4?
3, but it doesn't matter, it should work with Zero, 2, 3 and 4
thanks for your tutorial, but how can i fix this?
File "gui_python_test.py", line 2, in
import cv2
File "/home/pi/.local/lib/python3.5/site-packages/cv2/__init__.py", line 3, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
Seems that you are using an older version of Raspbian with an older Python version and I've built OpenCV with the latest Raspbian Buster and Python 3.7.
@@AtoZProgrammingTutorials How about Python 3.7 and Raspbian 9.1. I have just update Python 3.6 to 3.7 but it's not work :(
@@hoangvancuong4868 Try with a fresh Raspbian install and use the default Python 3 that comes with the system.
@@AtoZProgrammingTutorials I did this but still not working. I checked that it is working with python 2 but not 3 on the same py. maybe its a problem with path?
Are you sure you have numpy for python3 installed?
IMPORTANT
sir i am in a middle of a project
i am trying to install opencv 4 on beaglebone black running debian stretch following ur video
when i try to import cv2 iam getting this error
ImportError: OpenCV loader: missing configuration file: ['config-3.5.py', 'config-3.py']. Check OpenCV installation.
please help me !!!!
The OpenCV presented in the video was built for Debian Buster, I'm afraid it will not work with Stretch. You can try to install Buster (do a clean install, don't upgrade from Stretch) on a spare SD card and test if it works with the OpenCV version presented in the video.
@@AtoZProgrammingTutorials thank you sir it worked perfectly with debian buster
im now one step closer to my project complition, tnxs a lot
I install Opencv successfully, and can run gui_python_test.py in LX terminal, but when I run gui_python_test.py in Thonny Python IDE, it shows "ImportError: libopencv_quality.so.4.1: can not open shared object file: No such file or directory", What can I do? many thanks!
My guess (I've never use Thonny) is that Thonny is not using the LD_LIBRARY_PATH environment variable we've setup in .bashrc. I don't know exactly how or from where Thonny takes/reads the environment variables but you can try to search for this. Let me know if you can find a solution (maybe this will help other people too).
@@AtoZProgrammingTutorials Thanks very much! I just add /opt/opencv-4.1.0/lib into /etc/ld.so.conf file, it works!
@@cocowang4037 how to add that id.so.conf file, i have been facing the same problem for the past two weeks, please help me out\
Prem Raj ld.so.conf, not id.so.conf
@@cocowang4037 Can you give an example of how you exactly did it? I am facing the same issue but your solution does not work (yet).
Hi there,
I've got the below errors:
Traceback (most recent call last):
File "gui_python_test.py", line 2, in
import cv2
File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in
from .cv2 import *
ImportError: /home/pi/.local/lib/python3.7/site-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8
Could you help me out of this~~ thanks and Merry Christmas~~
You would missed one of the steps. I'm missed too, and I do the steps again, and it works very well
You god
thank you. please text all of them.
King
if take no module named cv2 error use this code
sudo apt install python3-opencv
sudo apt install python-opencv
Great Tutorial! Thank you very much!
Glad it was helpful!