Merge pull request #16826 from mshabunin:fix-kw-issues-34

This commit is contained in:
Alexander Alekhin 2020-03-16 18:48:19 +00:00
commit df74eb4ff6
2 changed files with 3 additions and 0 deletions

View File

@ -1323,6 +1323,7 @@ void quantized_counting_sort(const float a[], const int n,
const float quantum, const int nkeys, const float quantum, const int nkeys,
int idx[/*n*/], int cum[/*nkeys + 1*/]) int idx[/*n*/], int cum[/*nkeys + 1*/])
{ {
CV_Assert(nkeys > 0);
memset(cum, 0, sizeof(cum[0]) * (nkeys + 1)); memset(cum, 0, sizeof(cum[0]) * (nkeys + 1));
// Count up the quantized values // Count up the quantized values

View File

@ -1608,6 +1608,8 @@ bool QRDetectMulti::checkPoints(const vector<Point2f>& quadrangle_points)
li2++; li2++;
} }
} }
if (count_w == 0)
return false;
double frac = double(count_b) / double(count_w); double frac = double(count_b) / double(count_w);
double bottom_bound = 0.76; double bottom_bound = 0.76;