Bilinear图像修复

原创 2016年05月30日 22:05:28

Bilinear Interpolation

标签(空格分隔): Graphics


Bilinear

Bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables (e.g., x and y) on a rectilinear 2D grid1

img1

Suppose that we want to find the value of the unknown function f at the point P(x,y). It is assumed that we know the value of f at the four points  Q11(x1,y1),Q12(x1,y2),Q21(x2,y1),Q22(x2,y2) .

We first do linear interpolation in the x-direction. This yields

f(R1)x2xx2x1f(Q11)+xx1x2x1f(Q21),R1=(x,y1)
f(R2)x2xx2x1f(Q12)+xx1x2x1f(Q22),R2=(x,y2)

We proceed by interpolating in the y-direction to obtain the desired estimate

f(P)=y2yy2y1f(R1)+yy1y2y1f(R2)(x2x)(y2y)(x2x1)(y2y1)f(Q11)+(xx1)(y2y)(x2x1)(y2y1)f(Q21)+(x2x)(yy1)(x2x1)(y2y1)f(Q12)+(xx1)(yy1)(x2x1)(y2y1)f(Q22)

To restore damaged pixels in the image using the bilinear interpolation, we should first find the good pixels at both four directions near the specific pixel, and then we can calculate the rgb value of it by

f=afright+bfdown+cfleft+dfupa+b+c+d,bfdown+dfupb+d,afright+cflefta+c,if |(a+c)(b+d)|20if a+c>b+d+20if b+d>a+c+20

Now, for our test, we take a photo of mine shown below(dong.jpg): src

And then, we can damage it by adding tons of characters, just like this(dong_dmg.jpg):
src_dmg

In order to restore the damaged photo, firstly we mark out the damage parts in the photo by PhotoShop(dong_font.jpg):
src_font

After the bilinear interpolation, the output image would be:
src_dest

Also, it is somewhere diffrent from the source photo, but is still effective enough for damage restore.

版权声明:那泥烤去看鸭o o

相关文章推荐

雙線性插值(Bilinear interpolation)的圖像旋轉在mobile上面的C++實現

http://blog.csdn.net/cay22/article/details/5555585  雙線性插值(Bilinear interpolation)的圖像旋轉在mobile上面的C...

雙線性插值(Bilinear interpolation)的圖像拉伸在mobile上面的實現

http://blog.csdn.net/cay22/article/details/5555561  雙線性插值(Bilinear interpolation)的圖像拉伸在mobile上面的實...

数字图像处理实验(4):PROJECT 02-04 [Multiple Uses],Zooming and Shrinking Images by Bilinear Interpolation

实验要求: Zooming and Shrinking Images by Bilinear Interpolation Objective To manipulate another...

Bilinear Control Systems

  • 2014-08-07 10:46
  • 3.58MB
  • 下载

Bilinear Modeling

  • 2014-07-19 15:31
  • 210KB
  • 下载

纹理过滤模式中的Bilinear、Trilinear以及Anistropic Filtering

http://smartblack.iteye.com/blog/762948   1、 为什么在纹理采样时需要texture filter(纹理过滤)。 我们的纹理是要贴到三维图形表面的,而三...

纹理过滤模式中的Bilinear、Trilinear以及Anistropic Filtering

1、 为什么在纹理采样时需要texture filter(纹理过滤)         我们的纹理是要贴到三维图形表面的,而三维图形上的pixel中心和纹理上的texel中心并不一至(pixel不一定对...

三十分钟理解:线性插值,双线性插值Bilinear Interpolation算法

在数学上,双线性插值是有两个变量的插值函数的线性插值扩展,其核心思想是在两个方向分别进行一次线性插值

Bilinear Interpolation Of Texture Maps

Bilinear Interpolation Of Texture Maps by Tom HammersleyIntroductionDo you sometimes notice that whe...

纹理过滤模式中的Bilinear、Trilinear以及Anistropic Filtering

   1、 为什么在纹理采样时需要texture filter(纹理过滤)。 我们的纹理是要贴到三维图形表面的,而三维图形上的pixel中心和纹理上的texel中心并不一至(p...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)