Project 1: Upsampling an Image using Interpolation Techniques
There are a number of techniques that can be used to upsample an image.
In this assignment, you are expected to implement three Interpolation methods such as Cubic spline for three different images and compare the results.
Example Code Python:
orgImage = cv2.imread("dene.png")
w, h, d = orgImage.shape
xResized = int(w * scale);
yResized = int(h * scale);
....
cv2.imwrite("resizedImage.png", resizedImage)
Example Code Matlab:
I = imread('pen.png');
figure;
imshow(I);
[w, h, d ]= size(I)
R = I(:,:,1);
G = I(:,:,2);
B = I(:,:,3);
%for cubic spline write findcoefficients method
[ax,bx,cx,dx ] = findCoefficients(R);
[ay,by,cy,dy ] = findCoefficients(G);
[az,bz,cz,dz ] = findCoefficients(B);
....
R_new = ax(i)*i_d.^3 + bx(i)*i_d.^2 + cx(i)*i_d + dx(i);
G_new = ay(i)*i_d.^3 + by(i)*i_d.^2 + cy(i)*i_d + dy(i);
B_new = az(i)*i_d.^3 + bz(i)*i_d.^2 + cz(i)*i_d + dz(i);