如何评估插值的质量? [英] How to evaluate the quality of interpolation?

查看:26
本文介绍了如何评估插值的质量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立图像金字塔.首先,我拍摄一张大照片,然后制作一张甚至更小的小照片,等等.我使用插值法来缩小图像.而且我需要了解在什么插值下,图像之间的信息丢失会更少.这就是我所说的插值质量.我正在看水平渐变.请告诉我这个标准有多好,或者是否有更好的标准.

I am building a pyramid of images. First I take a big picture and build a smaller one even smaller, etc. I use interpolation to reduce the image. And I need to understand at what interpolation there will be less lost information between images. This is what I mean by interpolation quality. I am looking at horizontal gradients. Please tell me how good this criterion is or if there is something better.

Blurred = imfilter(img, PSF);
Blurred = im2double(Blurred)
Blurred2 = imresize(Blurred, [300 300], "Method", "bicubic");
[x0,y0] = meshgrid(1:360,1:360);
[x, y] = meshgrid(1:1.2:360, 1:1.2:360);
Blurred3 = interp2(x0, y0, Blurred, x,y, "spline");
gradX = diff(Blurred,1,1);
gradY = diff(Blurred,1,2);
gradX2 = diff(Blurred2,1,1);
gradY2 = diff(Blurred2,1,2);
gradX3 = diff(Blurred3,1,1);
gradY3 = diff(Blurred3,1,2);
[h, cx]=imhist(gradX);
[h2, cx2]=imhist(gradX2);
[h3, cx3]=imhist(gradX3);
h=log10(h);
h2 = log10(h2);
h3 = log10(h3);
figure, plot(cx, h)
hold on
plot(cx2, h2);
plot(cx3, h3);
hold off

推荐答案

您正在使用对导数的有限差分近似. gradX 中的单位是强度单位/像素,其中"pixel"表示像素.像素之间的距离(假定为1).重新缩放图像时,会增加像素大小,但是在导数中,您仍然假设像素之间的距离为1.因此, gradX2 中的值大于 gradX中的值.您必须按图像宽度进行归一化以校正此效果.

You're using the finite difference approximation to the derivative. The units in gradX are intensity units/pixel, with "pixel" the distance between pixels (which is assumed to be 1). When you rescale your image, you increase the pixel size, but in the derivative you're still assuming the distance between pixels is 1. Thus, the values in gradX2 are larger than those in gradX. You'd have to normalize by the image width to correct for this effect.

但是,归一化之后,我仍然看不到这是如何衡量插值质量的.正确的问题是:我怎样才能从 Blurred2 重构 Blurred ?我在这里假设 Blurred 已经足够模糊,以免在对图像进行重采样时出现混叠.

But still, after normalization, I don't see how this is a measure of quality of the interpolation. The right question would be: how well can I reconstruct Blurred from Blurred2? I'm assuming here that Blurred has been blurred just sufficiently to avoid aliasing when resampling the image.

我将对 Blurred2 应用第二轮插值,以恢复与 Blurred 大小相同的图像,然后使用MSE或类似的误差度量比较这两个图像.

I would apply a 2nd round of interpolation to Blurred2 to recover an image of the same size as Blurred, then compare the two images using MSE or similar error measure.

这篇关于如何评估插值的质量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆