Professional Documents
Culture Documents
AIM: To study about image enhancement in spatial domain and to write a program in
MATLAB to generate image negative and log transformation.
THEORY:
Objective of image enhancement:
To process am image so that result will be more suitable than original image for specific
application. A method which is quite useful for enhancing an image may or may not be
necessarily be the best approach for enhancing other image.
There are some enhancement techniques based on various combination of method from
these two categories:
g (x,y) = T [ f(x. y ) ]
where,
f (x, y) is the input image.
g (x,y) is the output image.
T is an operator on defined over a neighborhood of point (x, y).
Log transformation :
The general form of the log transformation is
s =c log (1 + r)
Where,
c is a constant,
and it is assumed that r>>0.
The log curve maps a narrow range of low intensity values in the input into a
wider range of output levels. It to expand the values of dark pixels in an image while
compressing the higher-level values. It compresses the dynamic range of images with
large variations in pixel values. Example, Fourier spectrum image. It can have intensity
range from 0 to 10^6 or higher.
While processing numbers such as these presents no problems for a computer,
image display systems generally will not be able to reproduce.
Inverse Log Transform:
It does exactly opposite of log operation. It is used to expand values of high pixels in an
image while compressing dark level.
CONCLUSION: Thus in digital negative we have seen that the grey level intensity is
changed to corresponding white and the white level intensity is changed to corresponding
grey level and in log transformation we have seen that low intensity pixels have changed
to high intensity and vice versa.
DIGITAL NEGATIVE
clc;
close all;
clear all;
a=imread('cameraman.tif');
a=double(a);
figure(1);
imshow(uint8(a));
title ('input image');
[m n]=size(a);
b=max(max(a));
c=b-a;
figure(2);
imshow(uint8(c));
title('output image');
Logarithmic Operation
clear all;
close all;
a=imread('cameraman.tif');
a=double(a);
[m n]=size(a);
b=abs(fft2(a));
b_log=log(1+b);
figure(1);
subplot(2,2,1);
imshow(uint8(a));
title('original image');
subplot(2,2,2);
imshow(uint8(b));
title('fft image');
subplot(2,2,3);
imshow(uint8(10*b_log));
title('log operation');