Image Enhancements

START

 

  • Image enhancements is manipulation of images (in term of images) that suits to our application.
  • As we discussed in last post by using Gaussian filter we can able to remove noises that is also one type of image enhancement technique.

Some of image enhancement techniques are

  1. Negative image
  2. Log transform
  3. Power law transform
  4. Filtering  (Gaussian filter, Median filter)
  5. Histogram equalization.
  • Post will discuss negative image, power log transform and log transform of images .
  • Histogram equalization is one the famous method of  image enhancement that I am not going to discuss in this post :D.

Negative Transform : 

output_image =  (Negative_range – 1)  – input_image ;

  • Its generate the negative image of input image.
  • We can manipulate the output image with Negative_range parameter.
  • Negative_range parameter can be 256 to 1.
  • Value below negative_range in input image will become zero in output image.

 

transforms
Figure.1 Image Enhancements

Figure shows the negative image of input Lena image with Negative_range = 256.

Power Law Transform:

output_image = Constant * (input_image^ gama) ;

  • Power low transform manipulates contrast of image with the help of gama value.
  • Figure.2 shows the power law transform output with Constant =1 and gama  =3;

Log Transform:

output_image = constant * log(1 + input_image);

  • Log transform changes the contrast of image in sort of reverse of power transform.
  • 1 is added to input image to avoid infinity (log (0)).
  • Log transform manipulate images with help of constant multiplier.
  • Figure.2 shows log transform of input lena image with constant value 5.

MATLAB code:

%%%%%%%%%%%%%%%%%%%%%%% code start %%%%%%%%%%%%%%%%%%%%%%

img = imread(‘lena’,‘jpg’); % load the image

img_gray = rgb2gray(img);

img_gray = double(img_gray); % convert image to double data type

[row,col,channel] = size(img);

subplot(2,2,1), imshow(uint8(img_gray))

title(‘Lena image’)

%% negative transform

%% Subtract the input image from 255

img_gray_negative = 255 – uint8(img_gray);

% plot the negative image

subplot(2,2,2), imshow(img_gray_negative)

title(‘Negative Lena image’)

%% power transform

constant = 1;   % assign the constant parameter equal to 1

gamma = 3;      % assign gama value to 3

img_gray_power = constant * (img_gray +1).^gamma;

subplot(2,2,3), imshow(img_gray_power,[])

title(‘Power law Lena image gamma = 3’)

% log transform

C = 5;   % assign constant C value to 5

img_gray_log = C * log(1+ img_gray);

subplot(2,2,4), imshow(img_gray_log,[])

title(‘log Lena image C = 5’)

%%%%%%%%%%%%%%%%%%% code end %%%%%%%%%%%%%%%%%%%%%

Note*

These transform serve as pre processing modules in image processing pipeline and help to enhance the image significantly according to applications.

 

 

the_end1

happy_learning

Happy Learning

 

Cheers

 

 

 

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s