Clear Filters
Clear Filters

How to produce a homogeneity image from GLCM stats?

2 views (last 30 days)
Hello, I currently have a 100x100 .tif file that I am loading into the code below in order to output a gray-level co-occurrence matrix from the image:
if true
I = imread('17_11985-12030_12005_SHG.tif');
imshow(I);
glcms = graycomatrix(I)
stats = graycoprops(glcms)
end
I get an output with the following statistics:
if true
stats =
struct with fields:
Contrast: 6.0606e-04
Correlation: 0.3997
Energy: 0.9984
Homogeneity: 0.9997
end
I want to see if there is a way for me to recreate my 100x100 .tif file with the homogeneity values. I want to go into my .tif file and replace each pixel with its corresponding homogeneity value and save that as a new .tif file.
  1 Comment
Rik
Rik on 28 Aug 2018
Homogeneity is a whole image metric (although you could apply it to smaller regions). So what do you mean? You could of course write an image with only 0.9997 as values, but I doubt that is what you want.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 16 Oct 2018
The answer is that if you did that, you'd end up with a 100x100 image of all one value. I don't think that would be of any value to you.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!