opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.43k stars 5.76k forks source link

opencv_test_wechat_qrcode is not all passed when dnn is used #2865

Open jsxyhelu opened 3 years ago

jsxyhelu commented 3 years ago

According to the opencv_test_wechat_qrcode results, if DNN is not used, 33 pass; if DNN is used, 30 pass. What is the reason for the difference here? So what is the value of using DNN and training these models?

CTEST_FULL_OUTPUT
OpenCV version: 4.5.1-dev
OpenCV VCS version: unknown
Build type: Debug Release
WARNING: build value differs from runtime: Debug
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe  (ver 19.16.27044.0)
Parallel framework: ms-concurrency (nthreads=4)
CPU features: SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?
[ INFO:0] global E:\Gitee\opencv_2021\opencv\modules\core\src\ocl.cpp (1176) cv::ocl::haveOpenCL Initialize OpenCL runtime...
[ INFO:0] global E:\Gitee\opencv_2021\opencv\modules\core\src\ocl.cpp (1182) cv::ocl::haveOpenCL OpenCL: found 2 platforms
[ INFO:0] global E:\Gitee\opencv_2021\opencv\modules\core\src\ocl.cpp (974) cv::ocl::OpenCLExecutionContext::Impl::getInitializedExecutionContext OpenCL: initializing thread execution context
[ INFO:0] global E:\Gitee\opencv_2021\opencv\modules\core\src\ocl.cpp (984) cv::ocl::OpenCLExecutionContext::Impl::getInitializedExecutionContext OpenCL: creating new execution context...
[ INFO:0] global E:\Gitee\opencv_2021\opencv\modules\core\src\ocl.cpp (1002) cv::ocl::OpenCLExecutionContext::Impl::getInitializedExecutionContext OpenCL: device=Intel(R) HD Graphics 620
OpenCL Platforms:
    Intel(R) OpenCL
        iGPU: Intel(R) HD Graphics 620 (OpenCL 2.1 )
        CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (OpenCL 2.1 (Build 2))
    AMD Accelerated Parallel Processing
        dGPU: Iceland (OpenCL 2.0 AMD-APP (2348.3))
        CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (OpenCL 1.2 AMD-APP (2348.3))
Current OpenCL device:
    Type = iGPU
    Name = Intel(R) HD Graphics 620
    Version = OpenCL 2.1
    Driver version = 21.20.16.4574
    Address bits = 64
    Compute units = 24
    Max work group size = 256
    Local memory size = 64 KB
    Max memory allocation size = 1 GB 1023 MB 1023 KB 1023 B
    Double support = Yes
    Host unified memory = Yes
    Device extensions:
        cl_intel_accelerator
        cl_intel_advanced_motion_estimation
        cl_intel_d3d11_nv12_media_sharing
        cl_intel_driver_diagnostics
        cl_intel_dx9_media_sharing
        cl_intel_motion_estimation
        cl_intel_packed_yuv
        cl_intel_required_subgroup_size
        cl_intel_simultaneous_sharing
        cl_intel_subgroups
        cl_khr_3d_image_writes
        cl_khr_byte_addressable_store
        cl_khr_d3d10_sharing
        cl_khr_d3d11_sharing
        cl_khr_depth_images
        cl_khr_dx9_media_sharing
        cl_khr_fp16
        cl_khr_fp64
        cl_khr_gl_depth_images
        cl_khr_gl_event
        cl_khr_gl_msaa_sharing
        cl_khr_global_int32_base_atomics
        cl_khr_global_int32_extended_atomics
        cl_khr_gl_sharing
        cl_khr_icd
        cl_khr_image2d_from_buffer
        cl_khr_local_int32_base_atomics
        cl_khr_local_int32_extended_atomics
        cl_khr_mipmap_image
        cl_khr_mipmap_image_writes
        cl_khr_spir
        cl_khr_subgroups
        cl_khr_throttle_hints
    Has AMD Blas = No
    Has AMD Fft = No
    Preferred vector width char = 16
    Preferred vector width short = 8
    Preferred vector width int = 4
    Preferred vector width long = 1
    Preferred vector width float = 1
    Preferred vector width double = 1
TEST: Skip tests with tags: 'mem_6gb', 'verylong', 'debug_verylong'
[==========] Running 33 tests from 4 test cases.
[----------] Global test environment set-up.
[----------] 21 tests from Objdetect_QRCode
[ RUN      ] Objdetect_QRCode.regression/0, where GetParam() = "version_1_down.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
E:\Gitee\opencv_2021\opencv_contrib\modules\wechat_qrcode\test\test_qrcode.cpp(84): error: Expected equality of these values:
  decoded_str
    Which is: ""
  original_info
    Which is: "aQqdqecq%hre3?JX"
[  FAILED  ] Objdetect_QRCode.regression/0, where GetParam() = "version_1_down.jpg" (4764 ms)
[ RUN      ] Objdetect_QRCode.regression/1, where GetParam() = "version_1_top.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/1 (515 ms)
[ RUN      ] Objdetect_QRCode.regression/2, where GetParam() = "version_2_left.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/2 (765 ms)
[ RUN      ] Objdetect_QRCode.regression/3, where GetParam() = "version_2_up.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/3 (485 ms)
[ RUN      ] Objdetect_QRCode.regression/4, where GetParam() = "version_2_top.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/4 (476 ms)
[ RUN      ] Objdetect_QRCode.regression/5, where GetParam() = "version_3_down.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/5 (489 ms)
[ RUN      ] Objdetect_QRCode.regression/6, where GetParam() = "version_3_left.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/6 (556 ms)
[ RUN      ] Objdetect_QRCode.regression/7, where GetParam() = "version_3_up.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/7 (455 ms)
[ RUN      ] Objdetect_QRCode.regression/8, where GetParam() = "version_3_top.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/8 (593 ms)
[ RUN      ] Objdetect_QRCode.regression/9, where GetParam() = "version_4_down.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/9 (479 ms)
[ RUN      ] Objdetect_QRCode.regression/10, where GetParam() = "version_4_left.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
E:\Gitee\opencv_2021\opencv_contrib\modules\wechat_qrcode\test\test_qrcode.cpp(84): error: Expected equality of these values:
  decoded_str
    Which is: ""
  original_info
    Which is: "aQqdqecq%hre3?JXcDxx#PqLG_29G*R^&f?bD6C5qam+Y_MUGaSmS5&fh_Q&bCZz"
[  FAILED  ] Objdetect_QRCode.regression/10, where GetParam() = "version_4_left.jpg" (4122 ms)
[ RUN      ] Objdetect_QRCode.regression/11, where GetParam() = "version_4_up.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/11 (447 ms)
[ RUN      ] Objdetect_QRCode.regression/12, where GetParam() = "version_4_top.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/12 (592 ms)
[ RUN      ] Objdetect_QRCode.regression/13, where GetParam() = "version_5_down.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/13 (555 ms)
[ RUN      ] Objdetect_QRCode.regression/14, where GetParam() = "version_5_left.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/14 (625 ms)
[ RUN      ] Objdetect_QRCode.regression/15, where GetParam() = "version_5_up.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/15 (2059 ms)
[ RUN      ] Objdetect_QRCode.regression/16, where GetParam() = "version_5_top.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/16 (500 ms)
[ RUN      ] Objdetect_QRCode.regression/17, where GetParam() = "russian.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/17 (701 ms)
[ RUN      ] Objdetect_QRCode.regression/18, where GetParam() = "kanji.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/18 (920 ms)
[ RUN      ] Objdetect_QRCode.regression/19, where GetParam() = "link_ocv.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
E:\Gitee\opencv_2021\opencv_contrib\modules\wechat_qrcode\test\test_qrcode.cpp(84): error: Expected equality of these values:
  decoded_str
    Which is: ""
  original_info
    Which is: "https://opencv.org/"
[  FAILED  ] Objdetect_QRCode.regression/19, where GetParam() = "link_ocv.jpg" (3721 ms)
[ RUN      ] Objdetect_QRCode.regression/20, where GetParam() = "link_wiki_cv.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode.regression/20 (1069 ms)
[----------] 21 tests from Objdetect_QRCode (24926 ms total)

[----------] 4 tests from Objdetect_QRCode_Close
[ RUN      ] Objdetect_QRCode_Close.regression/0, where GetParam() = "close_2.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Close.regression/0 (602 ms)
[ RUN      ] Objdetect_QRCode_Close.regression/1, where GetParam() = "close_3.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Close.regression/1 (752 ms)
[ RUN      ] Objdetect_QRCode_Close.regression/2, where GetParam() = "close_4.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Close.regression/2 (1537 ms)
[ RUN      ] Objdetect_QRCode_Close.regression/3, where GetParam() = "close_5.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Close.regression/3 (773 ms)
[----------] 4 tests from Objdetect_QRCode_Close (3671 ms total)

[----------] 5 tests from Objdetect_QRCode_Monitor
[ RUN      ] Objdetect_QRCode_Monitor.regression/0, where GetParam() = "monitor_1.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Monitor.regression/0 (382 ms)
[ RUN      ] Objdetect_QRCode_Monitor.regression/1, where GetParam() = "monitor_2.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Monitor.regression/1 (774 ms)
[ RUN      ] Objdetect_QRCode_Monitor.regression/2, where GetParam() = "monitor_3.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Monitor.regression/2 (743 ms)
[ RUN      ] Objdetect_QRCode_Monitor.regression/3, where GetParam() = "monitor_4.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Monitor.regression/3 (663 ms)
[ RUN      ] Objdetect_QRCode_Monitor.regression/4, where GetParam() = "monitor_5.png"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Monitor.regression/4 (560 ms)
[----------] 5 tests from Objdetect_QRCode_Monitor (3131 ms total)

[----------] 3 tests from Objdetect_QRCode_Curved
[ RUN      ] Objdetect_QRCode_Curved.regression/0, where GetParam() = "curved_1.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Curved.regression/0 (898 ms)
[ RUN      ] Objdetect_QRCode_Curved.regression/1, where GetParam() = "curved_5.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Curved.regression/1 (427 ms)
[ RUN      ] Objdetect_QRCode_Curved.regression/2, where GetParam() = "curved_6.jpg"
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.prototxt
Successfully upgraded batch norm layers using deprecated params.
Attempting to upgrade batch norm layers using deprecated params: E:/wechat_qrcode/detect.caffemodel
Successfully upgraded batch norm layers using deprecated params.
[       OK ] Objdetect_QRCode_Curved.regression/2 (744 ms)
[----------] 3 tests from Objdetect_QRCode_Curved (2074 ms total)

[----------] Global test environment tear-down
[==========] 33 tests from 4 test cases ran. (33813 ms total)
dddzg commented 3 years ago

Sorry for the delayed response. Thanks for your issue. I checked it and also found this problem. The DNN model is used to detect qrcode as the following illustration: image

For the three fail QRcode images, I found that the QRcode is successfully cropped, however, the decoded result is not stable ( several pixel shifts make a failing decode) because the curved QRcode makes key point alignment difficult.

We are trying to fix the problem.