Sitemap
Rajguleria

Rajguleria

help 9-5 workers start a one-person business without quitting their jobs. Start building your 1-person biz here -> https://michaellim.ck.page/crashcourse 🚀

How to install OpenCV in Python — Python Tutorial

2 min readJan 14, 2023

--

Press enter or click to view image in full size

OpenCV is an open-source Python library, which used to understand the content of the digital image. The CV is the abbreviation form of computer vision. It extracts the description from the real-time image or digital image, which may be an object, a text description, and so on.

Get Rajguleria’s stories in your inbox

Join Medium for free to get updates from this writer.

We can perform many tasks using the OpenCV library such as face detection, face recognition, blob detection, edge-detection, image filter, template matching, and etc. To work with the OpenCV, we need to install it in our Python environment.

Installation of OpenCV

Here, we install the OpenCV using the following ways.

  • Using pip command
  • Using Anaconda

Using pip command

Open a command prompt and type the following command.

pip install opencv-contrib-python --upgrade

Or, we can install it without extra module by the following command.

pip install opencv-python  
Press enter or click to view image in full size

Now, we will verify the proper installation of OpenCV. Import the cv2 module and print its version.

Press enter or click to view image in full size

If it has properly installed, then it will show its version.

Using Anaconda

Anaconda is a software package of Python. Anaconda with Jupyter is a the best way to work with the OpenCV. First, we need to install the Anaconda graphics installer from its official site.

Press enter or click to view image in full size

Now, choose a suitable bit installer.

Press enter or click to view image in full size

Once download is completed. Open the Anaconda prompt and type the following command.

conda install -c conda-forge opencv    
Press enter or click to view image in full size

Then, hit the enter button and it will download all rated OpenCV configuration.

Press enter or click to view image in full size

--

--

Rajguleria
Rajguleria

help 9-5 workers start a one-person business without quitting their jobs. Start building your 1-person biz here -> https://michaellim.ck.page/crashcourse 🚀