回答編集履歴

4

文言修正

2019/12/10 06:23

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -1,4 +1,4 @@
1
- こんな感じ?
1
+ こんな感じでしょうか
2
2
 
3
3
 
4
4
 

3

タプル代入時の括弧省略

2019/12/10 06:22

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -10,15 +10,15 @@
10
10
 
11
11
 
12
12
 
13
- left_lines = ((3, 5), (5, 7), (7, 9), (5, 11), (11, 13), (13, 15))
13
+ left_lines = (3, 5), (5, 7), (7, 9), (5, 11), (11, 13), (13, 15)
14
14
 
15
- right_lines = ((4, 6), (6, 8), (8, 10), (6, 12), (12, 14), (14, 16))
15
+ right_lines = (4, 6), (6, 8), (8, 10), (6, 12), (12, 14), (14, 16)
16
16
 
17
- middle_lines = ((5, 6), (12, 11))
17
+ middle_lines = (5, 6), (12, 11)
18
18
 
19
- left_face_lines = ((0, 1), (1, 3))
19
+ left_face_lines = (0, 1), (1, 3)
20
20
 
21
- right_face_lines = ((0, 2), (2, 4))
21
+ right_face_lines = (0, 2), (2, 4)
22
22
 
23
23
 
24
24
 
@@ -38,11 +38,13 @@
38
38
 
39
39
  for start, end in lines:
40
40
 
41
- cv2.line(img, (int(key_points[start, 0]), int(key_points[start, 1])),
41
+ cv2.line(img,
42
42
 
43
- (int(key_points[end, 0]), int(key_points[end, 1])),
43
+ (int(key_points[start, 0]), int(key_points[start, 1])),
44
44
 
45
+ (int(key_points[end, 0]), int(key_points[end, 1])),
46
+
45
- color, thickness=thickness)
47
+ color, thickness=thickness)
46
48
 
47
49
 
48
50
 
@@ -58,4 +60,6 @@
58
60
 
59
61
  return img
60
62
 
63
+
64
+
61
65
  ```

2

データをタプルにする

2019/12/10 05:47

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -10,27 +10,27 @@
10
10
 
11
11
 
12
12
 
13
- left_lines = [[3,5],[5,7],[7,9],[5,11],[11,13],[13,15]]
13
+ left_lines = ((3, 5), (5, 7), (7, 9), (5, 11), (11, 13), (13, 15))
14
14
 
15
- right_lines = [[4,6],[6,8],[8,10],[6,12],[12,14],[14,16]]
15
+ right_lines = ((4, 6), (6, 8), (8, 10), (6, 12), (12, 14), (14, 16))
16
16
 
17
- middle_lines = [[5,6],[12,11]]
17
+ middle_lines = ((5, 6), (12, 11))
18
18
 
19
- left_face_lines = [[0,1],[1,3]]
19
+ left_face_lines = ((0, 1), (1, 3))
20
20
 
21
- right_face_lines = [[0,2],[2,4]]
21
+ right_face_lines = ((0, 2), (2, 4))
22
22
 
23
23
 
24
24
 
25
- left_color = (0,0,255)
25
+ left_color = (0, 0, 255)
26
26
 
27
- right_color = (255,0,0)
27
+ right_color = (255, 0, 0)
28
28
 
29
- middle_color = (0,255,0)
29
+ middle_color = (0, 255, 0)
30
30
 
31
- left__face_color = (184,213,254)
31
+ left__face_color = (184, 213, 254)
32
32
 
33
- right_face_color = (254,184,213)
33
+ right_face_color = (254, 184, 213)
34
34
 
35
35
 
36
36
 

1

fix typo

2019/12/10 05:44

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -34,15 +34,15 @@
34
34
 
35
35
 
36
36
 
37
- def draw(lines, color, ticness=10):
37
+ def draw(lines, color, thickness=10):
38
38
 
39
39
  for start, end in lines:
40
40
 
41
41
  cv2.line(img, (int(key_points[start, 0]), int(key_points[start, 1])),
42
42
 
43
- (int(key_points[end, 0]), int(key_points[end, 1])),
43
+ (int(key_points[end, 0]), int(key_points[end, 1])),
44
44
 
45
- color, thickness=ticness)
45
+ color, thickness=thickness)
46
46
 
47
47
 
48
48