MagickCore
7.0.10
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/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/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"
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 | |
static size_t | GetImageChannels (const Image *image) |
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) |
Referenced by MagickLog10().
#define SimilarityImageTag "Similarity/Image" |
Referenced by GetNormalizedCrossCorrelationDistortion(), and SimilarityImage().
#define SimilarityImageTag "Similarity/Image" |
#define SSIMBlocksize 8 |
#define SSIMK1 0.01 |
Referenced by GetStructuralSimilarityDistortion().
#define SSIMK2 0.03 |
Referenced by GetStructuralSimilarityDistortion().
#define SSIML 1.0 |
Referenced by GetStructuralSimilarityDistortion().
#define SSIMRadius 5.0 |
Referenced by GetStructuralSimilarityDistortion().
#define SSIMSigma 1.5 |
Referenced by GetStructuralSimilarityDistortion().
MagickExport Image* CompareImages | ( | Image * | image, |
const Image * | reconstruct_image, | ||
const MetricType | metric, | ||
double * | distortion, | ||
ExceptionInfo * | exception | ||
) |
References AcquireAuthenticCacheView(), AcquireVirtualCacheView(), AllCompliance, AlphaPixelChannel, CloneImage(), _Image::columns, _Image::compose, CompositeImage(), _Image::debug, DestroyCacheView(), DestroyImage(), DirectClass, ExtentImage(), _Image::filename, GetCacheViewVirtualPixels(), GetFuzzyColorDistance(), GetImageArtifact(), GetImageDistortion(), GetMagickModule, GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), _RectangleInfo::height, LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickMax, MagickMin, MagickTrue, OpaqueAlphaChannel, QuantumRange, QuantumScale, QueryColorCompliance(), QueueCacheViewAuthenticPixels(), ReadPixelMask, _Image::rows, SetGeometry(), SetImageAlphaChannel(), SetImageMask(), SetImageStorageClass(), SetPixelViaPixelInfo(), _Image::signature, SyncCacheViewAuthenticPixels(), TraceEvent, UndefinedPixelTrait, UpdatePixelTrait, and _RectangleInfo::width.
|
static |
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetFuzzyColorDistance(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, MagickFalse, MagickMax, MagickMin, MagickTrue, MaxPixelChannels, QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
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 |
MagickExport MagickBooleanType GetImageDistortion | ( | Image * | image, |
const Image * | reconstruct_image, | ||
const MetricType | metric, | ||
double * | distortion, | ||
ExceptionInfo * | exception | ||
) |
References AbsoluteErrorMetric, AcquireQuantumMemory(), CompositePixelChannel, _Image::debug, _Image::filename, FormatImageProperty(), FuzzErrorMetric, GetAbsoluteDistortion(), GetFuzzDistortion(), GetMagickModule, GetMagickPrecision(), GetMeanAbsoluteDistortion(), GetMeanErrorPerPixel(), GetMeanSquaredDistortion(), GetNormalizedCrossCorrelationDistortion(), GetPeakAbsoluteDistortion(), GetPeakSignalToNoiseRatio(), GetPerceptualHashDistortion(), GetRootMeanSquaredDistortion(), GetStructuralDisimilarityDistortion(), GetStructuralSimilarityDistortion(), 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 | ||
) |
References AbsoluteErrorMetric, AcquireQuantumMemory(), _Image::debug, _Image::filename, FuzzErrorMetric, GetAbsoluteDistortion(), GetFuzzDistortion(), GetMagickModule, GetMeanAbsoluteDistortion(), GetMeanErrorPerPixel(), GetMeanSquaredDistortion(), GetNormalizedCrossCorrelationDistortion(), GetPeakAbsoluteDistortion(), GetPeakSignalToNoiseRatio(), GetRootMeanSquaredDistortion(), GetStructuralDisimilarityDistortion(), GetStructuralSimilarityDistortion(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, MaxPixelChannels, MeanAbsoluteErrorMetric, MeanErrorPerPixelErrorMetric, MeanSquaredErrorMetric, NormalizedCrossCorrelationErrorMetric, PeakAbsoluteErrorMetric, PeakSignalToNoiseRatioErrorMetric, PerceptualHashErrorMetric, RelinquishMagickMemory(), ResourceLimitFatalError, RootMeanSquaredErrorMetric, _Image::signature, StructuralDissimilarityErrorMetric, StructuralSimilarityErrorMetric, ThrowFatalException, and TraceEvent.
|
static |
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 |
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, QuantumRange, QuantumScale, _Image::rows, UndefinedPixelTrait, and UpdatePixelTrait.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
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 |
References AcquireVirtualCacheView(), AlphaPixelChannel, _Image::columns, CompositePixelChannel, DestroyCacheView(), GetCacheViewVirtualPixels(), GetImageChannels(), GetImageStatistics(), GetPixelAlpha(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelReadMask(), magick_restrict, 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 |
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 |
References GetMeanSquaredDistortion(), INFINITY, MagickEpsilon, MagickLog10(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
|
static |
References GetMeanSquaredDistortion(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
References CropImage(), DestroyImage(), GetImageDistortion(), MagickFalse, SetGeometry(), _RectangleInfo::x, and _RectangleInfo::y.
Referenced by SimilarityImage().
|
static |
References GetStructuralSimilarityDistortion(), and MaxPixelChannels.
Referenced by GetImageDistortion(), and GetImageDistortions().
|
static |
References AcquireKernelInfo(), AcquireVirtualCacheView(), _Image::columns, CompositePixelChannel, DestroyCacheView(), DestroyKernelInfo(), _Image::filename, FormatLocaleString(), GetCacheViewVirtualPixels(), GetImageArtifact(), GetImageChannels(), GetPixelChannel(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), _KernelInfo::height, magick_restrict, MagickFalse, MagickMax, MagickPathExtent, MagickTrue, MaxPixelChannels, 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 | ||
) |
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 |
References Log10Epsilon.
Referenced by GetPeakSignalToNoiseRatio().
MagickExport MagickBooleanType SetImageColorMetric | ( | Image * | image, |
const Image * | reconstruct_image, | ||
ExceptionInfo * | exception | ||
) |
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 | ||
) |
References AcquireAuthenticCacheView(), ClampToQuantum(), CloneImage(), _Image::columns, DeactivateAlphaChannel, _Image::debug, DestroyCacheView(), DestroyImage(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetSimilarityMetric(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickMaximumValue, MagickMin, MagickTrue, NormalizedCrossCorrelationErrorMetric, PerceptualHashErrorMetric, _Image::progress_monitor, QuantumRange, _Image::rows, SetGeometry(), SetImageAlphaChannel(), SetImageProgress(), SetImageStorageClass(), SetPixelChannel(), _ExceptionInfo::signature, _Image::signature, SimilarityImageTag, SyncCacheViewAuthenticPixels(), TraceEvent, UndefinedErrorMetric, UndefinedPixelTrait, UpdatePixelTrait, _RectangleInfo::x, and _RectangleInfo::y.