From: Alexander Mordvintsev Date: Tue, 22 May 2012 09:11:09 +0000 (+0000) Subject: fixed gaussian_mix.py sample X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4905 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddf7fde3b203e4fa2f0898881c0c64d63a025996;p=platform%2Fupstream%2Fopencv.git fixed gaussian_mix.py sample --- diff --git a/samples/python2/gaussian_mix.py b/samples/python2/gaussian_mix.py index c0f9816..dd3c9c7 100644 --- a/samples/python2/gaussian_mix.py +++ b/samples/python2/gaussian_mix.py @@ -35,9 +35,10 @@ if __name__ == '__main__': points, ref_distrs = make_gaussians(cluster_n, img_size) print 'EM (opencv) ...' - em = cv2.EM(points, params = dict( nclusters = cluster_n, cov_mat_type = cv2.EM_COV_MAT_GENERIC) ) - means = em.getMeans() - covs = em.getCovs() + em = cv2.EM(cluster_n, cv2.EM_COV_MAT_GENERIC) + em.train(points) + means = em.getMat('means') + covs = em.getMatVector('covs') found_distrs = zip(means, covs) print 'ready!\n'