From: nicolas Date: Tue, 4 Sep 2012 16:32:34 +0000 (+0000) Subject: minor sigmoidal tweak X-Git-Tag: 7.0.1-0~5006 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd84bfe1cb9bd924f6736e08ca6ef90fa872bfc8;p=imagemagick minor sigmoidal tweak --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index ea7246713..927114fe7 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -3379,8 +3379,8 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, The limit of ScaledSig as a->0 is the identity, but a=0 gives a division by zero. This is fixed below by hardwiring the identity when a is small. This would appear to be safe because the series expansion of - the sigmoidal function around x=b is 1/2-a*(b-x)/4+... so that s(1)-s(0) - is about a/4. + the logistic sigmoidal function around x=b is 1/2-a*(b-x)/4+... so that + s(1)-s(0) is about a/4. (With tanh, it's a/2.) */ #define ScaledSig(a,b,x) ( \ (Sig((a),(b),(x))-Sig((a),(b),0.0)) / (Sig((a),(b),1.0)-Sig((a),(b),0.0)) ) @@ -3410,7 +3410,7 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); (void) ResetMagickMemory(sigmoidal_map,0,(MaxMap+1)*sizeof(*sigmoidal_map)); - if (contrast<4.0*MagickEpsilon) + if (contrast