回答編集履歴

4

d

2018/11/15 04:21

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- filepath = handcoat_all.gif
17
+ filepath = 'handcoat_all.gif'
18
18
 
19
19
 
20
20
 
@@ -50,4 +50,6 @@
50
50
 
51
51
  cv2.destroyAllWindows()
52
52
 
53
+
54
+
53
55
  ```

3

d

2018/11/15 04:21

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -14,9 +14,21 @@
14
14
 
15
15
 
16
16
 
17
+ filepath = handcoat_all.gif
18
+
19
+
20
+
17
21
  # 画像の読み込み
18
22
 
23
+ if not os.path.exists(filepath):
24
+
25
+ print('File Not Found')
26
+
27
+ exit(1)
28
+
29
+
30
+
19
- img = cv2.imread("test.jpg", 1)
31
+ img = cv2.imread(filepath, 1)
20
32
 
21
33
  if img is None:
22
34
 
@@ -25,12 +37,6 @@
25
37
  exit(1)
26
38
 
27
39
 
28
-
29
- if not os.path.exists('handcoat_all.gif'):
30
-
31
- print('File Not Found')
32
-
33
- exit(1)
34
40
 
35
41
 
36
42
 

2

d

2018/11/15 04:21

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -7,6 +7,8 @@
7
7
 
8
8
 
9
9
  ```
10
+
11
+ import os
10
12
 
11
13
  import cv2
12
14
 
@@ -24,6 +26,14 @@
24
26
 
25
27
 
26
28
 
29
+ if not os.path.exists('handcoat_all.gif'):
30
+
31
+ print('File Not Found')
32
+
33
+ exit(1)
34
+
35
+
36
+
27
37
  cv2.namedWindow("img", cv2.WINDOW_NORMAL)
28
38
 
29
39
 

1

d

2018/11/15 04:20

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -18,6 +18,8 @@
18
18
 
19
19
  if img is None:
20
20
 
21
+ print('Failed to load image.')
22
+
21
23
  exit(1)
22
24
 
23
25