bugGNU Octave - Bugs: bug #55373, [octave forge] (image) random...

 
 

bug #55373: [octave forge] (image) random failure of unit test in imadjust.m

Submitted by:  Hartmut <hardy>
Submitted on:  Thu 03 Jan 2019 07:19:28 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.4.1 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 03 Jan 2019 07:19:28 PM UTC, original submission:

There is a unit test in imadjust.m of the image package, that randomly fails. Observed with the current image package 2.10.0 release.

The following loop code normally produces this test failure for me (tested on Ubunt 18.04 and Windows 10 with Octave 4.4.1):

pkg load image
for num = 1:10
    disp (num)
    test imadjust
end

Here is a typical output of the failing test:

***** test
in_u8 = randi ([0 255], 5, 5, 2, 3, "uint8");
in_u16 = randi ([0 65535], 5, 5, 2, 3, "uint16");
in_i16 = randi ([-32768 32767], 5, 5, 2, 3, "int16");
in_u8_d = im2double (in_u8);
in_u16_d = im2double (in_u16);
in_i16_d = im2double (in_i16);

## default values
assert (imadjust (in_u8), im2uint8 (imadjust (in_u8_d)))
assert (imadjust (in_u16), im2uint16 (imadjust (in_u16_d)))
assert (imadjust (in_i16), im2int16 (imadjust (in_i16_d)))

## single adjustment for all planes
args = {[.3; .7], [.1; .9], [1.5]};
assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))

## single adjustment for all planes (mixed with some complement)
args = {reshape([.2 .3 .25 .1 0 .1; .9 .7 .85 .9 1 .8], [2 2 3]),
         reshape([.1 .2 .05 .9 1 .3; .9 .85 .7 .1 0 .9], [2 2 3]),
         reshape([1 .75 1 1.2 1.5 2], [1 2 3])};
assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))

## test use of [] as limit and negative
args = {[], [.95; 0], 1.25};
assert (imadjust (in_u8, args{:}), im2uint8 (imadjust (in_u8_d, args{:})))
assert (imadjust (in_u16, args{:}), im2uint16 (imadjust (in_u16_d, args{:})))
assert (imadjust (in_i16, args{:}), im2int16 (imadjust (in_i16_d, args{:})))
!!!!! test failed
ASSERT errors for:  assert (imadjust (in_u8),im2uint8 (imadjust (in_u8_d)))

  Location  |  Observed  |  Expected  |  Reason
(1,3,2,3)       102          103        Abs err 1 exceeds tol 0 by 1
shared variables   scalar structure containing the fields:

    oRGB =

    ans(:,:,1) =

       0.00000
       0.00000
       0.20000
       0.40000
       0.60000
       0.80000
       1.00000
       1.00000
       1.00000
       1.00000

    ans(:,:,2) =

       0.00000
       0.00000
       0.00000
       0.20000
       0.40000
       0.60000
       0.80000
       1.00000
       1.00000
       1.00000

    ans(:,:,3) =

       0.00000
       0.00000
       0.00000
       0.00000
       0.20000
       0.40000
       0.60000
       0.80000
       1.00000
       1.00000

Hartmut <hardy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Updated the item)
  • -email is unavailable- added by hardy (Submitted the item)
  • -email is unavailable- added by hardy
  • -email is unavailable- added by hardy
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-03 avinoam StatusNone => Confirmed
    2019-01-03 hardy Carbon-Copy- => Added carandraug
        Carbon-Copy- => Added avinoam

    Back to the top


    Powered by Savane 3.4