/Computer-Vision-Basics-with-Python-Keras-and-OpenCV

Full tutorial of computer vision and machine learning basics with OpenCV and Keras in Python.

Primary LanguageJupyter Notebook

Computer Vision Basics with Python Keras and OpenCV

This was created as part of an educational for the Western Founders Network computer vision and machine learning educational session.

Demo

The final demo can be seen here and below:

Contents

Computer-Vision-Basics-with-Python-Keras-and-OpenCV.ipynb contains a full tutorial of basic computer vision and machine learning concepts, including:

  • What computers see
  • Image Filters and Functions
    • Blurring
    • Dilating
    • Erosion
    • Canny Edge Detectors
    • Thresholding
  • Background Subtraction Techniques
    • Using a background image to find differences
    • Using motion based background subtraction algorithms
  • Contours
    • Finding and sorting contours
  • Tracking
  • (Deep) Neural Networks
  • (Deep) Convolutional Neural Networks
  • Demo Project: Gesture Recognition
    • Extracting the subject
    • Tracking the hand
    • Collecting data
    • Building the Neural Network
    • Preparing Data for Training
    • Training the Network
    • Plotting Model History

Installation Instructions

Windows:

Option 1: Exact source package installs

  • Use the spec-file.txt provided, install identical packages

      $ conda create -n [ENV_NAME] --file spec-file.txt # create new env with same packages
    

    or, if you have an existing environment

      $ conda install -n [ENV_NAME] --file spec-file.txt # install packages into an existing env
    
  • Then activate the environment

      $ activate cv
    
  • Install OpenCV3 (https://opencv.org/)

    • Download whl file https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

    • Download “opencv_python 3.4.0+contrib cp35 cp35m win32.whl” or “opencv_python 3.4.0+contrib cp35 cp35m win_amd64.whl” for 32bit and 64bit respectively

    • Install package

      $ pip install [file path]
      

Option 2: Package installs

  • Using the environment.yml file provided, run

      $ conda create -n cv --file environment.yml
    

    or, if you have an existing environment

      $ conda install -n [ENV_NAME] --file spec-file.txt # install packages into an existing env
    
  • Activate the environment

      $ activate cv
    
  • Install OpenCV3 (https://opencv.org/)

    • Download whl file https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

    • Download “opencv_python 3.4.0+contrib cp35 cp35m win32.whl” or “opencv_python 3.4.0+contrib cp35 cp35m win_amd64.whl” for 32bit and 64bit respectively

    • Install the package

      $ pip install [file path]
      

Option 3: Manually installing packages