-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshow.py
57 lines (43 loc) · 1.38 KB
/
show.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#%%
from skimage.io import imread
import matplotlib.pyplot as plt
import os
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
#%%
filepath = "./img/flower.png"
image_name = os.path.split(filepath)[-1]
image_name = os.path.splitext(image_name)[0]
image = imread(filepath)
image_fine = imread(os.path.join("./output", image_name + "_fine.png"))
image_medium = imread(os.path.join("./output", image_name + "_medium.png"))
image_coarse = imread(os.path.join("./output", image_name + "_coarse.png"))
image_combined = imread(os.path.join("./output", image_name + "_combined.png"))
fig = plt.figure(figsize=(16, 12), facecolor="white")
ax = fig.add_subplot(2, 2, 1)
ax.imshow(image)
ax.axis("off")
ax.set_title("原始图像", color="black")
ax = fig.add_subplot(2, 2, 2)
ax.imshow(image_fine)
ax.axis("off")
ax.set_title("小尺度", color="black")
ax = fig.add_subplot(2, 2, 3)
ax.imshow(image_medium)
ax.axis("off")
ax.set_title("中尺度", color="black")
ax = fig.add_subplot(2, 2, 4)
ax.imshow(image_coarse)
ax.axis("off")
ax.set_title("大尺度", color="black")
fig = plt.figure(figsize=(12, 16), facecolor="white")
ax = fig.add_subplot(2, 1, 1)
ax.imshow(image)
ax.axis("off")
ax.set_title("原始图像", color="black")
ax = fig.add_subplot(2, 1, 2)
ax.imshow(image_combined)
ax.axis("off")
ax.set_title("多尺度滤波", color="black")
plt.show()
#%%