Raaj
Raaj

Reputation: 1200

Improving Texture Segmentation Results on Matlab

enter image description here Picture after segmentation with Euclidean distance (just absolute , not absolute squared) enter image description here Original texture picture

I'm getting the result above (picture 1) when I perform clustering using Kmeans algorithm and Laws Texture Energy filters (with cluster centroids / groups =6)

What are the possible ways of improving the result ? As can be seen from the result, there is no clear demarcation of the textures. Could dilation /erosion somehow be implemented for the same ? If yes, please guide.

Upvotes: 1

Views: 2599

Answers (2)

Shai
Shai

Reputation: 114796

Analysing the texture using k-means cause you to disregard spatial relations between neighboring pixels: If i and j are next to each other, then it is highly likely that they share the same texutre.
One way of introducing such spatial information is using pair-wise energy that can be optimized using graph cuts or belief-propagation (among other things).

Suppose you have n pixels in the image and L centroids in your k-means, then D is an L-by-n matrix with D(i,l) is the distance of pixel i to center l.

If you choose to use graph cuts, you can download my wrapper (don't forget to compile it) and then, in Matlab:

>> sz = size( img ); % n should be numel(img)
>> [ii jj] = sparse_adj_matrix( sz, 1, 1 ); % define 4-connect neighbor grid
>> grid = sparse( ii, jj, 1, n, n );
>> gch = GraphCut('open', D, ones( L ) - eye(L), grid );
>> [gch ll] = GraphCut('expand', gch );
>> gch = GraphCut('close', gch );
>> ll = reshape( double(ll)+1, sz );
>> figure; imagesc(ll);colormap (rand(L,3) ); title('resulting clusters'); axis image;

You can find sparse_adj_matrix here.


For a recent implementation of many optimization algorithms, take a look at opengm package.

Upvotes: 5

beedot
beedot

Reputation: 650

With respect morphological filtering i suggest this reference: Texture Segmentation Using Area Morphology Local Granulometries. The paper basically describes a morphological area opening filter which removes grayscale components which are smaller than a given area parameter threshold. In binary images the local granulometric size distributions can be generated by placing a window at each image pixel position and, after each opening operation, counting the number of remaining pixels within. This results in a local size distribution, that can be normalised to give the local pdf . Differentiating the pattern spectra gives the density that yields the local pattern spectrum at the pixel, providing a probability density which contains textural information local to each pixel position.

Here is an example to use the granulometries of an image. They are basically non linear scale spaces which work on the area of the grayscale components. The basic intuition is each texture can be characterized based on their spectrum of areas of their grayscale components. A simple binary area opening filter is available in Matlab.

Upvotes: 0

Related Questions