mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Merge pull request #13323 from alalek:issue_13297
This commit is contained in:
commit
ccf96b9e05
@ -174,7 +174,6 @@ void GMM::addSample( int ci, const Vec3d color )
|
||||
|
||||
void GMM::endLearning()
|
||||
{
|
||||
CV_Assert(totalSampleCount > 0);
|
||||
for( int ci = 0; ci < componentsCount; ci++ )
|
||||
{
|
||||
int n = sampleCounts[ci];
|
||||
@ -182,6 +181,7 @@ void GMM::endLearning()
|
||||
coefs[ci] = 0;
|
||||
else
|
||||
{
|
||||
CV_Assert(totalSampleCount > 0);
|
||||
double inv_n = 1.0 / n;
|
||||
coefs[ci] = (double)n/totalSampleCount;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user