GMM assignment incorrect in grabcut.cpp?

asked 2015-12-13 22:49:00 -0600

deepcv gravatar image

updated 2020-11-05 14:58:36 -0600

Hello, I was looking at http://code.opencv.org/attachments/93.... If "x" is a 3d vector and "z" is the gmm component that generated it, whichComponent() at L134 computes argmax p(x | z) by calling double GMM::operator()( int ci, const Vec3d color ) at L117. The returned "res" in this latter method is not multiplied by coefs[ci].

p(z | x) = p(z, x) / p(x) = p(x | z) p(z) / p(x).

I think it should really be assigning argmax p(x | z) p (z) since we want to compute the argmax p(z | x) to assign the gmm component, correct? (i.e change L141 from double p = (this)( ci, color ); to double p = (coefs[ci])(*this)( ci, color );.

Can anyone explain if my above reasoning is incorrect? Thanks!

edit retag flag offensive close merge delete