# best similarity measure for images with different angles

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)
print(out_rmse)
print(out_fsim)


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?

• 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. – Jayaram Iyer Apr 10 at 16:03
• Could you help in terms of code? @JayaramIyer – x89 Apr 10 at 16:23

## 1 Answer

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.

References: