Chess Computer Vision project for OSU CSE 5524
- Chess Checker – Detect a chess board, match pieces from an arbitrary board state. Continue from that state to detect moves with will be validated by an OSS chess engine.
- Data will come from:
- Chess.com
- An overhead mounted camera above an irl chess board
-
Computer board (AI Computer Chess)
- P1 – Board detection of chess.com game (template matching)
- P2 – Tracking piece movements (color histogram before and after each move is performed)
- P3 – Classify arbitrary board positions based on piece look (template matching of pieces)
- P4 – Hover mouse over piece and highlight possible movement squares (motion tracking, region segmentation)
-
IRL board (Move detection btw two humans, camera at slight angle to game)
- P1 – Board detection of physical game (Harris detector for points of interest, Hough transforms to solve for grid lines)
- P2 – Tracking piece movements
- Mean shift tracking to determine where pieces are and where they've ended up.
- P3 – Classify arbitrary board positions based on piece look (template matching)
- P4 – Touch piece and have a display show where it can move (motion tracking, region segmentation)
-
Parts All
- Connect to chess engine for move validation.
- Pieces movement heat map
- Demo of playing a match from arbitrary board state with the move validity checking
- Images of motion tracked game
Simply run python2 test.py
(test.py
is found in src/
)
Note: If on Windows use 32bit python2.7 as it might releviate some issues and replace pip install
below with python2 -m pip install
:/
- Install
python2.7
from Python.org. - Upgrade pip:
pip install --upgrade pip
. - Install python packages:
pip install -r requirements.txt
- If having trouble with Windows install from these Windows binaries
- Install opencv3
- Windows: install instructions
- Mac: install instructions
- Setup command line Matlab:
- Windows: Add the Matlab folder containing the executable to your path (Something like
C:/Program Files/MATLAB/R2016a/bin/win64/
) - Mac: We hard coded Matlab to this location
/Applications/MATLAB_R2016a.app/bin/matlab
change inCVAnalysis.py
(Although the path thing should work as well)
- Run the
test.m
file in the current directorymatlab -nodesktop -nosplash -r test
- Run some Matlab code
matlab -nodesktop -nosplash -r 'disp(5);pause;'
>> It displays the number5
and waits for anenter