+"""Debugging image display.
+
+This is a simple module, that shows images on screen using PyGame.
+It is not used anywhere in the standard UI, serves only for debugging.
+"""
+
try:
import pygame
except ImportError, msg:
sys.exit(1)
def show(image, caption='', name=None):
+ """Initialize PyGame and show the *image*."""
if image.mode != 'RGB':
image = image.convert('RGB')
pygame.init()
#!/usr/bin/env python
-"""Go image recognition."""
+"""Go image recognition.
+
+This is the main UI module of Imago.
+"""
import sys
import os
return parser
+# TODO factor this into smaller functions
def main():
"""Main function of the program."""
-"""Imago intersections module"""
+"""Imago intersections module."""
from math import cos, tan, pi
from operator import itemgetter
return output.Board(19, board_r)
def mean_luma(cluster):
+ """Return mean luma of the *cluster* of points."""
return sum(c[0][0] for c in cluster) / float(len(cluster))
def intersections_from_angl_dist(lines, size, get_all=True):