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.

 採用された回答

Christian Lenz
Christian Lenz 2012 年 7 月 23 日

0 投票

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

5 件のコメント

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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by