From: Alexander Alekhin Date: Tue, 17 Jul 2018 15:40:48 +0000 (+0000) Subject: Merge pull request #11984 from mshabunin:fix-static-1 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~600^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cc84ce8abeaf24514d075da642f5c3ed0ab1279;p=platform%2Fupstream%2Fopencv.git Merge pull request #11984 from mshabunin:fix-static-1 --- 7cc84ce8abeaf24514d075da642f5c3ed0ab1279 diff --cc modules/objdetect/src/qrcode.cpp index c04aab5,3111813..c3a5593 --- a/modules/objdetect/src/qrcode.cpp +++ b/modules/objdetect/src/qrcode.cpp @@@ -111,10 -111,11 +111,11 @@@ vector QRDecode::searchVerticalL 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) @@@ -182,10 -183,11 +183,11 @@@ vector QRDecode::separateHoriz 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)