for (size_t i = 0; i < test_lines.size(); i++) { length += test_lines[i]; }
+ CV_Assert(length > 0);
for (size_t i = 0; i < test_lines.size(); i++)
{
- if (i == 2) { weight += abs((test_lines[i] / length) - 3.0/7.0); }
- else { weight += abs((test_lines[i] / length) - 1.0/7.0); }
+ if (i == 2) { weight += fabs((test_lines[i] / length) - 3.0/7.0); }
+ else { weight += fabs((test_lines[i] / length) - 1.0/7.0); }
}
if (weight < eps_vertical)
for (size_t i = 0; i < test_lines.size(); i++) { length += test_lines[i]; }
+ CV_Assert(length > 0);
for (size_t i = 0; i < test_lines.size(); i++)
{
- if (i % 3 == 0) { weight += abs((test_lines[i] / length) - 3.0/14.0); }
- else { weight += abs((test_lines[i] / length) - 1.0/ 7.0); }
+ if (i % 3 == 0) { weight += fabs((test_lines[i] / length) - 3.0/14.0); }
+ else { weight += fabs((test_lines[i] / length) - 1.0/ 7.0); }
}
if(weight < eps_horizontal)