Lec 4 Image Processing
Lec 4 Image Processing
(CSC 352)
2022 – 2023
Lecture-4
Dr: Mary monir saied
Email: [email protected]
Digital Image Fundamentals
Image Enhancement
Fundamental Steps of DIP
3
Main points of Image Enhancement
Image
Enhancement
Spatial Frequency
domain Domain
4
Main points of Image Enhancement
Image
Enhancement
Spatial Frequency
domain Domain
Point Neighborhood
processing processing 5
Image Enhancement in the Spatial
Domain
6
Point Processing
Point
processing
Gray- Bit-
Linear Logarithmic Power-Law Contrast
level plane
Functions Functions Functions stretching
slicing slicing
Inverse-
Log
log
7
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Highlighting a specific range of intensities in an image. In other
words, we segment certain gray level regions from the rest of
the image.
Approach 1 Approach 2
9
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Approach 1
10
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Approach 1
Example: If the pixel intensity in the old image is between (100 200) convert it in
the new image into 255 (white). Otherwise convert it to 0 (black).
11
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Approach 2
In the second type, we brighten or darken the desired range of intensities(a to
b as shown below) and leave other intensities unchanged or vice versa. The
transformation function for both the cases, first where the desired range is
changed and second where it is unchanged, is shown below.
12
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Approach 2
Example: If the pixel intensity in the old image is between (100 200) convert it in
the new image into 255 (white). Otherwise it leaves it the same.
13
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Gray-level slicing(intensity-level slicing)
Example:
Apply intensity level slicing to following image, where:
a. If the intensity in the image is between (50 100) convert it in the new
image into 255 and preserve the background.
b. If the intensity in the image is between (50 100) convert it in the new
image into 255 , else convert it to 0.
Gray- Bit-
Linear Logarithmic Power-Law Contrast
level plane
Functions Functions Functions stretching
slicing slicing
Inverse-
Log
log
17
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Bit-plane Slicing
• Pixels are digital numbers, each one composed of 8
bits. Instead of highlighting gray-level range, we could
highlight the contribution made by each bit.
• This method is useful and used in image compression.
18
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Bit-plane Slicing
• Most significant bits contain the majority of visually
significant
19
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Bit-plane Slicing
20
Intensity Transformation Functions
2-piecewise Linear transformation functions.
• Bit-plane Slicing
[00000001] [00000010]
22
Point Processing
Point
processing
Gray- Bit-
Linear Logarithmic Power-Law Contrast
level plane
Functions Functions Functions stretching
slicing slicing
Inverse-
Log
log
23
Histogram Processing
24
Histogram Processing
25
Histogram Processing
26
Histogram Processing
- Histogram Equalization
•As the low-contrast image’s histogram is narrow and
centered toward the middle of the gray scale, if we
distribute the histogram to a wider range the quality of
the image will be improved.
27
Histogram Processing
- Histogram Equalization
28
Histogram Processing
29
Histogram Processing
- Histogram Equalization
30
Histogram Processing
- Histogram Equalization
31
Histogram Processing
- Histogram Equalization
• Example:
32
Histogram Processing
- Histogram Equalization
• 1-Calculate the histogram.
• 2-Calculate running sum over the histogram .
• 3-Divide each value by the max value
• 4-Multiply by the new range
• 5-Round the results
33
Histogram Processing
- Histogram Equalization
34
Histogram Processing
- Histogram Equalization
35
Histogram Processing
- Histogram Equalization
36
Histogram Processing
- Histogram Equalization
37
Point Processing
Point
processing
Gray- Bit-
Linear Logarithmic Power-Law Contrast
level plane
Functions Functions Functions stretching
slicing slicing
Inverse-
Log
log
38
Arithmetic Operation
Arithmetic operations
o Addition
o Subtraction
o Multiplication
39
Arithmetic Operation
Arithmetic operations
40
Arithmetic Operation
• Addition
Addition is used to combine the information in two images.
Or adding a constant value (scalar) to an image causes an
increase in its overall brightness.
41
Arithmetic Operation
• Addition
Addition is used to combine the information in two images.
42
Arithmetic Operation
• Addition
Addition is used to combine the information in two images.
43
Arithmetic Operation
• Addition
44
Arithmetic Operation
• Addition
45
Arithmetic Operation
• Addition (Brightness)
46
Arithmetic Operation
• Subtraction:
Subtraction of two images is often used to detect motion,
consider the case where nothing has changed in a scene; the
image resulting from subtraction of two sequential image is
filled with zero-a black image.
If something has moved in the scene, subtraction produces a
nonzero result at the location of movement.
Subtraction process also used to detect the defects in the
images.
Applications include Object tracking , Medical imaging.
48
Arithmetic Operation
• Subtraction:
The subtraction of two images is used for example to detect changes
49
Arithmetic Operation
• Subtraction:
50
Arithmetic Operation
• Subtraction:
51
Arithmetic Operation
• Subtraction:
52
Arithmetic Operation
• Multiplication:
53
Thank You
54