X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/763884f1a5fd3c98e53112f2d136b7e5ecea3343..b8d894cc2b9cf2b381560e47e6a35fbda2edba59:/imago_pack/intrsc.py diff --git a/imago_pack/intrsc.py b/imago_pack/intrsc.py index c64386f..9fabcd5 100644 --- a/imago_pack/intrsc.py +++ b/imago_pack/intrsc.py @@ -1,4 +1,4 @@ -"""Imago intersections module""" +"""Imago intersections module.""" from math import cos, tan, pi from operator import itemgetter @@ -26,6 +26,7 @@ def dst_sort(lines): def board(image, lines, show_all, do_something): """Compute intersections, find stone colors and return board situation.""" + # TODO refactor show_all, do_something lines = [dst_sort(l) for l in lines] intersections = intersections_from_angl_dist(lines, image.size) @@ -100,6 +101,7 @@ def board(image, lines, show_all, do_something): 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):