@@ -41,9 +41,9 @@ std::string qrcode_images_curved[] = {"curved_1.jpg", /*"curved_2.jpg", "curved_
41
41
"curved_4.jpg",*/
42
42
" curved_5.jpg" , " curved_6.jpg" ,
43
43
/* "curved_7.jpg", "curved_8.jpg"*/ };
44
- // std::string qrcode_images_multiple[] = {"2_qrcodes.png", "3_close_qrcodes.png", "3_qrcodes.png",
45
- // "4_qrcodes.png", "5_qrcodes.png", "6_qrcodes.png",
46
- // "7_qrcodes.png", "8_close_qrcodes.png"};
44
+ std::string qrcode_images_multiple[] = {/* "2_qrcodes.png",*/ " 3_close_qrcodes.png" , /* "3_qrcodes.png",
45
+ "4_qrcodes.png", "5_qrcodes.png", "6_qrcodes.png",*/
46
+ " 7_qrcodes.png" /* , "8_close_qrcodes.png"*/ };
47
47
48
48
typedef testing::TestWithParam<std::string> Objdetect_QRCode;
49
49
TEST_P (Objdetect_QRCode, regression) {
@@ -237,18 +237,20 @@ typedef testing::TestWithParam<std::string> Objdetect_QRCode_Multi;
237
237
TEST_P (Objdetect_QRCode_Multi, regression) {
238
238
const std::string name_current_image = GetParam ();
239
239
const std::string root = " qrcode/multiple/" ;
240
+ string path_detect_prototxt, path_detect_caffemodel, path_sr_prototxt, path_sr_caffemodel;
241
+ string model_version = " _2021-01" ;
242
+ path_detect_prototxt = findDataFile (" dnn/wechat" +model_version+" /detect.prototxt" , false );
243
+ path_detect_caffemodel = findDataFile (" dnn/wechat" +model_version+" /detect.caffemodel" , false );
244
+ path_sr_prototxt = findDataFile (" dnn/wechat" +model_version+" /sr.prototxt" , false );
245
+ path_sr_caffemodel = findDataFile (" dnn/wechat" +model_version+" /sr.caffemodel" , false );
240
246
241
247
std::string image_path = findDataFile (root + name_current_image);
242
248
Mat src = imread (image_path);
243
249
ASSERT_FALSE (src.empty ()) << " Can't read image: " << image_path;
244
250
245
251
vector<Mat> points;
246
- // can not find the model file
247
- // so we temporarily comment it out
248
- // auto detector = wechat_qrcode::WeChatQRCode(
249
- // findDataFile("detect.prototxt", false), findDataFile("detect.caffemodel", false),
250
- // findDataFile("sr.prototxt", false), findDataFile("sr.caffemodel", false));
251
- auto detector = wechat_qrcode::WeChatQRCode ();
252
+ auto detector = wechat_qrcode::WeChatQRCode (path_detect_prototxt, path_detect_caffemodel, path_sr_prototxt,
253
+ path_sr_caffemodel);
252
254
vector<string> decoded_info = detector.detectAndDecode (src, points);
253
255
254
256
const std::string dataset_config = findDataFile (root + " dataset_config.json" );
@@ -343,7 +345,7 @@ INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode, testing::ValuesIn(qrcode_images_
343
345
INSTANTIATE_TEST_CASE_P (/* */ , Objdetect_QRCode_Close, testing::ValuesIn(qrcode_images_close));
344
346
INSTANTIATE_TEST_CASE_P (/* */ , Objdetect_QRCode_Monitor, testing::ValuesIn(qrcode_images_monitor));
345
347
INSTANTIATE_TEST_CASE_P (/* */ , Objdetect_QRCode_Curved, testing::ValuesIn(qrcode_images_curved));
346
- // INSTANTIATE_TEST_CASE_P(/**/, Objdetect_QRCode_Multi, testing::ValuesIn(qrcode_images_multiple));
348
+ INSTANTIATE_TEST_CASE_P (/* */ , Objdetect_QRCode_Multi, testing::ValuesIn(qrcode_images_multiple));
347
349
348
350
TEST (Objdetect_QRCode_Big, regression) {
349
351
string path_detect_prototxt, path_detect_caffemodel, path_sr_prototxt, path_sr_caffemodel;
0 commit comments