Title: CSC 381/481 Quarter: Fall
1CSC 381/481 Quarter Fall 03/04
- Daniela Stan Raicu
- Email draicu_at_cs.depaul.edu
- Homepage http//facweb.cs.depaul.edu/dstan
- School of CTI, DePaul University
2Outline
- Chapter 3 Image Enhancement in the Spatial
Domain - Introduction (Section 3.1)
- Enhancement by point processing (Section 3.2)
- Image negatives
- Log transformations
- Power-law transformations
- Piecewise-linear transformations
- Histogram Processing (Section 3.3)
- Final Projects discussion
3Introduction
- Image Enhancement procedures are techniques used
to achieve a subjective improvement in image
quality for a specific application
(problem-oriented). - Typical applications
- noise removal
- geometric correction
- smoothing
- sharpening
- edge enhancement or extraction.
- Usually ad hoc procedures.
- Image Enhancement
- in the Spatial Domain (pixel operators)
- the Frequency Domain (frequency filtering).
4Spatial Domain Methods
- Procedures that operate directly on the
aggregate/neighborhood of pixels composing an
image - A neighborhood about (x,y) is defined by using a
square (or rectangular) subimage area centered at
(x,y).
5Spatial Domain Methods
- When the neighborhood is 1 x 1 then g depends
only on the value of f at (x,y) and T becomes a
gray-level transformation (also called an
intensity or mapping) function - sT(r)
- r,s gray levels of f(x,y) and g(x,y) at any
point (x,y) - r denotes the pixel intensity before processing
- s denotes the pixel intensity after processing.
- These intensity transformations are also called
point processing techniques.
6Enhancement by Point Processing
- The following methods are based only on the
intensity of single pixels. - Image negatives
- Log transformations
- Power-law transformations
- Piecewise-Linear Transformation Functions
- Contrast stretching
- Gray-level slicing
- Bit-plane slicing
7Image Enhancement in the Spatial Domain
Linear Negative, Identity Logarithmic Log,
Inverse Log Power-Law nth power, nth root
8Image Negatives
- Are obtained by using the transformation function
sT(r). - Function T reverses the order from black to white
so that the intensity of the output image
decreases as the intensity of the input increases.
0,L-1 the range of gray levels S L-1-r
9Image Enhancement in the Spatial Domain
Medical applications much easier to analyze the
breast tissue in the negative image
10Log Transformations
- s c log(1r)
- c constant, r gt0
- Compresses the dynamic range of images with large
variations in pixel values
11Piecewise-Linear Transformation Functions
Contrast Stretching
- To increase the dynamic range of the gray levels
in the image being processed.
12Contrast Stretching
- The locations of (r1,s1) and (r2,s2) control the
shape of the transformation function. - If r1 s1 and r2 s2 the transformation is a
linear function and produces no changes. - If r1r2, s10 and s2L-1, the transformation
becomes a thresholding function that creates a
binary image.
13Image Enhancement in the Spatial Domain
Contrast Stretching
Thresholding
14Contrast Stretching
- More on function shapes
- Intermediate values of (r1,s1) and (r2,s2)
produce various degrees of spread in the gray
levels of the output image, thus affecting its
contrast. - Generally, r1r2 and s1s2 is assumed.
15Image Enhancement in the Spatial Domain
Low contrast image
High contrast image
16Spatial Domain Methods
- Mask processing or filtering when the values of
f in a predefined neighborhood of (x,y) determine
the value of g at (x,y). - Through the use of masks (or kernels, templates,
or windows, or filters). - More in the next lecture when we discuss about
Basics of Spatial filtering (Section 3.5)
17Example of the use of a mask
Step 1 Move the window to the first location
where we want to compute the average
value and then select only pixels
inside the window.
Step 2 Compute the average value
Sub image p
Step 3 Place the result at the pixel in the
output image
Original image
4.3
Step 4 Move the window to the next
location and go to Step 2
Output image
18Histogram Processing
- The histogram of a digital image with gray levels
from 0 to L-1 is a discrete function h(rk)nk,
where - rk is the kth gray level
- nk is the pixels in the image with that gray
level - n is the total number of pixels in the image
- k 0, 1, 2, , L-1
- Normalized histogram p(rk)nk/n
- sum of all components 1
To visualize the histogram of a digital image, we
plot pr(rk) versus rk
19Image Enhancement in the Spatial Domain
The shape of the histogram of an image does
provide useful info about the possibility for
contrast enhancement.
20Types of Histogram Processing
- Histogram equalization
- Histogram matching (specification)
- Local enhancement
21Histogram Equalization
- As mentioned above, for gray levels that take on
discrete values, we deal with probabilities - pr(rk)nk/n, k0,1,.., L-1
- The plot of pr(rk) versus rk is called a
histogram and the technique used for obtaining a
uniform histogram is known as histogram
equalization (or histogram linearization).
22Histogram Equalization (HE)
- The technique used for obtaining a uniform
histogram - is known as histogram equalization (or histogram
linearization).
where pr(rk)nk/n, k0,1,.., L-1
- Histogram equalization(HE) results are similar to
contrast stretching but offer the advantage of
full automation, since HE automatically
determines a transformation function to produce a
new image with a uniform histogram.
23(No Transcript)
24Local Enhancement
- When it is necessary to enhance details over
smaller areas, then we need to devise
transformation functions based on the gray-level
distribution in the neighborhood of every pixel
The procedure is 1. Define a square (or
rectangular) neighborhood and move the center of
this area from pixel to pixel. 2. At each
location, the histogram of the points in the
neighborhood is computed and either a histogram
equalization or histogram specification
transformation function is obtained. 3. This
function is finally used to map the gray level of
the pixel centered in the neighborhood. The
center is then moved to an adjacent pixel
location and the procedure is repeated.