8/4/2019 DigitalImageProcessing14-Color Image Processing 2
1/61
Digital Image Processing
Color Image Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
2/61
2
of
62Contents
Full-color processing
Color transformations
Smoothing and sharpening
Color segmentation
Noise in Color Image
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
3/61
3
of
62
A full color image has a vector at each pixel. For colour
images, these vectors each have 3 or 4 components.
There are two Categories to process vectorial images:
First Category Process each component image individually
Form a composite processed color image
Second Category
Work with color pixel directly.
Color pixels are vectors.
Full Color Image Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
4/61
4
of
62
Scalar process.
Red
Scalar process.Green
Scalar process.Blue
Red
Green
Blue
Marginal Processing
Each channel is processed separately:
Full Color Image Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
5/61
5
of
62
Red
Green
Blue
Vectorialprocess.
Red
Green
Blue
The colour triplets are processed as single units:
Full Color Image Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
6/61
6
of
62Full Color Image Processing
For example: in RGB system, each color point can beinterpreted as a vector extending from the origin to that point in
the RGB coordinate system.
For an image with size M*N, there are MN such vectors.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
7/61
7
of
62
In order for per-color-component and vector basedprocessing to be equivalent:
1 The process has to be applicable to both vectors andscalars
2 the operation on each component of a vector must beindependent of other components.
In order for per-color-component and vector basedprocessing to be equivalent:
1 The process has to be applicable to both vectors andscalars
2 the operation on each component of a vector must beindependent of other components.For example Neighborhood averaging
per-color-component processing = vector based processing
For example Neighborhood averaging
per-color-component processing = vector based processing
Full Color Image Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
8/61
8
of
62Color Transformation
Different with gray level: pixel values are triplets or quartets.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
9/61
9
of
62
For example:
RGB color space
n=3, r1,r2, r3 denote the red, green, blue
CMYK or HSI space are chosen,
n=4 or n=3
Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
10/61
10
of
62Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
11/61
11
of
62
Remarks
Any transformation can be performed in any color
model.
Actually, some operations are better suited to
specific models.
Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
12/61
12
of
62Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
13/61
13
of
62Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
14/61
14
of
62
Si=kri Si=k ri +1-k S3=kr3=k*I
Color Transformation
Wrong in text book.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
15/61
15
of
62
HSI transformation involves the fewest number ofoperations.
But the computations required to convert an RGB or
CMYK image to HSI space more than offsets theadvantages of the simpler transformation.
Regardless of the color space selected, the output is
the same.
Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
16/61
16
of
62
Reducing the red color plane by 50
levels moves the color balance
towards cyan.
Reducing the green color plane by
50 levels moves the color balance
towards magenta.
Reducing the blue color plane by 50levels moves the color balance
towards yellow
Color Transformation
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
17/61
17
of
62Color Complements
Same as gray level
negative.
Color complements are
useful for enhancing detail
that is embedded in dark
regions of a color image
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
18/61
18
of
62Color Complements
Note: have no corresponding
functions in HSI space in color
complements.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
19/61
19
of
62
Highlighting a specific range of colors
Separating objects from their surrounds.
Basic idea
Display the colors of interest
Use the regions defined by the colors as a maskfor further processing.
More complicated than gray-level counterpartsRequire each pixels transformed color components
to be a function of all n original pixels colorcomponents.
Color Slicing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
20/61
20
of
62Color Slicing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
21/61
21
of
62Color Slicing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
22/61
22
of
62
Most Common UsesPhoto enhancement
Color reproduction.
Consistent: since these transformations are developed,
refined, and evaluated on monitors, it is necessary to maintainhigh color consistency between monitor and output devices.
Device-Independent Color Model.
Tone and Color Corrections
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
23/61
23
of
62Tone and Color Corrections
The principle of calibrated
imaging systems is that they
allow tonal and color
imbalances to be corrected
interactively and
independently. That is, in two
sequential operations.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
24/61
24
of
62Tone and Color Corrections
Notes: every action
affects the overall colorbalance of the image.
That is the perception of
one color is affected by
its surrounding colors.
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
25/61
25
of
62
Application Examples: Face and tongue diagnosis
Image
capture
Color
CorrectionSegmentation
Feature
Extraction1 1 1 2 1
2 1 2 2 2
1 2
.. .
.. .
... ... ... ...
.. .
n
n
m m m n
a a a
a a a
a a a
Classification
Data Base
Results!
Tone and Color Corrections
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
26/61
26
of
62
Correction
Model
Tone and Color Corrections
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
27/61
27
of
62
CIE L*a*b* CIELAB Model: Device independent L*: Lightness
a* b*: Color, a* represent red minus green, and b* forgreen minus blue
Tone and Color Corrections
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
28/61
28
of
62
After
correction
Tone and Color CorrectionsTone and Color Corrections
Before
correction
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
29/61
29
of
62
Automated way, and very efficient in Gray image
processing.
Unwise to histogram equalize the components of a color
image independently.
Lead to erroneous color.
A more logical approach
Spread the colorintensities uniformly
Leaving the colors themselves (e.g Hue) unchanged.
Histogram Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
30/61
30
of
62Histogram Processing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
31/61
31
of
62
Modify value based on the characteristics of the
surrounding pixels.
Smoothing
Sharpening
Color image smoothing
Gray image: Each pixel is replaced by the average of thepixels in the neighborhood defined by the mask.
Deal with component vectors.
Smoothing and Sharpening
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
32/61
32
of
62
=
=9
99
9
i
izR
1/91/9
1/9
1/91/9
1/9
1/91/9
1/9
Color Image Smoothing
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
33/61
33
of
62Color Image Smoothing
Note: The results is
the same whensmoothing each
plane of starting
RBG image using
conventional gray
scale neighborhood
processing.
34
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
34/61
34
of
62Color Image Smoothing
Filtered by
5*5
averaging
mask
35
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
35/61
35
of
62Color Image Smoothing
Smoothing intensity
component only
36
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
36/61
36
of
62Color Image Smoothing
37
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
37/61
37
of
62
RGB smoothingRGB smoothingI smoothingI smoothing
HIS smoothing
Wrong!
HIS smoothing
Wrong!
Color Image Smoothing
38
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
38/61
38
of
62Color Image Sharpening
),1(),1([),( yxfyxfyxf ++=
)1,()1,( +++ yxfyxf )],(4 yxf
fyxfyxg 2),(),( =
),1(),1(),(5 yxfyxfyxf +=
)1,()1,( + yxfyxf 39
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
39/61
39
of
62Color Image Sharpening
0 -1 0-1 5 -1
0 -1 0Sharpening in RGB Sharpening in HIS-Intensity
40
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
40/61
40
of
62
Segmentation: Partition an image into regions
Segmentation in HSI Color Space
Segmentation in RGB Vector Space
Color Edge Detection
Color Segmentation
41
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
41/61
41
of
62
Segment an image based on color in HSI space:
Color is conveniently represent in the hue
image.
Saturation is used as a masking image inorder to isolate further regions of interest in
the hue image.
Intensity infrequently used for segmentation,
Since it carries no color information.
Segmentation in HSI Space
42
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
42/61
42
of
62
Thresholding the
Saturating image with
a threshold equal to10% of the maximum
value in the
saturation image.
Segmentation in HSI Space
Region of interest
43
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
43/61
43
of
62
Segmentation in RGB Space
HSI Space: more intuitive.
RGB: better results.
Objective: Segment objects of a specified color range in an
RGB image.
Given a set of sample color points representative of thecolors of interest.
An estimate of the averagecolor that we wish to segment.
Segmentation in RGB Space
44
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
44/61
44
of
62Segmentation in RGB Space
9),( DazD
45
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
45/61
45
of
62
Generalization:
Segmentation in RGB Space
Where C is the covariance matrix of the samples
representative of the color we wish to segment. WhenC=I, it is as the described in the preceding page.
9),( DazD
46
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
46/61
46
of
62Segmentation in RGB Space
However, implementing of last two methods iscomputationally expensive for images of practical size,
even if the square roots are not computed.A compromise is to use a bounding box.
Given an arbitrary color point, we segment it bydetermining whether or not it is on the surface or inside the
box.
47
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
47/61
47
of
62
Select sample by rectangularregion
compute its mean vector
a
Compute standard deviation
r g9 bGet box:
ar- 1.25r ~ ar+ 1.25r
ag- 1.25g ~ ag+ 1.25g
ab- 1.25b ~ ab+ 1.25b
Codin 1in the box
Segmentation in RGB Space
48
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
48/61
48
of
62Segmentation in RGB Space
Segmentation results in RGB space Segmentation results in HSI space
49
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
49/61
49
of
62
An important tool for image segmentation.
Computing edges on an individual-image basis
Vs.
Computing edges in color vector space.
Edge detection
Gradient operators.
Color Edge Detection
50
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
50/61
50
of
62Color Edge Detection
Consider two M*M images (M is odd), considering the gradient
value at point [(M+1)/2, (M+1)/2]
51
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
51/61
51
of
62Color Edge Detection
52
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
52/61
52
of
62Color Edge Detection
53
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
53/61
of
62Color Edge Detection
Represented by Di Zenzo in 1986
54
C
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
54/61
of
62Color Edge Detection
Obtain by
vector
method
Obtain by
add three
RGB
gradient
components
Thedifference
55
C l Ed D i
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
55/61
of
62Color Edge Detection
56
N i i C l I
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
56/61
of
62
The noise content of a color image
The same characteristics in each color channel
For color channels to be affected differently by noise.
The relative strength of illumination: Red filter in a
CCD camera
CCD sensors are noisier at lower levels ofillumination.
Noise in Color Images
57
N i i C l I
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
57/61
of
62Noise in Color Images
Take a brief look at noise in color images and how noise carries
over when converting from one color model to another.
Noise is fine grain
noise such as thistends to be less
visually noticeable in a
color image than it is in
a monochrome image.
58
N i i C l I
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
58/61
of
62Noise in Color Images
HSI
With noise
HSI
No noise
59
N i i C l I
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
59/61
of
62Noise in Color Images
Note:
Hue and saturation components of
noisy image are significantly
degraded.This is due to the nonlinearity of
the cos and min operations in theRGB to HIS transformation
On the other hand, the intensity
component is slightly smoother than
any to the three noisy RGBcomponent images.Regarding the fact that image
averaging reduces random noise.
( ) ( )[ ]
( ) ( ) ( )[ ]
( )[ ]
( )BGRI
BGRBGR
S
BGBRGR
BRGR
with
GBif
GBifH
++=
++=
+
+=
>
=
3
1
),,min(1
1
cos
360
212
21
1
60
N i i C l I
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
60/61
of
62Noise in Color Images
61
S
8/4/2019 DigitalImageProcessing14-Color Image Processing 2
61/61
of
62Summary
In this lecture we have learned:Color Fundaments
Color Model
Pseudo-color processingFull-color transformation
Smoothing and Sharpening
Color SlicingNoise in color images
Next we will look at Representation &