OpenCV

Image processing and computer vision.

OpenCV is taught here in 13 lessons, running from Reading, writing and inspecting images through to Performance for real-time vision. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackAI & Intelligent Development
Lessons13
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: Ollama

Lessons

  1. Reading, writing and inspecting imagesLoad an image into a NumPy array, understand its shape and colour order, crop regions, and save results without losing data.
  2. Filters and edge detectionBlur to remove noise, compute gradients, and choose Canny thresholds that hold up outside the demo image.
  3. Contours and object detection basicsFind and filter shapes with contours, then use a trained model when a threshold is not enough - and know where the line is.
  4. Colour spaces and channel operationsBGR, RGB, HSV, LAB and grayscale, splitting and merging channels, and using inRange for colour segmentation that survives lighting changes.
  5. Geometric transformationsResize and interpolation, rotation without cropping, affine transforms, perspective warping for document scans, and border handling.
  6. Morphology and noise removalErosion, dilation, opening, closing, gradients and top-hat, choosing a kernel, and removing salt-and-pepper noise from binary masks.
  7. Histograms and contrast enhancementHistogram calculation, equalisation, CLAHE, back-projection, and automatic contrast stretching that does not clip highlights.
  8. Thresholding and image segmentationGlobal and Otsu thresholding, adaptive thresholding, watershed for touching objects, GrabCut, and choosing a method from the image rather than the tutorial.
  9. Feature detection and matchingORB and SIFT keypoints, brute-force and FLANN matching, filtering with Lowe's ratio test, and finding a homography with RANSAC.
  10. Video capture and processingVideoCapture and VideoWriter, frame loops and timing, background subtraction, optical flow, and a simple tracker that survives occlusion.
  11. Detection with cascades and DNN modulesHaar cascades, the dnn module for Caffe, ONNX and YOLO models, blob preparation, and post-processing boxes into usable results.
  12. Drawing, annotation and pipeline structureShapes, text, masks and overlays, a reusable pipeline of named steps, and saving intermediate results so a failure can be diagnosed.
  13. Performance for real-time visionNumPy vectorisation, avoiding copies, ROI views, threading and optimisation flags, GPU and OpenCL modules, and budgeting a frame.

More in AI & Intelligent Development

AI Basics AI Agents Math for AI Machine Learning scikit-learn TensorFlow PyTorch Natural Language Processing LangChain Ollama Codex Claude Code OpenCode Vibe Coding Selenium Playwright

FAQ

How long does the OpenCV course take?
It has 13 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for OpenCV?
Not strictly. It helps to have read Ollama first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after OpenCV?
Continue with Codex (12 lessons), the next course in AI & Intelligent Development.