我正在尝试绘制三个带有字幕的图像,但现在没有显示任何内容。
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('kids.tif')
# Averaged environment
avg_blur = cv2.blur(img,(5,5))
# Gaussian filter
gauss_blur = cv2.GaussianBlur(img,(0,0),5)
# Median filter
median_blur = cv2.medianBlur(img,5)
f, axarr = plt.subplots(nrows=1,ncols=3)
axarr[0].imshow(img)
axarr[1].imshow(avg_blur)
axarr[2].imshow(gauss_blur)
"""
plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(avg_blur),plt.title('Averaged environment')
plt.xticks([]), plt.yticks([])
plt.show()
"""