Contrast enhancement using Logarithmic transformation
The general for m is :
S = C * LOG( 1+R )
where
S
|
is the output value |
R
|
is the input value |
C
|
is a constant |
This transformation maps a narrow range of low gray-level values in the input image into a wider range of output levels. The opposite is true of higher values of input levels. We would use this transformation to expand the values of dark pixels in an image while compressing the higher-level values. To expand the bright levels we would use the inverse logarithmic transformation.
Flowchart
Example (Matlab)
input_image = imread('newMountain.jpg'); % reading image input_image_process=double(input_image); %converting image to integers %logaritm transform output_image_process=log(1+input_image_process); % log formula output_image=im2uint8(mat2gray(output_image_process)); % Converting image to 8-bit unsigned integers subplot(1,2,1); imshow(input_image); title('Original Image'); subplot(1,2,2); imshow(output_image); title('Secondary Image');