X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/2fbf55c60d081e31a445334ea65703136a12c8d8..2ce682559a6257f5822ebfc545b4f07b43a42ce7:/src/intrsc.py?ds=sidebyside diff --git a/src/intrsc.py b/src/intrsc.py index 355468c..6f78f8d 100644 --- a/src/intrsc.py +++ b/src/intrsc.py @@ -162,6 +162,8 @@ def stone_color_raw(image, (x, y)): except IndexError: pass norm = float(len(points)) + if norm == 0: + return 0, 0, 0 #TODO trow exception here color = (sum(p[0] for p in points) / norm, sum(p[1] for p in points) / norm, sum(p[2] for p in points) / norm)