"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;
Showing posts with label imagesimilarity. Show all posts
Showing posts with label imagesimilarity. Show all posts

August 07, 2022

ImageHash package - simplify hash

Python library to hash by different methods. Useful to build indexes / similarity search.

The different hashing techniques are

  • Average hashing  - crushes the image into a grayscale 8x8 image and sets the 64 bits in the hash based on whether the pixel's value is greater than the average color for the image.
  • Perceptual hashing - use a discrete cosine transform (DCT) and compares based on frequencies rather than color values
  • Difference hashing - gradient hash, calculate the difference for each of the pixel and compares the difference with the average differences.
  • Wavelet hashing - works in the frequency domain as pHash but it uses DWT instead of DCT.
  • HSV color hashing (colorhash)
  • Crop-resistant hashing

Ref - Link1, Link2


Ref - Link

Package Installation




File Upload



Create Hash Methods



Depending on usecases need to evaluate which suits the need or a combination of techniques.

Keep Exploring!!!






January 14, 2020

Day #318 - Image Comparison Techniques

Image is a set of points (vectors). We could use different techniques for image similarity comparison. Listed below some of out of box techniques. Dlib based comparison was earlier discussed.
  • Haar, Extract Region
Comparison Techniques
  • Euclidean distance
  • Cosine distance
  • Hamming distance
  • Jaccard-Needham dissimilarity


Ref - Link

SSIM Approach Technique of structural similarity
Happy Learning!!!