• 沒有找到結果。

Color and Radiometry

N/A
N/A
Protected

Academic year: 2022

Share "Color and Radiometry"

Copied!
14
0
0

加載中.... (立即查看全文)

全文

(1)

Color and Radiometry

Digital Image Synthesisg g y Yung-Yu Chuang

with slides by Svetlana Lazebnik, Pat Hanrahan and Matt Pharr

Radiometry

• Radiometry: study of the propagation of electromagnetic radiation in an environment electromagnetic radiation in an environment

• Four key quantities: flux, intensity, irradiance d di

and radiance

• These radiometric quantities are described by their spectral power distribution (SPD)

• Human visible light ranges from 370nm to 730nmg g

1 1 02 1 04

1 06 1 08

1 01 0 1 01 2

1 01 4 1 01 6

1 01 8 1 02 0

1 02 2 1 02 4

1 02 6

Cosm ic Ra y s Ga m m a

Ra y s X -Ra y s Ultra - V iolet Infra -

Red Ra d io H ea t Pow er

1 01 61 01 41 01 21 01 01 08 1 06 1 04 1 02 1 1 0-2 1 0-4 1 0-6 1 0-8 Ra y s Ra y s V iolet

Red

W a velength (N M )

7 0 0 6 0 0 5 0 0 4 0 0

IR R G B UV

Electromagnetic spectrum

Why do we see light at these wavelengths?

Human Luminance Sensitivity Function

Why do we see light at these wavelengths?

Because that’s where the sun radiates electromagnetic energy

Basic radiometry

• pbrt is based on radiative transfer: study of the transfer of radiant energy based on radiometric transfer of radiant energy based on radiometric principles and operates at the geometric optics level (light interacts with objects much larger level (light interacts with objects much larger than the light’s wavelength)

It i b d th ti l d l H

• It is based on the particle model. Hence, diffraction and interference can’t be easily

t d f accounted for.

(2)

Basic assumptions about light behavior

• Linearity: the combined effect of two inputs is equal to the sum of effects

equal to the sum of effects

• Energy conservation: scattering event can’t produce more energy than they started with produce more energy than they started with

• Steady state: light is assumed to have reached equilibrium so its radiance distribution isn’t equilibrium, so its radiance distribution isn t changing over time.

• No polarization: we only care the frequency of

• No polarization: we only care the frequency of light but not other properties (such as phases)

• No fluorescence or phosphorescence:

• No fluorescence or phosphorescence:

behavior of light at a wavelength or time doesn’t affect the behavior of light at other g wavelengths or time

Fluorescent materials

Color

Interaction of light and surfaces

• Reflected color is the

l f i i f

result of interaction of light source spectrum with surface reflectance

surface reflectance

• Spectral radiometry

– All definitions and units are now All definitions and units are now

“per unit wavelength”

– All terms are now “spectral”

(3)

Why reflecting different colors

high

heat/ light

heat/

chemical

g

low low

Light with specific wavelengths

b b d Fluorescent

are absorbed.

Primary colors

Primary colors for

addition (light sources) Primary colors for subtraction (reflection) ( g ) subtraction (reflection)

Heat generates light

• Vibration of atoms or electrons due to heat generates electromagnetic radiation as well If generates electromagnetic radiation as well. If its wavelength is within visible light (>1000K), it generates color as well

it generates color as well.

• Color only depends on temperature, but not t f th bj t

property of the object.

• Human body radiates IR light under room temperature.

• 2400-2900K: color temperature of incandescent p light bulb

Spectral power distribution

fl li h (日光燈)

400nm (bluish)

650nm (red) 550nm

(green)

fluorescent light (日光燈)

(4)

Spectral power distribution

lemmon skin

400nm

(bluish) 650nm

(red) 550nm

(green)

lemmon skin

Color

• Need a compact, efficient and accurate way to represent functions like these

represent functions like these

• Find proper basis functions to map the infinite- di i l f ll ibl SPD f ti dimensional space of all possible SPD functions to a low-dimensional space of coefficients

• For example, B(λ)=1 is a trivial but bad approximation

• Fortunately, according to tristimulus theory, all visible SPDs can be accurately represented y p with three values.

The Eye

Slide by Steve Seitz

Density of rods and cones

cone moleculespigment rod

molecules

Rods and cones are non-uniformly distributed on the retina

– Rods responsible for intensity, cones responsible for color

– Fovea - Small region (1 or 2°) at the center of the visual field containing the highest Fovea Small region (1 or 2 ) at the center of the visual field containing the highest density of cones (and no rods).

Less visual acuity in the periphery—many rods wired to the same neuron

Slide by Steve Seitz

(5)

Human Photoreceptors Color perception

M L Power

S

Wavelength

Rods and cones act as filters on the spectrum

– To get the output of a filter, multiply its response g p , p y p curve by the spectrum, integrate over all wavelengths

• Each cone yields one number

• Q: How can we represent an entire spectrum with 3 numbers?

• A: We can’t! Most of the information is lost.

As a result two different spectra may appear indistinguishable – As a result, two different spectra may appear indistinguishable

» such spectra are known as metamers

Slide by Steve Seitz

Metamers

different spectrum same perception different spectrum, same perception

t t (鎢絲) b lb l i i i

tungsten (鎢絲) bulb television monitor

(6)

Color matching experiment

p1= 645.2 nm p2= 525.3 nm

444 4

Foundations of Vision, by Brian Wandell, Sinauer Assoc., 1995

p1 p2 p3 p1 p2 p3

p3= 444.4 nm

Color matching experiment Color matching experiment

• To avoid negative parameters

(7)

Spectrum

• In core/spectrum.*

T t ti (d f lt)

• Two representations: RGBSpectrum (default) and SampledSpectrum

• The selection is done at compile time with a typedef in core/pbrt.h

typedef RGBSpectrum Spectrum;

• Both stores a fixed number of samples at a Both stores a fixed number of samples at a fixed set of wavelengths.

CoefficientSpectrum

template <int nSamples>

class CoefficientSpectrum { class CoefficientSpectrum {

+=, +, -, /, *, *= (CoefficientSpectrum)

== != (CoefficientSpectrum)

==, != (CoefficientSpectrum) IsBlack, Clamp

* * / / (float)

*, *=, /, /= (float) protected:

fl t [ S l ] float c[nSamples];

}

Sqrt, Pow, Exp

SampledSpectrum

• Represents a SPD with uniformly spaced samples between a starting and an ending samples between a starting and an ending wavelength (400 to 700 nm for HVS). The number of samples 30 is generally more than number of samples, 30, is generally more than enough.

static const int sampledLambdaStart = 400;

static const int sampledLambdaEnd = 700;

static const int nSpectralSamples = 30;

SampledSpectrum

class SampledSpectrum : public

CoefficientSpectrum<nSpectralSamples> { CoefficientSpectrum<nSpectralSamples> {

} }

It is possible to convert SPD with irregular spaced It is possible to convert SPD with irregular spaced samples and more or fewer samples into a

SampledSpectrum For example sampled BRDF SampledSpectrum. For example, sampled BRDF.

(8)

SampledSpectrum

static SampledSpectrum FromSampled(

float *lambda, float *v, int n) { float lambda, float v, int n) {

<Sort samples if unordered>

SampledSpectrum r;p p ;

for (int i = 0; i<nSpectralSamples; ++i) {

lambda0=Lerp(i/float(nSpectralSamples), sampledLambdaStart, sampledLambdaEnd);

lambda1=Lerp((i+1)/float(nSpectralSamples), sampledLambdaStart, sampledLambdaEnd);

r.c[i]=AverageSpectrumSamples(lambda, v, n, lambda0, lambda1);

}

return r;

}

AverageSpectrumSamples

Human visual system

• Tristimulus theory: all visible SPDs S can be accurately represented for human observers accurately represented for human observers with three values, xλ, yλ and zλ.

Th b i th t l t hi X(λ)

• The basis are the spectral matching curves, X(λ), Y(λ) and Z(λ) determined by CIE (國際照明委員 會)

會).

SXdx ( ) ( )

Y d S

y ( ) ( ) ) ( ) (

Z d S

z ( ) ( )

XYZ basis

pbrt has discrete versions (sampled every 1nm) of these bases in core/color.cpp

360 830

(9)

XYZ color

• Good for representing visible SPD to human observer but not good for spectral

observer, but not good for spectral computation.

• A product of two SPD’s XYZ values is likely

• A product of two SPD s XYZ values is likely different from the XYZ values of the SPD which is the product of the two original SPDs.p g

• It is frequent to convert our samples into XYZ

• In In Init()Init(), we initialize the following, we initialize the following

static SampledSpectrum X, Y, Z;

static float yint; X.c[i][ ]stores the sum of X function within the ith wavelength interval using AverageSpectrumSamples yintstores the

sum of Y.c[i]

XYZ color

void ToXYZ(float xyz[3]) const { xyz[0] = xyz[1] = xyz[2] = 0.;y [ ] y [ ] y [ ]

for (int i = 0; i < nSpectralSamples; ++i) {

xyz[0] += X c[i] * c[i];

xyz[0] += X.c[i] * c[i];

xyz[1] += Y.c[i] * c[i];

xyz[2] += Z.c[i] * c[i];

xyz[2] + Z.c[i] c[i];

}

xyz[0] /= yint;

xyz[0] /= yint;

xyz[0] /= yint;

} }

RGB color

SPD for LCD displays SPD for LED displays

RGB color

SPDs when (0.6, 0.3, 0.2) is displayed on LED and LCD displays We need to know display characteristics to display the color We need to know display characteristics to display the color described by RGB values correctly.

(10)

Conversions

(R,G,B) (R,G,B) XYZToRGB

057311 1 204043 0 055648 0

041556 . 0 875992 . 1 969256 . 0

498535 . 0 537150 . 1 240479 .

device dependent 3

Here, we use the f HDTV FromRGB

xλ, yλ, zλ

S X d

x ( ) ( )



0.055648 0.204043 1.057311

one for HDTV A heuristic

d Z S

d Y S y

d X S x

) ( ) (

) ( ) (

) ( ) (

ToXYZ process which

satisfies some

criteria z S()Z()d

criteria

spectrum (eg. SampledSpectrum)

RGBSpectrum

• Note that RGB representation is ill-defined.

Same RGB values display different SPDs on Same RGB values display different SPDs on different displays. To use RGB to display a specific SPD we need to know display specific SPD, we need to know display characteristics first. But, it is convenient, computation and storage efficient

computation and storage efficient.

class RGBSpectrum : public CoefficientSpectrum<3> {

i C ffi i tS t 3

using CoefficientSpectrum<3>::c;

}

Radiometry

Photometry

L i

( ) ( ) Y

V

L

 

d

Luminance

( ) ( ) Y

V

L

 

d

(11)

Basic quantities

Fl (W)

non-directional Flux: power, (W)

Irradiance: flux density per area, (W/m2)

Intensity: flux density per solid angle directional Intensity: flux density per solid angle

Radiance: flux density per solid angle per area

Flux (Φ)

• Radiant flux, power

T l f i h h

• Total amount of energy passing through a surface per unit of time (J/s,W)

Irradiance (E)

• Area density of flux (W/m2)

dA Ed

E 2 E Ecos

Lambert’s law Inverse square law

4 r 2 A A

Angles and solid angles

• Angle rrl

 circle has 2 radians

• Solid angle   A

• Solid angle 2

  R

The solid angle subtended by a surface is defined as the surface area of a unit sphere covered by the surface's projection onto the sphere.

sphere has 4 steradians

(12)

Intensity (I)

• Flux density per solid angle

I i d ib h di i dl di ib i

I d

• Intensity describes the directional distribution of light

( ) d I ( )  

d

Radiance (L)

• Flux density per unit area per solid angle

d

dA d L d

• Most frequently used, remains constant along ray remains constant along ray.

• All other quantities can b d i d f di be derived from radiance

Calculate irradiance from radiance )

, ( xL

d

d

x

dA

 

L x  d

dA x d

E( ) ( , )cos Light meter

dA

Irradiance Environment Maps

R N

( , )

L   E ( , )  

Radiance Environment Map

Irradiance Environment Map Environment Map Environment Map

(13)

Differential solid angles

Goal: find out the relationship between dand dθ d

d

between dand dθ, d Why? In the integral, d

d

r

2

) (

S

d f  

y g

dω is uniformly divided.

To convert the integral to



f(,)dd

We have to find the relationship We have to find the relationship between dand uniformly divided dθ and d.

Differential solid angles

• Can we find the surface area of a unit sphere b ?

 

2 

by ?

 

02 0 dd

 

02 0 dd

Differential solid angles

Goal: find out the relationship between dand dθ d

d

between dand dθ, d

By definition, we know that dA

sin r

d

d

r 2

r d  dA

2

( )( sin )

sin

dA r d r d

r d d

  

  

 

2 sin

d  dA2 sin  d d

d d d

r   

d d cos

Differential solid angles

We can prove that

d4

d sin

r S2

d

d

r

(14)

Differential solid angles

We can prove that

d 4

d sin

r S2

 

d

d

d

r

sin

2

2

 

d d

S

   

sin

sin

0 2 0

0 0

 

d d

d d

cos 2

1

1 0 0

d

 4

1

Isotropic point source

If the total flux of the light source is Φ light source is Φ, what is the intensity?

I d

  

2

4

S

I

4 I

I 4

 

Warn’s spotlight

If the total flux is Φ, what is the intensity?

I(

)cosS

Warn’s spotlight

If the total flux is Φ, what is the intensity?

I(

)ccosS

2



otherwise ) 0

(

2

1 1

2

cosS

dcos

d

2 c

cosS

dcos

0 0

0

c

 

S

d

d

S

d

1 S

c 2 0 1 1

S c y 2

1 S

 

y

y   

2

1 c S

1 0 S

1

S y  2

參考文獻

相關文件

After fixing the visually examined color filter panel on the transparent glass plate, the inspection system triggers the CNC X-Y table to control the precise

In this thesis, we present a new color interpolation algorithm and it can remove common artifact, such as cross-talk which creates blocky noise or image edge zipper

of the textbook depicting your tree immediately after each insertion and following the rebalancing rotation or color change (if any). Label all nodes with their color and identify

By means of these eighteen practices, the Bodhisattva purifies himself as well as all living beings; this is why it is said, &#34;if practice is pure, then living beings

In addition to the model of black/ white pieces, we further investigate the multiple color cases and its corresponding cycle.. We divide the multiple color case into

Given an n × n chessboard, we try to color its blocks as many as possible such that any 4 colored blocks do not form a rectangle with its sides parallel to the edge of the

(18%) Suppose that in the following week you have 12 hours each day to study for the final exams of Calculus 4 and English.. Let C be the number of hours per day spent studying

• Emergent Z_k 1-form &amp; 2-form symmetry. BF theory