PLEASE HELP TO SOLVE THE ERROR IN BELOW HOMOMORPHIC CODE ................
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
ERROR: (??? Error using ==> imageDisplayParsePVPairs at 72 Invalid input arguments.
Error in ==> imageDisplayParseInputs at 70
[common_args,specific_args] = imageDisplayParsePVPairs(varargin{:});
Error in ==> imshow at 199
[common_args,specific_args] = ...
Error in ==> homo at 25
figure(4),imshow(Ihmf, 'montage'); )
CODE:
clc
clear all
close all
I = imread('C:\Users\shankar\Documents\MATLAB\filtering\gaussian1.jpg');
figure(1),imshow(I)
I = im2double(I);
I = log(1 + I);
M = 2*size(I,1) + 1;
N = 2*size(I,2) + 1;
sigma = 10;
[X, Y] = meshgrid(1:N,1:M);
centerX = ceil(N/2);
centerY = ceil(M/2);
gaussianNumerator = (X - centerX).^2 + (Y - centerY).^2;
H = exp(-gaussianNumerator./(2*sigma.^2));
H = 1 - H;
figure(2),imshow(H,'InitialMagnification',25)
H = fftshift(H);
If1 = fft2(I, M, N);
If=rgb2gray(If1);
figure(3),imshow(If)
Iout = real(ifft2(H.*If));
Iout = Iout(1:size(I,1),1:size(I,2));
Ihmf = exp(Iout)- 1;
figure(4),imshow(Ihmf, 'montage');
1 Commento
Jan
il 5 Apr 2016
I've edited the message to apply a code formatting. Please use the "{} Code" button to post readable code.
I still cannot imagine why posters do not care about unreadable code. They want others to read and fix the problems and several times each day reminders are required. It would be very useful if MathWorks add a HUGE red reminder and explanantion of the "{} Code" button in the field for creating a question, at least for the first 5 posts of a user.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!