I want to compare different images (where the images are of the same setup but the angles with which the images are taken are different). I want to obtain some sort of similarity score. I tried using some libraries like

from image_similarity_measures.quality_metrics import rmse, psnr, fsim
in_img1 = cv2.imread("./IMG_4835.jpg")
in_img2= cv2.imread("./IMG_4836.jpg")
out_rmse = rmse(in_img1, in_img2)
out_fsim = fsim(in_img1, in_img2)

but none of the metrics seem to provide good results in my case. According to the description of different metrics given here, most of them check for contract/signal to error reconstruction ratio etc etc. https://up42.com/blog/tech/image-similarity-measures

What similarity metric or image comparison method in general would suit well in my case?

  • $\begingroup$ Is this is a 2D image - Try finding the mean horizontally (or vertically) - i.e. you end up with a 1D vector - and then try cosine similarity with images taken from other angles. $\endgroup$ – Jayaram Iyer Apr 10 at 16:03
  • $\begingroup$ Could you help in terms of code? @JayaramIyer $\endgroup$ – x89 Apr 10 at 16:23

A brute-force method is simply to try all rotation angles and decide if 2 images are a rotation of one another.

However, there are features (eg fourier coefficients) which are rotation-invariant. So comparing these rotation-invariant features is a similarity metric for determining if 2 images are a rotation of one another.


  1. Rotation Invariance in Images
  2. Rotation invariant indexing of shapes and line drawings
  3. Which Transformation, Or Similarity Metric, Is Rotation, Shift and Scale Invariant?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.