Install and build OpenCV python From Source on Raspberry pi 4 and 3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everybody in today's video i'm gonna show you how you can install opencv for python and raspberry pi for that i already opened the opencv documentation page where it shows how you can install opencv in ubuntu with the two different methods but i tried these two methods in a raspberry pi and they work just fine the first method and the easiest way to install opencv python in a raspberry pi is to install it from rebuild binaries and to do that all you have to do is to copy this line and run it in a terminal and that's it then you have the opencv installed in your raspberry pi but the problem with this method as they wrote here is that the apt repositories may not contain the latest version of opencv so that means there isn't any guarantee that you install the latest version to be sure that you install the latest version you have to build opencv from the source which is the second method but for that first we need to install some dependencies therefore i connected to my raspberry pi with a remote desktop but you can do these steps using ssh if you want so i have the raspberry pi here now all i have to do is to copy these commands and run them in a terminal now i'm gonna do it and you can follow along with me [Music] and here depending in if you want to install the opencv for python 2 or 3 you can choose one of these lines so because i want to install for python 3 i'm going to copy this line and rest of this installation is same for both python 2 and 3. [Music] do [Music] the optional dependencies as its name says is optional so if you want you can skip this step but i'm gonna install these dependencies as well [Music] now we have to download the latest source from opencv's github repository and for that we need to install git but i checked and noticed that git is pre-installed in a raspberry pi so you don't need to run this line instead you can copy this line and run it in terminal so it will download the source for you after download is completed you will see that a new folder is created and its name is opencv so you can change directory to the that folder by typing cd space opencv then you can copy this line and run it in a terminal so this command will create a new folder and it will name it build then you can again change directory to the build folder by typing cd a space build and then you can copy this line cmake point point slash and paste it here and then run it after it is done you can copy this line or you can just type it so you can type make and press enter so this process take a very long time the last time i tried it it took about two three hours so you can just let it run until it will be done so for now i'm gonna pause the video here and when it is done i will be back now this process is done and we have just one more step to do so you can type sudo space make install now the installation is completed and all we have to do is to check if everything is installed correctly so to do that you can type python3 and the import cv2 as cv and then you can copy this printer statement and paste it in a terminal and run it and if we got the is a version it means that we installed everything correctly and now we have opencv in our raspberry pi okay guys that was for this video if you enjoyed it make sure you like the video and subscribe to channel and as always if you had any questions or if you got any problem you can leave it in a comment section below so i'm gonna answer them if i knew the answer or if i could answer so see you next time
Info
Channel: Index-Zero
Views: 40,571
Rating: undefined out of 5
Keywords: Install opencv on raspberry pi 2021, build opencv from source, install OpenCV from source Raspberry pi, install opencv from source raspberry pi, install opencv on raspberry pi, install opencv on raspberry pi 3, install opencv python on raspberry pi, install opencv python raspberry pi, install opencv python raspberry pi 4, opencv raspberry pi 2021, Install opencv from source on Raspberry pi, raspberry pi install opencv for python, how to install opencv in raspberry pi 4
Id: QRe0QzS079s
Channel Id: undefined
Length: 7min 15sec (435 seconds)
Published: Sun Apr 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.