Car controller for games using OpenCV

Aditya Mhatre
1 min readJul 19, 2020

This is an OpenCV project that uses computer vision to detect contours and filters out the blue color on the steering wheel

The center blue area is used as the origin, and the top blue area is used for calculating the angle around the center

It then calculates the slope of the line formed using the center of the wheel and the top of the wheel and uses that to determine the steering input

The position of the center of the wheel is responsible for braking and accelerating. The area between the two white lines is a neutral region. If the red region goes above the top line, the “up” key is pressed. If the red region goes below the bottom line, the “down” key is pressed

Source code:

The controller in action! 👇