bpc: art and computation – fall 2006 digital media ii: light, vision & digital images glenn...

61
BPC: Art and Computation – Fall BPC: Art and Computation – Fall 2006 2006 Digital Media II: Digital Media II: Light, Vision & Digital Light, Vision & Digital Images Images Glenn Bresnahan [email protected]

Post on 20-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006BPC: Art and Computation – Fall 2006

Digital Media II:Digital Media II:Light, Vision & Digital ImagesLight, Vision & Digital Images

Glenn Bresnahan

[email protected]

Page 2: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 2

OutlineOutline

What is light?Properties of lightHow do we see?Digital representation of imagesComputer displayDigital image formats

Page 3: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 3

How Do We See?How Do We See?

Page 4: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 4

How Do We Hear?How Do We Hear?

Sound waves move through the air Waves interact (e.g. reflect) w/ environment Sounds wave reach our ear

Page 5: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 5

How Do We See?How Do We See?

Light is emitted from a source Waves interact (e.g. reflect) w/ environment Light reaches our eyes

Page 6: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 6

What is LightWhat is Light

Light is a

wave

Packets of light energy are called photons

Page 7: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 7

Waves RevisitedWaves Revisited

Page 8: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 8

Waves – PropertiesWaves – Properties

Sine Wave

-1.5

-1

-0.5

0

0.5

1

1.5

Amplitude

Wavelength (distance)

Page 9: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 9

Waves in Motion – PropertiesWaves in Motion – Properties

Sine Wave

-1.5

-1

-0.5

0

0.5

1

1.5

Period (time for one cycle)

TimeTime 11 22Frequency cycles per time interval

Page 10: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 10

Cycles and CirclesCycles and Circles

Sine waves and circles are closely related

Y axis

X axisangle

(x,y)

Page 11: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 11

Cycles and CirclesCycles and CirclesY Value vs Angle

-1.5

-1

-0.5

0

0.5

1

1.5

0 30 60 90 120 150 180 210 240 270 300 330 360

Angle

Y v

alu

e

Y axis

X axisangle

(x,y)

X Value vs Angle

-1.5

-1

-0.5

0

0.5

1

1.5

0 30 60 90 120 150 180 210 240 270 300 330 360

Angle

X v

alu

e

Page 12: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 12

Properties of SoundProperties of Sound

Pitch is the perception of frequencyHuman perception: 20 Hz – 20 KHzSound travels at approx. 1100

feet/second in air– Approx. 750 miles/hour or 1 mile every

4.8 sec.Loudness perception of amplitude

Page 13: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 13

Properties of LightProperties of Light

Color is the perception of frequencyHuman perception: 430 – 750 THz

(red – violet)– 1 THz = 1,000,000,000,000 Hz

Light travels at approx. 186,000 miles/second in air– Approx 1 foot every nanosecond

Brightness is perception of energy level (number of photons)

Page 14: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 14

How Fast is Light?How Fast is Light?

186,00 miles/sec or 300,000 meters/sec

8 minutes to reach earth from sun

Page 15: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 15

WavelengthWavelength

Wavelength = Speed / Freq– E.g. 1 ft/sec at 1 Hz = 1 ft wavelength– Higher frequencies == shorter wavelengths

Red = 300KM/Sec / 430 THz = 698 nm (nano (billionth) meters)

Violet = 300KM/Sec / 750 THz = 400 nm

Page 16: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 16

Visible SpectrumVisible Spectrum

Where is the white light?

What happens at higher/lower frequencies?

Page 17: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 17

Electromagnetic SpectrumElectromagnetic Spectrum

Visible light is electromagnetic force in a particular frequency range

Page 18: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 18

Light Interaction with MaterialsLight Interaction with Materials

When light hits a surface, several things can happen. The light can be:– Absorbed by the surface• Converted to another form of energy

– Reflected (bounced) off the surface– Transmitted (refracted) through the

surface

Page 19: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 19

Absorption and ReflectionAbsorption and Reflection

Different materials will absorb different frequencies

The absorption vs. reflection determines the color of the material– Black materials absorbs all wavelengths– White material reflects all wavelengths– Blue material reflects blue and absorbs all

other wavelengths Combining pigments causes more

wavelengths to be absorbed, fewer wavelengths to be reflected– Subtractive color

Page 20: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 20

Reflection and RefractionReflection and Refraction

Page 21: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 21

ReflectionReflection

Light reflects at an opposite and equal angle– Specular (mirror) reflection

Some light will be scattered in all directions

Page 22: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 22

RefractionRefraction

Speed of a wave varies by material Index of refraction is relative speed in the

medium– Vacuum 1.0000– Air 1.0003– Ice 1.31– Water 1.33– Quartz 1.46– Flint glass 1.57-1.75– Diamond 2.417

Page 23: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 23

RefractionRefraction

When a wave chances speed it changes direction, i.e. bends

The angle

depends of the

change in

refractive

index

Page 24: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 24

RefractionRefraction

Objects appear to bend in water

Page 25: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 25

RefractionRefraction

Lens change size of objects

Page 26: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 26

Combination of LightCombination of Light

White light?– Combination of multiple colors (freq) of

lightWhat happens when we combine

different frequencies of light, say red and green?

What happens when we combine different frequencies of sound, say an C and an E note?

Page 27: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 27

Color ExperimentColor Experiment

If we combine red, green and blue light we get new colors in the region of overlap

Colors seem to “add”

Page 28: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 28

How We SeeHow We See

Light is emitted from a sourceLight interacts with surfaces in the

environmentLight is reflected into our eyes

Page 29: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 29

Human VisionHuman Vision

Light passes into the cornea, though a liquid filled chamber and out through the lens. These focus the light

The pupil acts as diaphragm, controlling the amount of light

The light is projected onto the retina at the back of the eye

Page 30: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 30

Human VisionHuman Vision

The retina is covered with photosensitive receptor cells

Photoreceptor cells are attached to the optical nerve which feeds signals to the brain

Light (photons) enter the cell cause a chemical reaction which causes the cell to fire

Page 31: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 31

Eat Your Carrots!Eat Your Carrots!

Photoreceptor cells contain opsin (a protein) + retinal = rhodopsin

Photo excitation causes the rhodopsin to twist and release the retinal

The released retinal causes a reaction which cause the attached nerve to fire

Retinal is destroyed in the processRetinal is synthesized from vitamin AVitamin A is derived from beta-

carotene

Page 32: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006BPC: Art and Computation – Fall 2006

Digital Media II:Digital Media II:Light, Vision & Digital ImagesLight, Vision & Digital ImagesPart 2Part 2

Glenn Bresnahan

[email protected]

Page 33: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 33

Question?Question?

When we combine light of two different frequencies we seem to get light of a different color. Why does this happen? Sound waves don’t combine this way.

Page 34: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 34

Combining WavesCombining Waves

Sound waves do not combine to make new frequencies (pitch)

C + E not equal DC = 523.25 Hz / 65.9 cm (2.162 ft)

D = 587.33 Hz / 58.7 cm (1.925 ft)

E = 659.29 Hz / 52.3 cm (1.716 ft)

Page 35: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 35

Length of Light WavesLength of Light Waves

Human hair ~ 1/500”– 0.005 cm– 50,000 nm

Cyan light = 500 nm 100 wavelengths

across a human hair

Page 36: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 36

Human VisionHuman Vision

Light passes into the cornea, though a liquid filled chamber and out through the lens. These focus the image

The pupil acts as diaphragm, controlling the amount of light

The light is projected onto the retina at the back of the eye where a chemical reaction causes neurons to fire

Page 37: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 37

PhotoreceptorsPhotoreceptors

The retina contains two types of receptor cells: rods and cones

Approx. 90 million rods; 4.5 million cones

Page 38: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 38

Photoreceptors - RodsPhotoreceptors - Rods

Rods react to very low light levels– As few as several photons

Rods react to a broad spectrum of frequencies (max at 498 nm)

Rods react slowly (~100 milliseconds)

Page 39: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 39

Photoreceptors - ConesPhotoreceptors - Cones

Cones require much more light to fireCones react much more quickly (10-

15 ms)Cones are much denser in the center

(fovea) of the eye

Page 40: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 40

Photoreceptors – DistributionPhotoreceptors – Distribution

Page 41: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 41

Photoreceptors - ConesPhotoreceptors - Cones

Three types of cones: S, M, L which react to different wavelengths of light– L Cones: peak at 564 nm–M Cones: peak at 533 nm– S Cones: peak at 437 nm

Page 42: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 42

Photoreceptors – Response SpectrumPhotoreceptors – Response Spectrum

S = blue, M = green, L = red

Page 43: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 43

Photoreceptors – Seeing ColorsPhotoreceptors – Seeing Colors

Any response can be synthesized by combining red, green and blue light

Page 44: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 44

Color MixingColor Mixing

Adding red, green and blue light in various proportions can generate the perception of all colors

Page 45: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 45

Cell FiringsCell Firings

Light reaching photoreceptors causes some number of cells to fire (after an interval)

Cells can not continually fireReceptors can become saturatedCell firings are discrete

Page 46: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 46

Saturation – After ImagesSaturation – After Images

Page 47: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 47

Saturation – After ImagesSaturation – After Images

Page 48: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 48

Flicker FusionFlicker Fusion

If light is flashed fast enough, it becomes indistinguishable from a steady light

The rate is called the flicker fusion or critical flicker frequency

Dependent on intensity, but about 45 Hz

Page 49: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 49

Flicker Fusion & AnimationFlicker Fusion & Animation

Flicker fusion makes animation possible

Each frame is

displayed a

fraction of a

second

Page 50: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 50

Flicker Fusion in Film and VideoFlicker Fusion in Film and Video

Film uses 24 frames per secondVideo uses 30 frames per secondFlicker fusion is >45 FPSHow does this work??

Page 51: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 51

Flicker Fusion in FilmFlicker Fusion in Film

Film projector has a shutterEach frame is displayed 3 times

Page 52: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 52

Flicker Fusion in VideoFlicker Fusion in Video

Frame is broken up into strips (scan lines)

Frame is divided into two fields: odd lines and even lines

Fields are displayed at 60 Hz

Page 53: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 53

SeeingSeeing

The rods and cones cause nerves to fire and electrical signals to be send to the brain.

There are ~100 million receptor cells generating impulse streams

Impulses are combined by other nerve cells

1.2 million nerve fibers in optic nerve bundle

Page 54: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 54

Vision Is ComplicatedVision Is Complicated

Page 55: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 55

Digital ImagesDigital Images

Page 56: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 56

Digital ImagesDigital Images

Red = 100%Green = 80%Blue = 60%

Page 57: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 57

Digital ImagesDigital Images

Image is constructed from a grid (array) of individual color dots

Individual dots are called pixels (picture elements) Resolution is the number of elements in each

direction (e.g. 1280 in x, 1024 in y = 1.3 Mpixel) Each pixel is composed of three color

components representing levels of R,G,B light Each level (R,G,B) is represented by a number

– One byte (0-255) per component, e.g. 255,204,153 The array of pixel values is stored in a graphics

frame buffer (memory) The pixel values are read out (at approx. 60 fps)

and used to display the image on a monitor

Page 58: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 58

Graphics DisplayGraphics Display

RGB RGB RGB …

RGB RGB RGB …

RGB RGB RGB …… … …

Frame Buffer Computer Monitor

Page 59: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 59

Cathode Ray Tube DisplayCathode Ray Tube Display

Same technology as a TV screen Electron beam is aimed at the screen When the beam hits a phosphor on the surface it

glows Three different colored (RGB) beams phosphors

Page 60: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 60

Other DisplaysOther Displays

Liquid Crystal (LCD) Plasma panel Digital Light Projection

Page 61: BPC: Art and Computation – Fall 2006 Digital Media II: Light, Vision & Digital Images Glenn Bresnahan glenn@bu.edu

BPC: Art and Computation – Fall 2006 61

Digital Storage of ImagesDigital Storage of Images

Need to store RGB value for each pixel 1024x1280 pixels = 3.9 million numbers Different images files use different ways of

storing the numbers– Most file formats store additional information– Formats vary in how much information per pixel is

stored Some formats compress the information

– Compression can lead to loss of detail– Uncompressing the compressed image is NOT the same

as the original image.– Repeatedly storing (compressing) and retrieving

(uncompressing) can cause an image to degrade