Issue 1:
System information (version)

OpenCV => 3.4 / master branch

Operating System / Platform => Jetson TX2 Aarch64 Ubuntu 16.04 64bit

Compiler => GCC 5.4.0

Detailed description

I wrote PR #12905 , but even after mergin this PR, the test fails on Jetson TX2 (Aarch64)

$ ./bin/opencv_test_objdetect --gtest_filter=*QRC*/25
CTEST_FULL_OUTPUT
OpenCV version: 3.4.3-dev
OpenCV VCS version: 3.4.3-357-gd3f75df-dirty
Build type: Release
Compiler: /usr/bin/c++ (ver 5.4.0)
Parallel framework: pthreads
CPU features: NEON FP16
OpenCL is disabled
Note: Google Test filter = *QRC*/25
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Objdetect_QRCode
[ RUN ] Objdetect_QRCode.regression/25, where GetParam() = "russian.jpg"
/home/nvidia/opencv-fork/modules/objdetect/test/test_qrcode.cpp:69: Failure
Value of: detectQRCode(src, corners)
Actual: false
Expected: true
[ FAILED ] Objdetect_QRCode.regression/25, where GetParam() = "russian.jpg" (120 ms)
[----------] 1 test from Objdetect_QRCode (120 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (120 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Objdetect_QRCode.regression/25, where GetParam() = "russian.jpg"

1 FAILED TEST

#12905 was fixing the "decode" part, but this failure is on "detect" part.

Looking back , the detection was failed on this if section

opencv/modules/objdetect/src/qrcode.cpp

Line 319
in
ab2c16b

if( list_lines_y.size() < 3 ) { return false; }

Tracing back, the different behaviour comes from here

opencv/modules/objdetect/src/qrcode.cpp

Lines 202 to 205
in
ab2c16b

if(weight < eps_horizontal)

{

result.push_back(list_lines[pnt]);

}

This is computing the ratio of black and white, which should follow the QR code spec 1:1:3:1:1.

Unfortunately, this test case No. 25 is quite diagonal, so the ratio error becomes bit large, large enough above eps.

The difference of the binary image is very small.

Probably this difference comes from adaptiveThreshold

opencv/modules/objdetect/src/qrcode.cpp

Line 69
in
ab2c16b

adaptiveThreshold(barcode, bin_barcode, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, 83, 2);

It's using ADAPTIVE_THRESH_GAUSSIAN_C, so probably it has float rounding inside, and thus the binary image doesn't become "bit-exact"

I also loosen the eps_horizontal default_value from 0.1 to 0.11 and 0.2 here

In either case, this test No. 25 passes, but that causes false positive on other test cases.

So as a result of looking in this implementation, this test No.25 is on the edge of this algorithm, very edge so that even a rounding error could cause a different behavior

Now, I'd like to discuss about how to work with this issue.

ignore and keep this test fail on Aarch64

disable/skip this test on platform other than x86 (or totally remove this test case)

fix it from the source (this at least includes the implementation of bit-exact adaptiveThreshold)

Steps to reproduce

Run opencv_test_objdetect on Jetson TX2 (probably on any Aarch64 platform)

Issue 2:
System information (version)

OpenCV => 4.0.0 --> 4.1.0-pre

Operating System / Platform => Ubuntu 16.04

Compiler => gcc 6.4

Detailed description

When running the detailed stitching example, this error occurred:

/io/opencv/modules/core/src/ocl.cpp:4766: error: (-215:Assertion failed) u->refcount == 0 && "UMat deallocation error: some derived Mat is still alive" in function 'deallocate'

Steps to reproduce

Running stitching_detailed.cpp or stitching_detailed.py.