Skip to content

Compute error for PSNR and SSIM #288

@leftthomas

Description

@leftthomas

Convert RGB image to YCbCr and take luminance should be Y = 0.256789 R + 0.504129 G +0.097906 B, not

rgb_to_grey = torch.tensor([0.299, 0.587, 0.114]).view(1, -1, 1, 1).to(x)

As for SSIM, to make sure the results can be same with Matlab Code, it must use DoubleTensor, and these three lines should change:

x = x.type(torch.float32)

y = y.type(torch.float32)

coords = torch.arange(kernel_size).to(dtype=torch.float32)

Please refer to my implement of SSIM and PSNR.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions