Question

I am attempting to create a content based image retrieval system (CBIR) in MATLAB for colour images, and am using a k-means algorithm to extract the feature vectors for images in my database. Each image has four clusters, and each cluster has information about the colour (R,G,B) and position (X,Y).

I am now trying to add a texture feature to my clusters, and need to use grey level co-occurrence matrices (GLCM) for this. I know that GLCM is just an indicator of probability that a certain grey level will appear next to another, and have created the GLCM for my images.

I am unclear about how to map the GLCM to the original image (and thus its clusters), since GLCM talks about pairs of pixels, and I would like each X,Y position to have texture information. How does one go about translating GLCM to pixels?

Was it helpful?

Solution

The output of GLCM seems to be a T-by-T matrix where T is the number of distinct grayscale levels in the image. Therefore, the size of this matrix does not really depend on the size of your image. The matrix also describes the texture of the whole image, so it isn't especially meaningful to associate GLCM data with a single pixel.

It sounds like you could compute GLCM for the individual clusters, since this would describe the texture within that cluster? I think graycomatrix requires a rectangular image, but you could find the bounding box for each cluster and extract GLCM from them separately.

If you wanted to get some more meaningful information out of a GLCM matrix (i.e. something that is appropriate as a 'feature'), you could use graycoprops which returns 4 summary statistics.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top