Skip to content

Commit 4739973

Browse files
committed
Merge pull request #2897 from Chester-zZz:wechat-qrcode
2 parents 7f6004e + ba281ca commit 4739973

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/wechat_qrcode/src/detector/ssd_detector.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ vector<Mat> SSDDetector::forward(Mat img, const int target_width, const int targ
3131
const float* prob_score = prob.ptr<float>(0, 0, row);
3232
// prob_score[0] is not used.
3333
// prob_score[1]==1 stands for qrcode
34-
if (prob_score[1] == 1) {
34+
if (prob_score[1] == 1 && prob_score[2] > 1E-5) {
35+
// add a safe score threshold due to https://github.com/opencv/opencv_contrib/issues/2877
3536
// prob_score[2] is the probability of the qrcode, which is not used.
3637
auto point = Mat(4, 2, CV_32FC1);
3738
float x0 = CLIP(prob_score[3] * img_w, 0.0f, img_w - 1.0f);

0 commit comments

Comments
 (0)