Commit ccf96b9e authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #13323 from alalek:issue_13297

parents 3fe70d5c 5ed7d5a5
...@@ -174,7 +174,6 @@ void GMM::addSample( int ci, const Vec3d color ) ...@@ -174,7 +174,6 @@ void GMM::addSample( int ci, const Vec3d color )
void GMM::endLearning() void GMM::endLearning()
{ {
CV_Assert(totalSampleCount > 0);
for( int ci = 0; ci < componentsCount; ci++ ) for( int ci = 0; ci < componentsCount; ci++ )
{ {
int n = sampleCounts[ci]; int n = sampleCounts[ci];
...@@ -182,6 +181,7 @@ void GMM::endLearning() ...@@ -182,6 +181,7 @@ void GMM::endLearning()
coefs[ci] = 0; coefs[ci] = 0;
else else
{ {
CV_Assert(totalSampleCount > 0);
double inv_n = 1.0 / n; double inv_n = 1.0 / n;
coefs[ci] = (double)n/totalSampleCount; coefs[ci] = (double)n/totalSampleCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment