程序代写代做代考 cse3431-lecture14-color

cse3431-lecture14-color

Text

xt

Experiment 1

Experiment 2

Experiment 3

Experiment 4

Experiment 4: the proof

Experiment 4

Experiment 4

Another interesting phenomenon

Fourier Series (advanced)
Any periodic and integrable function f(x) can be
approximated with a series

where

f(x) = f(x + T ), ⇥x

f(x) �
a0
2

+
⇥⇤

n=1


an cos


2�nx

T


+ bn sin


2�nx

T

⇥⇥
,

a0 =
1
T

⌅ �

��
f(x)dx,

an =
1
T

⌅ �

��
f(x) cos


2�nx

T


dx,

bn =
1
T

⌅ �

��
f(x) sin


2�nx

T


dx,

n = 1, 2, 3, . . .

Fourier series
• In some sense the function is analyzed in “function

coordinates” that happen to be cosines and sines.
Note:
• It is an orthogonal basis!

π

−π

cos(nx) sin(mx)dx = 0, for m ̸= n.

Example 1

0 2.5 5

y = sin(x)

f

Time of Spatial Domain Frequency Domain

Example 2: sum of two sinusoidals

0 2.5 5 7.5

0 2.5 5

-0.8

0.8

y = sin(x) + 0.5 sin(2x+1.5)

f 2f

FOURIER
SERIES

y1 = sin(x)

y2 = 0.5 sin(2x + 1.5)

Time or Spatial Domain Frequency Domain
y = f(x)

Example 3

Visible Spectrum
We perceive electromagnetic energy having wavelengths in the
range of 400-700 nms as visible light

Text

From:
http://www.yorku.ca/eye/

http://www.yorku.ca/eye/
http://www.yorku.ca/eye/

(0,1,1) = (1,1,1) – (1,0,0)

(1,0,1) = (1,1,1) – (0,1,0)

(1,1,0) = (1,1,1) – (0,0,1)

Question
• Ok, our color perception can be modeled with a 3D

linear space.
• But what are the basis vectors of this space?

• In other words, how do we compute a single frame of
reference for color? We all have different eyes!

Standard Color Space
To answer this question we will need to look
first at the pure spectral colors

What are the rgb coordinates of the
pure spectral colors?

• Perception of color is largely a result of a psycho-
physical process.

• The question can only be answered experimentally.

• This was done long time ago through an experiment of
“Color Matching”.

Weight functions, not spectrums.

Given a spectrum I(λ), we can use these
functions to compute its color:

where R,G,B are the unit vectors (the
standardized color of spectral red,green, and blue
light sources used in the experiment)

R =
Z


r(�)I(�)d�

G =
Z


g(�)I(�)d�

B =
Z


b(�)I(�)d�

C = RR + GG + BB

Color Matching functions

I(λ)

λ

Problem

Negative coefficients

This will happen with any choice of visible primaries.

Adding colors creates a less saturated color.

Solution: affine transformation of (r,g,b)

The RGB cube in XYZ

(e.g. brown, pink)

From XYZ to (x,y,Y)

From (x,y,Y) to XYZ

Working in XYZ

Text

RGB vs CMY
RGB CMY

Affine transformation

Equivalent colors between monitors
(color conversion)

Monitor 1 has phosphors with colors:

R1 = (X1r,Y1r,Z1r) 

G1 = (X1g,Y1g,Z1g) 

B1 = (X1b,Y1b,Z1b)

Monitor 2 has phosphors with colors :

R2 = (X2r,Y2r,Z2r) 

G2 = (X2g,Y2g,Z2g) 

B2 = (X2b,Y2b,Z2b)

Given color C1= (R1c,G1c,B1c) in monitor 1 what is the
equivalent color C2 = (R2c,G2c,B2c) in monitor 2 ?

Color in monitor one
Given color C1= (R1c,G1c,B1c) in monitor one
its coordinates C =(Xc,Yc,Zc) in XYZ-space
are:

Equivalent color in monitor 2
Similarly for monitor 2:
C=M2C2

Putting both together:

Other Color Spaces
• NTSC YIQ (TV)
• Y : luminance, I,Q color information
• Relation to RGB

2

6666
4

Y

I

Q

3

7777
5
=

2

6666
4

0.30 0.59 0.11

0.60 �0.28 �0.32

0.21 �0.52 0.31

3

7777
5

2

6666
4

R

G

B

3

7777
5

Visualization of the HSV

Tone Mapping
Simplest definition
• Map a set of colours to another set of colours

Appears in many areas that deal with visual
information (e.g. images)
• Computer graphics
• Digital photography
• Printing

Often associated with High Dynamic Range
images

Computer graphics
What does color intensity > MAX_DISP_INT
means?
• How do you map the following color (10,1,1) to display

intensities in [0,1]
• Clamp –> (10,1,1) –> (1,1,1)
• Uniform Scale –> (10,1,1) –> (1,0.1,0.1)

How do you map the colours of an entire
image to the colours of a monitor?
• Color histogram normalization
• Perception-based techniques

Digital Photography (HDR Images)

Same scene 6 different exposures (i.e. tones)

Courtesy Dean S. Pemberton, Wikipedia

Digital Photography (HDR Images)

mixed –>

Courtesy
Dean S. Pemberton,
Wikipedia

Computer vision
• Often the problem relates to balancing colour

histograms
• Object recognition under varying illumination

conditions

Printing
The most complex application where tone
mapping is crucial