HISTVARIANCE - Variance feature derived from (co)occurrence matrices.

Contents

Description

Calculate the variance feature defined in [HSD73] from (co)occurrence matrices.

This feature measures the variation V of greylevel distribution as [ST99]:

Syntax

   V = HISTVARIANCE(Pij, i, j);
   V = HISTVARIANCE(Pd, d);

References

See HISTCONTRAST.

See also

Ressembles: HISTCONTRAST, HISTENERGY, HISTHOMOGENEITY, HISTENTROPY2, HISTENTROPY10, HISTMAXIMUM, HISTMEAN, HISTDISSIMILARITY, HISTIDIFFERENCE, HISTCORRELATION, LOCALGLCM2D, LOCALGLOV2D, LOCALGLSDV2D.

Function implementation

function V = histvariance(pIJ, I, varargin)

muI = sum( I(:) .* pIJ(:));

if nargin>2
    J = varargin{1};
    muJ = sum( J(:) .* pIJ(:));
    V = sum (I(:) .* J(:) .* pIJ(:) - muI .* muJ);

else % J = I = D
    V = sum (I(:).^2 .* pIJ(:) - muI.^2);
end

end % end of histvariance