Magick++ adding IsImageSimilar to functionality

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Explosion_Of_Colour

Magick++ adding IsImageSimilar to functionality

Post by Explosion_Of_Colour »

Afternoon folks,

I'm just trying to work out how I can wrap the IsImageSimilar method from the MagickCore for use in Magick++ - my C++ and C skills are limited but I'm learning as I go! Is it possible to wrap this method or is there limitations to what can be used from the C++ side?

Thanks very much,
Becky
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Magick++ adding IsImageSimilar to functionality

Post by magick »

You should be able to access any MagickCore method with the Magick++ MagickCore namespace. Use MagickCore::IsImageSimilar(). However, have you tried the Magick++ method compare():
  • // Compare current image with another image
    // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError
    // in the current image. False is returned if the images are identical.
    bool Magick::Image::compare ( const Image &reference_ )
Explosion_Of_Colour

Re: Magick++ adding IsImageSimilar to functionality

Post by Explosion_Of_Colour »

Ah I hadn't thought of trying that one - is there a difference in functionality or is it simply are the images identical? true/false?
Explosion_Of_Colour

Re: Magick++ adding IsImageSimilar to functionality

Post by Explosion_Of_Colour »

Hmmm, on second thoughts I'm not sure the Compare method will do what I want, as I can't pass x and y values as offsets; which is assume in IsImageSimilar are updated with the values of the similar position. Is Magick++ Visual C++ compatible or will I need to use gcc?

Thanks,
Becky
Post Reply