failing 'MAT (MatLab gray 64-bit LSB double) ...' test

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Petr
Posts: 51
Joined: 2010-01-07T09:37:51-07:00
Authentication code: 8675309

failing 'MAT (MatLab gray 64-bit LSB double) ...' test

Post by Petr »

For

Code: Select all

print("MAT (MatLab gray 64-bit LSB double) ...\n");
$srcimage_name = 'input_gray_lsb_double.mat';
$refimage_name = 'reference/read/input_gray_lsb_double_mat.miff';

$srcimage=Image::Magick->new;
$srcimage->ReadImage("$srcimage_name");
$refimage=Image::Magick->new;
$refimage->ReadImage("$refimage_name");

$srcimage->Difference($refimage);

$normalized_mean_error=$srcimage->GetAttribute('mean-error');
print("mean-error: $normalized_mean_error\n");
we get with 6.8.8-1 e. g.:
  1. * on s390x, mean-error=0.210655235762401
    * on ppc64, mean-error=0.210660069835285
    * on x86_64, mean-error=0.0838661846826908
Mean error slightly exceedes threshold 0.2 required in test #13 of PerlMagick/t/read.t. The test fails also for 32-bit s390 and ppc.
Petr
Posts: 51
Joined: 2010-01-07T09:37:51-07:00
Authentication code: 8675309

Re: failing 'MAT (MatLab gray 64-bit LSB double) ...' test

Post by Petr »

Seemingly, value of opacity of 'p image' depends on MALLOC_PERTURB_ similarly like in bug 22586:

$ export MALLOC_PERTURB_=69
$ gdb perl
(gdb) b compare.c:1646
(gdb) run read-compare.pl
Breakpoint 1, IsImagesEqual (image=0x8032d100, reconstruct_image=0x8031a410) at magick/compare.c:1646
1646 p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
(gdb) printf "%x\n", p[0].opacity
baba

$ export MALLOC_PERTURB_=70
[...]
(gdb) printf "%x\n", p[0].opacity
b9b9
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: failing 'MAT (MatLab gray 64-bit LSB double) ...' test

Post by magick »

The opacity member is not defined unless the image is an alpha image. Otherwise the opacity member is undefined and might contain any random data.

There is some expectation of slight differences in converting floating point doubles to grayscale on various computer hosts, that is why we introduce a fuzz in this test. We may need to just adjust the fuzz factor unless you can illustrate a bug in the ImageMagick Matlab reader.
Petr
Posts: 51
Joined: 2010-01-07T09:37:51-07:00
Authentication code: 8675309

Re: failing 'MAT (MatLab gray 64-bit LSB double) ...' test

Post by Petr »

magick wrote:The opacity member is not defined unless the image is an alpha image. Otherwise the opacity member is undefined and might contain any random data.
:) That makes sense.
magick wrote:There is some expectation of slight differences in converting floating point doubles to grayscale on various computer hosts, that is why we introduce a fuzz in this test. We may need to just adjust the fuzz factor unless you can illustrate a bug in the ImageMagick Matlab reader.
Ok, that's understandable. Which fuzz factor are you going to choose?
Post Reply