Questions tagged [glcm]

The gray level co-occurrence matrix (GLCM) is a statistical method of texture analysis that describes texture through a set of statistical measures extracted from a matrix that computes how often pairs of pixels with specific values and in a specified spatial relationship occur in an image.

The GLCM is a tabulation of how often different combinations of pixel brightness values (gray levels) occur in an image for a certain pixel offset (distance and direction). This approach consists in representing texture through a feature vector whose components are statistics computed from the different GLCMs corresponding to the considered distance-direction combinations.

A good start on the field is having a look at The GLCM Tutorial.

115 questions
16
votes
2 answers

Calculating entropy from GLCM of an image

I am using skimage library for most of image analysis work. I have an RGB image and I intend to extract texture features like entropy, energy, homogeneity and contrast from the image. Below are the steps that I am performing: from skimage import…
Sreejith Menon
  • 1,057
  • 1
  • 18
  • 27
8
votes
1 answer

Tensorflow custom filter layer definition like glcm or gabor

I want to apply various filters like GLCM or Gabor filter bank as a custom layer in Tensorflow, but I could not find enough custom layer samples. How can I apply these type of filters as a layer? The process of generating GLCM is defined in the…
acs
  • 796
  • 2
  • 14
  • 33
6
votes
1 answer

Sliding window in Python for GLCM calculation

I am trying to do texture analysis in a satellite imagery using GLCM algorithm. The scikit-image documentation is very helpful on that but for GLCM calculation we need a window size looping over the image. This is too slow in Python. I found many…
Johny
  • 319
  • 3
  • 12
5
votes
1 answer

Compare the LBP in python

I generated a texture image like this I have to compare two textures. I have used histogram comparison method. image_file = 'output_ori.png' img_bgr = cv2.imread(image_file) height, width, channel = img_bgr.shape hist_lbp = cv2.calcHist([img_bgr],…
5
votes
1 answer

Implementing GLCM texture feature with scikit-image and Python

I am trying to implement a texture image as described in this tutorial using Python and skimage. The issue is to move a 7x7 window over a large raster and replace the center of each pixel with the calculated texture from the 7x7 window. I manage to…
user2341961
5
votes
1 answer

levels parameter in greycomatrix scikit-image python

I'm moving my Matlab image processing algorithms to Python using scikit-image tools, and I'm calculating the gray level co-occurrence matrix (GLCM) using greycomatrix. I have a problem if the parameter levels is lesser than the maximum value of the…
rpezoa
  • 51
  • 1
  • 2
4
votes
1 answer

The use of graycomatrix offset parameter

I came across this example on how to call the function graycomatrix >I = imread('circuit.tif'); >GLCM2 = graycomatrix(I,'Offset',[2 0;0 2]); >stats = GLCM_features1(GLCM2,0) but I do not understand the effect of the second parameter in…
klijo
  • 15,761
  • 8
  • 34
  • 49
4
votes
2 answers

Calculating entropy from co-occurence matrix in Matlab

I am trying to extract the entropy from co-occurence matrices with zero entries in Matlab. From the definition of entropy of a co-occurence matrix: has to be calculated, where cij stands for the (i,j) entry of the co-occurence matrix. Thus it…
4
votes
1 answer

how to find glcm of an image in OpenCV or numpy?

I have to find texture based features of an image like correlation, energy, homogeneity, and contrast in Python. I am using python-opencv to do other operations, since python-opencv returns image as an numpy array. But I didn't find any good…
user1234567
  • 198
  • 4
  • 11
3
votes
1 answer

Extracting Haralick features from GLCM. Why do I get multiple values for each feature?

I have seen this paper yesterday. In this paper the features are taken as contrast, local homogeneity and energy, which all are a single values (as per my knowledge) but according to skimage fuction greycomatrix, the parameters passed to these that…
3
votes
1 answer

Gray Level CoOccurence Features Do Not Match Equations

Consider a simple glcm matrix. glcm = [0 1 2 3;1 1 2 3;1 0 2 0;0 0 0 3]; Calculate the statistics using Matlab's built in features. stats = graycoprops(glcm) Contrast: 2.8947 Correlation: 0.0783 Energy: 0.1191 Homogeneity: 0.5658 Now,…
gsandhu
  • 489
  • 5
  • 13
3
votes
1 answer

Calculating the co-occurrence matrix of part of an image from a mask

I have the following code in which I am trying to get a portion of a image corresponding to a mask I am given. Then I would like to apply the skimage.feature.glcm on that portion. But I get the error: glcm = greycomatrix(mancha, [2], [0],…
3
votes
1 answer

Python Implementation of MATLAB's graycomatrix and graycoprops

image of cat used source: https://www.petfinder.com/cats/cat-grooming/ I am trying to receive in Python the exact same results of the functions graycomatrix and graycoprops as in MATLAB. But the results differ and I am not able to write the code…
Sofiia
  • 51
  • 1
  • 6
2
votes
2 answers

Grey level co-occurrences matrix 14 feature implementation

According to this Haralicks research paper, there are 14 textural features that can be extracted from a GLCM. I searched for a equivalent implementation in Matlab but found only 4 of them being implemented. Does anyone know of a library that I could…
user574183
  • 710
  • 1
  • 10
  • 22
2
votes
0 answers

Gray Level Co occurrence Matrix of image in Python

I am working on obtaining Gray Level Co-occurrence Matrix of an image and also to calculate Homogeneity, Correlation, Entropy and Kurtosis of this matrix using Python. I imported greycomatrix and greycoprops from skimage and obtained GLCM…
Shehin
  • 25
  • 1
  • 5
1
2 3 4 5 6 7 8