Project

General

Profile

Actions

action #68474

closed

similarity calculation can return NaN

Added by nadvornik over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Regressions/Crashes
Target version:
-
Start date:
2020-06-26
Due date:
% Done:

0%

Estimated time:

Description

I have updated my SLE15SP1 machine to current openQA and installed all SLE updates:
openQA-4.6.1592990132.f2d269d68-2896.1.noarch
os-autoinst-4.6.1592908950.5038d8c2-458.1.x86_64
libopencv3_4-3.4.10-2.1.x86_64

Previously installed openQA version was from January.

Then I got failures in tests that worked before:
after x11_start_program('xterm') on GNOME desktop the xterm did not appear.
With vnc client I checked that xterm actually appeared, just the openQA screen was not updated.

After more debugging I have found that

$sim = $lastscreenshot->similarity($image) if $lastscreenshot;

in backend/baseclass.pm method enqueue_screenshot returns NaN and this breaks all further updates.

The following change apparently fixed the issue, but I don't understand why norm() could return NaN. Maybe the image is somewhat broken.

--- a/ppmclibs/tinycv_impl.cc
+++ b/ppmclibs/tinycv_impl.cc
@@ -301,6 +301,10 @@ double getPSNR(const Mat& I1, const Mat& I2)

     double noise = norm(I1, I2);

+    if (std::isnan(noise)) {
+        return VERY_DIFF;
+    }
+
     if (!noise) {
         return VERY_SIM;
     }

Files

opencv_test.tar.gz (862 KB) opencv_test.tar.gz nadvornik, 2020-06-26 13:59

Related issues 2 (0 open2 closed)

Related to openQA Tests (public) - action #68510: test fails in logpackages on some aarch64 workersResolved2020-06-29

Actions
Related to openQA Project (public) - action #68554: [sporadic] some tests fail in incomplete state due to a 'cv::Exception'Resolvedmkittler2020-07-01

Actions
Actions

Also available in: Atom PDF