Section 1: Lab: Getting Started with OpenCV 5 and Python
- How computer vision works, from image capture and processing to analysis and interpretation
- Install Python, a virtual environment and opencv-python 5, including the headless option
- Images as NumPy arrays: pixels, channels and the BGR, RGB, HSV and grayscale colour spaces
- Read, show and save images, and open a webcam with VideoCapture
- Lab: a first program that shows the camera feed and saves a still image
Section 2: Lab: Drawing and Geometric Transformations
- Draw lines, rectangles, circles and text on images
- Resize, rotate, translate and crop images with a ROI
- Affine and perspective transforms
- Lab: straighten a photo of a skewed document so it looks scanned
Section 3: Image Arithmetic and Thresholding
- Add, subtract and blend images, and use bitwise operations with masks
- Global, Otsu and adaptive thresholding
- Separate objects by HSV colour range with inRange
- Lab: detect objects by colour in images and from a webcam
Section 4: Filters, Morphology and Edge Detection
- Reduce noise with Gaussian, median and bilateral filters
- Morphology: erode, dilate, opening and closing
- Find edges with Sobel and Canny
- Lab: clean up images of parts before analysing them
Section 5: Lab: Histograms and Image Enhancement
- Analyse histograms of grayscale and colour images
- Adjust brightness and contrast with histogram equalisation and CLAHE
- Gamma correction for images that are too dark or too bright
- Lab: normalise camera images taken in different lighting so they can be analysed consistently