1

I have been scratching my head try to understand how to use the GMM model returned by the opencv grabcut function(python API), the GMM models returned are 2* 64 elements tuple which I assume contains both the mean and variance information but I don't know how to apply it to a pixel that contains 3 color channel to predict how likely it belongs to the foreground or the background. I didn't manage to find any example code that does anything with the GMM models returned by the grabcut function.

Alternatively, I understand that I can use EM.predict to obtain the possibilities if I build the graph and train background/foreground using EM. But I want to be able to use grabcut the way it's written.

Any help will be greatly appreciated!

4

1 回答 1

2

原来这是一个相当复杂的问题,计算它的正确顺序是首先将一个 GMM 分量分配给该像素,然后根据分配的高斯的权重、均值和协方差计算概率。

于 2018-03-31T03:41:29.877 回答