diff --git a/modules/objdetect/src/qrcode.cpp b/modules/objdetect/src/qrcode.cpp index f7c40a744f..e3c8d559ae 100644 --- a/modules/objdetect/src/qrcode.cpp +++ b/modules/objdetect/src/qrcode.cpp @@ -71,8 +71,11 @@ bool QRDecode::localization() Point begin, end; std::vector list_lines_x = searchVerticalLines(); + if (list_lines_x.empty()) return false; std::vector list_lines_y = separateHorizontalLines(list_lines_x); + if (list_lines_y.empty()) return false; std::vector result_point = pointClustering(list_lines_y); + if (result_point.empty()) return false; for (int i = 0; i < 3; i++) { localization_points.push_back(