Image Enhancement

Those are some native functions of pkg: image, to enhance an image, either as a whole or based on its gray values.

Using a grayscale image, function imadjust, on line 5, maps the gray scale image values between [.4 .75] to the full range of [0 1]. That way we can highlight a specific range of interest.

Using the imcomplement, on line 6, we can get the obvious.. complementary aka negative of that image. To achieve the same result with imadjust all we have to do is to properly map the values of [0 1] to [1 0].

Finally function stretchlim, on line 7, can be used as an “auto” mode of imadjust when we don’t need to specifically deal with range mapping. That one stretches the contrast ending up increasing it for all low and highs of the current input image.

pkg load image
close all
f = imread('My IMGs/XRAY.tif');

enhancedGreyArea = imadjust(f,[0.4 0.75], [0 1]);
neg = imcomplement(f);
autoEnhanced = imadjust(f, stretchlim(f), []);

title('Original Image') 

title('Enhanced (mapped) grey values from [.6 .85] to [0 1]') 

title('Negative by Complement') 

title('Auto Enhanced, Saturated') 
Enhanced Images by the above functions