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

1 次查看(过去 30 天)
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 个评论
Jan
Jan 2016-4-5
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.

请先登录,再进行评论。

回答(2 个)

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

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

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by