2

How can the spatial context (or neighbourhood) of a pixel be taken into account (besides the pixel intensity) when clustering an image?

For the time being, I'm using K-means, GMM and Fuzzy C-means which cluster the image based only on the distribution of the pixel intensities. But, I need to include the information on the spatial context of the pixel into the clustering, to avoid the misclassification caused by the noise speckle.

Hakim
  • 3,225
  • 5
  • 37
  • 75

1 Answers1

4

The standard approach for segmentation is to add the X and Y coordinates with appropriate scaling to the color values (in RGB or Lab space). Examples of these are SLIC (K-means clustering in x-y-Lab space) and Quickshift (an accelerated mean shift in x-y-Lab space). When also considering spacial distances, it is often possible to gain a lot of speed. Check out the implementations in scikit-image or this blog or my blog

Andreas Mueller
  • 27,470
  • 8
  • 62
  • 74
  • Is the `normalization` of the space `S = (Intensity, X, Y)` using the formula `S = (S - mean) / std_dev` a good scaling? – Hakim Nov 21 '15 at 18:46
  • 1
    It depends on the trade-off between compactness and color homogeneity. I recommend you read the SLIC and quickshift papers. – Andreas Mueller Nov 23 '15 at 22:18