projekty
/
imago.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hough transform in C
[imago.git]
/
linef.py
diff --git
a/linef.py
b/linef.py
index
fbd1368
..
37690cc
100755
(executable)
--- a/
linef.py
+++ b/
linef.py
@@
-83,6
+83,7
@@
def find_lines(image, show_all, do_something, verbose):
lines = []
im_c = im_h2.convert('RGB').convert('RGB', (1, 0.5, 0.5, 0))
draw_c = ImageDraw.Draw(im_c)
lines = []
im_c = im_h2.convert('RGB').convert('RGB', (1, 0.5, 0.5, 0))
draw_c = ImageDraw.Draw(im_c)
+ bounds = []
for line_l in lines_m:
im_line = Image.new('L', im_h2.size)
for line_l in lines_m:
im_line = Image.new('L', im_h2.size)
@@
-96,6
+97,9
@@
def find_lines(image, show_all, do_something, verbose):
for point in line_points:
draw_c.point(point, fill=(120, 255, 120))
lines.append(hough1.lines_from_list(line_points))
for point in line_points:
draw_c.point(point, fill=(120, 255, 120))
lines.append(hough1.lines_from_list(line_points))
+ line_points = list(line_points)
+ line_points.sort()
+ bounds += [line_points[0], line_points[-1]]
if show_all:
do_something(im_c, "hough x lines")
if show_all:
do_something(im_c, "hough x lines")
@@
-105,9
+109,9
@@
def find_lines(image, show_all, do_something, verbose):
for line in [l for s in lines for l in s]:
draw.line(line_from_angl_dist(line, image.size), fill=(120, 255, 120))
if show_all:
for line in [l for s in lines for l in s]:
draw.line(line_from_angl_dist(line, image.size), fill=(120, 255, 120))
if show_all:
- do_something(image_g, "
the grid
")
+ do_something(image_g, "
lines
")
- return lines
+ return lines
, lines_m[0][0], lines_m[1][0], bounds, hough1
def combine(image1, image2):
im_l1 = image1.load()
def combine(image1, image2):
im_l1 = image1.load()