1 | initial version |
ah, thanks a lot for reporting back. it was missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
i'll update the patch in a second.
(really, thanks again, you saved me from making a fool of myself there ;)
2 | No.2 Revision |
ah, thanks a lot for reporting back. it was missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
i'll update the patch in a second.second, please try again !
(really, thanks again, you saved me from making a fool of myself there ;)
3 | No.3 Revision |
ah, thanks a lot for reporting back. it was missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
i'll update the patch in a second, please try again !
(really, thanks again, you saved me from making a fool of myself there ;)
4 | No.4 Revision |
ah, thanks a lot for reporting back. it was missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
i'll update the patch in a second, is updated, please try again !
from cv2 import ml
import numpy as np
data = np.ones((10,10), np.float32)
em = ml.EM_create()
em.setClustersNumber(5)
em.trainEM(data)
covs = em.getCovs()
print(covs)
5 | No.5 Revision |
ah, thanks a lot for reporting back. it was missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
patch is updated, please try again !
from cv2 import ml
import numpy as np
data = np.ones((10,10), np.float32)
em = ml.EM_create()
em.setClustersNumber(5)
em.trainEM(data)
covs = em.getCovs()
print(covs)
[array([[ 2.22044605e-16, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00],
....
(5 arrays a 10x10)
6 | No.6 Revision |
ah, thanks a lot for reporting back. it was indeed missing a second tweak (a CV_OUT before vector<mat>) so it actually returns the covs array. (you do not have to pre-allocate or feed it in).
patch is updated, please try again !
from cv2 import ml
import numpy as np
data = np.ones((10,10), np.float32)
em = ml.EM_create()
em.setClustersNumber(5)
em.trainEM(data)
covs = em.getCovs()
print(covs)
[array([[ 2.22044605e-16, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00],
....
(5 arrays a 10x10)