%Roll number p07ec911 %PROGRAM FOR BIT PLANE SLICNG P=imread('cameraman.tif'); subplot(2,2,1); imshow(m);title('orignal image'); n=P; o=P; for i=1:255 for j=1:255 if m(i,j)>=128 m(i,j)=0; end end end subplot(2,2,2); imshow(P);title('MSB is cleared'); for i=1:255 for j=1:255 if n(i,j)>=64 &n(i,j)<=127; n(i,j)=0; end end end subplot(2,2,3); imshow(n);title('Bit 6 is cleared'); for i=1:255 for j=1:255 if n(i,j)>=32& n(i,j)<=63; o(i,j)=0; end end end subplot(2,2,4); imshow(n);title('Bit 5 is cleared'); for i=1:255 for j=1:255 if o(i,j)<=1; o(i,j)=0; end end end subplot(2,2,4); imshow(o);title('Bit 0(LSB) is cleared');imshow(Q);title('gamma 2');
%TYAGENDRA SINGH KARARIA
%ROLL NO:- P07EC911 %Resize image with bilinear. A=imread('cameraman.tif'); figure; imshow(A);title('realimage'); B = imresize(A,[150 200]);; figure subplot(2,1,1); imshow(B);title('resize by interpolation'); C = imresize(A,[150 200],'bilinear'); subplot(2,1,2); imshow(C);title('resize by bilinear'); D = imresize(A,[1500 2500]); figure; subplot(2,1,1); imshow(D);title('resize by interpolation'); E = imresize(A,[1500 2500],'bilinear'); subplot(2,1,2); imshow(E);title('resize by bilinear');
% PO7EC911 %Generate negative of image P = imread('CIRCUIT.TIF'); Q = imcomplement(P); subplot(1,2,1); imshow(P) subplot(1,2,2); imshow(Q)
% TYAGENDRA SINGH KARARIA
% PO7EC911 %Histogram equalization in image p = imread('cameraman.tif'); q = histeq(p); subplot(2,2,1); imshow(p) subplot(2,2,2); imshow(q) subplot(2,2,3); imhist(p,64) subplot(2,2,4); imhist(q,64)
%TYAGENDRA SINGH KARARIA
%ROLL NO:- P07EC911 %Q.1 Nagative of image. P=imread('cameraman.tif'); subplot(2,1,1); imshow(P); title('original image'); for i=1:256 for j=1:256 Q(i,j)=255-P(i,j); end end subplot(2,1,2) imshow(Q);title('nagative');
%TYAGENDRA SINGH KARARIA
%ROLL NO:- P07EC911 %Q.3 Rsize image with bilinear. A=imread('cameraman.tif'); figure; imshow(A);title('realimage'); B = imresize(X,[150 200]);; figure subplot(2,1,1); imshow(B);title('resize by interpolation'); C = imresize(X,[150 200],'bilinear'); subplot(2,1,2); imshow(C);title('resize by bilinear'); D = imresize(X,[1500 2500]); figure; subplot(2,1,1); imshow(D);title('resize by interpolation'); E = imresize(X,[1500 2500],'bilinear'); subplot(2,1,2); imshow(E);title('resize by bilinear');