X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/cb5eb5a01ee68e22c9ac02a6feaf52c46bfc6c0e..e34ac48a7387f7c359c1987f3a58ebcca154697e:/hough.py diff --git a/hough.py b/hough.py index d01416a..a8f64b2 100644 --- a/hough.py +++ b/hough.py @@ -59,35 +59,6 @@ class Hough: lines.append(self.angle_distance((x, y))) return lines - def find_angle_distance(self, image): - image_l = image.load() - - points = [] - - count = 0 - point_x = 0 - point_y = 0 - for x in xrange(image.size[0] / 2): - for y in xrange(image.size[1] / 2, image.size[1]): - if image_l[x, y]: - count += 1 - point_x += x - point_y += y - points.append((float(point_x) / count, float(point_y) / count)) - - count = 0 - point_x = 0 - point_y = 0 - for x in xrange(image.size[0] / 2, image.size[0]): - for y in xrange(image.size[1] / 2, image.size[1]): - if image_l[x, y]: - count += 1 - point_x += x - point_y += y - points.append((float(point_x) / count, float(point_y) / count)) - - return [self.angle_distance(p) for p in points] - def angle_distance(self, point): return (self.dt * point[1] + self.initial_angle, point[0] - self.size[0] / 2)