Page 1 of 1

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

Posted: 2014-02-10T05:56:05-07:00
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.

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

Posted: 2014-02-11T03:18:04-07:00
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

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

Posted: 2014-02-11T06:26:31-07:00
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.

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

Posted: 2014-02-12T04:19:59-07:00
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?