OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Sun, 13 Dec 2015 22:49:00 -0600GMM assignment incorrect in grabcut.cpp?http://answers.opencv.org/question/79215/gmm-assignment-incorrect-in-grabcutcpp/ Hello,
I was looking at http://code.opencv.org/attachments/934/grabcut.cpp.
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!Sun, 13 Dec 2015 22:49:00 -0600http://answers.opencv.org/question/79215/gmm-assignment-incorrect-in-grabcutcpp/