PLEASE HELP TO SOLVE THE ERROR IN BELOW HOMOMORPHIC CODE ................

1 view (last 30 days)
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 Comment
Jan
Jan on 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.

Sign in to comment.

Answers (2)

Jan
Jan on 5 Apr 2016
I do not find the argument "montage" in the help text om imshow .

Jay
Jay on 14 Apr 2016
The problem is in last line.
use :
figure,imshowpair(Ihmf,I,'montage');
imshow() doesn't have any property named 'montage'.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!