Unit 14 · Perception & Navigation · about 98 min
Simple vision and evaluation
Mission: Find the red marker without mistaking a red background for it, then report honestly what an untouched image set reveals.
The interactive version of this unit needs JavaScript. Below are its steps as text.
Steps
1. Find the marker
Select “Mark the marker”, inspect the image and read the values beside it.
Why it matters: A human label says whether the specified marker is in the image. The detector must decide from pixels alone.
2. Select pixels
Select “Apply threshold”, inspect the image and read the values beside it.
Why it matters: The redness score is R − max(G, B) for each 8-bit RGB pixel. A mask marks scores at or above the threshold.
3. Dim the image
Select “Dim the scene”, inspect the image and read the values beside it.
Why it matters: Changing illumination changes recorded pixel values. The fixed score boundary now misses the marker.
4. Recover the dim marker
Select “Lower threshold”, inspect the image and read the values beside it.
Why it matters: The image decision becomes positive when at least 50 pixels are selected. This setting can also admit other red surfaces.
5. Meet a red distractor
Select “Show negative image”, inspect the image and read the values beside it.
Why it matters: This is a false detection: the same pixel rule cannot know what object made the redness.
6. Try a stricter boundary
Select “Raise threshold”, inspect the image and read the values beside it.
Why it matters: A stricter threshold also risks missing the dim marker seen earlier. Compare both images before choosing settings.
7. Compare with the label
Select “Compare truth”, inspect the image and read the values beside it. This comparison returns to threshold 50.
Why it matters: The label and prediction answer different questions. Their comparison produces a confusion category.
8. Count the tuning set
Select “Count tuning results”, inspect the image and read the values beside it.
Why it matters: True positives, false positives, false negatives and true negatives count image-level decisions. They describe only this set and configuration.
9. Freeze the settings
Select “Freeze configuration”, inspect the image and read the values beside it.
Why it matters: Freezing records the choice before evaluation. A separate image set is needed for the next question.
10. Open held-out images
Select “Open test results”, inspect the image and read the values beside it. If the readout says no configuration is frozen, visit step 9 first.
Why it matters: The test images are separate fixed synthetic examples in two lighting conditions. They are not physical measurements.
11. Calculate the rates
Select “Show precision and recall”, inspect the image and read the values beside it. If results are not open, visit steps 9 and 10 first.
Why it matters: Precision asks what fraction of positive decisions were true. Recall asks what fraction of positive labels were found.
12. Change after looking
Select “Try a new threshold”, inspect the image and read the values beside it. If results are not open, visit steps 9 and 10 first; then open Notebook for the physical capture plan.
Why it matters: Choosing settings from test results uses that set for tuning. Preserve the first report and collect a new untouched set.
Go deeper
Detector and local workflow
score = R − max(G, B); select if score ≥ threshold predict positive if selected pixels ≥ minimum area precision = TP / (TP + FP); recall = TP / (TP + FN)
RGB values are 8-bit samples, not physical light. Both examples and helper process a fixed 32 × 24 px image; the helper resizes using OpenCV INTER_AREA. A red object other than the marker can fool this image-level detector. It does not measure bounding-box or localization accuracy.
The synthetic evidence record is saved locally, separately from the opt-in learner notebook, so replay and navigation do not erase its history. If browser storage is unavailable or unreadable, results are withheld. This fixed teaching set is reused; another credible evaluation needs a genuinely new, disjoint image set, not a replay or a cleared browser.
Fresh synthetic test plan: retain the original report; construct at least 20 different images with new IDs and pixel data, positive and negative labels under both lighting conditions, and no overlap with tuning or the old test; freeze the revised settings before inspecting the new results. This lesson does not generate that new set. For a physical test, follow the separate capture plan in Notebook.
Why does a vision demo fail outside its test image? Different lighting and backgrounds can change the pixels, exposing misses or false detections. A small held-out set shows only the examples tested, not a guarantee of future performance.
The original Stanford CS223A overview and Modern Robotics are background, not validation of this lesson or the detector.