Page 1 of 1

.Compare Image Comparison - Parameters Issue

Posted: 2013-07-29T00:13:50-07:00
by JPH
A bit of background - I am trying to automate image comparison using a program called AutoIt.

I have the following code:

Code: Select all

Func _Compare_Image($fileOne, $fileTwo, $result)
local $o_object;
local $rc;

$o_object = ObjCreate("ImageMagickObject.MagickImage.1")
If Not IsObj($o_object) Then
Return 0
endif

$rc = $o_object.Compare("-metric", "PSNR", $fileOne, $fileTwo, $result)


Return $rc
EndFunc


$test = Call("_Compare_Image", "Sample One.png", "Sample Two.png", "Result.png")

ConsoleWrite($test)
This code half works - I get certain metrics information - the result.PNG image is created - but then the line errors:

Code: Select all

Sample One.png PNG 30x30 30x30+0+0 8-bit sRGB 305B 0.016u 0:00.005
Sample Two.png PNG 30x30 30x30+0+0 8-bit sRGB 380B 0.000u 0:00.000
Image: Sample One.png
  Channel distortion: MAE
    red: 1713.33 (0.0261438)
    green: 17.1333 (0.000261438)
    blue: 685.333 (0.0104575)
    alpha: 0 (0)
    all: 603.95 (0.00921569)
Sample One.png=>Result.png PNG 30x30 30x30+0+0 8-bit sRGB 3c 308B 0.000u 0:00.002
C:\Users\BOB\Desktop\ImageMagick.au3 (10) : ==> The requested action with this object has failed.:
$rc = $o_object.Compare("-verbose", "-metric", "MAE", $fileOne, $fileTwo, $result)
$rc = $o_object.Compare("-verbose", "-metric", "MAE", $fileOne, $fileTwo, $result)^ ERROR
Can anyone assist?