projekty
/
imago.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grid lines in debugging mode
[imago.git]
/
imago.py
diff --git
a/imago.py
b/imago.py
index
61e2558
..
9e1697c
100755
(executable)
--- a/
imago.py
+++ b/
imago.py
@@
-47,6
+47,9
@@
def main():
except IOError, msg:
print >> sys.stderr, msg
return 1
except IOError, msg:
print >> sys.stderr, msg
return 1
+ if image.mode == 'P':
+ image = image.convert('RGB')
+
if image.size[0] > args.w:
image = image.resize((args.w, int((float(args.w)/image.size[0]) *
image.size[1])), Image.ANTIALIAS)
if image.size[0] > args.w:
image = image.resize((args.w, int((float(args.w)/image.size[0]) *
image.size[1])), Image.ANTIALIAS)
@@
-127,8
+130,12
@@
def main():
do_something(im_c, "hough x lines")
lines.append(hough1.all_lines(im_c))
do_something(im_c, "hough x lines")
lines.append(hough1.all_lines(im_c))
- print lines[0]
- print lines[1]
+ image_g = image.copy()
+ draw = ImageDraw.Draw(image_g)
+ 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")
intersections = intersections_from_angl_dist(lines, image.size)
image_g = image.copy()
intersections = intersections_from_angl_dist(lines, image.size)
image_g = image.copy()
@@
-142,7
+149,7
@@
def main():
line])
if show_all:
line])
if show_all:
- do_something(image_g, "
the grid
")
+ do_something(image_g, "
intersections
")
return 0
return 0