hello
i am trying to implement this code to get the result in figure 5.26(b) but still something wrong could you help me in that
Refernce: digital image processing gonzalez third edition
c = im2double(imread('Fig0526(a)(original_DIP).tif')); figure,imshow(c) a = 0.1; b = 0.1; T=1; [M, N] = size(c); h = zeros(M,N); for u = 1:M for v = 1:N h(u,v) = (T/(pi*(u*a + v*b)))*... sin(pi*(u*a + v*b))*... exp(-1i*pi*(u*a + v*b)); end end cf=(fft2(c)); c1 = cf.*h; c1a=(ifft2(c1)); figure,imshow(abs(log(c1a)+1), []);
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
The origin was not at the right place. Try this:
clc; % Clear the command window. fprintf('Beginning to run %s.m ...\n', mfilename); close all; % Close all figures (except those of imtool.) clear; % Erase all existing variables. Or clearvars if you want. workspace; % Make sure the workspace panel is showing. format long g; format compact; fontSize = 15; grayImage = im2double(imread('logo.tif')); % Make sure it's 688 like the book says. grayImage = imresize(grayImage, [688, 688]); subplot(2, 3, 1); imshow(grayImage, []) impixelinfo axis('on', 'image') title('Original Image', 'FontSize', fontSize) % Make a filter for the spectral domain. a = 0.1; b = a; T=1; [rows, columns] = size(grayImage); h = zeros(rows, columns); for u = 1 : rows for v = 1 : columns rx = v - columns/2; ry = u - rows/2; h(u,v) = (T/(pi*(ry*a + rx*b))) *... sin(pi*(ry*a + rx*b))*... exp(-1i*pi*(ry*a + rx*b)); end end % Print the max value of h. absh = real(h); fprintf('Max h = %f.\n', max(absh(:))) subplot(2, 3, 2); imshow(log(absh), []); impixelinfo; axis('on', 'image')
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment