0% found this document useful (0 votes)
11 views8 pages

Chapter 8

Chapter 8 discusses image enhancement techniques aimed at improving image quality for human viewing or making images suitable for automated analysis. It covers gray-level transformations, including linear, piecewise linear, and nonlinear transformations, and their applications such as contrast manipulation and gamma correction. The chapter emphasizes the importance of user interaction and computational efficiency in specifying transformation functions, often utilizing lookup tables for faster processing.

Uploaded by

abdo2652149
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Chapter 8

Chapter 8 discusses image enhancement techniques aimed at improving image quality for human viewing or making images suitable for automated analysis. It covers gray-level transformations, including linear, piecewise linear, and nonlinear transformations, and their applications such as contrast manipulation and gamma correction. The chapter emphasizes the importance of user interaction and computational efficiency in specifying transformation functions, often utilizing lookup tables for faster processing.

Uploaded by

abdo2652149
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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”.

OVERVIEW OF GRAY-LEVEL (POINT) TRANSFORMATIONS


• Point operations are also referred to as gray-level transformations
or spatial transformations.
▪ They can be expressed as:
g(x, y) = T [ f (x, y)] (8.1)
where g(x, y) is the processed image, f (x, y) is the original image, and T
is an operator on f (x, y).
• Since the actual coordinates do not play any role in the way the
transformation function processes the original image,1 equation
(8.1) can be rewritten as:
▪ s = T [r] (8.2)
where r is the original gray level of a pixel and s is the resulting gray level
after processing.
• Point transformations may be linear (e.g., negative), piecewise
linear (e.g., gray level slicing), or nonlinear (e.g., gamma
correction).
▪ Examples of basic linear (identity and negative) and nonlinear (log,
inverse log, power also known as gamma, and nth root) transformation
functions.

• Point operations are usually treated as simple mapping operations


whereby the new pixel value at a certain location (x0, y0) depends
only on the original pixel value at the same location and the
mapping function.
• We will call linear point transformations those that can be
mathematically described by a single linear equation:
▪ s=c·r+b (8.3)
where r is the original pixel value, s is the resulting pixel value, and c is a
constant responsible for controlling the contrast of the output image,
whereas b is another constant whose value impacts the output image’s
overall brightness.
• From a graphical perspective, a plot of s as a function of r will
show a straight line, whose slope (or gradient) is determined by
the constant c; the constant term b determines the point at which
the line crosses the y-axis.
• Since the output image should not contain any pixel values
outside a certain range (e.g., a range of [0, 255] for monochrome
images of class uint8 in MATLAB), the plot usually also shows a
second, horizontal, straight line that is indicative of clamping the
results to keep them within range.
• If a point transformation function requires several linear
equations, one for each interval of gray-level values, we shall call it
a piecewise linear function.
• Transformation functions that cannot be expressed by one or
more linear equations will be called nonlinear.
• The power law and log transformations are examples of nonlinear
functions.

EXAMPLES OF POINT TRANSFORMATIONS


• Contrast Manipulation
▪ One of the most common applications of point transformation functions
is contrast manipulation (also known by many other names such as
contrast stretching, gray-level stretching, contrast adjustment, and
amplitude scaling).

• These functions often exhibit a curve that resembles the curve of a sigmoid
function (Figure 8.5a): pixel values of f<m are compressed toward darker values
in the output image, whereas values of f>m are mapped to brighter pixel values
in the resulting image.
• The slope of the curve indicates how dramatic the contrast changes will be; in its
most extreme case, a contrast manipulation function degenerates into a binary
thresholding3 function (Figure 8.5b), where pixels in the input image whose
value is f<m become black and pixels whose value is f>m are converted to white.
▪ One of the most useful variants of contrast adjustment functions is the
automatic contrast adjustment (or simply autocontrast), a point
transformation that—for images of class uint8 in MATLAB—maps the
darkest pixel value in the input image to 0 and the brightest pixel value
to 255 and redistributes the intermediate values linearly.
▪ The autocontrast function can be described as follows:

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

where r is the original pixel value, s is the resulting pixel value, c is a


scaling constant, and γ is a positive value. Figure 8.8 shows a plot of
equation (8.5) for several values of γ.
▪ The results of applying gamma correction to an input image using two
different values of γ. It should be clear from the figure that when γ < 1,
the resulting image is darker than the original one; whereas for γ > 1, the
output image is brighter than the input image.

▪ 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.

▪ An example of gray-level slicing, a particular case of piecewise linear


transformation in which a specific range of intensity levels (in this case,
the [100, 150] range) is highlighted in the output image, while all other
values remain untouched.
SPECIFYING THE TRANSFORMATION FUNCTION
• All the transformation functions presented in this chapter have
been described mathematically in a way that is elegant and
appropriate for input variables in the continuous or discrete
domain.
• The mathematical formulation is not always useful in practice, for
two different—but relevant—reasons:
1- From a user interaction viewpoint, it is often preferable to specify the
desired point transformation function interactively using the mouse
and a GUI-based application, such as the glsdemo.
2- From the perspective of computational efficiency, point operations
can be executed at significantly higher speed using lookup tables
(LUTs). For images of type uint8 (i.e., monochrome images with 256
gray levels), the LUT will consist of a 1D array of length 256. LUTs can
be easily implemented in MATLAB as demonstrated in the following
examples.

Important level 3 (IT, CS)


Made by Abdulrahman Salah Eldin

You might also like