octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55100] [octave forge] (signal) Unit test in n


From: Rafael Laboissiere
Subject: [Octave-bug-tracker] [bug #55100] [octave forge] (signal) Unit test in normxcorr2 fails randomly
Date: Mon, 26 Nov 2018 00:44:03 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?55100>

                 Summary: [octave forge] (signal) Unit test in normxcorr2
fails randomly
                 Project: GNU Octave
            Submitted by: rlaboiss
            Submitted on: Mon 26 Nov 2018 05:44:02 AM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: other
        Operating System: Other

    _______________________________________________________

Details:

I was hit by a failure in a non-determinstic unit test in file normxcorr2.m:


octave:1> pkg load image 
octave:2> test normxcorr2 verbose
>>>>> /usr/share/octave/packages/image-2.8.1/normxcorr2.m
***** function offsets = get_max_offsets (c)
  l = find (c == max (c(:)));
  offsets = nthargout (1:ndims (c), @ind2sub, size (c), l);
***** endfunction
***** test
 row_shift = 18;
 col_shift = 20;
 a = randi (255, 30, 30);
 b = a(row_shift-10:row_shift, col_shift-7:col_shift);
 c = normxcorr2 (b, a);
 ## should return exact coordinates
 assert (get_max_offsets (c), {row_shift col_shift});

 ## Even with some small noise, should return exact coordinates
 b = imnoise (b, "gaussian");
 c = normxcorr2 (b, a);
 assert (get_max_offsets (c), {row_shift col_shift});
***** test
 a = rand (10, 10);
 c = normxcorr2 (a(5:7, 6:9), a);
 assert (c(7, 9), 1, eps*2);
!!!!! test failed
ASSERT errors for:  assert (c (7, 9),1,eps * 2)

  Location  |  Observed  |  Expected  |  Reason
     ()           1            1         Abs err 6.6613e-16 exceeds tol
4.4409e-16 by 2e-16


Even though the failure seems to happen very rarely, it would be better to
avoid it, as in the patch attached to this bug report.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 26 Nov 2018 05:44:02 AM UTC  Name: xtest-in-normxcorr2.patch  Size:
491B   By: rlaboiss

<http://savannah.gnu.org/bugs/download.php?file_id=45527>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55100>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]