Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
OutlineMotivation and Color Fundamentals
Standard Color Models (RGB/CMYK/HSI)
Demosaicing and Color Filtering
Pseudo-color and Full-color Image Processing
Color Transformation
Tone and Color Corrections
Color Image Smoothing, Sharpening, Segmentation, Edge detection, and Denoising
Assignments
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
MotivationColor is a powerful descriptors that simplifies feature extraction
and object identification from a sceneHVS is sensitive to thousands of color shades or intensities
instead of two dozens of shades of gray Basics
Color spectrum of visible light has six broad regions, viz., Violet, Blue, Green, Yellow, Orange, and Red (ViBGYOR)
Achromatic light is void of color. Chromatic light spans electromagnetic spectrum from 400 nm to 700 nm.
Radiance is the amount of light energy radiates from light source in Watts. Luminance is the energy perceives by viewer in Lumen. Infrared spectrum may have significant radiance but zero luminance
Brightness is a subjective measure, depends on the reflectance or absorption characteristics of the observed body
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color Spectrum
Color spectrum of white light passing through a prism. Experimented by Sir Isaac Newton in 1666
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Absorption Characteristics
65% cones are sensitive to Red
33% cones are for Green
2% cones are for Blue, but very sensitive!
Absorption characteristics experimented in 1965.
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Primary and Secondary ColorsIn 1931, CIE (Commission Internationale de l’Ecairage –
International Commission on Illumination) designated three primary color : Blue = 435.8 nm, Green = 546.1 nm, and Red = 700 nm long before absorption characteristics are obtained.
Additive mixing of primary color lights provides secondary color of lights: Magenta= Red+Blue, Cyan= Green+Blue, Yellow=Red+Green.
Additive mixing primary color lights is used as principle of modern display devices. CRT (cathode ray tube) uses electron sensitive phosphor. LCD (liquid crystal displays) uses thin filmtransistors (TFTs) to block or pass polarized light. In plasma units pixels are tiny gas cells coated with phosphor.
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pigments act like subtractive colors, and hence mixtures of pigments provide common primary color of light. For example, Magenta and Yellow provides Red color.
Primary and Secondary Colors
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Characteristics of ColorBrightness – Achromatic notion of intensity.
Hue – Dominant wavelength in the mixture of light waves, i.e., dominant color perceived by observer, say, Red
Saturation – Relative purity or the amount of white light mixed with a hue. For example, pink (red+white) and lavendar(violet+white) are saturated. Degree of saturation is inversely proportional to the amount of white light.
Chromaticity – Hue and saturation together is the chromaticity.
Any color is specified a combination of tristimulus values denotes as X (Red), Y (Green), and Z (Blue)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Characteristics of ColorA color is thus specified by trichromatic coefficients
1
; ;
=++∴++
=++
=++
=
zyxZYX
zzZYX
YyZYX
Xx
CIE chromaticity diagram – For a given value of x (red) and y (green), a corresponding value of z=1-(x+y), i.e., blue is obtainedA color is thus specified by trichromatic coefficients
Any triangle inside chromaticity diagram shows all possible colors which may be obtained mixing only three distinct wavelength primary electromagnetic waves.
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Chromaticity Diagram
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color Gamuts
CRT Display
Printing
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
RGB Color ModelColor space in terms of three primary colors of light, viz. Red,
Green, and Blue
Hardware oriented models, e.g., monitors, video camera, internet etc.
Number of bits used to represent a pixel is called pixel-depth. For a 8-bit image one needs 24 bits in color space
Coordinate24-bit color cube
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
RGB Color Model
Acquiring the RGB image in the reverse process shown
Three hidden planes in the cube
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Safe RGB ColorsIn practice, only 216
colors known as all-system safe colors are used in the internet and represented by two hexadecimal numbers for each color
safe color cube
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
CMY/CMYK Color ModelColor space in terms of the primary colors of pigment, viz.
Cyan, Magenta, Yellow, or Black
Printer or copier those use pigments on paper considers this model. ‘Four-color printing’ refers to CMYK model
Conversion of RGB and CMY model:
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
BGR
YMC
111
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
HSI Color ModelColor space in terms of its Hue, Saturation and
Brightness
The model is used for interpretation of human understanding of colors
This model is used for image processing.
The model decouples the intensity component from the color descriptors
It is known that Hue – purity of color
It is also known that Saturation – degree of pure color (diluted with white color)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
HSI and RGB Color ModelIntensity of HSI space is the projection of a point on the
vertical line (connected line between black and white, called intensity axis) shown in the RGB space
Locus of the color points lie on the plane perpendicular to theintensity axis.
Conceptual model in HSI
space
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Hue/Saturation in HSI ModelThe color vector perpendicular to the intensity axis creates a
triangular or hexagonal shape with the boundaries of the cube or circular shape inside the cube.
The saturation is the length of the color vector. Hue is the angle of the vector.
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Hue/Saturation in HSI Model
Hue and saturation in the triangular or circular color planes
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
RGB to HSI Model
⎩⎨⎧
>≤
=GBGB
H if360 if
0
θHue
( ) ( )[ ]( ) ( )( )[ ] ⎪⎭
⎪⎬⎫
⎪⎩
⎪⎨⎧
−−+−
−+−= −
212
21
1coswith BGBRGR
BRGRθ
( ) { }[ ]BGRBGR
S ,,min31++
−=Saturation
( )BGRI ++=31
Intensity
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
HSI to RGB Model
( ) ( ) ( )BRI-; GH
HSI; RSIB +=⎥⎦
⎤⎢⎣
⎡−
+=−= 360coscos11 0
RG Sector ( )00 1200 <≤ H
GB Sector ( )00 240120 <≤ H
BR Sector ( )00 360240 ≤≤ H
( ) ( ) ( )GRI-; BH
HSI; GSIR +=⎥⎦
⎤⎢⎣
⎡−
+=−= 360coscos11 0
( ) ( ) ( )BRI-; RH
HSI; BSIG +=⎥⎦
⎤⎢⎣
⎡−
+=−= 360coscos11 0
0120−= HH
0240−= HH
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
(a) (b) (c) (d)
Components of HSI Model
(a) Original RGB image. The component images are (b) Hue (c) Saturation (d) Intensity
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Image DemosaicingDemosaicing is a process of obtaining a full color image from
incomplete color samples
A single image sensor associated with the color filter array (CFA) performs the demosaicing
A digital camera may store the raw data so that user-defined software for CFA may be chosen instead of built-in firmware.
Problems of image demosaicing includes chromatic aliases, zippering (abrupt change in intensity), and purple fringing.
Most commonly used CFA for demosaicing is the ‘Bayer Filter’.
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Bayer Filter
CFA on pixel array of image sensor
‘Bayer Filter’ has alternating Red (R) and Green (G) filters in odd rows and alternating Blue (B) and Green (G) filters in the even rows.
Green filters are twice since HVS is widely sensitive to Green color!
Optical anti-aliasing filter is used between sensor and lens.
Image due to CFA
Original Reconstructed (Adobe)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pseudocolor Image Processing
Geometric interpretation
In intensity slicing, a set of intensity levels are coded with a particular color
Functional diagram
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Intensity SlicingMonochrome is
color coded
Two colors
Eight colors
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Intensity SlicingMonochrome is color coded for SAR images
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pseudo-color ProcessingPseudo-color enhancement by gray level to color transformation
Explosive detection
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pseudo-color ProcessingTwo gray level transformation
functions for detection of explosives in a luggage in a typical airport
Functional diagram
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pseudo-color ProcessingPseudo-color enhancement
of multispectral images
(a) (b) (c) (d) (e) (f)
(a)-(d) Images of four bands. (e) First three are treated as RGB components (f) Infrared image is shown in red
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Pseudo-color Processing
Pseudo-color enhancement in terms of material deposition, e.g., sulfur content shown in yellow for Jupiter moon Io
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Full-color ProcessingFull-color processing uses independent mask processing of
individual RGB components
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Full-color Processing
Components for full color processing in different color spaces
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color TransformationGeneral transformation ( )nii rrrTs ,,, 21 L=
For RGB or CMY or HSI 3=nFor CMYK 4=n
Color mapping
HSI ( ) 221133 10 rsrskkrs ==<<=
RGB ( ) 3,2,1 10 =<<= ikkrs ii
CMY ( ) 3,2,1 10 )1( =<<−+= ikkkrs ii
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color Transformation
Intensity reduction by 33% in three different color spaces using full-color processing
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color Complements
Hues directly opposite to color circle are called color complements
Complements are used to generate color film negatives
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color Complements (a) (b) (c) (d)
(a) Original image (b) Transformation functions for generating complements (c) Resultant image for RGB space (d) Resultant image for HSI space
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color SlicingSelection of a color using a hypercube in a color space
Red color in the RGB space using two different set of cubes
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Tone and Color CorrectionsDigital darkroom – Allows tone adjustment and color
corrections digitally by avoiding traditional wet processing
Most common use are photo enhancement and color reproduction in the printing media and compression
For adjustment or corrections device-independent color model should be used
Many color management system (CMS) consider the CIE
or simply CIELAB model
CIELAB is proposed in 1976*** baL
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
CIELAB ModelThe color components are *** baL
⎥⎦
⎤⎢⎣
⎡⎟⎟⎠
⎞⎜⎜⎝
⎛−⎟⎟
⎠
⎞⎜⎜⎝
⎛=
⎥⎦
⎤⎢⎣
⎡⎟⎟⎠
⎞⎜⎜⎝
⎛−⎟⎟
⎠
⎞⎜⎜⎝
⎛=
−⎟⎟⎠
⎞⎜⎜⎝
⎛⋅=
WW
WW
W
ZZh
YYhb*
YYh
XXha
YYhL
200
500*
16116*
( )⎪⎩
⎪⎨⎧
≤+>
=008856.0116
16787.7008856.03
qqqq
qhwhere
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
CIELAB ModelThe are the reference white tristimulus
values of a perfectly reflecting diffuser under CIE standard D65illumination, which is defined as x=0.3127 and y=0.3290 in the CIE chromaticity diagram
WWW ZYX ,,
Colormetric – Colors perceived as matching are encoded identically.
Uniform perceptuality – Color differences among various hues are perceived uniformly
Device independent and gamut encompasses the entire visible spectrum
Transformation to another color space is common
Features of color space *** baL
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
CIELAB Model
Transformation to another color space is necessary
Excellent decoupler of intensity and color for Red-Green and for Green-Blue
Tonal adjustment and color corrections are done independently and interactively (in other words sequentially)
Three common tonal ranges (or key types) are (i) High-key (colors at high intensities) (ii) Low-key (colors at low intensities) (iii) Middle-key (lie in between high and low-keys)
Intensites should be uniform in colors or shadows
Other features of color space *** baL
*L *a*b
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Tonal TransformationTonal or contrast
correction and corresponding transformation function in RGB color space
Middle- Key
High- Key
Low- Key
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Color TransformationColor balancing
correction and corresponding transformation function in CMYK color space
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Histogram ProcessingHistogram equalization
followed by saturation adjustment in HSI color space
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Processing of Color Image
RGB Components
HSI Components
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Smoothing of Color Image(a) (b) (c)
Image smoothing by 5×5 averaging mask using (a) RGB components and (b) Intensity component of HSI space. (c) Absolute difference between (a) and (b)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Sharpening of Color Image(a) (b) (c)
Image sharpening by Laplacian using (a) RGB components and (b) Intensity component of HSI space. (c) Absolute difference between (a) and (b)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Segmentation of Color ImageApproaches for enclosing data regions for RGB vector
segmentation
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Segmentation of Color Image(a) (b)(a) Original RGB image (b)
Segmented region of red color from the image
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Gradient of Color ImageGradient of color image
yB
xB
yG
xG
yR
xRg
yB
yG
yRg
xB
xG
xRg
xy
yy
xx
∂∂
∂∂
+∂∂
∂∂
+∂∂
∂∂
=
∂∂
+∂∂
+∂∂
=
∂∂
+∂∂
+∂∂
=
222
222
Maximum rate of change would be at
( )⎥⎥⎦
⎤
⎢⎢⎣
⎡
−= −
yyxx
xy
ggg
yx2
tan21, 1θ
The maximum gradient would be
( ) ( ) ( ) ( ) ( ){ } 21
,2sin2,2cos21, ⎥⎦
⎤⎢⎣⎡ +−++= yxgyxggggyxF xyyyxxyyxx θθθ
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Gradient of Color Image
(a) (b) (c) (d)
(a) Original color image (b) Color gradient (c) Added result of individual gradients of RGB components (d) Absolute difference between (b) and (c)
Individual gradients of RGB components
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Noisy Color Image
(a) Red (b) Green (c) Blue components of RGB color space for AWGN (d) Noisy color image
(a) (b) (c) (d)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
Noisy Color Image
(a) Hue (b) Saturation (c) Intensity components of HSI color image for AWGN
(a) (b) (c)
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
(a) Color image corrupted by Salt- and-Pepper noise (b) Hue (c) Saturation (d) Intensity components of HSI color space
(a) (b) (c) (d)
Noisy Color Image
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
AssignmentsProblem #1
Problem #2
EEE 6209 – Digital Image ProcessingEEE 6209 – Digital Image Processing
© Dr. S. M. Mahbubur Rahman
Color Image ProcessingColor Image Processing
AssignmentsProblem #3
Problem #4
Derive the CMY intensity mapping function from its RGB counterpart.