function result = calculateRelMSE(image, reference)


reference_grayscale = mean(reference, 3);
reference_grayscale_rgb = repmat(reference_grayscale, [1 1 3]);
err = (image - reference).^2 ./ (1e-2 + reference_grayscale_rgb.^2);
result = mean(err(:));
