Download Ch 6

Document related concepts

Architectural lighting design wikipedia , lookup

Color temperature wikipedia , lookup

Color wikipedia , lookup

Color vision wikipedia , lookup

Transcript
Chapter 6: Color
Preview
。The world is colorless
。Color is caused by the vision system (dominated
by the visual cortex) responding differently to
different wavelengths of light
Cortex:
Macro-structure
Ordered Feature Map
1
Micro-structure
visual cortex auditory cortex
Auditory cortex:
Visual cortex:
Hippocampal cortex:
Somatosensory cortex:
tonotopic map
retinotectal map
geographic map
somatic map
6.1 Physics of Color
A color we perceive is resulting from
(a) the color of object surface
(b) the colors of light sources
2
6.1.1 Colored Lights
○ Spectral (wavelength) units (quantities)
-- Units with the phrase “per unit wavelength”
e.g., Spectral radiance L ( x, ,  )
Spectral irradiance
Spectral BRDF
Spectral exitance
3
6.1.2 The Colors of Sources
○ Black body: absorbs light without reflection
The distribution of spectral radiation
1
E ( )  ( 5 )(
)

exp( hc / k T )  1
1
where T
h
k
c

: color temperature,
: Plank’s constant
: Boltzmann’s constant
: speed of light,
: wavelength
4
○ Sun – a distant bright point source
Light from the sun
(i) strikes a surface and is reflected into camera or
eye (sunlight/daylight)
(ii) is scattered by the air, strikes a surface, and is
reflected into camera or eye (airlight/skylight)
Airlight
(skylight)
Sunlight
(daylight)
5
○ Sky:
(a) Crude geometrical model
-- a hemisphere with
constant exitance
However,
sky is substantially brighter at the horizon
than at the zenith because a viewing ray
along the horizon passes through more sky
(b) Natural model
– air emits a constant
amount of light per
unit volume
6
○ Illumination during the day by:
(a) Sunlight, (b) Airlight
wavelength
7
○ Application – Dehazing
8
An image is contributed by two light sources
I = D + A, where D: direct light, A: airlight
9
Direct light D( x )  J ( x )t ( z ) : the light emitted
from the object and passes through the air
x : image pixel; z: object distance
J(x) : light emitted from object surface
t(z) : atmosphere transmittance
z
t ( z )  exp[  β( , z )dz ]
0
scatter function
z
z
0
0
t ( z )  exp[  β( )dz ]  exp[β( )  dz ]
 exp[β( ) z ]
10
Airlight A: the amount of light within the conical
volume
11
12
13
14
○ (a) Light of a long wavelength
can travel farther than light
of a short wavelength
(Rayleigh scattering)
(b) The sun looks yellow;
the sky looks blue
atmosphere
(c) The intensity of spectral
radiation scattered by a
unit volume of air depends
on the 4th power of
frequency, i.e.,
R  f 4   4
15
○ Application - Shadow Detection
Shadow
Self shadows
Cast shadows
16
Input
Background
Foreground
(1) Intensity test -- a shadow area should be darker
than its corresponding background areas
Dark regions
17
(2) Blue ratio test -- distinguishes between dark and
shadow areas
Non-shadow area L  Lsun  Lsky
Shadow areas L   Lsun  Lsky , 0    1
Lisky   i Lisun , i  r , g , b, 1  b   r   g  0
Li   Lisun  Lisky   Lisun   i Lisun  (   i ) Lisun
18
Li (   i ) Lisun    i


i
i
L
(1   i ) Lsun
1  i
Let p be a shadow point.
I i ( p ) Li  ( p )  R ( p ) Li  ( p )    i
 i
 i

i
I ( p) L ( p)  R( p ) L ( p ) 1   i
(   b ) (   r ) (   g )

,
(1   b )
(1   r ) (1   g )
(needs to be proven)
I b ( p ) I  r ( p ) I  g ( p )
 r
, g
b
I ( p) I ( p) I ( p)
19
Dark regions
Shadow areas
(3) Reflectance test -- distinguishes between cast
and self shadows
Non-shadow image area I i  ( Lisun  Lisky ) R i
Shadow image areas I i  ( Lisun  Lisky ) R i
I i  I i  I i  (1   ) Lisun Ri
20
I i
(1   ) Lisun R i
Ri


,
Normalization: ri 
I
(1   ) Lsun R 3 R
i  r , g , b, I  (I r , I g , I b )T
Training r  (rr , rg , rb ) of different materials
Cast
shadows
Self
shadows
21
○ Artificial Illuminants
Incandescent light: metal filament (e.g.,
tungsten) is heated to a high temperature
Fluorescent light: high speed electrons
strike gas; gas releases ultraviolet radiation;
the radiation causes phosphors to fluoresce
Arc lamp: contains gaseous metal (e.g.,
mercury) and inert gases; light is produced
by electrons in metal atoms dropping from
an excite state to a lower energy state
22
23
6.1.3 The Color of Surfaces
○ Spectral reflectance
24
6.2 Human Color Perception
○ Types of photoreceptors:
Rod : sensitive to light
Cone: sensitive to color
Types of cone:
S (blue) – short wavelength light
M (green) – medium wavelength light
L (red) – long wavelength light
25
○ Principle of Uni-Variance
-- Receptors respond strongly or weakly, but do
not signal the wavelength of the light falling
on them
The response of the kth type of receptor
26
6.2.1 Color Matching
-- is to figure out how a color is composed
of primaries
Two ways of color matching:
Additive matching, Subtractive matching
○ Additive matching
27
○ Subtractive matching
For some colors, their i s may be negative.
Subtractive matching adds some amount of
some primaries to the test light.
○ Principle of Trichromacy
(1) The primaries must be independent
(2) Both additive and subtractive matching
are allowed
6.3 Representing Color
Unit radiance source:
U ( )  f1 ( ) P1  f 2 ( ) P2  f 3 ( ) P3
P1 , P2 , P3 : primaries
: color matching function
28
Single wavelength source: S ( )U ( )
Source:
S   U ( ) S ( ) d 

  { f1 ( ) P1  f 2 ( ) P2  f 3 ( ) P3 }S ( )d 

 { f1 ( )S ( ) d }P1 +{ f 2 ( )S ( ) d }P2


 { f 3 ( )S ( ) d }P3  w1 P1  w2 P2  w3 P3

29
○ Grassman’s Laws -- matching is linear
30
○ Color Matching Function f1 ( ), f 2 ( ), f 3 ( )
。 RGB Color Space
R,G,B are real primaries
Color matching functions
may be negative
。 CIE XYZ Color Space
CIE: Commission
International D’eclairage
X,Y,Z are not real primaries
Color matching functions
are positive everywhere
31
N 1
Definitions:
X  k  f x (i )l (i )r (i ),
i 0
N 1
Y  k  f y (i )l (i )r (i ),
i 0
N 1
Z  k  f z (i )l (i )r (i )
i 0
32
6.3.1 Linear Color Spaces
-- A color lies on a straight line connecting
two colors. The color can be formed by
a linear combination of the two colors
-- A color lies on a planar patch formed by
connecting three colors. The color can
be formed by a linear combination of
the three colors
33
○ RGB Color Space
R: 645.16 nm,
G: 526.32nm,
B: 444.44nm
○ YIQ color space
Y  0.299 0.587 0.114   R 
 I   0.596 0.275 0.321 G 
  
 
Q  0.212 0.523 0.311   B 
34
○ YUV color space
Y  0.299 R  0.587G  0.114 B
U  0.493( B  Y ), V  0.877( R  Y )
○ CIE XYZ Color Space
The volume of visible
colors in the XYZ
space is a cone whose
vertex is at the origin
35
。The relationship between RGB and XYZ
 X   0.431 0.342 0.178   R 
 Y    0.222 0.707 0.071 G 
  
 
 Z   0.02 0.130 0.939   B 
 R   3.063 1.393 0.476   X 
G    0.969 1.876
0.042   Y 
  
 
 B   0.068 0.229 1.069   Z 
36
。CIE xy Space
-- The space results from intersecting the
XYZ space with plane X  Y  Z  1
Chromaticity Diagram
37
(i) Spectral locus: the curved boundary along
which the colors are experienced
(ii) Neutral point: the color whose weights are
equal for all three primaries
(iii) Colors that lie
farther away
from the neutral
point are more
saturated
38
○ CMY -- primaries of pigments
Cyan
= White – Red,
Magenta = White – Green,
Yellow = White – Blue
。 A pigment removes the
colors other than the pigment
color from the incident light, which
is then reflected from surface
e.g., Red ink removes green
and blue lights; red light
passes through the ink
and is reflected from the
paper
39
6.3.2 Nonlinear Color Spaces
-- The coordinates of a color in a linear space may
not encode properties that are familiar to human
○ HSI Space: Hue, Saturation, Intensity
RGB  HSI
RG  B
I
3
3
S  1
min( R, G, B)
RG B
1
[( R  G )  ( R  B)]
1
2
H  cos {
}
2
1/ 2
[( R  G )  ( R  B)(G  B)]
H  360  H
if B  G
40
HSI  RGB
0  H  120 :
1
1
S cos H 
b  (1  S ), r  1 
, g  1  ( r  b)

3
3  cos(60  H ) 
120  H  240 :
1
S cos H  
1
, H   H  120
r  (1  S ), g  1 

3  cos(60  H ) 
3
b  1  (r  g )
240  H  360 :
1
S cos H  
1
, H   H  240
g  (1  S ), b  1 

3  cos(60  H ) 
3
r  1  ( g  b)
R
G
B
r
,g
, b
RG  B
RG  B
RG  B
41
○ Lu*v* color space
Y
Y 1/ 3

 0.008856
16

)
25(100

u*  13L *(u  u0 )
Y0
Y0
,
L*  
Y
Y
 

,0.008856 v*  13L *(v  v0 )
903.3

Y0
Y0
4X
9Y
where u 
, v 
X  15Y  3Z
X  15Y  3Z
9u
L * 16 3
12  3u   20v 3
X
Y , Y  Y0 (
) , Z Y(
)
4v
25
4v 
u*
v*



where u 
 u0 , v 
 v0
13L *
13L *
u0 , v0 : reference white
42
43
44
○ Uniform Color Space
。 Noticeable difference – the difference when
modifying a color until one can tell it has changed.
The noticeable difference of a color forms the
boundary of the color and can be fitted with an
ellipse (macadam ellipse)
。 The color difference in
the CIE xy space is poor
(a) the ellipses at the top
are larger than those
at the bottom
(b) the ellipses rotate as
they move up
45
CIE u’v’ Space – a more uniform space than
CIE xy space
4X
9Y
(u, v)  (
,
)
X  15Y  3Z X  15Y  3Z
46
○ La*b* color space is a substantial uniform space
Y 1/ 3
X 1/ 3 Y 1/ 3
L*  25[100 ]  16, a*  500[( )  ( ) ]
Y0
X0
Y0
X 1/ 3
Z 1/ 3
b*  200[( )  ( ) ]
X0
Z0
a*
1 1/ 3 L * 16 3
L * 16 3
X  X 0[
(
) (
)] , Y  Y0 (
)
500 100
25
25
1 1/ 3 L * 16
b* 3
Z  Z 0 [(
) (
)
]
100
25
200
X 0 , Y0 , Z 0 : reference white
47
6.3.3 Spatial and Temporal Effects
○ Chromatic adaptation – the color system adapts
(the color diagram is skewed) when the visual
system has been exposed to an illuminant for
some time
Assimilation – the surrounding
colors of a color cause the
color to move toward the
surrounding colors
Contrast -- the surrounding colors of a
color cause the color to move away
from the surrounding colors
48
6.4 Surface Color from Image Color
Image color depends on
(a) Camera
(b) Physical effects
(i) The color of object surface
(ii) The colors of light sources
49
○ Cameras
。A color camera contains an imaging
device that is composed of a set of
sensory elements CCD (charge
coupled device)
。Each CCD contains one of three filters, each
realizing a spectral sensitivity function (SSF)
。 In terms of SSF, CCDs are arranged in
a mosaic with a particular pattern, called
the Bayer pattern
。Gamma correction is a form of compression for
compressing the incoming dynamic
range e.g., I 1/  , where I: intensity
50
○ Physical effects
。 The color of light arriving a camera is determined
by (a) the spectral radiance of the light
(b) the spectral reflectance of surface
。 The spectrum of the reflected light of a patch
51
○ The response of a photoreceptor of the kth type
to the patch pk 


k
( )  ( ) E ( ) d 
52
○ The value at an image pixel x
C ( x)  i ( x)  gd ( x)d ( x)  gs ( x) s( x) where
i ( x ) : colored light
d ( x ) : image color of a frontal surface
gd ( x) : change in brightness due to
the orientation of the surface
s( x ) : image color of specularity from
a flat frontal surface
gs ( x) : change in specular energy due to the
orientation of the surface
53
○ Specularities on electric and dielectric
surfaces look different
1. Light striking an electric surface can not
penetrate it, which is either absorbed or
reflected. Electric surfaces have a specular
component that is wavelength dependent
of the light
2. Light striking a dielectric surface can
penetrate it. Dielectric surfaces have a
specular component that is wavelength
independent of the light
54
○ Example: Dielectric object with single color
Pixel value: p( x)  gd ( x)d  gs ( x) s
gd ( x)d - Produces a line that extends to pass
through the origin
- The points on the line have the same
color (source + surface) but different
intensity values
55
gs ( x) s - Produces a line colliding with a face of the
color cube
- The points on the line may have different
colors from the source one
56
。 Example: Plastic object on black background
57
A window of pixels in
(a) Background region  a point-like cluster of
points in the color space
All background pixels have the same
color and intensity
(b) Diffuse region  a line-like cluster
The object surface has a single color but
has different intensities from point to point
(c) Boundary region  a plan-like cluster
Weighted combinations of two different
colors (specular and surface colors)
58
○ Finding Specularities
A. Find in the color space:
(i) the dog-leg pattern, (ii) the specular line
B. Look for small bright patches in image
59
6.5 Inferring Lightness and Color
○ Surfaces reveal different colors when imaging
under lights with different colors or intensities
60
○ Humans can easily achieve
Color constancy –
Intensity-independent
description of color
Lightness constancy –
Color-independent
description of intensity
61
○ Model of image intensity
。 Radiance arriving at a pixel depends on
(a) The illumination of the light source
(b) The BRDF of the surface
(c) The configuration of the surface
(d) Camera responses
。 Simplifications:
(a) Scene surfaces are planar and frontal
(b) Surfaces are Lambertian
(c) The camera response is linear
C ( x)  kc I ( x)  ( x)
62
Take logarithm
log C ( x)  log kc  log I ( x)  log  ( x)
Assumptions:
(i) No albedo change of an object
(ii) Albedo changes occur only
when one object occludes
another
(iii) Illumination I changes slowly over space
63
。Example:
Recovering
lightness
Horn approach:
(1) Differentiate the log
transform
(2) Throw away small
gradients
(3) Integrate the result
64
Rephrase as an optimization problem
Find log  whose gradient d log  / dx is most
like the thresholded d log C / dx , i.e., find log 
2
d log 
d log C
that minimizes
 thresholded
dx
dx
i.e., d log C / dx
65
○ Finite-Dimensional Linear Models – Models
(i) surface albedo and (ii) illuminant irradiance
as a weighted sum of basis functions
Irradiance:
Albedo:
m
n
 ( )   rj j ( ) E ( )   ei i ( )
i 1
j 1
The response of receptor of the kth type
n
m
j 1
i 1
pk    k ( )  ( ) E ( )d     k ( )[ rj j ( )][ ei i ( )]d 



m ,n
m ,n
 e r (  ( ) ( ) ( )d  )   e r g
i 1, j 1
i j

k
j
i
i 1, j 1
i j ijk
where gijk    k ( ) j ( ) i ( )d  can be learned
66
○ Assume the average of albedo is constant and known
n
      r j j   
j 1
The average of the response of the kth receptor is
pk 
m,n

i 1, j 1
e j gijk rj
In vector-matrix form, p  Ae where
n
A  [ gijk rj ]
j 1
Solve for illumination e.
67
◎ Gamut mapping
The gamut of an image: the set of all pixel values
Let
G: the convex hull of the gamut of the given image
W: the convex hull of the gamut of an image of
many different colors under white light
M e : mapping an image seen under illuminant e
to an image seen under white light
68
69
The only illuminants
s. t. M e (G)  W
e to be considered are those
Once the family of potential illuminants has been
found, it remains to determine an appropriate
illuminant
The strategies of determination depend on applications
70