python 使用scikit 求图像局部熵
2021/12/6 11:16:46
本文主要是介绍python 使用scikit 求图像局部熵,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
entropy
求局部熵,熵是使用基为2的对数运算出来的。该函数将局部区域的灰度值分布进行二进制编码,返回编码的最小值。
函数格式:
entropy(image, selem)
selem表示结构化元素,用于设定滤波器。
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.lena()) dst =sfr.entropy(img, disk(5)) #半径为5的圆形滤波器 plt.figure('filters',figsize=(8,8)) plt.subplot(121) plt.title('origin image') plt.imshow(img,plt.cm.gray) plt.subplot(122) plt.title('filted image') plt.imshow(dst,plt.cm.gray)
这篇关于python 使用scikit 求图像局部熵的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python