Bicubic interpolation direct interpolation formula Matlab source code

조회 수: 33 (최근 30일)
Gobert
Gobert 2018년 6월 15일
댓글: Rik 2021년 2월 23일
Can anyone help by sharing the source code of the bicubic image interpolation algorithm using/involving 'direct interpolation formula'? See the figure below?
Also, here's an incomplete (and possibly erroneous) example showing the 'direct interpolation formula' -- V(m',n'):
a = y2-y;
b = x2-x;
d1 = -a*((1-a)^2)*(-b*((1-b)^2))*img(x0,y0); %%(m-1,n-1)
d2 = (1-2*(b^2) + (b^3))*img(x0,y1); %%(m,n-1)
d3 = b*(1+b-(b^2))*img(x0,y2); %%(m+1,n-1)
d4 = -(b^2)*(1-b)*img(x0,y3); %%(m+2,n-1)
d5 = (1-2*(a^2)+(a^3))*(-b*((1-b)^2))*img(x1,y0); %%(m-1,n)
d6 = (1-2*(b^2)+(b^3))*img(x1,y1); %%(m,n)
d7 = b*(1+b-(b^2))*img(x1,y2); %%(m+1,n)
d8 = -(b^2)*(1-b)*img(x1,y3); %%(m+2,n)
d9 = a*(1+a-(a^2))*(-b*((1-b)^2))*img(x2,y0); %%(m-1,n+1)
d10 =(1-2*(b^2)+(b^3))*img(x2,y1); %%(m,n+1)
d11 = b*(1+b-(b^2))*img(x2,y2); %%(m+1,n+1)
d12 = -(b^2)*(1-b)*img(x2,y3); %%(m+2,n+1)
d13 = -(a^2)*(1-a)*(-b*((1-b)^2))*img(x3,y0); %%(m-1,n+2)
d14 =(1-2*(b^2) + (b^3))*img(x3,y1); %%(m,n+2)
d15 = b*(1+b-(b^2))*img(x3,y2); %%(m+1,n+2)
d16 = -(b^2)*(1-b)*img(x3,y3); %%(m+2,n+2)
V(m',n') = (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 + d12 + d13 + d14 + d15 + d16);
PS: I don't want the source code shown here: https://thilinasameera.wordpress.com/2010/12/24/digital-image-zooming-sample-codes-on-matlab/. Also, I don't want to use 'interp2' or any other shortcut.
  댓글 수: 8
Shubha B.
Shubha B. 2021년 2월 23일
To understand the theory concept correctly. For above written code I am not getting the theory for that.
Rik
Rik 2021년 2월 23일
If your main point is understanding the theory, does the exact implementation matter?

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
Steven Lord 2018년 6월 15일
Why not just use interp2? The help for the 'cubic' method states:
'cubic' - bicubic interpolation as long as the data is
uniformly spaced, otherwise the same as 'spline'
If you're not allowed to use interp2 because this is homework, tell us what's blocking you from completing the implementation and we may be able to offer guidance.
  댓글 수: 1
Gobert
Gobert 2018년 6월 15일
I didn't want to use 'interp2' or any other short-cut. What is intriguing to me is simply the 'geometric transformation' that will enable accessing (x0, y0), etc., at the edges of an image, without generating errors (even if it requires padding that image, first).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by