Computer Vision bot for racing simulator (Python / OpenCV)
Development of an autonomous pixel bot based on computer vision for automating the perfect start in a racing simulator. The program analyzes a specified screen area at a high frequency (100+ FPS) and emulates hardware key presses/releases with millisecond accuracy.
Implemented technical solutions:
1. Bypassing Fullscreen Exclusive: A transparent UI overlay (Tkinter) with forced focus has been developed for convenient visual highlighting of the scanning area over the game, eliminating the need to manually input coordinates.
2. Optical weather filter: The algorithm ignores visual noise (raindrops, dust). Gaussian blur (cv2.GaussianBlur) and hard binarization (cv2.threshold) are applied — the bot reacts exclusively to massive pixel shifts (takeoff of the starting line).
3. Multithreading: Screen capture via the ultra-fast dxcam API and image processing are offloaded to a separate daemon thread, keeping the GUI fully responsive.
4. Dynamic key-binding: Global hooks (keyboard) allow the user to assign any keys (or mouse buttons) for controlling the bot "on the fly," with settings saved in config.json.
Technology stack: Python, OpenCV, DXcam, Win32API, PyDirectInput, Tkinter, Nuitka.
#python #opencv #computervision #automation #bot #scripting #nuitka
Implemented technical solutions:
1. Bypassing Fullscreen Exclusive: A transparent UI overlay (Tkinter) with forced focus has been developed for convenient visual highlighting of the scanning area over the game, eliminating the need to manually input coordinates.
2. Optical weather filter: The algorithm ignores visual noise (raindrops, dust). Gaussian blur (cv2.GaussianBlur) and hard binarization (cv2.threshold) are applied — the bot reacts exclusively to massive pixel shifts (takeoff of the starting line).
3. Multithreading: Screen capture via the ultra-fast dxcam API and image processing are offloaded to a separate daemon thread, keeping the GUI fully responsive.
4. Dynamic key-binding: Global hooks (keyboard) allow the user to assign any keys (or mouse buttons) for controlling the bot "on the fly," with settings saved in config.json.
Technology stack: Python, OpenCV, DXcam, Win32API, PyDirectInput, Tkinter, Nuitka.
#python #opencv #computervision #automation #bot #scripting #nuitka