Can both PSNR and Compression ratio be good for the same image?
2 次查看(过去 30 天)
显示 更早的评论
I am using a compression algorithm for a image. Then I am calculating both PSNR and compression ratio of the image. I am getting a high PSNR value. For the same image is it possible to obtain high compression ratio?
0 个评论
回答(1 个)
Walter Roberson
2015-11-20
Yes.
Let the image be 1024 x 768, with the pixel value 42 in every pixel except the bottom row is 43. This can compress considerably, possibly to 5 bytes. But suppose the decompressed version is all 42 everywhere, that the bottom border of 43 was restored incorrectly.
Then for this image, for the MSE calculation the difference would be 0 nearly everywhere but would be 1 for a 1 x 768 strip. The total squared error would then be 1*768 and that would be divided by 1024 * 768 to give an MSE of 1/1024. If you work through the PSNR calculation,
10*log10(255^2/(1/1024))
you will get about 78.2 which is decent. Meanwhile your compression ratio might be 150000 to 1.
If you accept a lower compression ratio then the PSNR can improve by supposing lower and lower imperfections in the re-creation, which would probably take more storage.
Of course if you have a constant image and it is restored perfectly and compresses extremely well because it is constant, then your PSNR is going to be infinite because your MSE would be 0.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!