High pass filter in MATLAB

Hi,
I understand that high pass filter is essentially, orignal image - low pass filter.
I attempted the following but gotten a black screen. Anyone knows what when wrong? Thanks lots!
--CODE-
A=imread('image.jpg');
G=fspecial('gaussian', [50 50], 5);
Ig=imfilter(A,G,'same');
JK=A-Ig;
S=imshow(JK) >>> the output here is black image.

 Réponse acceptée

Christian Lenz
Christian Lenz le 23 Juil 2012

0 votes

normalize image...
A = double( imread('image.jpg'));
A = A./max(max(max(A)));
keep the rest.

5 commentaires

Yvonne
Yvonne le 23 Juil 2012
I add the 2 lines, the image is still black.
Ryan
Ryan le 23 Juil 2012
S = imshow(JK,[])
Christian Lenz
Christian Lenz le 23 Juil 2012
It's not black when I do it... Tried another image?
Christian Lenz
Christian Lenz le 23 Juil 2012
Or play with your parameters (thresholding)
Yvonne
Yvonne le 24 Juil 2012
Thanks! I need to do mat2gray as well =)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by