我正在使用skimage库进行大多数图像分析工作。
我有一个RGB图像,我打算从图像中提取texture功能,如entropy,energy,homogeneity和contrast。
下面是我正在执行的步骤:
from skimage import io, color, feature
from skimage.filters import rank
rgbImg = io.imread(imgFlNm)
grayImg = color.rgb2gray(rgbImg)
print(grayImg.shape) # (667,1000), a 2 dimensional grayscale image
glcm = feature.greycomatrix(grayImg, [1], [0, np.pi/4, np.pi/2, 3*np.pi/4])
print(glcm.shape) # (256, 256, 1, 4)
rank.entropy(glcm, disk(5)) # throws an error since entropy expects a 2-D array in its arguments
rank.entropy(grayImg, disk(5)) # given an output.我的问题是,从灰度图像(直接)计算的熵是否与从GLCM (纹理特征)提取的熵特征相同?
如果没有,从图像中提取所有纹理特征的正确方法是什么?
注意:我已经提到:
Entropy - skimage
GLCM - Texture features
发布于 2017-01-04 04:45:23
from skimage.feature import greycomatrix, greycoprops
dis = (greycoprops(glcm, 'dissimilarity'))
plt.hist(dis.ravel(), normed=True, bins=256, range=(0, 30),facecolor='0.5');plt.show()https://stackoverflow.com/questions/40919936
复制相似问题