i;
difference=0.0;
- for (i=0; i < 7; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
{
double
alpha,
i;
difference=0.0;
- for (i=0; i < 7; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
{
double
alpha,
return(MagickTrue);
}
-
-
static MagickBooleanType GetRootMeanSquaredDistortion(const Image *image,
const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
{
GetMagickPrecision(),pow(scale,powers[0])*
channel_moments[channel].ellipse_intensity,GetMagickPrecision(),
channel_moments[channel].ellipse_intensity);
- for (i=0; i < 8; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
n+=FormatLocaleFile(file," I%.20g: %.*g (%.*g)\n",i+1.0,
GetMagickPrecision(),channel_moments[channel].I[i]/pow(scale,powers[i]),
GetMagickPrecision(),channel_moments[channel].I[i]);
n;
n=FormatLocaleFile(file," %s:\n",name);
- for (i=0; i < 7; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
n+=FormatLocaleFile(file," PH%.20g: %.*g, %.*g\n",i+1.0,
GetMagickPrecision(),channel_phash[channel].srgb_hu_phash[i],
GetMagickPrecision(),channel_phash[channel].hclp_hu_phash[i]);
if (perceptual_hash == (ChannelPerceptualHash *) NULL)
return((ChannelPerceptualHash *) NULL);
for (channel=0; channel <= MaxPixelChannels; channel++)
- for (i=0; i < 7; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
perceptual_hash[channel].srgb_hu_phash[i]=
(-MagickLog10(moments[channel].I[i]));
moments=(ChannelMoments *) RelinquishMagickMemory(moments);
return((ChannelPerceptualHash *) NULL);
}
for (channel=0; channel <= MaxPixelChannels; channel++)
- for (i=0; i < 7; i++)
+ for (i=0; i < MaximumNumberOfImageMoments; i++)
perceptual_hash[channel].hclp_hu_phash[i]=
(-MagickLog10(moments[channel].I[i]));
moments=(ChannelMoments *) RelinquishMagickMemory(moments);
extern "C" {
#endif
+#define MaximumNumberOfImageMoments 8
+
typedef struct _ChannelStatistics
{
size_t
typedef struct _ChannelMoments
{
double
- I[32];
+ I[MaximumNumberOfImageMoments+1];
PointInfo
centroid,
typedef struct _ChannelPerceptualHash
{
double
- srgb_hu_phash[32],
- hclp_hu_phash[32];
+ srgb_hu_phash[MaximumNumberOfImageMoments+1],
+ hclp_hu_phash[MaximumNumberOfImageMoments+1];
} ChannelPerceptualHash;
typedef enum