Python图像高级滤波之最大值滤波

2024-10-12 10:11:03

1、打开IDLE:IDLE是Pythonshell界面,如图所示。

Python图像高级滤波之最大值滤波

3、读取图片:读取自己要处理的图片,并且将图片进行灰度化处理,这里读取skimage包内的图片。img=color.rgb2gray(data.coffee())

Python图像高级滤波之最大值滤波

5、查看效果:采用下面语句来查看我们滤波后的图片。plt.figure('filters')plt.subplot(121)plt.imshow(img,plt.cm.gray)plt.subplot(122)plt.imshow(dst,plt.cm.gray)plt.show()

Python图像高级滤波之最大值滤波
猜你喜欢