image processing assignment ii(appu)
TRANSCRIPT
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 1/7
1 | P a g e
By
M.Apuroop
110113044
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 2/7
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 3/7
3 | P a g e
Explanation:
An image as a function can be expressed as the product of illumination and
reflectance components as follows:
F(x,y) = I(x,y) * R(x,y) (1)
The illumination component
– Slow spatial variations
– Low frequency
The reflectance component
– Vary abruptly, particularly at the junctions of dissimilar objects
–
High frequency
Equation (1) cannot be used directly to operate separately on the frequency
components of illumination and reflectance because the Fourier transform of the
product of two functions is not separable. Instead the function can be represented as
a logarithmic function wherein the product of the Fourier transform can be
represented as the sum of the illumination and reflectance components as shown
below:
ln(x,y) = ln(I(x,y)) + ln(R(x,y)) (2)
The Fourier transform of equation (2) is
Z(u,v) = Fi(u,v) + Fr(u,v) (3)
The fourier transformed signal is processed by means of a filter function H(u,v) and
the resulting function is inverse fourier transformed. Finally, inverse exponential
operation yields an enhanced image. This enhancement approach is termed ashomomorphic filtering .
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 4/7
4 | P a g e
The whole operation is expressed as a block diagram below:
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 5/7
5 | P a g e
Program :
I = im read('wil lo wt ree.jpg ');
f igure, imsh ow (I);
% the image might be a color im age, so we co nver t i t to greyscale
I = rgb 2gray(I);
% conv ert the image to f loat ing-point typ e from uint8(whic h is default)
I = im2doub le(I);
f igure, imshow (I);
% take the image into the log domain
I = log (1 + I);
f igure, imsh ow (I);
% Now lets co ns tru ct the gaussian fil ter here k = size(I,1) = size(I,2)
M = 2*size(I,1) + 1;
N = 2*si ze(I,2) + 1;
% standard deviat ion of the equiv alent sp atial dom ain gaussian f i l ter
sigm a = 10;
Contd.
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 6/7
6 | P a g e
% X and Y are k*k s ize matr ices w ith
% X has co lumn i w ith al l i 's (this is tru e for i = 1,. .. .k
% Y has row i w ith al l i 's (this is true for i = 1,.. ..k
[X, Y] = meshg rid(1:N,1:M);
centerX = ceil(N/2);
centerY = ceil(M/2);
gaus sianNumerator = (X - cen terX).^ 2 + (Y - cent erY).^2;
H = exp(-gaussianNumerator./(2*sigma.^2));
H = 1 - H;
imshow(H,'Ini t ialMagnif icat ion',25)
H = fftshi ft(H);
If = fft2(I, M, N);
Iout = real(ifft 2(H.*If));
Iout = Iou t(1:size(I,1),1:si ze(I,2));
Ihmf = exp(Iout) - 1;
imshow pair( I, Ihm f, 'montage')
8/19/2019 Image Processing Assignment II(Appu)
http://slidepdf.com/reader/full/image-processing-assignment-iiappu 7/7
7 | P a g e
Output
Original Image
Homomorphic Filtered Image
: