Lecture 4
Key Stages in Digital Image Processing
Chapter 2
Image Enhancement
Point processing operations:
1. Arithmetic operations
2- Color Images Operations
3- Multiple Image Operations
4- Contrast
2- Color Images Operations
• Possible channel operations:
– Changing the image lighting color.
– Swapping image channels.
– Eliminating color channels.
Color Images Operations
Cont …,
1- Changing the image lighting color
To change the intensity of one or more channel by adding or
subtracting a constant C.
– R + C => the image will be reddish
– G + C => the image will be greenish
– B + C => the image will be bluish
– R,G + C => the image will be yellowish
Cont …,
Cont …,
2- Swapping image channels
To exchange the intensity between the image channels.
R , G => the image will be GRB
G , B => the image will be RBG
B , R => the image will be BGR
Other spaces could be obtained by swapping 2 channels
at once like; GBR and BRG.
Cont …,
Cont …,
3- Eliminating color channels
To set one or more color channels by zero values.
• Eliminating R => image will be in cyan
• Eliminating G => image will be in magenta
• Eliminating B => image will be in yellow
• Eliminating R,G => image will be in blue
• Eliminating G,B => image will be in red
• Eliminating B,R => image will be in green
Cont …,
Point processing operations:
1. Arithmetic operations
2- Color Images Operations
3- Multiple Image Operations
4- Contrast
3- Multiple Image Operations
• Perform operations between two images or more
for:
– Enhance the image visual appear.
– Getting specific part of image between similar
images.(eg. motion tracking)
– For some preprocessing purposes.
Cont …,
• Assume two images x1 and x2: the possible operations
between x1 and x2:
Example
16
Example
• Image 1
Image 1 Image 2 Image 1 – image 2
17
Example
Background Subtraction (video)
Background Subtraction (video)
average
Background Subtraction
Image Histogram
It is a graph indicating the number of times each
grey level occurs in the image.
• An image histogram is a type of histogram that acts as
a graphical representation of the tonal distribution in a digital
image. It plots the number of pixels for each tonal value. By
looking at the histogram for a specific image a viewer will be
able to judge the entire tonal distribution at a glance.
• Image histograms are present on many modern services.
Photographers can use them as an aid to show the
distribution of tones captured, and whether image detail has
been lost to blown-out highlights or blacked-out
shadows. This is less useful when using a raw image format,
as the dynamic range of the displayed image may only be an
approximation to that in the raw file.
24
• The horizontal axis of the graph represents the tonal
variations, while the vertical axis represents the total number
of pixels in that particular tone.
• The left side of the horizontal axis represents the dark areas,
the middle represents mid-tone values and the right hand
side represents light areas. The vertical axis represents the
size of the area (total number of pixels) that is captured in
each one of these zones.
• Thus, the histogram for a very dark image will have most of its
data points on the left side and center of the graph.
Conversely, the histogram for a very bright image with few
dark areas and/or shadows will have most of its data points
on the right side and center of the graph.
25
Color Image Histogram
4 5
x 10 x 10
9 9000 3.5
8 8000
3
7 7000
2.5
6 6000
2
5 5000
4 4000
1.5
3 3000
1
2 2000
0.5
1 1000
0 0 0
0 50 100 150 200 250 300 0 50 100 150 200 250 300 0 50 100 150 200 250 300
Color Image Histogram
4 4
x 10 x 10
10 12000 2.5
10000
8 2
7
8000
6 1.5
5 6000
4 1
4000
3
2 0.5
2000
0 0 0
0 50 100 150 200 250 300 0 50 100 150 200 250 300 0 50 100 150 200 250 300
Color Image Histogram
4 5 5
x 10 x 10 x 10
10 3 3.5
9
3
2.5
8
2.5
7
2
6
2
5 1.5
1.5
4
1
3
1
2
0.5
0.5
1
0 0 0
0 50 100 150 200 250 300 0 50 100 150 200 250 300 0 50 100 150 200 250 300
Why Histogram?
• To know image features:
– Most color(intensity) in the image
– Image Contrast
– Image Brightness
–…
• For segmentation purpose
– A threshold can be used to segment the image
into parts.
Histogram contrast features
In a dark image, the grey levels (and hence the
histogram) would be clustered at the lower end.
In a uniformly bright image, the grey levels would be
clustered at the upper end.
In a well contrasted image, the grey levels would be
well spread out over much of the range.
Test
• Draw down the histogram of this image
• Then describe the image histogram from your
opinion?
Thank You!