Question about image comparison using Magick++
Posted: 2013-03-07T12:07:18-07:00
Hello,
I'm doing the comparison between two images. First I tested the result using command line, which worked well.
convert $image1 -crop $area - | compare -dissimilarity-threshold 1 -fuzz 25% -metric AE $image2 -null: 2>result.txt
Then I need to do the same thing using Magick++. Here is what I have done.
1) Read the first image into the image class.
Image1.read("image1name.jpg")
2) Did crop on the first image.
image1.crop( Geometry(width, height, xOffset, yOffset) )
3) Set fuzz as 25%
image1.colorFuzz(25*QuantumRange/100)
4) Did comparison
image1.compare("image2name.jpg")
So my questions are:
1) How to set the "-dissimilarity-threshold" and "-metric" as the command line did?
2) How to output the comparison value to a *.txt file as the command line did?
I didn't find the related information in the tutorail or the forum.
I appreciate any related information.
I'm doing the comparison between two images. First I tested the result using command line, which worked well.
convert $image1 -crop $area - | compare -dissimilarity-threshold 1 -fuzz 25% -metric AE $image2 -null: 2>result.txt
Then I need to do the same thing using Magick++. Here is what I have done.
1) Read the first image into the image class.
Image1.read("image1name.jpg")
2) Did crop on the first image.
image1.crop( Geometry(width, height, xOffset, yOffset) )
3) Set fuzz as 25%
image1.colorFuzz(25*QuantumRange/100)
4) Did comparison
image1.compare("image2name.jpg")
So my questions are:
1) How to set the "-dissimilarity-threshold" and "-metric" as the command line did?
2) How to output the comparison value to a *.txt file as the command line did?
I didn't find the related information in the tutorail or the forum.
I appreciate any related information.