25 lines
625 B
Python
25 lines
625 B
Python
import cv2
|
|
import matplotlib.pyplot as plt
|
|
plt.rcParams['font.sans-serif'] = ['simHei']
|
|
plt.rcParams['axes.unicode_minus'] = False
|
|
|
|
#读取照片
|
|
image_gaussian = cv2.imread("file/circuitboard-gaussian.tif")
|
|
|
|
#高斯滤波
|
|
kernel_size_gaussian = (5,5) #核的大小
|
|
sigmax = 0 #标准差
|
|
image_gaussian2 = cv2.GaussianBlur(image_gaussian,kernel_size_gaussian,sigmax)
|
|
|
|
plt.subplot(1,2,1)
|
|
plt.imshow(image_gaussian, cmap='gray')
|
|
plt.title('1.高斯噪声')
|
|
plt.axis('off')
|
|
|
|
plt.subplot(1,2,2)
|
|
plt.imshow(image_gaussian2, cmap='gray')
|
|
plt.title('1.高斯滤波_高斯噪声')
|
|
plt.axis('off')
|
|
|
|
plt.tight_layout()
|
|
plt.show() |