Changeset - f1f8a2421f92
[Not reviewed]
default
0 2 4
Laman - 6 years ago 2019-05-30 12:33:45

updated readme
6 files changed with 28 insertions and 21 deletions:
readme.md
27
21
static/dochi-12.jpg
bin+new file
static/dochi-16.jpg
bin+new file
static/s12.jpg
bin+new file
static/s16.jpg
bin+new file
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
__pycache__/
 
^\.idea/
 
^images/
 
config.json$
 
ftp.json$
 
^static/
readme.md
Show inline comments
 
OneEye
 
======
 
 
Program to extract moves of a go game from a video and save them to SGF or broadcast them online.
 
A program to extract moves of a go game from a video and save them to SGF or broadcast them online.
 
 
Modules:
 
The basic prototype is already working. However, it requires the user to manually mark the board. This is bothersome and more importantly, the same would be required again for any possible movement of the camera or the board. Which is unavoidable.
 
 
  * Video: grabbing still frames from a video file / stream. Planning to use FFmpeg.
 
  * Graphic: extracting game position from an image. Using Pillow.
 
  * Watcher: interpreting sequence of game positions as a sequence of moves.
 
  * Broadcaster: interfacing with a go server.
 
## Position detection ##
 
Therefore our current research focuses on automatic position detection. It is planned as a sequence of three stages.
 
 
Written for Python 3.5.0. Dependencies: Pillow 2.7.0, NumPy 1.10.0. Start gui.py to run.
 
### Sansa ###
 
First detector approximately locates the board in the picture. It uses SSD (single shot detector) with MobileNet and is working decently.
 
 
Examples (downloaded from Flickr under CC0 license):
 
![Sansa example 1](static/s16.jpg)
 
 
Licensed under GNU GPL v2.0 or later. See license.txt. Relicensing possible, don't hesitate to ask.
 
  
 
![Sansa example 2](static/s12.jpg)
 
 
### Dochi ###
 
Then the cropped and normed image is fed to the second detector, designed to return precise grid corners' coordinates. This is currently implemented by a convolutional neural network and obtaining the required precision is a major hurdle to be passed.
 
 
Graphic
 
-------
 
Interpolating the board grid from specified corner points.
 
Pretty good:
 
![Dochi example 1](static/dochi-16.jpg)
 
 
Determining the point status based on majority voting of pixels in its neighbourhood (deciding by HSI intensity). Could be improved by considering saturation. Other methods could be better. Opened to research.
 
Also good, but not enough:
 
![Dochi example 2](static/dochi-12.jpg)
 
 
Autodetection of the board?
 
### Genjo ###
 
With grid corners it is not difficult to rectify the image and cut it into tiles, one for each intersection. Then a third stage, Genjo classifier, decides whether the intersection is empty or occupied by a black or white stone. This is currently realized by a sample of pixels voting according to their HSI intensity and it suffices to produce satisfying results. Further improvements should be relatively easy.
 
 
 
Watcher
 
-------
 
## Stringing a sequence of board states to a sequence of moves ##
 
 
Base case: we have two correctly recognized positions differing by a single move (single added stone). Easy.
 
 
Issues:
 
 
  * illegal positions -> ignorable
 
  * illegal positions → ignorable
 
  * positions unreachable from the previous state
 
    * reachable from any past state. (Incorrect states inbetween). How to pick the correct leaf of such a tree?
 
    * reachable by more than one move. Issues with branching factor.
 
  * board shifts -> repaired manually (or automatically), further positions have to be reevaluated
 
    * reachable from any past state. (Incorrect states inbetween.) How to pick the correct leaf of such a tree?
 
    * reachable by more than one move. (Lost states inbetween.) Issues with branching factor.
 
  * stone shifts
 
    * stone stops being recognized -> fixable manually and even ignorable
 
    * stone stops being recognized → fixable manually and even ignorable
 
    * stone is recognized at an empty intersection. It can be occupied later for real. What do?
 
    
 
This is handled by the `statebag` package and its documentation also states the problem and used solution in precise terms.
static/dochi-12.jpg
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
static/dochi-16.jpg
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
static/s12.jpg
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
static/s16.jpg
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
0 comments (0 inline, 0 general)