aetilius / pHash

pHash - the open source perceptual hash library
https://www.phash.org
GNU General Public License v3.0
565 stars 81 forks source link

Radial hash ignores gamma parameter? #22

Open ChernyshevDS opened 4 years ago

ChernyshevDS commented 4 years ago

Looking at ph_image_digest function, I've discovered the following line:

(graysc / graysc.max()).pow(gamma);

It seems for me, that this line doesn't do anything, because graysc.max() returns scalar value, and operator/(const T value) returns new image instance. pow method is called on that instance, but it doesn't make any difference, because the result is not assigned anywhere. Am I missing something there?

eklinger commented 4 years ago

You're right - that looks like a bug

On Thu, Aug 13, 2020 at 6:34 AM ChernyshevDS notifications@github.com wrote:

Looking at ph_image_digest function, I've discovered the following line:

(graysc / graysc.max()).pow(gamma);

It seems for me, that this line doesn't do anything, because graysc.max() returns scalar value, and operator/(const T value) returns new image instance. pow method is called on that instance, but it doesn't make any difference, because the result is not assigned anywhere. Am I missing something there?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aetilius/pHash/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFXPDOXTS7CQROVR6P7IILSAPTWVANCNFSM4P6NRJAA .