octave-maintainers
[Top][All Lists]
Advanced

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

Re: imwrite.m test failures


From: Andreas Weber
Subject: Re: imwrite.m test failures
Date: Mon, 07 Oct 2013 11:38:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9

On 06.10.2013 19:03, marco atzeri wrote:
> Il 10/6/2013 6:52 PM, Andreas Weber ha scritto:
>> Am 03.10.2013 21:46, schrieb marco atzeri:
>>> testing latest devel
>>> (changeset:   17540:b7aa1d726bcc)
>>>
>>> anyone seeing the same ?
>>>
>>>>>>>> processing /pub/hg/octave/scripts/image/imwrite.m
>>>    ***** testif HAVE_MAGICK
>>>   imw = randi (255, 100, "uint8");
>>>   filename = [tmpnam() ".png"];
>>>   unwind_protect
>>>     imwrite (imw, filename);
>>>     imr = imread (filename);
>>>   unwind_protect_cleanup
>>>     unlink (filename);
>>>   end_unwind_protect
>>>   assert (imw, imr)
>>> !!!!! test failed
>>> ASSERT errors for:  assert (imw,imr)
>>>
>>>    Location  |  Observed  |  Expected  |  Reason
>>>     (1,1)         104          103        Abs err 1 exceeds tol 0
>>>     (2,1)         184          183        Abs err 1 exceeds tol 0
>>> ..
>>>    (99,100)        96           95        Abs err 1 exceeds tol 0
>>>   (100,100)       126          125        Abs err 1 exceeds tol 0
>>>>>>>> processing /pub/hg/octave/scripts/image/ind2gray.m
>>>
>>>
>>
>> Hi Marco,
>> cset: 0c6750ace8b4, test imwrite.m PASSES 10 out of 10 tests
>>
>> GraphicsMagick 1.3.16 2012-06-23 Q8 http://www.GraphicsMagick.org/
>>
>> MAGICK_CPPFLAGS = -I/usr/include/GraphicsMagick
>> MAGICK_LDFLAGS =
>> MAGICK_LIBS = -lGraphicsMagick++ -lGraphicsMagick
>>
>> Can you try
>> octave> imw = uint8([0 100 200]);
>> octave> imwrite(imw, "testA.png")
>>
>> and then in a shell
>> $ gm identify -verbose testA.png
>>
>> I get:
>> Image: testA.png
>>    Format: PNG (Portable Network Graphics)
>>    Geometry: 3x1
>>    Class: PseudoClass
>>    Type: grayscale
>>    Depth: 8 bits-per-pixel component
>>    Channel Depths:
>>      Gray:     6 bits
>>    Channel Statistics:
>>      Gray:
>>        Minimum:                     0.00 (0.0000)
>>        Maximum:                   200.00 (0.7843)
>>        Mean:                      100.00 (0.3922)
>>        Standard Deviation:        100.00 (0.3922)
>>    Colors: 256
>>      0: (  0,  0,  0)      black
>>      1: (  1,  1,  1)      #010101
>> ..
>>      100: (100,100,100)      #646464
>> ...
>>      200: (200,200,200)      #C8C8C8
>> ...
>>    255: (255,255,255)      white
>>    Filesize: 69
>>    Interlace: No
>>    Orientation: Unknown
>>    Background Color: white
>>    Border Color: #DFDFDF
>>    Matte Color: #BDBDBD
>>    Compose: Over
>>    Dispose: Undefined
>>    Iterations: 0
>>    Compression: Zip
>>    Signature:
>> 6f5c5c4f22b887737ef219b11c1e7f94faef02e50d985032538327b2bcd9a2ec
>>    Tainted: False
>>
>> Until now it could be a problem with imwrite or imread, perhaps we can
>> assign it to one of them.
>>
>> HTH, Andy
>>
> 
> Q16 instead of Q8
> GraphicsMagick 1.3.18 2013-03-10 Q16 http://www.GraphicsMagick.org/
> 
> therea are some slight differences in the gray depth
> 
> $ gm identify -verbose testA.png
> Image: testA.png
>   Format: PNG (Portable Network Graphics)
>   Geometry: 3x1
>   Class: PseudoClass
>   Type: grayscale
>   Depth: 8 bits-per-pixel component
>   Channel Depths:
>     Gray:     8 bits
>   Channel Statistics:
>     Gray:
>       Minimum:                     0.00 (0.0000)
>       Maximum:                 51143.00 (0.7804)
>       Mean:                    25528.67 (0.3895)
>       Standard Deviation:      25571.61 (0.3902)
>   Colors: 256
>     0: (  0,  0,  0)      black
>     1: (  1,  1,  1)      #010101
> 
>     100: (100,100,100)    #646464
> 
>     255: (255,255,255)    white
>   Filesize: 69
>   Interlace: No
>   Orientation: Unknown
>   Background Color: white
>   Border Color: #DFDFDF
>   Matte Color: #BDBDBD
>   Compose: Over
>   Dispose: Undefined
>   Iterations: 0
>   Compression: Zip
>   Png:IHDR.color-type-orig: 0
>   Png:IHDR.bit-depth-orig: 8
>   Signature:
> eaa4e546aa78466f45e563dbcbab6f26d66e96f2485b3e199d7b0e59c5f49775
>   Tainted: False
> 
> 
> 

Hi Marco,
I use octave default 36b9fa789d8e
can you try this changeset too? There were some changes to imwrite since
b7aa1d726bcc.

I compiled libgraphicsmagick with Q16:
GraphicsMagick 1.3.16 2012-06-23 Q16 http://www.GraphicsMagick.org/

$ gm identify -verbose testA.png
Image: testA.png
  Format: PNG (Portable Network Graphics)
  Geometry: 3x1
  Class: PseudoClass
  Type: grayscale
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Gray:     8 bits
  Channel Statistics:
    Gray:
      Minimum:                     0.00 (0.0000)
      Maximum:                 51400.00 (0.7843)
      Mean:                    25700.00 (0.3922)
      Standard Deviation:      25700.00 (0.3922)


Do you see the different values for Max and Mean?
When I read back the image with imread I get
octave:1> imread("testA.png")
warning: your version of GraphicsMagick limits images to 16 bits per pixel
ans =

    0  100  200

So perhaps a problem with the newer gm lib?

Regards Andy


reply via email to

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