Ask Your Question
0

EM algorithm, change nclusters property doesn't cause isTrained() to return false.

asked 2012-11-28 01:40:06 -0600

wl2776 gravatar image

updated 2012-11-30 00:37:34 -0600

Suppose I create EM object, train it and then change its "nclusters" property. In my understanding, this should reset it to the untrained state, since the sizes of means and covs do not longer correspond to the number of clusters.

However, isTrained() returns true.

Is is a bug or feature?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2012-11-30 00:29:39 -0600

wl2776 gravatar image

Yes, this looks like a bug. isTrained is implemented as

return !means.empty();

So, the application should itself keep track on what is trained and what is not.

Also, cv::Algorithm's implementation of property storage lists and getters/setters doesn't have any means for object invalidation. The AlgorithmInfo::set() methods simply change values, but do not track the object logical consistency.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-11-28 01:40:06 -0600

Seen: 324 times

Last updated: Nov 30 '12