Distance between matrix taking into account element position.

28 Views Asked by At

I am using machine learning to reconstruct images.

I have Image A and want to reconstruct it.

During the training process the model uses a loss function to determine how different the original and reconstructed images are.

When using the euclidean distance between the images, taking the values of their pixels into account, the model reconstructs Image A as this Image B.

The problem is that when comparing the reconstructed image to the original one, the distance between those two will be small because the euclidean distance doesn't take into account the position of each element.

I need a distance function that take the position of each element into account.

Do you guys have any sugestions?

Thanks a lot!

1

There are 1 best solutions below

0
On

Use traditional sum-squared error: the sum over each pixel of the squared difference of their intensities (or gray levels).