Install OpenCV 4 with Python and C++ support on Raspberry Pi

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 105

  • @harshalsarode8283
    @harshalsarode8283 4 роки тому +8

    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.

    • @JM_Tushe
      @JM_Tushe 4 роки тому

      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?

    • @harshalsarode8283
      @harshalsarode8283 4 роки тому

      @@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.

  • @JimWroten
    @JimWroten 4 роки тому +5

    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!

  • @hamzahimran1648
    @hamzahimran1648 4 роки тому +5

    the only tutorial that actually works can't thank you enough man
    you are a lifesaver

  • @balajim1011
    @balajim1011 4 роки тому +3

    Installed opencv successfully on first attempt itself(on raspberry pi 3B raspian buster......)thanks for simple and great tutorial...

    • @jamilatagdimi3076
      @jamilatagdimi3076 Рік тому

      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?

  • @itsrobelschwarz7248
    @itsrobelschwarz7248 4 роки тому +1

    you my friend just saved me from possibly the next 2 days of suffering.

  • @mowazzemhosen366
    @mowazzemhosen366 4 роки тому +1

    Wow man.. . . Salute. . .only recommended way I guess. Thanks for the pre-built binary and settings.. . You just won my heart

  • @saimmetinkaryagar8789
    @saimmetinkaryagar8789 4 роки тому +1

    Both c++ and python code works like a charm. Thank you sir.

  • @roshanisylvain9383
    @roshanisylvain9383 4 роки тому +2

    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

  • @sindhurraju7733
    @sindhurraju7733 4 роки тому +1

    Thanks a ton, man!
    It worked on rpi 4.Thanks again for the great tutorial. Keep going :)

  • @romanfrancisconavajuarez8216
    @romanfrancisconavajuarez8216 4 роки тому +2

    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!

  • @jugglingsix1164
    @jugglingsix1164 4 роки тому +1

    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!

  • @drzobekenobe
    @drzobekenobe 5 років тому +1

    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 :)

  • @goodlife6984
    @goodlife6984 4 роки тому

    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 😍😍😍😍😍😍😍

    • @JM_Tushe
      @JM_Tushe 4 роки тому

      you mean, reinstall NOOBS/Raspbian?

    • @ockychandra703
      @ockychandra703 4 роки тому

      @@JM_Tushe same question bruh

    • @JM_Tushe
      @JM_Tushe 4 роки тому +1

      @@ockychandra703 It worked after trying 4 times, no need to reinstall Raspbian…, but, I don't remember which tutorial did the job. :u

  • @georgesg8300
    @georgesg8300 4 роки тому +2

    Amazing guide !! It worked like a charm !!!

  • @MARUTI96
    @MARUTI96 4 роки тому

    Thank you for the great video.you saved me.
    I spend 3 days, finally I found your wonderful video👍😊.
    This is working.

  • @shashwatsingh3348
    @shashwatsingh3348 4 роки тому +1

    Thanks man 👍
    Highly recommended.

  • @andinugroho6876
    @andinugroho6876 4 роки тому +1

    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

  • @egealsan6684
    @egealsan6684 4 роки тому +1

    It works well on pi 3 model B. Thank you!!!!!

  • @Zonkobel
    @Zonkobel 4 роки тому +1

    thanks man. worked for me!!!

  • @xavibaca3490
    @xavibaca3490 4 роки тому +3

    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?

  • @filiperibeiro4768
    @filiperibeiro4768 4 роки тому +3

    love u my man, you are so helpfull

  • @shubhampatil3904
    @shubhampatil3904 4 роки тому +2

    nice video!thank you

  • @rachity100
    @rachity100 4 роки тому +3

    Sir it doesn't work on raspberry pi 4

  • @junboyang8656
    @junboyang8656 4 роки тому

    It works! Thanks very much.

  • @sartaj0
    @sartaj0 4 роки тому

    It works thank you so much 🤟

  • @lporteniuable
    @lporteniuable 5 років тому +1

    Thank you! Its works for me

  • @otakuxboy8958
    @otakuxboy8958 3 роки тому

    thank you sire , your tutorial is very very usefull

  • @bestHassani
    @bestHassani 5 років тому +1

    Thank you for this great tutorial

  • @kumuthinikulanthavel8110
    @kumuthinikulanthavel8110 2 роки тому

    Is this opencv package includes opencv contrib modules too?

  • @goodlife6984
    @goodlife6984 4 роки тому

    Thank you so much
    It works with me

  • @HectorUch123
    @HectorUch123 3 роки тому

    Thanks so much!!!

  • @georgesg8300
    @georgesg8300 4 роки тому

    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 ?

  • @mahmoudsayed3474
    @mahmoudsayed3474 4 роки тому

    can`t find opencv_cpp_settings/
    bash: cd: opencv_cpp_settings/: No such file or directory

  • @ModernScienceCodersHD
    @ModernScienceCodersHD 4 роки тому

    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

  • @jamilatagdimi3076
    @jamilatagdimi3076 Рік тому

    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?

  • @fih7836
    @fih7836 4 роки тому

    Mine shows importerror: libjasper .so.1 cannot open shared object file : no such directory
    Also i can't import cv2 in python terminal

  • @yinaye6593
    @yinaye6593 4 роки тому +1

    Thank a lot

  • @Ohmyseed
    @Ohmyseed 4 роки тому

    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

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  4 роки тому

      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.

  • @Idkhow-r6c
    @Idkhow-r6c 4 роки тому

    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

  • @neeldesai8940
    @neeldesai8940 4 роки тому

    cant import cv2 in python3. NEED HELP!!!!!!!!!!!!!!!!!!!!!!!!

  • @KunalKhade25
    @KunalKhade25 5 років тому

    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

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      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.

  • @not_ever
    @not_ever 4 роки тому

    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

    • @not_ever
      @not_ever 4 роки тому +2

      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

  • @Shadow20890
    @Shadow20890 5 років тому

    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

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      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 ...

    • @Shadow20890
      @Shadow20890 5 років тому

      @@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

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      @@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.

    • @Shadow20890
      @Shadow20890 5 років тому

      @@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)

  • @jithinkgeorge9232
    @jithinkgeorge9232 5 років тому

    Can you make a video on how to install picovoice offline speech to text on raspberry Pi

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому +1

      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.

  • @premraj8649
    @premraj8649 5 років тому

    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 ??

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      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).

    • @premraj8649
      @premraj8649 5 років тому

      @@AtoZProgrammingTutorials ohh okay ill try uninstalling everything and start from the beginning

  • @fernandosalinas2174
    @fernandosalinas2174 5 років тому

    Wich board are you using? Raspberri Pi 3 or 4?

  • @hoangvancuong4868
    @hoangvancuong4868 5 років тому

    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

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      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.

    • @hoangvancuong4868
      @hoangvancuong4868 5 років тому

      @@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 :(

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому +1

      @@hoangvancuong4868 Try with a fresh Raspbian install and use the default Python 3 that comes with the system.

    • @zahrasaqib7739
      @zahrasaqib7739 4 роки тому

      @@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?

    • @krackerslacker
      @krackerslacker 3 роки тому

      Are you sure you have numpy for python3 installed?

  • @yashaspswamy439
    @yashaspswamy439 4 роки тому

    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 !!!!

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  4 роки тому

      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.

    • @yashaspswamy439
      @yashaspswamy439 4 роки тому

      @@AtoZProgrammingTutorials thank you sir it worked perfectly with debian buster
      im now one step closer to my project complition, tnxs a lot

  • @cocowang4037
    @cocowang4037 5 років тому

    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!

    • @AtoZProgrammingTutorials
      @AtoZProgrammingTutorials  5 років тому

      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).

    • @cocowang4037
      @cocowang4037 5 років тому +1

      @@AtoZProgrammingTutorials Thanks very much! I just add /opt/opencv-4.1.0/lib into /etc/ld.so.conf file, it works!

    • @premraj8649
      @premraj8649 5 років тому

      @@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\

    • @cocowang4037
      @cocowang4037 5 років тому

      Prem Raj ld.so.conf, not id.so.conf

    • @jaapweerheim4572
      @jaapweerheim4572 5 років тому

      @@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).

  • @KenKenkentang
    @KenKenkentang 5 років тому

    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~~

    • @felipetoledoneves8464
      @felipetoledoneves8464 4 роки тому

      You would missed one of the steps. I'm missed too, and I do the steps again, and it works very well

  • @PaprikaYT
    @PaprikaYT 4 роки тому

    You god

  • @nimaltd
    @nimaltd 5 років тому

    thank you. please text all of them.

  • @ViniBreda90
    @ViniBreda90 5 років тому

    King

  • @ademberkaksoy7080
    @ademberkaksoy7080 4 роки тому

    if take no module named cv2 error use this code
    sudo apt install python3-opencv
    sudo apt install python-opencv

  • @sebastiang5847
    @sebastiang5847 3 роки тому

    Great Tutorial! Thank you very much!