Hi All.
I'm trying to get pics difference in %. I tried to use ImageMagickObject.dll within AutoIt language.
I can share code, but not sure it will be useful, so I'll just mention which function & parameters I use:
Function - Compare
Parameters: "-metric" = "MAE"
2 bmp images for comparison (640x480)
destination of comparison = "null:" (I don't need one more image - just % of source images distortion)
"Compare" itself works well, but returns empty string.
I make few series of compare operations & then terminate my program - at this moment my debug console gets a load of strings from ImageMagickObject.dll:
+>00:19:55 AU3Check ended.rc:0
>Running:(3.3.8.0) :\Program Files\AutoIt3\autoit3.exe "D:\1\1.au3"
10.8064 (0.0423779)
10.8064 (0.0423779)
10.8064 (0.0423779)
+>00:19:58 AutoIT3.exe ended.rc:0
+>00:19:59 AutoIt3Wrapper Finished
>Exit code: 0 Time: 4.167
Numbers like "10.8064 (0.0423779)" seem like what I need. They are greater when images are different & smaller when images are alike.
So the problem is that I can get them only after termination - not while script execution.
I tried to catch any events from dll & it's object inside my script, but it gave nothing.
I tried several cases with parameter "-format" - many of possible means mentioned here (http://www.imagemagick.org/script/escape.php) gave me real values during script execution, but "%[distortion]" gave empty string (may be that's not a result of operation, but parameter of compare execution).
I think I "cook" ImageMagickObject in a wrong way.
Grates to everyone who can offer solution in any programming language or helpful link.
ImageMagickObject - compare - how to get pics difference in
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: ImageMagickObject - compare - how to get pics difference
"compare" sends output to stderr, not stdout.
"%[distortion]" is for "compare". This goes to stdout.
"%[distortion]" is for "compare". This goes to stdout.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ImageMagickObject - compare - how to get pics difference
I have moved this from the Consulting forum. That forum is for paid consulting.
Re: ImageMagickObject - compare - how to get pics difference
Well I already tried both of them & could not get anything except empty string... Could you provide a piece of working code?snibgo wrote:"compare" sends output to stderr, not stdout.
"%[distortion]" is for "compare". This goes to stdout.
Re: ImageMagickObject - compare - how to get pics difference
Ok. Sorry if I placed it in a wrong place.fmw42 wrote:I have moved this from the Consulting forum. That forum is for paid consulting.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ImageMagickObject - compare - how to get pics difference
In command line,
Code: Select all
compare -metric rmse image1 image2 null: 2>&1
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: ImageMagickObject - compare - how to get pics difference
As fmw says for "compare".
The "convert" version is:
This returns just a floating-point number between 0 and 1. "compare" returns both this and the same number multiplied by quantum.
I know nothing about AutoIt language.
The "convert" version is:
Code: Select all
convert image1 image2 -metric RMSE -format "%[distortion]" -compare info:
I know nothing about AutoIt language.
snibgo's IM pages: im.snibgo.com
Re: ImageMagickObject - compare - how to get pics difference
I'd like to see code in any language, cause workable example for me will be a proof of right usage of ImageMagicObject & it's correct reaction.