我正在尝试在 GMM 上应用 EM 后访问这些手段,使用此处详述的代码:http://docs.opencv.org/2.3/modules/ml/doc/expectation_maximization.html
我的代码:
import cv2,cv
em = cv2.EM(nclusters=4)
result = em.train(gaussData)
print em.getMeans()
但我收到此错误:
AttributeError: 'cv2.EM' object has no attribute 'getMeans'
我正在使用opencv 2.4.5(http://docs.opencv.org/2.4.5/modules/ml/doc/expectation_maximization.html),它只列出了算法::get()和算法::set()函数C++
如何使用 Python 访问均值和协方差?!
我克服这个问题的方法是简单地放一个
print help(em)
在我的代码中。这打印了与 em 关联的所有数据成员,我能够找到我需要的东西!