Lecture 05 2
Lecture 05 2
• Definitions:
• q is in N4(p) or
• q is in ND(p) and the set N4(p)N4(q) has no pixels with values
from V
Adjacency
0 1 1 0 1 1 0 1 1
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1
Adjacency
• Euclidean distance:
– D8(p,q) = max(|x-s|,|y-t|)
– Forms a square centered at p
– e.g. pixels with D8≤2 from p
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2 D8 = 1 are the 8-neighbors
2 1 1 1 2 of p
2 2 2 2 2
Distance Measures
Original Negative
s = 1.0 - r
Image Image
Point Processing Example: Negative Images
(cont…)
Original Image Enhanced Image x
x
s = intensitymax - r
Point Processing Example: Thresholding
1.0 r >
s=
threshold
0.0 r <= threshold
Intensity Transformations
Basic Grey Level Transformations
•There are many different kinds of grey level transformations
• Three of the most
common are shown
here
– Linear
• Negative/
Identity
– Logarithmic
• Log/
Inverse
log
– Power law
• nth
power/nth
root
Basic Grey Level Transformations
Logarithmic Transformations
•The general form of the log transformation is
• s = c * log(1 + r)
• The log transformation maps a narrow range
of low input grey level (Darker regions) values into
a wider range of output values
• The inverse log transformation performs the
opposite transformation
•Log transformation is a non-linear image processing
technique
Logarithmic Transformations
0.
7
0.
tensities
6
0.
5
0.
40 0.2 0.4 0.6 1
0.8
0.
3 Old Intensities
0.
2
0.
1
0
Power Law Example (cont…)
γ = 0.4
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original
Intensities
Power Law Example (cont…)
γ = 0.3
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original
Intensities
Power Law Example (cont…)
• The images
to the right show a s = r 0.6
magnetic resonance
(MR) image of a
fractured human
s = r 0.4
spine
• Different
curves highlight
different detail
Power Law Example
Power Law Example (cont…)
γ = 5.0
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original
Intensities
Power Law Transformations (cont…)
•An aerial photo
of a runway is
shown s = r 3.0
•This time
power law
transforms are
s = r 4.0
used to darken
the image
•Different curves
highlight
different detail
Piecewise Linear Transformation Functions
1.Contrast Stretching
2.Gray Level Slicing
3.Bit Plane Slicing
Contrast Stretching
Increase the dynamic range
of the gray levels in the
image
(b) a low-contrast image :
result from poor
illumination, lack of dynamic
range in the imaging sensor,
or even wrong setting of a
lens aperture of image
acquisition
(c) result of contrast
stretching: (r1,s1) = (rmin,0)
and (r2,s2) = (rmax,L-1)
(d) result of thresholding
Gray-level slicing Highlighting a specific
range of gray levels in an
image
Display a high value
of all gray levels in
the range of
interest and a low
value for all other
gray levels
Transformation highlights
range [A,B] of gray level
and reduces all others to
a constant level
Transformation highlights
range [A,B] but preserves
all other levels
Gray Level Slicing
•Highlights a specific range of grey
levels
– Similar to thresholding
– Other levels can be
suppressed or maintained
– Useful for highlighting features
in an image
Bit-plane slicing
45
8 bit planes
Bit-plane 7 Bit-plane 6
47
Bit Plane Slicing
• Often by isolating particular bits of the pixel values
in an image we can highlight interesting aspects of that
image
– Higher-order bits usually contain most of the significant
visual information
– Lower-order bits contain
subtle details
Bit Plane Slicing (cont…)
[10000000] [01000000]
[00100000] [00001000]
[00000100] [00000001]
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Bit Plane Slicing (cont…)
Reconstruct
ed image
Bit Plane Slicing (cont…) using only
bit planes 8
and 7
Reconstructed
image using
only bit planes
8, 7
and 6
Reconstructed
image using
only bit planes
7, 6
and 5
Home Work (Compete Two Cases)
Home Work (Cases 1 When c=1)
Home Work (Cases 2)