質問編集履歴
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,6 +64,10 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
+
root.mainloop()
|
68
|
+
|
69
|
+
|
70
|
+
|
67
71
|
|
68
72
|
|
69
73
|
def img_open():
|
1
コードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,3 +21,71 @@
|
|
21
21
|
改善方法などありますでしょうか.
|
22
22
|
|
23
23
|
よろしくお願いします.
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```ここに言語を入力
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
from PIL import Image, ImageTk
|
34
|
+
|
35
|
+
import numpy as np
|
36
|
+
|
37
|
+
import tkinter as tk
|
38
|
+
|
39
|
+
import tkinter.ttk as ttk
|
40
|
+
|
41
|
+
import tkinter.filedialog as tkfd
|
42
|
+
|
43
|
+
import cv2
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
if __name__ == "__main__":
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
root = tk.Tk()
|
54
|
+
|
55
|
+
root.title("")
|
56
|
+
|
57
|
+
root.geometry("")
|
58
|
+
|
59
|
+
btn1 = tk.Button(root)
|
60
|
+
|
61
|
+
btn1.configure(text="test", command=func.img_open)
|
62
|
+
|
63
|
+
btn1.pack(anchor="ne")
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
def img_open():
|
70
|
+
|
71
|
+
img1 = cv2.imread('1.png')
|
72
|
+
|
73
|
+
img2 = cv2.imread('2.png')
|
74
|
+
|
75
|
+
img3 = cv2.imread('3.png')
|
76
|
+
|
77
|
+
plt.imshow(img1)
|
78
|
+
|
79
|
+
plt.show()
|
80
|
+
|
81
|
+
plt.imshow(img2) #以降の処理がメインウィンドウを閉じてから実行される
|
82
|
+
|
83
|
+
plt.show()
|
84
|
+
|
85
|
+
plt.imshow(img3)
|
86
|
+
|
87
|
+
plt.show()
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
```
|