Image comparison in C++
Posted: 2007-08-22T17:43:42-07:00
Hi,
I am using the ImageMagick C++ API.
I try to differentiate the Color/Black & White image as the description in this link:
http://www.imagemagick.org/Usage/compare/#type_general
So, in Code:
Magick::Image source( "color.jpg" );
Magick::Image image = source;
image.type( GrayscaleType );
source.compare( image );
source.meanErrorPerPixel();
source.normalizedMaxError();
source.normalizedMeanError();
However, all meanErrorPerPixel, normalizedMaxError, and normalizedMeanError return zero.
The comparison seems working if replacing the line "image.type( GrayscaleType );" with "image.solarize();"
So, what happened? and how to make it work?
Thanks!
I am using the ImageMagick C++ API.
I try to differentiate the Color/Black & White image as the description in this link:
http://www.imagemagick.org/Usage/compare/#type_general
So, in Code:
Magick::Image source( "color.jpg" );
Magick::Image image = source;
image.type( GrayscaleType );
source.compare( image );
source.meanErrorPerPixel();
source.normalizedMaxError();
source.normalizedMeanError();
However, all meanErrorPerPixel, normalizedMaxError, and normalizedMeanError return zero.
The comparison seems working if replacing the line "image.type( GrayscaleType );" with "image.solarize();"
So, what happened? and how to make it work?
Thanks!