Ask Your Question
0

what the use of nmixtures, nchannels in bgmodel.create from bgfg_gaussmix.cpp line 123?

asked 2015-06-10 12:18:41 -0500

Shiloh gravatar image

Hi I've problem to understand why there so many size parameter in bgmodel.create( 1, frameSize.height*frameSize.width*nmixtures*(2 + 2*nchannels), CV_32F ); from bgfg_gaussmix.cpp line 123? Why put nmixtures, and (2+2*channels)? And how they clustering the pixel value like how they get mean and covariance for each Gaussian distribution, it's seems the clustering program is not there..

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-06-28 11:16:06 -0500

Shiloh gravatar image

I'm so stupid not to understand the comment from the author, so here my explanation.. We want to clustering pixel value at each coordinate (x,y) with mixture of Gaussian, we know that Gaussian distribution have 2 main parameter which is mean, and covariance/variance, and in background subtraction we classify the Gaussian distribution which is foreground or background first by sorting the distributions by weight/(covariance or variance) from the highest, and then sum the weight from the sorting Gaussian before which larger than some threshold (T). For example: we use RGB color space. As I told before, we need mean, covariance, and weight/covariance for each Gaussian distribution.. So we need 3 for save each mean (because it's RGB not grayscale), 3 for save each variance, and 1 for save each weight, 1 for save each weight/covariance ratio, so the total things we need to save for each Gaussian distribution =3+3+1+1=8 that's where the equation (2+2*nchannel) come from..

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-06-10 12:18:41 -0500

Seen: 73 times

Last updated: Jun 28 '15