Learn CV
Hold something bright up to your camera and build a tracker for it. First the basics: get a picture from the camera, and read the numbers inside it. Then a colour mask, a contour fit, a Kalman filter that keeps tracking while it's hidden, and a finger counter. You write ordinary OpenCV in Python, the same code that runs on a laptop or on the robot.
Before you start
1. Camera
2. Python
Python, NumPy and OpenCV run in your browser. The first download is about 27 MB; after that it's kept for next time.
3. An object
Anything solid and brightly coloured: a tennis ball, a sticky note, a marker cap. Plain colours beat patterns. For level 6, sit in front of a plain wall.
Levels
- 01Camera on4 minShow the camera in a window, and a greyscale copy,
gray, in a second window. - 02Pixels6 minSet
pickedto the average H, S and V of the 10 × 10 square in the middle of the frame. - 03See it7 minMake
maskwhite on your object and black elsewhere. - 04Find it9 minSet
centerto the object's (x, y) every frame, orNonewhen it's not there. - 05Track it14 minSet
estimateto the filtered position every frame, including while the ball is hidden, andaimto where it will beLEADseconds from now. - 06Count fingers9 minSet
fingersto how many fingers are up, 0 to 5. - 07Armor platesdemoRun it and watch it pair the bars.