Python图像高级滤波之均衡化滤波
1、打开IDLE:
IDLE是Python shell界面的另一种称呼。

2、导入软件包:
这里用到了相关的软件库包,可采用以下代码实现,若是报错可能没有安装相关的软件包,
from skimage import data,color
import matplotlib.pyplot as plt
from skimage.morphology import disk
import skimage.filters.rank as sfr

3、读入图片:
这里读入一张库包内部的图片,代码如下,
img =color.rgb2gray(data.coffee())

4、滤波运算:
采用以下代码进行高级滤波处理,
dst =sfr.equalize(img, disk(5))

5、查看结果:
可查看以下程序显示结果,
plt.figure('equalize')
plt.subplot(121)
plt.imshow(img,plt.cm.gray)
plt.subplot(122)
plt.imshow(dst,plt.cm.gray)
plt.show()

6、效果如下。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:174
阅读量:140
阅读量:79
阅读量:56
阅读量:113