An automated chess analysis tool that uses computer vision to analyze a chessboard and recommends the best move using the Stockfish chess engine.
C++
1
35 commits
updated Sep 16, 2026
A real-time chess assistant that uses computer vision to detect chessboard positions from your screen and suggests optimal moves powered by Stockfish.
Features • How It Works • Prerequisites • Build • Usage • Architecture • Contributing • Roadmap
Oracle operates in two phases:
Ctrl + LMB) to define the board corners and color reference.| Dependency | Version | Notes |
|---|---|---|
| Visual Studio | 2022 (v143 toolset) | Community edition or higher |
| Windows SDK | 10.0+ | Included with Visual Studio |
| OpenCV | 4.12.0 | Pre-built binaries (opencv_world4120, put in OpenCV directory at the root of the repo) |
| DirectX 11 | - | Ships with Windows SDK |
| Dear ImGui | - | Vendored in Oracle/ImGui/ (no setup needed) |
| Stockfish | - | Bundled in Oracle/stockfish/ (no setup needed) |
| C++ Standard | C++17 | Set in the project configuration |
git clone https://github.com/rccmb/oracle.git
cd oracle
Download the pre-built OpenCV 4.12.0 binaries from opencv.org/releases and extract them (e.g., to OpenCV\ directory at the root of the repo).
Open Oracle/Oracle.sln in Visual Studio 2022 and set the following project properties for your active configuration (e.g., Debug | x64):
Include Directories - Project Properties → VC++ Directories → Include Directories:
OpenCV\build\include
Library Directories - Project Properties → Linker → General → Additional Library Directories:
OpenCV\build\x64\vc16\lib
Linker Input - Project Properties → Linker → Input → Additional Dependencies:
opencv_world4120.lib # Release build
opencv_world4120d.lib # Debug build
Copy the OpenCV DLLs from OpenCV\build\x64\vc16\bin into the output directory (e.g., Oracle/x64/Debug/), or add the bin directory to your system PATH, may or may not be automatically generated so check before.
Set the build configuration to x64 and build the solution (Ctrl + Shift + B).
Launch from Visual Studio (F5) or run the compiled executable directly. Make sure stockfish/stockfish.exe is accessible relative to the executable's working directory.
| Hotkey | Action |
|---|---|
Ctrl + F1 | Toggle the overlay menu on/off |
Numpad + / Numpad - | Alternative toggle for the overlay menu |
Ctrl + LMB | Set board corner clicks (during calibration) |
Ctrl + F1.Ctrl + Click on the top-left square (a8) followed by the square directly to its right (b8).oracle/
├── Oracle/ # Main source directory
│ ├── main.cpp # Entry point, overlay window, render loop
│ ├── ChessboardDetection.cpp/h # Board scanning, FEN generation, piece matching
│ ├── StockfishHandler.cpp/h # UCI protocol, engine lifecycle
│ ├── InitialConfiguration.cpp/h # Calibration: clicks, samples, crop, references
│ ├── Menu.cpp/h # ImGui UI: settings, live preview, move display
│ ├── Overlay.cpp/h # Transparent fullscreen Win32 overlay
│ ├── Direct3D.cpp/h # D3D11 device, swap chain, render target
│ ├── BoardStateManager.cpp/h # Board change detection thread
│ ├── Utils.cpp/h # Screen capture, palette masking, unicode
│ ├── FileHandler.cpp/h # Reference piece image I/O
│ ├── Globals.cpp/h # Shared global state
│ ├── Structs.h # CLICK and SAMPLE data structures
│ ├── ImGui/ # Vendored Dear ImGui sources
│ ├── stockfish/ # Bundled Stockfish engine + sources
│ ├── Oracle.sln # Visual Studio solution
│ └── Oracle.vcxproj # Visual Studio project
└── OpenCV/ # OpenCV installation (not tracked in git)
For a deep dive into the architecture and module responsibilities, see ARCHITECTURE.md.
Contributions are welcome! Please read the Contributing Guide for details on:
See ROADMAP.md for the planned features and improvements.
Creative Commons Attribution-NonCommercial 4.0 International
See LICENSE.md for details.
35 commits
C++
93.1%
C
6.8%
An automated chess analysis tool that uses computer vision to analyze a chessboard and recommends the best move using the Stockfish chess engine.
C++
1
35 commits
updated Sep 16, 2026
A real-time chess assistant that uses computer vision to detect chessboard positions from your screen and suggests optimal moves powered by Stockfish.
Features • How It Works • Prerequisites • Build • Usage • Architecture • Contributing • Roadmap
Oracle operates in two phases:
Ctrl + LMB) to define the board corners and color reference.| Dependency | Version | Notes |
|---|---|---|
| Visual Studio | 2022 (v143 toolset) | Community edition or higher |
| Windows SDK | 10.0+ | Included with Visual Studio |
| OpenCV | 4.12.0 | Pre-built binaries (opencv_world4120, put in OpenCV directory at the root of the repo) |
| DirectX 11 | - | Ships with Windows SDK |
| Dear ImGui | - | Vendored in Oracle/ImGui/ (no setup needed) |
| Stockfish | - | Bundled in Oracle/stockfish/ (no setup needed) |
| C++ Standard | C++17 | Set in the project configuration |
git clone https://github.com/rccmb/oracle.git
cd oracle
Download the pre-built OpenCV 4.12.0 binaries from opencv.org/releases and extract them (e.g., to OpenCV\ directory at the root of the repo).
Open Oracle/Oracle.sln in Visual Studio 2022 and set the following project properties for your active configuration (e.g., Debug | x64):
Include Directories - Project Properties → VC++ Directories → Include Directories:
OpenCV\build\include
Library Directories - Project Properties → Linker → General → Additional Library Directories:
OpenCV\build\x64\vc16\lib
Linker Input - Project Properties → Linker → Input → Additional Dependencies:
opencv_world4120.lib # Release build
opencv_world4120d.lib # Debug build
Copy the OpenCV DLLs from OpenCV\build\x64\vc16\bin into the output directory (e.g., Oracle/x64/Debug/), or add the bin directory to your system PATH, may or may not be automatically generated so check before.
Set the build configuration to x64 and build the solution (Ctrl + Shift + B).
Launch from Visual Studio (F5) or run the compiled executable directly. Make sure stockfish/stockfish.exe is accessible relative to the executable's working directory.
| Hotkey | Action |
|---|---|
Ctrl + F1 | Toggle the overlay menu on/off |
Numpad + / Numpad - | Alternative toggle for the overlay menu |
Ctrl + LMB | Set board corner clicks (during calibration) |
Ctrl + F1.Ctrl + Click on the top-left square (a8) followed by the square directly to its right (b8).oracle/
├── Oracle/ # Main source directory
│ ├── main.cpp # Entry point, overlay window, render loop
│ ├── ChessboardDetection.cpp/h # Board scanning, FEN generation, piece matching
│ ├── StockfishHandler.cpp/h # UCI protocol, engine lifecycle
│ ├── InitialConfiguration.cpp/h # Calibration: clicks, samples, crop, references
│ ├── Menu.cpp/h # ImGui UI: settings, live preview, move display
│ ├── Overlay.cpp/h # Transparent fullscreen Win32 overlay
│ ├── Direct3D.cpp/h # D3D11 device, swap chain, render target
│ ├── BoardStateManager.cpp/h # Board change detection thread
│ ├── Utils.cpp/h # Screen capture, palette masking, unicode
│ ├── FileHandler.cpp/h # Reference piece image I/O
│ ├── Globals.cpp/h # Shared global state
│ ├── Structs.h # CLICK and SAMPLE data structures
│ ├── ImGui/ # Vendored Dear ImGui sources
│ ├── stockfish/ # Bundled Stockfish engine + sources
│ ├── Oracle.sln # Visual Studio solution
│ └── Oracle.vcxproj # Visual Studio project
└── OpenCV/ # OpenCV installation (not tracked in git)
For a deep dive into the architecture and module responsibilities, see ARCHITECTURE.md.
Contributions are welcome! Please read the Contributing Guide for details on:
See ROADMAP.md for the planned features and improvements.
Creative Commons Attribution-NonCommercial 4.0 International
See LICENSE.md for details.
35 commits
C++
93.1%
C
6.8%