MATLAB: High pass filter in MATLAB

fspecialhigh pass filter

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.

Best Answer

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