Reverse image searching engine based on Perpetual image hashing technique.
Image hashing algorithms are based on Kind of like that and Looks Like It by Dr. Neal Krawetzy.
Image hashing is the process of using a hashing algorithm to assign a unique hash value to an image.
- Simplest of all image hashing algorithms
- More false positives compared to phash and ahash
Working
- Convert image to grayscale and resize to 8x8 pixels.
- Compute the mean of the image array.
- If P[x] > mean : P[x] = 1 else P[x] = 0
- Compute hash
- Very few false positives
- High computational time
- Few false positives, more than phash
- Less computational time
- The Hash value of input images is calculated using (Phash, Dhash, Ahash) algorithm.
- This hash value and its corresponding image are stored in a database.
- VPTree or KD-Tree can be used to store hash values of images on the based hamming distance between them.
- On searching a particular image its hash value is calculated which is then passed to KD-Tree/VP-Tree, it finds related images based on the hamming distance between calculated hash and stored hash values.
- OpenCV
- Python 3
- Clone this repository
git clone https://github.com/Anant-mishra1729/Hash-hunt.git
- For indexing images execute
python index_images.py
--images or -i: Path to the source directory of images to index
--dataset or -d: Path to generated index file
--algo or -a: Algorithm to use phash, dhash or ahash
- For searching an image execute
python search.py
--image or -i: Image to search
--dataset or -d: Path to generated index file
Images are taken from dataset
This project is licensed under the MIT License - see the LICENSE.md file for details
Kind of like that and Looks Like It by Dr. Neal Krawetzy.