JImageHash icon indicating copy to clipboard operation
JImageHash copied to clipboard

Add rotational invariant hash

Open KilianB opened this issue 6 years ago • 3 comments

WIP.

Probably derived from https://www.idosi.org/mejsr/mejsr24(4)16/75.pdf

KilianB avatar Oct 28 '18 10:10 KilianB

Multiple version have been implemented and will be shipped with the next major version. The paper does not exactly outline how the hash is created and it's not fully compatible with what JImageHash is doing. Therefore an approach was adapted.

  1. Precomputation -> resize and extract Y luma component

  2. Ring parition. Rotate pixels around the center and fit it into a bucket rotationalhash

  3. Sorting the lum values of each bucket increasingly and compute a 1d dct transformation. Compute hash by comparing the values to the mean of each bucket. (Multiple bits per bucket)

3.1 (alternative) A gradient version also exists which simply compares the mean of each ring partition. With this approach we get a perfect 0 distance hash for %90 rotations but need to compute a lot of data. Slow and not worth the effort. Semantically this approach isn't clean either as an increase in ring partition index (the further out you go) means more actual pixels are represented in a single bit value.

KilianB avatar Nov 04 '18 12:11 KilianB

wip 49e0ed2158c0fdbe1715897d5dc8633eddb25d47 & b0e246e879d785017b519c1483818f08cfaa771e

KilianB avatar Nov 14 '18 02:11 KilianB

Partially resolved with #13 . Maybe look at different approaches in the future e.g. http://www.jaist.ac.jp/~kurkoski/papers/conf/Parrao-Hernandex-mwcas11.pdf

KilianB avatar Dec 01 '18 12:12 KilianB