I'm trying to implement a loss function for my neuronal network and I don't know if it is a distance already implemented.
I want to compare two black and white images to know how different the two images are:
- One image will be the original image, the one I want to get from the neuronal network.
- The other image will be the predicted image from the neuronal network.
To do it, I have considered that two images are the same if both images has the same white pixel at the same location (x,y).
Both images will have black pixels, with value 0.0, and white pixels, with value 1.0.
So, using this information, I think if I sum both images (computationally, images are matrices) and count how many 2.0 values are in this sum, and compare it with the number of pixels with value 1.0 in the original image, I will know if both images are the same or not.
Is this a known distance?
I used Euclidean distance, but I'm not sure if I can use it know if both images are the same.
Simply count the pixels that differ. This is called the Hamming distance.