Symptom:
When updating the background model (icvUpdateGaussianBGModel()), in partial
window condition, when one pixel has a value of 0, that pixel becomes 0 in
the background model and so remains forever. For the tests I used 1-channel
frames.
Cause:
The icvMatchTest() function matches the zero pixel to the first
uninitialized gaussian component whose mean value is 0 (mean is initially
set to 0 by the cvCreateGaussianBGModel() function). Afterwards
icvUpdatePartialWindow() sets to 1 the match_sum of that gaussian component
and the variance to 0 (icvUpdateFullWindow() does not so), and then
icvGetSortKey() calculates the sort key to inf (division by zero), making
that gaussian component dominant forever.
Proposed solution:
To prevent such a division by zero, the gaussian components that have never
been matched don't have to be matched in icvMatchTest(). Just put the
following test around the contents of the for-cycle inside icvMatchTest():
if( g_point->g_values[k].match_sum > 0 ) {
...
}
kecsap
libraries(cv/cvaux/highgui)
algorithm
Public
|
Date: 2009-01-01 20:08 Thank you very much for your bug report and patch. I have committed to svn. |
|
Date: 2008-12-05 02:27 Xv0ofc <a href="http://pddnpijrirtl.com/">pddnpijrirtl</a>, |
| Filename | Description | Download |
|---|---|---|
| cvbgfg_gaussmix.cpp.patch | Proposed patch to cvbgfg_gaussmix.cpp version 1.1pre1 | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-01-01 20:08 | kecsup |
| resolution_id | None | 2009-01-01 20:08 | kecsup |
| close_date | - | 2009-01-01 20:08 | kecsup |
| assigned_to | nobody | 2009-01-01 20:07 | kecsup |
| File Added | 303538: cvbgfg_gaussmix.cpp.patch | 2008-11-30 22:40 | mussiado |