MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
|
#include "MagickCore/studio.h"
#include "MagickCore/artifact.h"
#include "MagickCore/attribute.h"
#include "MagickCore/cache-view.h"
#include "MagickCore/channel.h"
#include "MagickCore/client.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colorspace.h"
#include "MagickCore/colorspace-private.h"
#include "MagickCore/compare.h"
#include "MagickCore/composite-private.h"
#include "MagickCore/constitute.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/enhance.h"
#include "MagickCore/fourier.h"
#include "MagickCore/geometry.h"
#include "MagickCore/image-private.h"
#include "MagickCore/list.h"
#include "MagickCore/log.h"
#include "MagickCore/memory_.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/property.h"
#include "MagickCore/registry.h"
#include "MagickCore/resource_.h"
#include "MagickCore/string_.h"
#include "MagickCore/statistic.h"
#include "MagickCore/string-private.h"
#include "MagickCore/thread-private.h"
#include "MagickCore/transform.h"
#include "MagickCore/utility.h"
#include "MagickCore/version.h"
Go to the source code of this file.
Macros | |
#define | SimilarityImageTag "Similarity/Image" |
#define | Log10Epsilon (1.0e-11) |
#define | SSIMRadius 5.0 |
#define | SSIMSigma 1.5 |
#define | SSIMBlocksize 8 |
#define | SSIMK1 0.01 |
#define | SSIMK2 0.03 |
#define | SSIML 1.0 |
#define | SimilarityImageTag "Similarity/Image" |
Functions | |
MagickExport Image * | CompareImages (Image *image, const Image *reconstruct_image, const MetricType metric, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetAbsoluteDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetFuzzDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetMeanAbsoluteDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetMeanErrorPerPixel (Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetMeanSquaredDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetNormalizedCrossCorrelationDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetPeakAbsoluteDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static double | MagickLog10 (const double x) |
static MagickBooleanType | GetPeakSignalToNoiseRatio (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetPerceptualHashDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetRootMeanSquaredDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetStructuralSimilarityDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
static MagickBooleanType | GetStructuralDisimilarityDistortion (const Image *image, const Image *reconstruct_image, double *distortion, ExceptionInfo *exception) |
MagickExport MagickBooleanType | GetImageDistortion (Image *image, const Image *reconstruct_image, const MetricType metric, double *distortion, ExceptionInfo *exception) |
MagickExport double * | GetImageDistortions (Image *image, const Image *reconstruct_image, const MetricType metric, ExceptionInfo *exception) |
MagickExport MagickBooleanType | IsImagesEqual (const Image *image, const Image *reconstruct_image, ExceptionInfo *exception) |
MagickExport MagickBooleanType | SetImageColorMetric (Image *image, const Image *reconstruct_image, ExceptionInfo *exception) |
static double | GetSimilarityMetric (const Image *image, const Image *reference, const MetricType metric, const ssize_t x_offset, const ssize_t y_offset, ExceptionInfo *exception) |
MagickExport Image * | SimilarityImage (const Image *image, const Image *reference, const MetricType metric, const double similarity_threshold, RectangleInfo *offset, double *similarity_metric, ExceptionInfo *exception) |
#define Log10Epsilon (1.0e-11) |
#define SimilarityImageTag "Similarity/Image" |
#define SimilarityImageTag "Similarity/Image" |
#define SSIMBlocksize 8 |
#define SSIMK1 0.01 |
#define SSIMK2 0.03 |
#define SSIML 1.0 |
#define SSIMRadius 5.0 |
#define SSIMSigma 1.5 |
MagickExport Image * CompareImages | ( | Image * | image, |
const Image * | reconstruct_image, | ||
const MetricType | metric, | ||
double * | distortion, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 112 of file compare.c.
References AcquireAuthenticCacheView(), AcquireVirtualCacheView(), AllCompliance, AlphaPixelChannel, CloneImage(), _Image::columns, _Image::compose, CompositeImage(), DestroyCacheView(), DestroyImage(), DirectClass, ExtentImage(), _Image::filename, GetCacheViewVirtualPixels(), GetFuzzyColorDistance(), GetImageArtifact(), GetImageDistortion(), GetMagickModule, GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), _RectangleInfo::height, IsEventLogging(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickMax, MagickTrue, OpaqueAlphaChannel, QuantumRange, QuantumScale, QueryColorCompliance(), QueueCacheViewAuthenticPixels(), ReadPixelMask, _Image::rows, SetGeometry(), SetImageAlphaChannel(), SetImageMask(), SetImageStorageClass(), SetPixelViaPixelInfo(), _Image::signature, SyncCacheViewAuthenticPixels(), TraceEvent, UndefinedPixelTrait, UpdatePixelTrait, and _RectangleInfo::width.
|
static |
Definition at line 346 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetFuzzyColorDistance(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 465 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetImageChannels(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, PerceptibleReciprocal(), QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
MagickExport MagickBooleanType GetImageDistortion | ( | Image * | image, |
const Image * | reconstruct_image, | ||
const MetricType | metric, | ||
double * | distortion, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1609 of file compare.c.
References AbsoluteErrorMetric, AcquireQuantumMemory(), CompositePixelChannel, _Image::filename, FormatImageProperty(), FuzzErrorMetric, GetAbsoluteDistortion(), GetFuzzDistortion(), GetMagickModule, GetMagickPrecision(), GetMeanAbsoluteDistortion(), GetMeanErrorPerPixel(), GetMeanSquaredDistortion(), GetNormalizedCrossCorrelationDistortion(), GetPeakAbsoluteDistortion(), GetPeakSignalToNoiseRatio(), GetPerceptualHashDistortion(), GetRootMeanSquaredDistortion(), GetStructuralDisimilarityDistortion(), GetStructuralSimilarityDistortion(), IsEventLogging(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MaxPixelChannels, MeanAbsoluteErrorMetric, MeanErrorPerPixelErrorMetric, MeanSquaredErrorMetric, NormalizedCrossCorrelationErrorMetric, PeakAbsoluteErrorMetric, PeakSignalToNoiseRatioErrorMetric, PerceptualHashErrorMetric, RelinquishMagickMemory(), ResourceLimitFatalError, RootMeanSquaredErrorMetric, _Image::signature, StructuralDissimilarityErrorMetric, StructuralSimilarityErrorMetric, ThrowFatalException, and TraceEvent.
Referenced by CompareImages(), and GetSimilarityMetric().
MagickExport double * GetImageDistortions | ( | Image * | image, |
const Image * | reconstruct_image, | ||
const MetricType | metric, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1755 of file compare.c.
References AbsoluteErrorMetric, AcquireQuantumMemory(), _Image::filename, FuzzErrorMetric, GetAbsoluteDistortion(), GetFuzzDistortion(), GetMagickModule, GetMeanAbsoluteDistortion(), GetMeanErrorPerPixel(), GetMeanSquaredDistortion(), GetNormalizedCrossCorrelationDistortion(), GetPeakAbsoluteDistortion(), GetPeakSignalToNoiseRatio(), GetRootMeanSquaredDistortion(), GetStructuralDisimilarityDistortion(), GetStructuralSimilarityDistortion(), IsEventLogging(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, MaxPixelChannels, MeanAbsoluteErrorMetric, MeanErrorPerPixelErrorMetric, MeanSquaredErrorMetric, NormalizedCrossCorrelationErrorMetric, PeakAbsoluteErrorMetric, PeakSignalToNoiseRatioErrorMetric, PerceptualHashErrorMetric, RelinquishMagickMemory(), ResourceLimitFatalError, RootMeanSquaredErrorMetric, _Image::signature, StructuralDissimilarityErrorMetric, StructuralSimilarityErrorMetric, ThrowFatalException, and TraceEvent.
|
static |
Definition at line 586 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetImageChannels(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, PerceptibleReciprocal(), QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 706 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), _Image::error, GetCacheViewVirtualPixels(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, _ErrorInfo::mean_error_per_pixel, _ErrorInfo::normalized_maximum_error, _ErrorInfo::normalized_mean_error, PerceptibleReciprocal(), QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 809 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetImageChannels(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, PerceptibleReciprocal(), QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), GetImageDistortions(), GetPeakSignalToNoiseRatio(), and GetRootMeanSquaredDistortion().
|
static |
Definition at line 929 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetImageStatistics(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickEpsilon, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, _ChannelStatistics::mean, PerceptibleReciprocal(), _Image::progress_monitor, QuantumRange, QuantumScale, RelinquishMagickMemory(), _Image::rows, SetImageProgress(), SimilarityImageTag, _ChannelStatistics::standard_deviation, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 1125 of file compare.c.
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickTrue, MaxPixelChannels, QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 1240 of file compare.c.
References GetMeanSquaredDistortion(), INFINITY, MagickEpsilon, MagickLog10(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 1258 of file compare.c.
References CompositePixelChannel, GetImageArtifact(), GetImagePerceptualHash(), IsStringTrue(), MagickFalse, MagickTrue, MaximumNumberOfImageMoments, MaxPixelChannels, _ChannelPerceptualHash::phash, and RelinquishMagickMemory().
Referenced by GetImageDistortion().
|
static |
Definition at line 1337 of file compare.c.
References GetMeanSquaredDistortion(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 2869 of file compare.c.
References CropImage(), DestroyImage(), GetImageDistortion(), MagickFalse, SetGeometry(), _RectangleInfo::x, and _RectangleInfo::y.
Referenced by SimilarityImage().
|
static |
Definition at line 1593 of file compare.c.
References GetStructuralSimilarityDistortion(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
Definition at line 1352 of file compare.c.
References AcquireKernelInfo(), AcquireVirtualCacheView(), _Image::columns, CompositePixelChannel, DestroyCacheView(), DestroyKernelInfo(), _Image::filename, FormatLocaleString(), GetCacheViewVirtualPixels(), GetImageArtifact(), GetImageChannels(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), _KernelInfo::height, magick_restrict, MagickFalse, MagickMax, MagickPathExtent, MagickTrue, MaxPixelChannels, QuantumRange, QuantumScale, ResourceLimitError, _Image::rows, SSIMK1, SSIMK2, SSIML, SSIMRadius, SSIMSigma, StringToDouble(), ThrowBinaryException, UndefinedPixelTrait, UpdatePixelTrait, _KernelInfo::values, and _KernelInfo::width.
Referenced by GetImageDistortion(), GetImageDistortions(), and GetStructuralDisimilarityDistortion().
MagickExport MagickBooleanType IsImagesEqual | ( | const Image * | image, |
const Image * | reconstruct_image, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1897 of file compare.c.
References AcquireVirtualCacheView(), _Image::columns, DestroyCacheView(), GetCacheViewVirtualPixels(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), magick_restrict, MagickCoreSignature, MagickEpsilon, MagickFalse, MagickMax, MagickTrue, _Image::rows, _Image::signature, UndefinedPixelTrait, and UpdatePixelTrait.
|
inlinestatic |
Definition at line 1231 of file compare.c.
References Log10Epsilon.
Referenced by GetPeakSignalToNoiseRatio().
MagickExport MagickBooleanType SetImageColorMetric | ( | Image * | image, |
const Image * | reconstruct_image, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2017 of file compare.c.
References AcquireVirtualCacheView(), _Image::columns, DestroyCacheView(), _Image::error, GetCacheViewVirtualPixels(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), magick_restrict, MagickCoreSignature, MagickEpsilon, MagickFalse, MagickMax, MagickTrue, _ErrorInfo::mean_error_per_pixel, _ErrorInfo::normalized_maximum_error, _ErrorInfo::normalized_mean_error, QuantumScale, _Image::rows, _Image::signature, UndefinedPixelTrait, and UpdatePixelTrait.
MagickExport Image * SimilarityImage | ( | const Image * | image, |
const Image * | reference, | ||
const MetricType | metric, | ||
const double | similarity_threshold, | ||
RectangleInfo * | offset, | ||
double * | similarity_metric, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2900 of file compare.c.
References AcquireAuthenticCacheView(), _Image::channels, ClampToQuantum(), CloneImage(), _Image::columns, DeactivateAlphaChannel, DestroyCacheView(), DestroyImage(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetImageArtifact(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetSimilarityMetric(), IsEventLogging(), IsStringTrue(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickMaximumValue, MagickMin, MagickTrue, NormalizedCrossCorrelationErrorMetric, PerceptualHashErrorMetric, _Image::progress_monitor, QuantumRange, ReadMaskChannel, _Image::rows, SetGeometry(), SetImageAlphaChannel(), SetImageProgress(), SetImageStorageClass(), SetPixelChannel(), _ExceptionInfo::signature, _Image::signature, SimilarityImageTag, SyncCacheViewAuthenticPixels(), TraceEvent, UndefinedErrorMetric, UndefinedPixelTrait, UpdatePixelTrait, _RectangleInfo::x, and _RectangleInfo::y.