常用函数:
entropy | Entropy of grayscale image |
entropyfilt | Local entropy of grayscale image |
rangefilt | Local range of image |
stdfilt | Local standard deviation of image |
graycomatrix | Create gray-level co-occurrence matrix from image |
graycoprops | Properties of gray-level co-occurrence matrix |
纹理滤波函数:
在感兴趣像素周围定义一个邻域,计算该邻域的统计特性,并用统计结果作为该感兴趣像素的输出值。
应用举例:
1.检测纹理边缘
I = imread('eight.tif');
imshow(I)
K = rangefilt(I); figure, imshow(K)
2.统计纹理重复特性
circuitBoard = rot90(rgb2gray(imread('board.tif')));
imshow(circuitBoard);
offsets0 = [zeros(40,1) (1:40)'];%%Create the GLCMs. Call the graycomatrix function specifying the offsets.
glcms = graycomatrix(circuitBoard,'Offset',offsets0)
%%Derive statistics from the GLCMs using the graycoprops function. The example calculates the contrast and correlation.
stats = graycoprops(glcms,'Contrast Correlation');
%%Plot correlation as a function of offset.
figure, plot([stats.Correlation]); title('Texture Correlation as a function of offset'); xlabel('Horizontal Offset') ylabel('Correlation')![]()
plot图在offsets7,15,23和30处出现波峰。观察左图可发现,在垂直方向每隔7个像素有重复的模式出现。
参考: