projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4793ca8
)
fixed gaussian_mix.py sample
author
Alexander Mordvintsev
<no@email>
Tue, 22 May 2012 09:11:09 +0000
(09:11 +0000)
committer
Alexander Mordvintsev
<no@email>
Tue, 22 May 2012 09:11:09 +0000
(09:11 +0000)
samples/python2/gaussian_mix.py
patch
|
blob
|
history
diff --git
a/samples/python2/gaussian_mix.py
b/samples/python2/gaussian_mix.py
index
c0f9816
..
dd3c9c7
100644
(file)
--- 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)
\r
\r
print 'EM (opencv) ...'
\r
- em = cv2.EM(points, params = dict( nclusters = cluster_n, cov_mat_type = cv2.EM_COV_MAT_GENERIC) )
\r
- means = em.getMeans()
\r
- covs = em.getCovs()
\r
+ em = cv2.EM(cluster_n, cv2.EM_COV_MAT_GENERIC)
\r
+ em.train(points)
\r
+ means = em.getMat('means')
\r
+ covs = em.getMatVector('covs')
\r
found_distrs = zip(means, covs)
\r
print 'ready!\n'
\r
\r