i run the following script on 2 machines:
1. centos5 ImageMagick 6.7.1-6
2. centos6 ImageMagick 6.7.1-9
both has the same script and run on same jpgs. the jpgs are identical except for a different date text written on both
on the centos5 i get "Error is 25.458516, Mean Error is 0.000388"
on centos6 the error always 0.000
the script:
use Image::Magick;
$g1 = Image::Magick->new;
$g2 = Image::Magick->new;
$w = $g1->Read( filename=>"11.jpg");
$w = $g2->Read( filename=>"12.jpg");
$w = $g1->Compare(image=>$g2); # compare
printf ("Errors is %f\n", $g1->Get('error'));
printf ("Mean Error is %f\n", $g1->Get('mean-error'));
off course the problem is on the centos6, cause the jpgs has difference
any ideas?
compare returns always 0
Re: compare returns always 0
Here is the correct code:
Code: Select all
$g3 = $g1->Compare( image=>$g2, metric=>'RMSE' ); # compare
if (ref($g3)) {
printf ("Errors is %f\n", $g3->Get( 'error' ));
}