This is first tutorial of the series beginning with installation instruction of opencv2 / opencv3 in python anaconda virtual Environment . We will come with lot of exciting blog like face detection and recognition in video/image/livestream , object or people tracking etc , So stay tuned and subscribe for more updates .
We are installing it on MAC OS , you need below tools to setup OpenCV:
- Xcode
- Homebrew
- Anaconda
- OS X
Step 1: Install Xcode
- Go to App Store , Search for Xcode
- Install it .
Step 2: Install HomeBrew
- Open Terminal(Application->Utilites->terminal)
- Write this following in terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python
Step 3: Install Anaconda Python PackageFollow the Installation instructions, should be pretty standard, however Continuum has a guide here.
Type Conda Info and check Installation . click here for Anaconda cheat sheet .
Step 4: Create Conda Virtual Env and setup OpenCVYou can choose either OpenCV2 OR openCV3OpenCV2 InstallationExecute below commands in your terminalconda create --name ComputerVision python=2.7 -y
Conda activate ComputerVision
conda install -c menpo opencv -y
pip install opencv-python
conda install -c anaconda numpy -y
conda install pandas -y
conda install -c anaconda sqlalchemy -y
conda install -c conda-forge matplotlib -yOpenCV3 InstallationExecute below commands in your terminalconda create --name ComputerVision3.5 python=3.5
Conda activate ComputerVision3.5
conda install -c menpo opencv3
pip3 install opencv-python
conda install -c anaconda numpy
conda install pandas
conda install -c anaconda sqlalchemy
conda install -c conda-forge matplotlibStep 5: Execute code in Jupyter Notebook
- Open Terminal
- Activate Conda environment using : Conda activate ComputerVision3.5
- Type ipython OR jupyter notebook in terminal
- Open New Notebook if jupyter notebook chosen .
- Type Below commands to check installation :
- import cv2
- import numpy as np
- Print('Importing Libraries')
If you still facing any issues . Leave a comment here OR go to my youtube video :
Comments
Post a Comment