\small specification}
\author{Tomáš Musil\\
\small \texttt{tomik.musil@gmail.com}}
-\date{\small 2012}
+\date{\small summer 2012}
\begin{document}
\maketitle
+\section{General information}
\paragraph{}
Imago will be a program for automatic processing of Go images. It will take an image (or a set of images), find the board-grid and stones and produce an abstract representation of the game situation (or a game record).
\paragraph{}
The program will be written mainly in Python, performance-critical parts later refactored in C. It will be distributed under a free (but not copyleft) license.
It will be platform independent.
-The grid detection algorhitm will be based on a method described in \cite{thirsima05}.
-Since the grid-finding algorhitm does not work on boards filled with stones, another algorhitm will be deviced for these. It will be based on further research.
+The grid detection algorhitm will be based on a method described in~\cite{thirsima05}.
+Since this grid-finding algorhitm does not work on boards filled with stones, another algorhitm will be deviced for these. It will be based on further research.
+
+\section{User interface specification}
+As the process should be as authomatic as possible, there will be very few options. Therefore there is no need for a GUI (with exceptions mentioned below) and all the options (output format etc.) will be specified on the command line.
+\paragraph{Single image processing}
+Ideally, user would suply an image and get a position representation in specified output format right away, no further questions asked.
+Should the authomatic grid-findig system fail, the user will be prompted to run a simple GUI and point out corners of the grid.
+\paragraph{Multiple images processing}
+It will be possible to process a set of images as a game record. The grid will be found in the first picture and remebered for following ones (assuming the camera position had not changed in between) or found in each picture separately. When player's hand or other object hides part of the board, Imago will try to infer the position from previous and following pictures. If it fails to do so, it will ask the user to open a simple GUI, look at the pictures and fill in the move.
+\paragraph{Output formats}
+The ASCII output will be similar to the {\em GNU Go} command-line mode output. Each situation will be desribed by 19 rows of 19 characters each, with the respective symbol ('.', 'X', 'O') being used for empty intersection, black stone and white stone.
+It will be possible to export both single positions and complete game records to {\em Smart Game Format} (its specification can be found at~\cite{sgf}).
+\paragraph{Supporting scripts}
+There will be a script to capture images from a web camera. It will be capable of taking pictures periodically or running a go clock and taking picture with every clock-press.
+
+\section{Technical specification}
+\paragraph{Image processing}
+Imago will first try to find the grid based on visible lines. The procedure used here relies on the Hough transform and is similar to the method described~\cite{thirsima05}. If it fails to do so, it will try to locate sufficient number of stones to infere the grid position. Algorhitm for finding stones will be subject to further research. If neither of aforementioned methods succedes, it will promt the user to open a GUI and locate corners of the grid manually. When it has the grid, it figures out stones position and color based on the color around each intersection.
+
+Multiple images processing is essentially the above mentioned proccess repeated, possibly without the grid-locating part, which could be omitted after the first picture. Methods for infering missing moves will be based on further research.
+
+\paragraph{Programming languages and libraries}
+Most of the program will be written in Python 2.7.
+{\em Python Imaging Library} (PIL, ~\cite{pil}) will be used for basic image manipulation. {\em Pygame} will be used for the GUI-related stuff. Web camera will be accessed using {\em openCV} on unix and {\em VideoCapture} module (\cite{vidcap}) on Windows.
+\paragraph{Code architecture}
+The code will be divided into following modules and corresponding classes:
+\begin{description}
+ \item[camera] accesing the web camera
+ \item[capture] capturing images
+ \item[filters] graphic filters
+ \item[grid] grid finding
+ \item[hough] hough transform and related functions
+ \item[imago] the main program
+ \item[output] for output to different formats
+ \item[record] game record proccessing
+ \item[stones] stone finding
+ \item[timer] go clock with image capture
+\end{description}
\begin{thebibliography}{9}
2005.
\url{http://www.cis.hut.fi/thirsima/gocam/gocam.pdf}
+ \bibitem{sgf}
+ SGF File Format FF[4],
+ last updated 2006.
+ \url{http://www.red-bean.com/sgf/}
+
+ \bibitem{pil}
+ Python Imaging Library (PIL)
+ \url{http://www.pythonware.com/products/pil/}
+
+ \bibitem{pygame}
+ pygame
+ \url{http://www.pygame.org/}
+
+ \bibitem{vidcap}
+ VideoCapture
+ \url{http://videocapture.sourceforge.net/}
+
\end{thebibliography}
\end{document}