CompareImagesGetImageDistortionGetImageDistortionsIsImagesEqualSimilarityImage

CompareImages

CompareImages() compares one or more pixel channels of an image to a reconstructed image and returns the difference image.

The format of the CompareImages method is:

Image *CompareImages(const Image *image,const Image *reconstruct_image,
  const MetricType metric,double *distortion,ExceptionInfo *exception)

A description of each parameter follows:

image
the image.
reconstruct_image
the reconstruct image.
metric
the metric.
distortion
the computed distortion between the images.
exception
return any errors or warnings in this structure.

GetImageDistortion

GetImageDistortion() compares one or more pixel channels of an image to a reconstructed image and returns the specified distortion metric.

The format of the GetImageDistortion method is:

MagickBooleanType GetImageDistortion(const Image *image,
  const Image *reconstruct_image,const MetricType metric,
  double *distortion,ExceptionInfo *exception)

A description of each parameter follows:

image
the image.
reconstruct_image
the reconstruct image.
metric
the metric.
distortion
the computed distortion between the images.
exception
return any errors or warnings in this structure.

GetImageDistortions

GetImageDistortions() compares the pixel channels of an image to a reconstructed image and returns the specified distortion metric for each channel.

The format of the GetImageDistortions method is:

double *GetImageDistortions(const Image *image,
  const Image *reconstruct_image,const MetricType metric,
  ExceptionInfo *exception)

A description of each parameter follows:

image
the image.
reconstruct_image
the reconstruct image.
metric
the metric.
exception
return any errors or warnings in this structure.

IsImagesEqual

IsImagesEqual() measures the difference between colors at each pixel location of two images. A value other than 0 means the colors match exactly. Otherwise an error measure is computed by summing over all pixels in an image the distance squared in RGB space between each image pixel and its corresponding pixel in the reconstruct image. The error measure is assigned to these image members:

    o mean_error_per_pixel:  The mean error for any single pixel in
the image.
normalized_mean_error

The normalized mean quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in the image.

normalized_maximum_error

The normalized maximum quantization error for any single pixel in the image. This distance measure is normalized to a range between 0 and 1. It is independent of the range of red, green, and blue values in your image.

A small normalized mean square error, accessed as image->normalized_mean_error, suggests the images are very similar in spatial layout and color.

The format of the IsImagesEqual method is:

MagickBooleanType IsImagesEqual(Image *image,
  const Image *reconstruct_image,ExceptionInfo *exception)

A description of each parameter follows.

image

the image.

reconstruct_image

the reconstruct image.

exception

return any errors or warnings in this structure.

SimilarityImage

SimilarityImage() compares the reference image of the image and returns the best match offset. In addition, it returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between.

The format of the SimilarityImageImage method is:

Image *SimilarityImage(const Image *image,const Image *reference,
  const MetricType metric,const double similarity_threshold,
  RectangleInfo *offset,double *similarity,ExceptionInfo *exception)

A description of each parameter follows:

image
the image.
reference
find an area of the image that closely resembles this image.
metric
the metric.
similarity_threshold
minimum distortion for (sub)image match.
offset
the best match offset of the reference image within the image.
similarity
the computed similarity between the images.
exception
return any errors or warnings in this structure.