I am looking for functions to perform segmentation of noisy medical images (grayscale) with GMM (Gaussian Mixture Models).
I have found in MATLAB:
gm = gmdistribution(mu,sigma) idx = cluster(gm,X)
X, my grayscale image.
How would you define
sigma? What size should they be? And how would you initialize them?
I have tried the following (given an image of size (576x720)):
mu = rand(5,size(X,2)); sigma = ones(720,720); gm = gmdistribution(mu,sigma); idx = cluster(gm,X);
but I get an error:
Ill-conditioned covariance created.
log_lh=wdensity(X,obj.mu, obj.Sigma, obj.PComponents, obj.SharedCov, CovType);
I have a basic idea of how GMM works, i.e. soft clustering, but I 'd like help of a more advanced person to understand what I'm doing here.