piq: Compute error for `PSNR` and `SSIM`

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@leftthomas, Indeed, RGB2YCrCb uses different from RGB2YIQ (or rgb2ntsc) weights. However, we are not using rgb2ycbcr colour conversion. Our approach uses more common YIQ colour map.

@leftthomas thank you for your feedback regarding PSNR and SSIM performance. PSNR compares grayscale images. In order to get a grayscale image, we use conversion proposed in PIL (docs) and OpenCV (docs). This conversion is identical to Y channel of RGB2YIQ transformation. Sadly, previous comment in code was misleading. It will be fixed to avoid misunderstanding in future.

Following your quote, PSNR implementation proposed in IQA-PyTorch uses RBG2YIQ as a default colour conversion, which matches our approach. Any additional colour conversions other than standard grayscale could be added as preprocessing step to your pipeline.

UPD: In addition, MATLAB version rgb2gray conversion function matches our approach as well.