fixed gaussian_mix.py sample
This commit is contained in:
parent
4793ca8fbb
commit
ddf7fde3b2
@ -35,9 +35,10 @@ if __name__ == '__main__':
|
|||||||
points, ref_distrs = make_gaussians(cluster_n, img_size)
|
points, ref_distrs = make_gaussians(cluster_n, img_size)
|
||||||
|
|
||||||
print 'EM (opencv) ...'
|
print 'EM (opencv) ...'
|
||||||
em = cv2.EM(points, params = dict( nclusters = cluster_n, cov_mat_type = cv2.EM_COV_MAT_GENERIC) )
|
em = cv2.EM(cluster_n, cv2.EM_COV_MAT_GENERIC)
|
||||||
means = em.getMeans()
|
em.train(points)
|
||||||
covs = em.getCovs()
|
means = em.getMat('means')
|
||||||
|
covs = em.getMatVector('covs')
|
||||||
found_distrs = zip(means, covs)
|
found_distrs = zip(means, covs)
|
||||||
print 'ready!\n'
|
print 'ready!\n'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user