有人可以帮助我如何使用MATLAB计算图像的能量和相关性吗?
答案 0 :(得分:2)
我认为您正在寻找graycomatrix
和graycoprops
。从graycoprops
文档中,可以计算出两个属性:
'Correlation' statistical measure of how correlated a pixel is to its
neighbor over the whole image. Range = [-1 1].
Correlation is 1 or -1 for a perfectly positively or
negatively correlated image. Correlation is NaN for a
constant image.
'Energy' summation of squared elements in the GLCM. Range = [0 1].
Energy is 1 for a constant image.
要计算这些属性,首先通过graycomatrix
计算graylevel同现矩阵,然后调用graycoprops
。例如,
I = imread('circuit.tif');
GLCM = graycomatrix(I,'Offset',[2 0;0 2]);
stats = graycoprops(GLCM,{'correlation','energy'})
您只需要确定Offset
的{{1}}参数即可。彻底的选择是graycomatrix
要计算GLCM的熵,您无法使用offset = [0 1; -1 1; -1 0; -1 -1];
,因此您必须自己完成:
graycoprops