Skip to main content

Installation of OpenCV2 / OpenCV3 with Python and Anaconda

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:
  1. Xcode
  2. Homebrew
  3. Anaconda
  4. OS X

Step 1: Install Xcode

  1. Go to App Store , Search for Xcode
  2. Install it .

Step 2: Install HomeBrew
  1. Open Terminal(Application->Utilites->terminal)
  2. 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 Package

Follow 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 OpenCV

You can choose either OpenCV2 OR openCV3 

OpenCV2 Installation
Execute below commands in your terminal
conda 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 -y
OpenCV3 Installation
Execute below commands in your terminal
conda 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 matplotlib

Step 5: Execute code in Jupyter Notebook

  1. Open Terminal
  2. Activate Conda environment using : Conda activate ComputerVision3.5
  3. Type ipython OR jupyter notebook in terminal
  4. Open New Notebook if jupyter notebook chosen .
  5. Type Below commands to check installation :
    1. import cv2
    2. import numpy as np
    3. Print('Importing Libraries')



If you still facing any issues . Leave a comment here OR go to my youtube video :





















    Comments

    Popular posts from this blog

    MonoLithic Vs Microservice Architecture | which Architecture should i choose ?

    From last few years ,microservices are an accelerating trend . Indeed, microservices approach offers tangible benefits including an increase in scalability, flexibility, agility, and other significant advantages. Netflix, Google, Amazon, and other tech leaders have successfully switched from monolithic architecture to microservices. Meanwhile, many companies consider following this example as the most efficient way for business growth. On the contrary, the monolithic approach is a default model for creating a software application. Still, its trend is going down because building a monolithic application poses a number of challenges associated with handling a huge code base, adopting a new technology, scaling, deployment, implementing new changes and others. So is the monolithic approach outdated and should be left in the past? And is it worth shifting the whole application from a monolith to microservices ? Will developing a microservices application help you reach you...

    C Program to sort an array using insertion sort

    I have seen couple of students who use swap in insertion sort to sort an array.Insertion sort is an example of exchange sort ,we don't swap two elements to sort an array ,instead of this we shift elements if ith element is greater than i+1th element to sort an array.It works on simple concept:- Store the ith element in temporary variable and shift element until you find the element smaller than this element towards 0 index position.Here is the C Program to find insertion sort:- _________________________________________________________________________________ #include <stdio.h> #include <string.h> main() {     int arrSize,i;    printf("Enter Size of array:");    scanf("%d",&arrSize);    int array[arrSize];    for(i=0;i<arrSize;i++){        scanf("%d",&array[i]);    }    int temp,j;    for(i=1;i<arrSize;i++){        temp...

    Perfect Hashing and its implementation in C

    Perfect hashing simply means hashing with no collision.But there is nothing like perfect hashing(no collision).These are just a work around to achieve perfect hashing.Using this we can able to search the large set of records in a constant time i.e O(1) time complexity.To achieve searching in strict O(1) time ,one needs to implement hash table and then search the given record in to hash table using hash function.         Here in perfect hashing ,one need to implement two level hash table , first level hash table consist a set of pointers that points to the second level hash table,we must select hash function that first maps the key in to first level hash table,so it simply means there must be collision in first level hash table ,thats  why i am saying its just a work around to achieve prefect  hashing.We must wisely choose hash function:                  h(x)=((a*x+b)mod p)mod m x is the key to be map, Here ...