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
1
vote
2 answers

Correlation formula Matlab

I am working towards my degree thesis in image processing, and I'm using the Matlab Image Processing toolbox. I'm calculate the correlation of an image with the co-occurrence matrix using the Matlab function graycoprops. My problem is that I can't…
Elettra
  • 13
  • 3
1
vote
1 answer

MATLAB Anonymous function handle to use with NLFILTER

I have the following function which calculates a GLCM and then a given statistic parameter. I would like to pass this function to NLFILTER to do the calculation for a whole image (in small windows, e.g. convolution). I already have then NLFILTER set…
MBL
  • 1,197
  • 2
  • 11
  • 17
1
vote
1 answer

Saving different 'graycoprops' properties values on a matrix [MATLAB]

I've a picture. I create the co-occurrence matrix (graycomatrix) to extract different properties (contrast, correlation) etc on it (graycoprops) x = [] for a lot of pictures, do the same: imgB = imread('currentLoopImage.jpg') contrast =…
user981227
  • 155
  • 2
  • 6
  • 12
1
vote
0 answers

Errors: Only integers, slices [...] and scalar tf.int32/tf.int64 tensors are valid indices // Tensor object does not support item assignment

Trying to build a custom keras layer for GLCM, which requires to count pairs of pixels before doing further calculations, gets me the error below. The algorithm works just fine outside keras context. Error 1 Only integers, slices (`:`), ellipsis…
Onegaro
  • 21
  • 1
1
vote
0 answers

What is the correct way to implement a basic GLCM-Layer in Tensorflow/Keras?

I am trying to get a GLCM implementation running in a custom Keras Layer in a reasonable fast time. So far I took the _glcm_loop from skimage-implementation, reduced it to what I needed and put it into a basic layer, like this: import numpy as…
Onegaro
  • 21
  • 1
1
vote
1 answer

Extracting GLCM features

So I was going through a research paper [link], which has the following Algo for getting the texture of the image. So what i understand from the above algo is that I need make grids of 4x4 and find the GLCM matrices for each of those 4x4 sub…
XXDIL
  • 220
  • 2
  • 10
1
vote
1 answer

Texture analysis on irregular region of interest

I have an image which I would like to extract the GLCM texture in an area of interest(AOI). But AOI is a non-rectangular shape. As an image is always stored as a matrix in Matlab, even if the AOI is an irregular polygonal area the neighboring pixels…
1
vote
0 answers

Issue in GLCM directions

I am trying to calculate the texture features of my 1 image using GLCM. Now if I use these properties properties = ['contrast', 'energy','ASM', 'homogeneity', 'correlation', 'dissimilarity'] and calculate GLCM in 4 direction angles like [0, np.pi /…
kiran
  • 11
  • 2
1
vote
1 answer

Why do I get different glcms when masking an image and when cropping it

I'm trying to build an image classification model based on features extracted from GLCM. I want to mask some of the images to improve the model, and of course I don't want the GLCM to take those pixels in account. based on the following post I've…
iTSmE
  • 47
  • 4
1
vote
1 answer

skimage.feature.greycomatrix only producing diagonal values

I am attempting to produce glcm on a trend-reduced digital elevation model. My current problem is that the output of skimage.feature.greycomatrix(image) only contains values in the diagonal entries of the matrix. glcm =…
1
vote
1 answer

Raster merge using doParallel creates temp file for each merge step

I am working with the raster and glcm packages to compute Haralick texture features on satellite imagery. I have successfully run the glcm() function using a single core but am working on running it in parallel. Here is the code I'm using: # tiles…
Andy
  • 11
  • 2
1
vote
1 answer

How to use the scikit-image greycomatrix() -function in python?

I'm trying to compute grey level co-occurrence matrices from images for feature extraction. I'm using greycomatrix for the task but there seems to be something I don't understand about the process since I'm getting the following error: ValueError:…
Iizuki
  • 354
  • 1
  • 6
  • 12
1
vote
1 answer

How to pass the HH subband of an image to greycomatrix function?

I'm using scikit-images's function greycomatrix, to which I want to give as input one of the components obtained from wavelet transform after haar filtering. import pywt import cv2 from skimage.feature import greycomatrix original =…
Ganga
  • 195
  • 1
  • 11
1
vote
2 answers

Creating gray-level co-occurrence matrix from 16-bit image

I have a data set of images that are 16-bit and I want to create GLCM matrix from them to extract GLCM features. However, the resulting matrix shows one value (as shown in the picture below), I wonder why. I tried using the same image but converted…
gin
  • 873
  • 2
  • 12
  • 23
1
vote
1 answer

Cropping Image to Object Region's Area

I'm going to apply texture recognition to different flower pictures and I'm considering GLCM for feature extraction. Before applying GLCM I should convert RGB images to gray images. I also want to subtract background information from gray images to…