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.
| Track | AI & Intelligent Development |
| Lessons | 13 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: Ollama |
Lessons
- 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.
- Filters and edge detectionBlur to remove noise, compute gradients, and choose Canny thresholds that hold up outside the demo image.
- 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.
- Colour spaces and channel operationsBGR, RGB, HSV, LAB and grayscale, splitting and merging channels, and using inRange for colour segmentation that survives lighting changes.
- Geometric transformationsResize and interpolation, rotation without cropping, affine transforms, perspective warping for document scans, and border handling.
- Morphology and noise removalErosion, dilation, opening, closing, gradients and top-hat, choosing a kernel, and removing salt-and-pepper noise from binary masks.
- Histograms and contrast enhancementHistogram calculation, equalisation, CLAHE, back-projection, and automatic contrast stretching that does not clip highlights.
- 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.
- Feature detection and matchingORB and SIFT keypoints, brute-force and FLANN matching, filtering with Lowe's ratio test, and finding a homography with RANSAC.
- Video capture and processingVideoCapture and VideoWriter, frame loops and timing, background subtraction, optical flow, and a simple tracker that survives occlusion.
- 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.
- 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.
- 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.