This function interpolates the rows first and then the columns from the interpolated rows.
function [enl] = enlarge(image)img = imread(image);img = double(img);[m,n] = size(img);% enl = zeros(m,n);
for i = 1:1:m for j = 1:2:n-1 enl(i,j+1) = (img(i,j)+img(i,j+1))/2; end endfor i = 1:2:m-1 for j = 1:1:n enl(i+1,j) = (img(i,j)+img(i+1,j))/2; end endimshow(enl)imwrite(enl, 'enl.gif')end
Best Answer