Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv3 Expectation Maximization Python getCovs

How do I use the em.getCovs() function in python with opencv3?

def dictionary(descriptors, N):
    em = cv2.ml.EM_create()
    em.setClustersNumber(N)
    em.trainEM(descriptors)
    means = em.getMeans()
    covs = em.getCovs()
    weights = em.getWeights()
    return np.float32(means), np.float32(covs), np.float32(weights)

I keep getting a AttributeError: 'cv2.ml_EM' object has no attribute 'getCovs'