This is what I am trying to do:
Download MNIST images:
resource = ResourceObject["MNIST"];
trainingData = ResourceData[resource, "TrainingData"];
testData = ResourceData[resource, "TestData"];
SeedRandom[42];
rctraindata = RandomChoice[trainingData, 1000];
rctraindatat = 1. - Map[Flatten, Map[ImageData, rctraindata[[All, 1]]]];
Add Guassian noise:
nrctraindatat = Table[rctraindatat[[i]] + RandomVariate[NormalDistribution[0, 0.2], 784], {i, Length[rctraindatat]}];
Calculate the distance between clean and noisy image:
EuclideanDistance[rctraindatat[[1]], nrctraindatat[[1]]] (*5.82*)
Scale the noisy image as follows:
scaled = (nrctraindatat[[1]]-Min[Flatten[nrctraindatat]])/(Max[Flatten[nrctraindatat]] -
Min[Flatten[nrctraindatat]]);
The idea behind scaling is that the clean images are within (0,1) and I wanted the noisy image to be in the same range to calculate the distance between them. Calculate the distance again:
EuclideanDistance[rctraindatat[[1]], scaled] (*8.78*)
Which is the correct way to calculate the distance between a corrupted and a clean image and why? PSNR and SSIM are usually used as metrics. Do I need to rescale the noisy image before calculating PSNR or SSIM?
I also posted here