3

I have found OpenCV code that uses CvGaussBGStatModelParams structure, cvCreateGaussianBGModel, and other related functions. However, I haven't been able to find any explanations for how they work and how they are to be used and what they mean.

Any help would be appreciated.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Wall-EEEEE
  • 33
  • 1
  • 4

1 Answers1

2

These functions are undocumented (at least as far as the manual goes). However, if you look around in the source, you will find them in src/cvaux/cvbgfg_gaussmix.cpp. In there:

This is based on the "An Improved Adaptive Background Mixture Model for Real-time Tracking with Shadow Detection" by P. KaewTraKulPong and R. Bowden http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf The windowing method is used, but not the shadow detection. I make some of my own modifications which make more sense. There are some errors in some of their equations.

That link is probably a good start for you.

mpenkov
  • 21,621
  • 10
  • 84
  • 126
  • Thanks for your reply. I'll check that paper. Just another question, though. If I want to get to the actual code inside these functions, I can normally do so in VC++. However, here when I go to the definition of, say, cvCreateGaussianBGModel, all I find is: /* Creates Gaussian mixture background model */ CVAPI(CvBGStatModel*) cvCreateGaussianBGModel( IplImage* first_frame, CvGaussBGStatModelParams* parameters CV_DEFAULT(NULL)); Any idea how I should get to the actual implementation of the algorithm? – Wall-EEEEE Feb 04 '11 at 06:54
  • I don't use VC++, so I'm not familiar with its idiosyncrasies. However, if all you can see is the definition of the function, chances are all you have are the headers and compiled library files, not the source. If that's the case, the only way you can get to the function implementation is by downloading the OpenCV source code. I built OpenCV from source, so I have the source code for the function you're interested in -- that's how I found the link to the paper. – mpenkov Feb 04 '11 at 13:51
  • The gaussian mixture model method of opencv are messy to handle, that's why i think they're not fully developed yet and you'll have to wait before using them. Another interesting fact is that in the auto cvbgfg_gaussmix code the whole gaussian mixture model has been re-implemented by hand not using the opencv GMM-methods. I've been toying around with the GMM and the dissapointment on the obsurity and results was large. But hey, it's opencv so you can make it better and upload a working version into the opencv repo. The community will appreciate. – count0 Feb 09 '11 at 17:04