Professional Documents
Culture Documents
Dip As5
Dip As5
Page 1 of 2
e. [m n]=size(a);
f. p=input('Enter the size you want: ');
g. for i=1:m % loop to extract every row
h. for j=1:n % loop to extract every column
i. for k=1:p % loop to control the number of replication
j. b(i,(j-1)*p+k)=a(i,j);% replication of pixels in row wise
k. end
l. end
m. end
n. c=b;
o. [m n]=size(c);
p. for i=1:n % loop to extract every column
q. for j=1:m % loop to extract every row
r. for k=1:p % loop to control the number of replication
s. b((j-1)*p+k,i)=c(j,i); % replication of pixel in column wise
t. end
u. end
v. end
w. imshow(a),title('original image')
x. figure,imshow(b),title('Zoomed image')
y. xlabel(sprintf('Zooming factor is %g',p))
END
Page 2 of 2