Detect Regions of Texture in Images

This example shows how to detect regions of texture in an image using the texture filter functions

Read an image into the workspace and display it. In the figure, the background is smooth--there is very little variation in the gray-level values. In the foreground, the surface contours of the coins exhibit more texture. In this image, foreground pixels have more variability and thus higher range values.

I = imread('eight.tif');
imshow(I)

Filter the image with the rangefilt function and display the results. Range filtering makes the edges and contours of the coins visible.

K = rangefilt(I);
figure
imshow(K)