PSNR for intra-predicted frame and encoded frame

I need to perform predicted Intra encoding on a video frame and calculate its PSNR. Now I am asked to take the same original frame and encode it, which consists of doing DCT, quantizing, dequantizing, and inverse DCT. I have to calculate the PSNR of the encoded frame and compare it to the internally predicted frame.

I got 53.37 dB for the intra-predicted frame and 32.64 dB for the encoded frame. I have to analyze the probability distribution of the encoded image using a histogram. The histogram for both frames looks very similar, so what should I actually be looking for?

EDIT

The way I am calculating PSNR takes the difference between the original frame and the reconstructed frame and then uses the PSNR formula. Below is the code snippet:

errorFrame = orgFrame - reconstFrame;    
y = 10*log10(255*255/mean(mean((errorFrame.^2))));

      

If PSNR inside the predicted frame and the reconstructed frame is the same value? I have loaded a histogram of a reconstructed frame with intra prediction and a reconstructed frame without intra prediction

enter image description here

The histograms look extremely similar, so why is the PSNR different?

0


source to share


1 answer


PSNR performs a two-point comparison between two images. Histograms capture the entire intensity distribution as a whole. For example, if you have an image that was:

A = [0 255;
     255 0]; 

      

... and another one that was:

B = [255 0; 
     0 255];

      

... and let the original image be

C = [0 128; 
    128 0];. 

      



Although the histograms between A

and are the B

same, PSNR 9.0650

and 2.0344

dB are respectively. Thus, I would not rely on the histograms themselves, since they only capture global information. Look at it locally. You can obviously see that one has a higher quality than the other. In your histograms, although most of the bins of histograms look the same, but the histograms are not in space... In other words, the spatial relationships of pixels are not captured in histograms, as you saw in my example above. You could have, say, 15 pixels at an intensity of 80 for both images, but they could be in completely different places in each of the images. So you can have a completely different look of the image compared to another, but if you count the number of pixels per intensity while the count values per intensity are equal, the histograms will be equal.

You can see that A

both C

are similar to each other as it is just a grayer version of the other. However, it is B

turned off as it has white pixels, which have dark pixels in C

and dark pixels when C

there are gray pixels. Although the histograms between A and B are the same, the actual content between them is completely different from C

.

I understand that you need to compare histograms / probability distributions between both images, but this question may have been asked on purpose. While you can see that the intensity distribution is relatively the same, if you analyze the local image patches in between you can definitely see that it is of lower quality than the other. Honestly, and from personal experience, you should take PSNR with a grain of salt. Just because one image has a higher PSNR than another does not necessarily mean that it is better. In fact, there were images where they were below PSNR, but I considered them to be of higher quality than the one with higher PSNR.

This way, when you answer your own question, make sure you refer to everything I said here.

tl;dr

: Although histograms look the same, histograms are not spatially aware. The spatial relationships of pixels are not captured in histograms. So you can have a completely different view of the image compared to another, but if you counted the number of pixels per intensity while the count values per intensity are equal, the histograms will be equal. Even though the histograms are unequal, doing PSNR makes the difference point by point, and this one captures the spatial relationships of the pixels and thus explains why PSNRs are completely different.

+1


source







All Articles