Calculating a custom Levenshtein distance between two images

asked 2019-04-20 05:02:49 -0500

DarioP gravatar image

I have two images (grayscale, but doesn't really matter) with the same size and i would like to quantify their similarity.

For this I was thinking about something like a Levenshtein (or edit) distance between them built in the following way:

  1. Swap some pixels of image 2 to increase the similarity between the two images. The cost of this operation should be some physical distance (cartesian or manhattan) between the pixel being swapped.
  2. Alter the values of the pixels of image 2 in order to exactely match image 1. The cost of this operation should be the difference of the initial and final pixel values multiplied by some constant.

I am looking for some infrastructure to achieve this or something similar, thank you in advance for your advice.

edit retag flag offensive close merge delete