projekty
/
imago.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3b0b7b
)
bugs in manual mode fixed
author
Tomas Musil
<tomik.musil@gmail.com>
Tue, 9 Oct 2012 20:16:46 +0000
(22:16 +0200)
committer
Tomas Musil
<tomik.musil@gmail.com>
Tue, 9 Oct 2012 20:16:46 +0000
(22:16 +0200)
manual.py
patch
|
blob
|
history
diff --git
a/manual.py
b/manual.py
index
f774c7b
..
c7f8e2b
100644
(file)
--- a/
manual.py
+++ b/
manual.py
@@
-32,7
+32,7
@@
def find_lines(im_orig):
fill=(255, 64, 64))
corners = []
color=(64, 64, 255)
fill=(255, 64, 64))
corners = []
color=(64, 64, 255)
- line_width =
2
+ line_width =
1
lines_r = []
while not done:
lines_r = []
while not done:
@@
-71,10
+71,10
@@
def find_lines(im_orig):
(corners[1], corners[2])]
l_hor += [(corners[0], corners[1]),
(corners[2], corners[3])]
(corners[1], corners[2])]
l_hor += [(corners[0], corners[1]),
(corners[2], corners[3])]
- l_vert
= sorted(l_vert
)
- l_hor
= sorted(l_hor
)
- for i in [3,
8, 14
]:
- for j in [3,
8, 14
]:
+ l_vert
.sort(
)
+ l_hor
.sort(
)
+ for i in [3,
9, 15
]:
+ for j in [3,
9, 15
]:
hoshi(intersection(line(l_vert[i][0], l_vert[i][1]),
line(l_hor[j][0], l_hor[j][1])))
lines_r = [[l2ad(l[0], l[1], im.size) for l in l_vert],
hoshi(intersection(line(l_vert[i][0], l_vert[i][1]),
line(l_hor[j][0], l_hor[j][1])))
lines_r = [[l2ad(l[0], l[1], im.size) for l in l_vert],
@@
-139,6
+139,11
@@
def l2ad(a, b, size):
q = float(a[1] - b[1]) / (a[0] - b[0])
angle = atan(q)
q = float(a[1] - b[1]) / (a[0] - b[0])
angle = atan(q)
+ if angle < 0:
+ angle += pi
+ if angle > pi:
+ angle -= pi
+
distance = (((a[0] - (size[0] / 2)) * sin(angle)) +
((a[1] - (size[1] / 2)) * - cos(angle)))
return (angle, distance)
distance = (((a[0] - (size[0] / 2)) * sin(angle)) +
((a[1] - (size[1] / 2)) * - cos(angle)))
return (angle, distance)