Color Image Processing
CS 663, Ajit Rajwade
Pouring in color
2
Questions
3
4
http://en.wikipedia.org/wiki/Tints_and_shades
More questions
5
Color perception and physics
6
7
| |
380–450 nm | |
450–495 nm | |
495–570 nm | |
570–590 nm | |
590–620 nm | |
620–750 nm | |
Ultraviolet
Infrared
Color physics
8
Human color perception
9
Human color perception
10
Yellow color: L is stimulated a bit more than M and S is not stimulated
Red: L is stimulated much more than M and S is not stimulated
Violet: S is stimulated, M and L are not
Color-blindness: absence of one or more of the three types of cones
Response sensitivity functions for LMS cells
Human color perception
11
C is a matrix of size 3 x Nλ and I is a vector of Nλ elements
Vectors of length Nλ
Human color perception
12
Display systems (CRT/LCD)
13
Color Models (Color Spaces)
14
RGB color model
15
16
CMY(K) color space
17
C = 255-R, M = 255-G, Y = 255-B
CMY(K) color space
18
19
Three examples of color half-toning with CMYK separations. From left to right: The cyan separation, the magenta separation, the yellow separation, the black separation, the combined halftone pattern and finally how the human eye would observe the combined halftone pattern from a sufficient distance.
Color half-toning
20
Digression: Gray-scale half-toning
Left: Halftone dots. Right: How the human eye would see this sort of arrangement from a sufficient distance.
21
Digression: negative after-images!
http://thebrain.mcgill.ca/flash/a/a_02/a_02_p/a_02_p_vis/a_02_p_vis.html#
HSI color space
22
23
a x yellow + b x black + c x white, where a, b, c are non-negative and sum to 1. By rotating this triangle about the intensity axis, you will get different hues.
HSI space
24
By rotating the triangle about the intensity axis, you will get different hues. In fact hue is an ANGULAR quantity ranging from 0 to 360 degrees. By convention, red is considered 0 degrees.
Primary colors are separated by 120 degrees. The secondary colors (of light) are 60 degrees away from the primary colors.
25
To be very accurate, this HSI spindle is actually hexagonal. But it is approximated as a circular spindle for convenience. This approximation does not alter the notion of hue or intensity and has an insignificant effect on the saturation.
RGB to HSI conversion
26
Refer to textbook for formulae to convert back from HSI to RGB
HSI and RGB
27
Practical use of hue
28
Hue is invariant to:
What does this mean physically?
Practical use of hue
29
Ambient light (say due to sunlight): constant effect on all points of the object’s surface
Diffuse reflection of light from a directed source off a rough surfaces: varies from point to point on a surface
Reflection from shiny surface: varies from point to point on a surface
30
Diffuse reflection from an irregular surface
Specular reflection
31
Diffuse reflection
Diffuse + specular reflection
Vector normal to the surface at a point
Lighting
direction
Viewing
direction
Direction of reflected light
L=Strength of white light source,
ka,kd,ks: surface reflectivity (fraction of incident light that is reflected off the surface)
For shiny surfaces, α is large.
Practical use of hue
32
Food for thought
Is the chromaticity vector also an illumination invariant feature? How does it compare to hue?
33
Digression: Playing with color: seeing is not (!) believing
34
http://thebrain.mcgill.ca/flash/a/a_02/a_02_p/a_02_p_vis/a_02_p_vis.html#
Operations on color images
35
Histogram equalization
36
37
Top row: original images
Middle row: histogram equalization channel by channel
Bottom row: histogram equalization on intensity (of HSI) and conversion back to RGB
Color image smoothing: bilateral filtering
38
Bilateral filtering for color images
39
Bilateral filtering for color images
40
What’s wrong with separate channel bilateral filtering?
41
Channel by channel: Color artifacts around edges. RGB channels are highly inter-dependent – you shouldn’t treat them as independent.
Separate channel
Coupled
42
43
44
Color Edges
45
Color Edges
46
(Rx,Gx,Bx) = (255,255,255),
(Ry,Gy,By) = (0,0,0),
Rx^2 + Gx^2 +Bx^2 + Ry^2+Gy^2+By^2 = 3*255^2
(Rx,Gx,Bx) = (255,255,0),
(Ry,Gy,By) = (0,0,255),
Rx^2 + Gx^2 +Bx^2 + Ry^2+Gy^2+By^2 = 3*255^2
Color Gradient/Edge
47
Color Gradient/Edge
48
Color Gradient/Edge
49
Local color gradient matrix
50
PCA on RGB values
51
PCA on RGB values
0.5952 0.6619 0.4556
0.6037 0.0059 -0.7972
0.5303 -0.7496 0.3961
52
PCA on RGB values
53
PCA on RGB values
54
55
56
57
58
The variances of the three eigen-coefficient values:
8411, 159.1, 71.7
59
60
61
62
RGB and its corresponding Y, Cb, Cr channels
Beyond color: Hyperspectral images
63
Sources of confusion ☺
64
Beyond color: Hyperspectral images
65
66
Example multispectral image with 6 bands
67
68
69
70
71
72
Reference color image
Color image Demosaicing
CS 663, Ajit Rajwade
Color Filter Arrays
74
Color Filter Arrays
75
Color Filter Arrays
76
*The word “mosaic” or “mosaiced” is not to be confused with image panorama generation which is also called image mosaicing.
77
“original scene”
Mosaiced image
Mosaiced image – just coded with the Bayer filter colors
“Demosaiced” image – obtained by interpolating the missing color values at all the pixels
A Demosaicing Algorithm
Malvar, H.S., L. He, and R. Cutler, High quality linear interpolation for demosaicing of Bayer-patterned color images. ICASPP, Volume 34, Issue 11, pp. 2274-2282, May 2004.
78
Demosaicing Algorithm
79
Demosaicing Algorithm
80
Original image (top left), o/p of bilinear interpolation for demosaicing (top right), o/p of MATLAB’s demosaic algorithm (bottom left)
Demosaicing algorithm
81
Demosaicing algorithm
82
Gain factor
Bilinearly interp. value
83
Demosaicing algorithm
84
Bilinear interp. value
Demosaicing algorithm
85
Bilinear interp. value
Demosaicing algorithm
86
Bilinear interp. value
Demosaicing algorithm
87
Bilinear interp. value
Gain factors
88
Demosaicing: when does it happen?
89