Project overview
Draw in the air with a coloured marker and a webcam. Tracks the marker with OpenCV and paints the path on screen in real time.
A drawing program with no mouse and no touchscreen. The webcam tracks a coloured marker held in the air, and the path it traces becomes strokes on a canvas. It runs on a plain laptop webcam with nothing but OpenCV, so there is no depth sensor and no hand-tracking model involved, just colour in HSV space.
Colour tracking is fragile under changing light, which is the real problem this had to solve. Rather than hardcoding thresholds that work in one room, six trackbars expose the upper and lower hue, saturation and value bounds so the tracker can be retuned live for a different marker or a darker afternoon. Strokes are held per colour in bounded deques, so a line stays continuous while the marker is visible and breaks cleanly the moment tracking is lost.