thorn-oss / perception

Perceptual hashing tools for detecting child sexual abuse material
https://perception.thorn.engineering/
Apache License 2.0
173 stars 16 forks source link

Issue with pHash implementation #12

Open shubhamjain0594 opened 3 years ago

shubhamjain0594 commented 3 years ago

https://github.com/thorn-oss/perception/blob/f02ff3513b8e4f029a93553419ad1ae26034e448/perception/hashers/image/phash.py#L45

According to thesis by Zauner (2010) there has to be 7x7 mean filter before resizing. And I think it is not being done in the current implementation.

faustomorales commented 3 years ago

Thank you so much for raising this! Will try to get this corrected this soon but, of course, would gladly accept a pull request to add a call to cv2.boxFilter before the resize step. Here are some implementation questions that came to mind when thinking about it and my suggested answers.

Let me know any additional feedback / questions you have, of course. Again, thanks for opening this issue!