How to calculate PSNR correctly?

I am having trouble computing PSNR on entire dataset. My results are not matching. What is the correct way to compute PSNR?

  1. PSNR = 20 * log10(255.0 / Average_RMSE)
  2. PSNR = MEAN( PSNR_OF_EACH_IMAGE )
  3. Compute total Suqare Error of dataset and then average it by dividing total pixels in dataset. Then compute PSNR = 20 * log10( 255.0 / RMSE)

I tried all three methods but I get slightly more PSNR. For third method, I compared bilinear PSNR of Set14 and got 27.6 while its mentioned as 26.55 in different papers.

1 Like

I have same question among this and here is my analysis about 1 and 2, 3 should be same as 1.