-
附录
A
3 Image
Enhancement in the Spatial Domain
The
principal objective of enhancement is to process
an image so that the result
is more
suitable than the original image for a specific
application. The word specific
is
important, because it establishes at the outset
than the techniques discussed in this
chapter
are
very
much
problem
oriented.
Thus,
for
example,
a
method
that
is
quite
useful
for
enhancing
X-ray
images
may
not
necessarily
be
the
best
approach
for
enhancing pictures of
Mars transmitted by a space probe. Regardless of
the method
used
.However,
image
enhancement
is
one
of
the
most
interesting
and
visually
appealing areas of
image processing.
Image
enhancement
approaches
fall
into
two
broad
categories:
spatial
domain
methods and frequency domain methods.
The term spatial domain refers to the image
plane itself, and approaches in this
category are based on direct manipulation of
pixels
in
an
image.
Fourier
transform
of
an
image.
Spatial
methods
are
covered
in
this
chapter, and frequency domain
enhancement is discussed in Chapter ement
techniques based on various
combinations of methods from these two categories
are
not unusual. We note also that many
of the fundamental techniques introduced in this
chapter in the context of enhancement
are used in subsequent chapters for a variety of
other image processing applications.
There is no general theory of image
enhancement. When an image is processed
for
visual
interpretation,
the
viewer
is
the
ultimate
judge
of
how
well
a
particular
method
works.
Visual
evaluation
of
image
quality
is
a
highly
is
highly
subjective
process, thus making the definition of
a “good image” an elusive standard by which to
compare algorithm performance. When the
problem is one of processing images for
machine perception, the evaluation task
is somewhat easier. For example, in dealing
with
a
character
recognition
application,
and
leaving
aside
other
issues
such
as
computational
requirements,
the
best
image
processing
method
would
be
the
one
yielding
the
best
machine
recognition
results.
However,
even
in
situations
when
a
clear-cut criterion of performance can
be imposed on the problem, a certain amount of
trial and error usually is required
before a particular image enhancement approach is
selected.
3.1 Background
As indicated previously, the term
spatial domain refers to the aggregate of pixels
composing an image. Spatial domain
methods are procedures that operate directly on
these pixels. Spatial domain processes
will be denotes by the expression
g
?
x
,
y
?
?
T
?
< br>f
(
x
,
y
)
?
(3.1-1)
where
f(x,
y)
is
the
input
image,
g(x,
y)
is
the
processed
image,
and
T
is
an
operator on
f, defined over some neighborhood of (x, y). In
addition, T can operate on
a
set
of
input
images,
such
as
performing
the
pixel-by-pixel
sum
of
K
images
for
noise reduction, as
discussed in Section 3.4.2.
The
principal approach in defining a neighborhood
about a point (x, y) is to use a
square
or rectangular subimage area centered at (x,
y).The center of the subimage is
moved
from pixel to starting, say, at the top left
corner. The operator T is applied at
each location (x, y) to yield the
output, g, at that location. The process utilizes
only
the
pixels
in
the
area
of
the
image
spanned
by
the
neighborhood.
Although
other
neighborhood shapes,
such as approximations to a circle, sometimes are
used, square
and
rectangular
arrays
are
by
far
the
most
predominant
because
of
their
ease
of
implementation.
The simplest from of T is when the
neighborhood is of size 1×
1 (that is, a
single
pixel).
In
this
case,
g
depends
only
on
the
value
of
f
at
(x,
y),
and
T
becomes
a
gray-
level (also called an intensity or mapping)
transformation function of the form
s
p>
?
T
(
r
)
(3.1-2)
where, for simplicity in notation, r
and s are variables denoting, respectively, the
grey level of f(x, y) and g(x, y)at any
point (x, y).Some fairly simple, yet powerful,
processing
approaches
can
be
formulates
with
gray-level
transformations.
Because
enhancement at any point in an image
depends only on the grey level at that point,
techniques in this category often are
referred to as point processing.
Larger
neighborhoods allow considerably more flexibility.
The general approach
is
to
use
a
function
of
the
values
of
f
in
a
predefined
neighborhood
of
(x,
y)
to
determine the value of g at (x, y). One
of the principal approaches in this formulation
is based on the use of so-called masks
(also referred to as filters, kernels, templates,
or
windows). Basically, a mask is a
small (say, 3×
3) 2-Darray, in which the
values of the
mask coefficients
determine the nature of the type of approach often
are referred to as
mask processing or
filtering. These concepts are discussed in Section
3.5.
3.2 Some Basic Gray Level
Transformations
We begin the study of
image enhancement
techniques by
discussing gray-level
transformation
functions.
These
are
among
the
simplest
of
all
image
enhancement
techniques. The values of pixels,
before and after processing, will be denoted by r
and
s,
respectively.
As
indicated
in
the
previous
section,
these
values
are
related
by
an
expression of the from s = T(r), where
T is a transformation that maps a pixel value r
into
a
pixel
value
s.
Since
we
are
dealing
with
digital
quantities,
values
of
the
transformation
function
typically
are
stored
in
a
one-dimensional
array
and
the
mappings
from r to s are implemented via table lookups. For
an 8-bit environment, a
lookup table
containing the values of T will have 256 entries.
As an introduction to gray-level
transformations, which shows three basic types
of
functions
used
frequently
for
image
enhancement:
linear
(negative
and
identity
transformations),
logarithmic
(log
and
inverse-log
transformations),
and
power-law
(nth power and nth
root transformations). The identity function is
the trivial case in
which out put
intensities are identical to input intensities. It
is included in the graph
only for
completeness.
3.2.1 Image Negatives
The
negative
of
an
image
with
gray
levels
in
the
range
[0,
L-1]is
obtained
by
using the negative
transformation show shown, which is given by the
expression
s
?
L
?
1
?
r
(3.2-1)
Reversing
the
intensity
levels
of
an
image
in
this
manner
produces
the
equivalent of a photographic negative.
This type of processing is particularly suited
for enhancing white or grey detail
embedded in dark regions of an image, especially
when the black areas are dominant in
size.
3.2.2 Log
Transformations
The general from of the
log transformation is
s
?
c
log(1
?
r
p>
)
(3.2-2)
Where c is a
constant, and
it is assumed that r ≥0 .The shape of the log
curve
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
a
transformation
of
this
type
to
expand
the
values
of
dark
pixels
in
an
image while compressing the higher-
level values. The opposite is true of the inverse
log transformation.
Any
curve having the general shape of the log
functions would accomplish this
spreading/compressing
of
gray
levels
in
an
image.
In
fact,
the
power-
law
transformations discussed in the
next section are much more versatile for this
purpose
than the log transformation.
However, the log function has the important
characteristic
that
it
compresses
the
dynamic
range
of
image
characteristics
of
spectra.
It
is
not
unusual
to
encounter
spectrum
values
that
range
from
0
to
106
or
higher.
While
processing numbers such as these
presents no problems for a computer, image display
systems
generally
will
not
be
able
to
reproduce
faithfully
such
a
wide
range
of
intensity values .The net effect is
that a significant degree of detail will be lost
in the
display of a typical Fourier
spectrum.
3.2.3 Power-Law
Transformations
Power-Law
transformations have the basic from
s
p>
?
cr
?
(3.2-3)
Where c and y are positive
constants .Sometimes Eq. (3.2-3) is written as
to
account for an offset (that is, a
measurable output when the input is zero).
However,
offsets typically are an issue
of display calibration and as a result they are
normally
ignored in Eq. (3.2-3). Plots
of s versus r for various values of y are shown in
Fig.3.6.
As in the case of the log
transformation, power-law curves with fractional
values of y
map a narrow range of dark
input values into a wider range of output values,
with the
opposite being true for higher
values of input levels. Unlike the log function,
however,
we notice here a family of
possible transformation curves obtained simply by
varying
y.
As
expected,
we
see
in
Fig.3.6
that
curves
generated
with
values
of
y
>
1
have
exactly the opposite
effect as those generated with values of
y
<
1. Finally, we
note
that Eq.(3.2-3) reduces to the
identity transformation when c = y = 1.
A
variety
of
devices
used
for
image
capture,
printing,
and
display
respond
according to as gamma[hence our use of
this symbol in Eq.(3.2-3)].The process used
to correct this power-law response
phenomena is called gamma correction.
Gamma correction is important if
displaying an image accurately on a computer
screen is of concern. Images that are
not corrected properly can look either bleached
out,
or,
what
is
more
likely,
too
dark.
Trying
to
reproduce
colors
accurately
also
requires some knowledge
of gamma correction because varying the value of
gamma
correcting changes not only the
brightness, but also the ratios of red to green to
blue.
Gamma correction has become
increasingly important in the past few years, as
use of
digital
images
for
commercial
purposes
over
the
Internet
has
increased.
It
is
not
Internet has increased.
It is not unusual that images created for a
popular Web site will
be viewed by
millions of people, the majority of whom will have
different monitors
and/or monitor
settings. Some computer systems even have partial
gamma correction
built in. Also,
current image standards do not contain the value
of gamma with which
an image was
created, thus complicating the issue further.
Given these constraints, a
reasonable
approach when storing images in a Web site is to
preprocess the images
with a gamma that
represents in a Web site is to preprocess the
images with a gamma
that represents an
“average” of the types of monitors and computer
systems that one
expects in the open
market at any given point in time.
3.2.4 Piecewise-Linear Transformation
Functions
A
complementary
approach
to
the
methods
discussed
in
the
previous
three
sections
is
to
use
piecewise
linear
functions.
The
principal
advantage
of
piecewise
linear functions
over the types of functions we have discussed thus
far is that the form
of
piecewise
functions
can
be
arbitrarily
complex.
In
fact,
as
we
will
see
shortly,
a
practical
implementation
of some important
transformations can be formulated only
-
-
-
-
-
-
-
-
-
上一篇:小学六年级日记10篇
下一篇:si2302中文资料pdf