Not work MagickCompareImages, need help
Posted: 2007-10-11T08:34:28-07:00
In console:
In my application:
Source code:
Why 6.70699291666667E+0003 (but not 9.86553)? I don't understand, where is my trouble?
Code: Select all
C:\Program Files\ImageMagick-6.3.6-Q8>compare.exe -metric PSNR C:\1.bmp C:\2.bmp C:\Result.bmp
9.86553
Code: Select all
D:\Test>Test.exe
Status = 1
Status = 1
Distortion = 0.00000000000000E+0000
Distortion = 6.70699291666667E+0003
Code: Select all
program Test;
{$APPTYPE CONSOLE}
uses
SysUtils,
ImageMagick in 'PascalMagick\magick\ImageMagick.pas',
magick_wand in 'PascalMagick\wand\magick_wand.pas';
var
Img1, Img2, ImgResult: PMagickWand;
Status: MagickBooleanType;
Distortion: Double;
begin
MagickWandGenesis;
Img2 := NewMagickWand;
Img1 := NewMagickWand;
Status := MagickReadImage(Img1, PChar('C:\1.bmp'));
Writeln('Status = ', Status);
Status := MagickReadImage(Img2, PChar('C:\2.bmp'));
Writeln('Status = ', Status);
Writeln('Distortion = ', Distortion);
ImgResult := MagickCompareImages(Img1, Img2, PeakSignalToNoiseRatioMetric, @Distortion);
Writeln('Distortion = ', Distortion);
Img1 := DestroyMagickWand(Img1);
Img2 := DestroyMagickWand(Img2);
DestroyMagickWand(ImgResult);
MagickWandTerminus;
end.