This project built on an earlier line-following robot, replacing the dedicated color sensor with a camera-based vision system. The goal remained the same — navigate a maze with multiple colored lines and follow only the target path — but the sensing approach shifted entirely to real-time image processing.
The hardware used two DC motors driven by a Raspberry Pi via GPIO pins. A downward-facing camera captured live frames processed through OpenCV: grayscale conversion, Gaussian blur, and thresholding isolated the line, while contour detection identified the largest path region and computed its centroid.
Steering logic compared centroid position to the frame center — forward when centered, left or right when shifted, and a recovery behavior when no line was detected. All motion control including speed, direction, and continuous movement was programmed in Python using edge detection.