Chapter 8
Chapter 8
INTRODUCTION
• Image enhancement techniques usually have one of these two
goals:
1. To improve the subjective quality of an image for human viewing.
The ultimate goal is an improved version of the original image, whose
interpretation will be left to a human expert for example, an enhanced X-ray
image that will be used by a medical doctor to evaluate the possibility of a
fractured bone.
2. To modify the image in such a way as to make it more suitable for
further analysis and automatic extraction of its contents.
The goal is to serve as an intermediate step toward an automated solution
that will be able to derive the semantic contents of the image (forthe goal is
to serve as an intermediate step toward an automated solution that will be
able to derive the semantic contents of the image) for example, by improving
the contrast between characters and background on a page of text before it is
examined by an OCR algorithm.
• Sometimes these goals can be at odds with each other. For example,
sharpening an image to allow inspection of additional fine-grained
details is usually desired for human viewing, whereas blurring an
image to reduce the amount of irrelevant information is often
preferred in the preprocessing steps of a machine vision solution.
• Another way to put it is to say that image enhancement
techniques are used when either:
1) An image needs improvement, or
2) The low-level features must be detected.
• Image enhancement methods “improve the detectability of
important image details or objects by man or machine”.
where r is the pixel value in the original image (in the [0, 255] range),
rmax and rmin are the values of its brightest and darkest pixels,
respectively, s is the resulting pixel value, and L − 1 is the highest gray
value in the input image (usually L = 256).
▪ An example of an image before and after autocontrast.
▪ In MATLAB:
• Function imadjust to perform contrast adjustments (including autocontrast).
• interactive brightness and contrast adjustments can also be performed using
imcontrast that opens the Adjust Contrast tool.
• Negative
▪ The negative point transformation function (also known as contrast
reverse).
▪ The negative transformation is used to make the output more suitable
for the task at hand (e.g., by making it easier to notice interesting details
in the image).
▪ In MATLAB:
• Function to compute the negative of an image: imcomplement.
• Power Law (Gamma) Transformations
▪ The power law transformation function is described by
▪ In MATLAB:
• The imadjust function in the IPT can be used to perform gamma correction with
the syntax: g = imadjust(f,[],[],gamma);
• Log Transformations
▪ The log transformation and its inverse are nonlinear transformations
used, respectively, when we want to compress or expand the dynamic
range of pixel values in an image.
▪ Log transformations can be mathematically described as
s = c · log(1 + r)
where r is the original pixel value, s is the resulting pixel value, and c is a
constant.
▪ Be aware that in many applications of the log transformation, the input
“image” is actually a 2D array with values that might lie outside the usual
range for gray levels that we usually associate with monochrome images
(e.g., [0, 255]).
• Piecewise Linear Transformations
▪ Piecewise linear transformations can be described by several linear
equations, one for each interval of gray-level values in the input image.
▪ The main advantage of piecewise linear functions is that they can be
arbitrarily complex.
▪ The main disadvantage is that they require additional user input.
▪ An example of an arbitrary piecewise linear transformation function
used to improve the contrast of the input image.