Sem 7 >
Digital Image Processing
WAP to show filtered image after passing through ideal low pass filter
a=imread('C:\Users\Desktop\lena2.png'); b=double(a); [m n]=size(a); d0=input('enter the cut off frequency'); for u=1:1:m for v=1:1:n d=((u-m/2)^2+(v-n/2)^2)^0.5; if(d<d0) H(u,v)=1; else H(u,v)=0; end end end fouriertrans=fft2(b,size(H,1),size(H,2)); shiftedfouriertrans=fftshift(fouriertrans); x=shiftedfouriertrans.*H; X=abs(ifft2(x)); filtered_image=uint8(X); filtered_image = filtered_image(1:size(a, 1), 1:size(a, 2)); subplot(2,2,1); imshow(a); title('original image'); subplot(2,2,2); imshow(filtered_image); title('Filtered Image'); subplot(2,2,3); imshow(H); title('Ideal low pass filter'); subplot(2,2,4); mesh(H),colormap(gray); title 'Ideal low pass frequency response'; |
WAP to display the antilog transformation of an image.
Source Preview:
|
WAP to display log transformation of an image.
Preview:
|
WAP to display negative of image
Source Code: a=imread('C:\Users\Desktop\lena.png'); subplot(2,2,1); imshow(a); title('original image'); b=rgb2gray(a); subplot(2,2,2); imshow(b); title('gray scale image'); c=255-a; subplot(2,2,3); imshow(c); title('negative of image'); d=255-b; subplot(2,2,4); imshow(d); title('negaative of gray scale image'); Output: |
1-5 of 5