Changeset - ec97d7dc6601
[Not reviewed]
default
0 2 0
Laman - 10 years ago 2015-09-01 22:40:48

minor updates
dependencies in readme
bug note in Grid
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
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.
 
 
Modules:
 
  * 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.
 
 
Written for Python 3.4.3. Dependencies: Pillow 2.7.0, NumPy 1.9.2.
 
  
 
 
Graphic
 
-------
 
Interpolating the board grid from specified corner points.
 
 
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.
 
 
Autodetection of the board?
 
 
 
Watcher
 
-------
 
Base case: we have two correctly recognized positions differing by a single move (single added stone). Easy.
 
 
Issues:
 
  * 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
 
  * stone shifts
 
    * 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?
 
src/grid.py
Show inline comments
 
@@ -22,25 +22,25 @@ class Grid:
 
  #  The result is stored in grid.intersections, a boardSize*boardSize list with [row][column] coordinates.
 
  #  
 
  #  @param corners a properly initialized Corners object. !! Needs a check for the proper initialization.
 
  def __init__(self,corners):
 
    # ad
 
    # bc
 
    a,b,c,d=[c.toProjective() for c in corners.corners]
 
    
 
    p1=numpy.cross(a,b)
 
    p2=numpy.cross(c,d)
 
    vanish1=numpy.cross(p1,p2)
 
    # !! 32 bit int can overflow. keeping it reasonably small. might want to use a cleaner solution
 
    vanish1=EPoint.fromProjective(vanish1).toProjective()
 
    vanish1=EPoint.fromProjective(vanish1).toProjective() # !! EPoint fails with point in infinity
 
    
 
    p3=numpy.cross(a,d)
 
    p4=numpy.cross(b,c)
 
    vanish2=numpy.cross(p3,p4)
 
    vanish2=EPoint.fromProjective(vanish2).toProjective()
 
    
 
    horizon=numpy.cross(vanish1,vanish2)
 
 
    horizon=EPoint.fromProjective(horizon).toProjective()
 
    
 
    rectiMatrix=numpy.matrix([horizon,[0,1,0],[0,0,1]])
 
    rectiMatrixInv=numpy.linalg.inv(rectiMatrix)
0 comments (0 inline, 0 general)