操作方法
打开IDLE界面: IDLE也是Python的shell界面。
载入软件包: 载入要使用的软件包,如果报错则肯能没有安装相关的软件包, from skimage import data,color import matplotlib.pyplot as plt from skimage.morphology import disk import skimage.filters.rank as sfr
读入图片: 采用下面代码读取一种图片,并且将图片进行会对化处理, img =color.rgb2gray(data.coffee())
滤波处理: 用下面的指令对图片进行高级滤波处理, dst =sfr.entropy(img, disk(5))
显示结果: 采用下面代码显示我们的滤波结果, plt.figure('entropy') plt.subplot(121) plt.imshow(img,plt.cm.gray) plt.subplot(122) plt.imshow(dst,plt.cm.gray)
结果: 结果如图所示。