Skip to content

Commit

Permalink
negate correlation image for NCC metric
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Feb 15, 2025
1 parent c6272cc commit 61c6651
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion magick/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,11 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference,
}
if (metric == PerceptualHashErrorMetric)
similarity=MagickMin(0.01*similarity,1.0);
SetPixelRed(q,(double) QuantumRange*similarity);
if (metric == NormalizedCrossCorrelationErrorMetric)
SetPixelRed(q,ClampToQuantum((double) QuantumRange-QuantumRange*
similarity));
else
SetPixelRed(q,ClampToQuantum((double) QuantumRange*similarity));
SetPixelGreen(q,GetPixelRed(q));
SetPixelBlue(q,GetPixelRed(q));
q++;
Expand Down

0 comments on commit 61c6651

Please sign in to comment.