% images.m loads and displays two Matlab images. It shows how to do simple % modifications such as brightening, reverse video, superimposition, % flipping, and blurring. It also makes a graph of the gray-scale intensity % as a surface and contour graph. orient tall load clown C=ind2gray(X,map); load trees T=ind2gray(X,map); T=T(1:200,1:320); h = fspecial('gaussian',[5 5]); BC = filter2(h,C); BC = filter2(h,BC); BC = filter2(h,BC); BC = filter2(h,BC); BC = filter2(h,BC); BC = filter2(h,BC); computecontrast(C) computecontrast(BC) subplot(4,2,1) imshow(C,64); title('Clown') subplot(4,2,2) imshow(T,64); title('Trees') subplot(4,2,3) imshow(max(max(C))-C,64); title('1 - Clown'); subplot(4,2,4) imshow(fliplr(T)+0.4,64) title('Trees + 0.4, reversed'); subplot(4,2,5) imshow(C.*C,64); title('Clown * Clown'); subplot(4,2,6) imshow((4*C+T)/5,64); title('0.8*Clown + 0.2*Trees'); subplot(4,2,7) SC=C(:,[20:320 1:19]); imshow((4*C+SC)/5,64); title('0.8*Clown + 0.2*Shifted Clown'); subplot(4,2,8) imshow(BC,64) title('Blurred Clown') figure(2) MC = fliplr(BC')'; subplot(2,1,1) mesh(MC) view(-10,50) xlabel('Horizontal'); ylabel('Vertical'); zlabel('Intensity'); title('Surface plot of blurred clown'); subplot(2,1,2) contour(MC,40) title('Contour plot of blurred clown')