unable to fit Gaussian mixture model
이전 댓글 표시
Hi, I am trying to recognise the moving objects in binary image. In each frame i have identified the blobs and also have their centroids. I need to fit a GMM so that they gets identified when the blobs overlap each other. could anyone help me in doing this. I tried the gmdistribution.fit function but i am confused with the fact that whether input parameter needs to be the distribution of the coordinates of the blobs in each frame? If this is the case then how will it identify the bob in each frame? Please provide me some help.
댓글 수: 5
kittu
2012년 10월 18일
You do not have to give the coordinates of blobs,rather you need to provide the coordinates of each pixels in the blobs.This will give you 2xN array of x,y values.On this you preform GMM with the number of clusters you have/predict "clusters".For each cluster you will get a centroid and covariance matrix. This is how you perform the GMM.I hope it helps.
Niraj
2012년 10월 29일
Algorithms Analyst
2012년 11월 15일
Can you share the source code..Becasue I am working on the same problem..
this could be done something like:
%
pixelList = [struct.PixelList]; struct is a structure which contains the pixels of interest
obj = gmdistribution.fit(pixelList,k); %k is the number of clusters you want.
sig=obj.Sigma;
mu=obj.mu;
for cluster=1:k
[v,d]=eig(sig(:,:,cluster));
dd=sqrt(d);
ra=2*dd(1,1);
rb=2*dd(2,2);
x0=mu(cluster,1);
y0=mu(cluster,2);
ang = atan(v(2,1)/v(1,1))*(180/pi);
area=pi*ra*rb;
end
you can pass these parameters top draw the ellipse.
Kittu
Niraj
2012년 12월 7일
답변 (1개)
Tom Lane
2012년 10월 18일
0 개 추천
I don't know much about analyzing images. But gmdistribution expects its input data to be samples drawn from a Gaussian mixture distribution. If your image is being modeled so that the image values are something like the density of a gmm, then that's more like surface fitting than distribution fitting. Is that the case?
카테고리
도움말 센터 및 File Exchange에서 Gaussian Mixture Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!