Kifu: Go game record (kifu) generator

From ElphelWiki
Revision as of 11:47, 23 July 2008 by Luxigo (talk | contribs) (Kifu: Go game record (kifu) generator)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Image change detection:

Using vertical RGB components sums of a thresholded difference between a reference image and the current one, it is easy to compute the screen coordinates of a played stone

Geometric projection:

It is necessary to map a point from the screen to a point of the goban rectangle, the corners screen coordinates, and the target rectangle proportions being known.

And for this, to compute a 3x3 transformation matrix to map any point of the displayed quadrilateral shape to a rectangular shape.

Then you can compute proportionally the grid coordinates using the mapped coordinates.


To compute the tranformation matrix, there is this untested formulae:

(Maybe somebody could confirm it's worth writing code for H=X'Xt(XXt)^-1 ... :)


X: screen projection coordinates

X': goban corners coordinates

X=[x1 x2 x3 x4; y1 ... y4; 1 ... 1]

X'=[x1' x2' x3' x4'; y1' ... y4'; 1 ... 1]

H=X'Xt(XXt)^-1 (with Xt = transposed matrix of X)

p'=Hp

p'=[a;b;c]

x=a/c

y=b/c




Links:

irc://irc.freenode.net/#kifu

http://www.sourceforge.net/projects/kifu

http://sciences.ch/htmlfr/geometrie/geometrieanalytique01.php#eqcartplan

http://sciences.ch/htmlfr/geometrie/geometrieprojective01.php