MATLAB Answers

Anu G
0

How to find the Statistical Properties(Mean, Standard Deviation, Skwness and Kurtosis) of image?

Asked by Anu G
on 10 Jun 2019
Latest activity Answered by Image Analyst
on 11 Jun 2019
Accepted Answer by KSSV
I = imread('C:\Users\Annalakshmi\Desktop\file\bse_gray_250.png');
offsets0 = [zeros(40,1) (1:40)'];
glcms = graycomatrix(I,'Offset',offsets0)
glcm = graycomatrix(I,'Offset',[2 0;0 2])
stats = graycoprops(glcm)

  0 Comments

Sign in to comment.

2 Answers

Answer by KSSV
on 10 Jun 2019
 Accepted Answer

  4 Comments

Show 1 older comment
I am getting error in skwness and kurtosis. Kindly help me to resolve.
I = imread('C:\Users\Annalakshmi\Desktop\file\bse_gray_250.png');
img1g_totpx = numel( I);
size(I)
%%
% Create two gray-level co-occurrence matrices (GLCM) from the image,
% specifying different offsets.
offsets0 = [zeros(40,1) (1:40)'];
glcms = graycomatrix(I,'Offset',offsets0)
glcm = graycomatrix(I,'Offset',[2 0;0 2])
%%
% Get statistics on contrast and homogeneity of the image from the GLCMs.
stats = graycoprops(glcm);
meanval = mean2(I)
val = std2(I)
skew = sum((glcm - meanval) .^ 3 .* size(I)) ./ ((img1g_totpx - 1).* val.^3);
kurtosis = sum((glcm - meanval) .^ 4 .* size(I) ./ (( - 1) * val^4));

Sign in to comment.


Answer by Image Analyst
on 11 Jun 2019

See my attached demo for find the central spatial moments, if that's what you want.
KSSV's solution gives you the radiometric stats, not spatial stats. For example, the first moment (mean) for intensity will give you the mean gray level whereas for spatial it will give you the location of the centroid. Spatial moments can also give you things like moment of inertia, etc. Not sure which moments you want.

  0 Comments

Sign in to comment.