Computer vision starts with the pixels.
A practical NumPy and OpenCV starter: read image arrays, build a segmentation baseline, and learn to question its score.
Start the course →A model cannot rescue a swapped color channel, a corrupted label map, or a misleading metric. This course begins at those boundaries. You will build a complete small experiment whose inputs, operations, and failures are all visible.
The first module is available now: four connected lessons. The broader CV course is in progress. Components, geometry, learned segmentation, and real-image studies will follow in reviewed modules; they are not hidden behind unfinished lesson links.
Your first experiment
Start with four colored pixels to learn coordinates, channel order, dtype, and memory layout. Then segment a synthetic bright rectangle containing a hole and a distractor. The target is defined independently of the corrupted image, so we can measure mistakes rather than grade the algorithm against itself.
The fourth lesson builds from nine weighted pixels to smoothing, signed Sobel derivatives, and edge evaluation. It includes an explicit NumPy reference, matching OpenCV implementation, exact profile diagrams, and a protocol for testing whether filtering actually helps.
The third lesson deepens the representation contract: split RGB planes, understand axis reductions and pixel selection, and composite alpha in linear light.
After the lessons, read IoU, Dice, and Hausdorff: what each metric misses . It is an independent article with the deeper evaluation argument, a companion to the module.
Before you begin
You should be able to assign a Python variable, index a list, and call a function. If shapes or broadcasting are unfamiliar, the tensor foundations lesson is a useful companion. No neural network, GPU, dataset account, or calculus is required.
The examples use typed NumPy and OpenCV. PyTorch becomes useful when we train differentiable models; adding it to a threshold operation would obscure the simplest baseline. Lesson 1 establishes the channel-first tensor layout you will need when you get there.
Run the exact examples
Download the vision starter bundle , extract it, and open a terminal in that folder:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python verify_cv.pyOn Windows, activate with .venv\Scripts\activate instead. The recorded environment uses Python 3.12; the requirements pin the libraries used for the verified run. OpenCV is the headless package: the examples do not open native GUI windows. SciPy supplies independent metric checks. The numerical implementations themselves use NumPy and OpenCV.
The bundle includes the source files, tests, and a recorded verification report. Open complete file shows imports and highlights the exact snippet. Visualize steps through an actual recorded run inside the snippet; it does not execute arbitrary Python in your browser. Large arrays are labeled as samples. The complete mask diagrams show all 144 pixels.
How to know you understood
Predict an output before pressing Next. Change one input locally. Explain a failure in words, then use the array to locate it. The goal is to know which parts of a result come from evidence and which come from your assumptions.
The learning path/ 04
READ → EXPERIMENT → CHECKImages are arrays. The contract matters.
Locate a pixel, read its channels, avoid integer overflow, and prepare a model tensor without silently changing the image.
From pixels to masks: build a baseline you can question.
Threshold a synthetic image, understand erosion and dilation, and distinguish a successful cleanup from an assumption that destroys the target.
RGB, BGR, and alpha: what a channel actually means.
Separate color planes, read axis reductions, select pixels, and composite transparency without confusing storage with light.
From neighborhoods to edges: what a filter actually measures.
Work through nine weighted pixels, implement correlation in NumPy, preserve signed Sobel gradients, and design a fair smoothing experiment.