Saturday, June 14, 2008

Assignment #8 Q5

Using the nearest neighbour approach (Ass#7 Shrink2) , I scaled down four of the images by factors of 0.8, 0.6, 0.4, and 0.2 like so.

A=imread("Q5.jpg");
B=shrink2(A,.8); #size(B) = 408 613 3
C=shrink2(A,.6); #size(C) = 306 459 3
D=shrink2(A,.4); #size(D) = 203 306 3
E=shrink2(A,.2); #size(E) = 101 152 3

Next, I placed each of the scaled images in an appropriate region so to replicate (or at least try to) the given final image.

A(52:459,78:690,:)=B;
A(103:408,155:613,:)=C;
A(155:357,231:536,:)=D;
A(206:306,308:459,:)=E;
F=double(A)/255;
imwrite("Q51.jpg",F(:,:,1),F(:,:,2),F(:,:,3))

No comments: