OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. It was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.
The library has more than 2500 optimised algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognise faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects, produce 3D point clouds from stereo cameras, stitch images together to produce a high resolution image of an entire scene, find similar images from an image database, remove red eyes from images taken using flash, follow eye movements, recognise scenery and establish markers to overlay it with augmented reality, etc.
In this hands-on Beginners Machine Learning online workshop, you will develop your data processing skills to images. These workshop series will gradually develop to include video processing, deep learning and more advanced applications in computer vision.
During the workshop we will analyse and process images in a Jupyter notebook. We first will look at the properties of images and explore the different image processing commands. After we have learned the basics, we will go through some exercises identifying objects in images using simple edge detection techniques and contours.
- How are images stored in computers and what colour channels are
- How to read in and save images for processing using command line options
- How to perform basic image operations such as cropping, masking and transformations
- How to detect objects in images
- How to perform image analysis
This workshop consists of 6 lessons and 5 projects:
LESSONS
- Basic Image Operations (Parsing Commands, Loading and Showing images)
- Basic Image Processing Techniques (Cropping, Masking, Geometric Transformations, Morphological Transformations)
- Kernels, Smoothing and Blurring Images
- Image Gradients, Thresholding, Edge Detection
- Identifying Contours of objects in Images
- Histograms and Image Enhancements by Equalising
PROJECTS
- Data Augmentation for a flower detection machine learning classifier
- Detecting Xs and Os for a Tic Tac Toe mobile game app
- Classifying Shapes in an image
- Identifying licence plates in a photograph
- Enhancing dimly lit/low contrast images for edge detection
While you won't need prior experience in computer vision, we will assume basic programming experience with Python and package/environment managers such as pip, conda or pipenv.
- Conda installed locally (https://docs.anaconda.com/anaconda/install/)
- Jupyter Notebook installed locally (https://jupyter.readthedocs.io/en/latest/install.html)
For referesher on python programming we recommend the following free course:
- Python programming language: See Udacity - Intro to Python
Use the following guides to setup your development environment
-
USING CONDA
- Install Miniconda (~400MB) or Anaconda (~3GB) package manager following instructions here
- Create your local environment (see prerequisite No. 1):
conda env create -f environment.yml
- Activate the conda environment:
conda activate ${environment_name}
-
USING VENV & PIP
- Setup a new virtual environment using venv by following instructions here
- Activate your newly created virtual environment
- Install required packages using
pip install -r requirements.txt
- Add virtual env to jupyter notebook kernel
python -m ipykernel install --user --name=${environment_name}
this should print "Installed kernelspec ${environment_name} in ${dir}
Then go to /notebooks/Lesson 1 - Basic Image Operations and select bml-cv4
kernel
(every time you open a new lesson you're likely to have to select your kernel again)
You're ready to go!
- Clone this git repository using
git clone https://github.com/beginners-machine-learning-london/computer_vision_basics.git
or download the repo as a zip file to get started - Setup your development environment using conda or pipenv using the
requirements.txt
file. - Listen to lectures then work your way through the notebooks in
notebooks
folder. - Complete the project sections in the notebooks after the workshop.
- Join our slack group to get access to this workshop's private channel so that you can ask questions and connect with your classmates
- Submit the github repo link to your completed projects on our website for grading and a chance to earn a course certificate
IMPORTANT NOTE: Attempt to complete the projects by yourself using openCV documentation and googling online. If you get stuck and cannot progress any further, then take a look at the solutions in the
solutions
folder
- Python: Python is a programming language that lets you work more quickly and integrate your systems more effectively.
- OpenCV: OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library containing 2500 computer vision algorithms. It was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.
- OpenCV Python Documentation - Use this resource as the main resource for this class.
- Official OpenCV Website - Check out this resource to learn more about OpenCV and read the official documentation. The documentation provides further information on CV algorithms and concepts utilised in each function.
- pyimagesearch Computer Vision Blog - A great resource to dive deeper into computer vision topics.
- Conda Cheat Sheet
- BML Slack Channel - Join our slack workspace to collaborate with others, discuss ideas and post any questions you have about our group or the workshops
- How was this workshop? Please provide us with some feedback here so that we can improve the content and delivery of future workshops.