Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is...

43
EECS490: Digital Image Processing Lecture #12 Image Correlation (example ) Color basics (Chapter 6) The Chromaticity Diagram Color Images RGB Color Cube Color spaces Pseudocolor Multispectral Imaging

Transcript of Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is...

Page 1: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

Lecture #12

• Image Correlation (example)

• Color basics (Chapter 6)

• The Chromaticity Diagram

• Color Images

• RGB Color Cube

• Color spaces

• Pseudocolor

• Multispectral Imaging

Page 2: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

White Light

A prism splits white light into its component colors.

Page 3: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Optical Units

Radiometric units:Radiance (watts/sr/m2) — power per unit solid angle emitted by a light sourceIrradiance (watts/m2) — total power incident on a surface

Photometric units (corrected for wavelength sensitivity of the human eye):Luminous intensity (candela) - “power” emitted by a source in a given directionLuminance (candela/m2) — total light passing through a given surface or emitted from asurfaceLuminous flux (lumens) — luminous flux of light produced by a light source that emits onecandela of luminous intensity over a solid angle of one steradian

Page 4: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Human Eye

The cones provide all thecolor sensitivity and areconcentrated near themacula.

Relative color sensitivity ofthe cones.

65% of cones are red sensitive;33% are green sensitive; 2% areblue sensitive.

Page 5: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Primary/Secondary Colors

(Primary) additive colorsoperate in transmissionsuch as found in televisionsand computer monitors

(Secondary) subtractivecolors operate in reflectionsuch as found in printing

Subtractive colors operateby absorbing a primarycolor. They usually requireblack as an additional color.

For example, yellow absorbsblue and reflectsred+green=yellow

RGB

CMY

Page 6: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Why K?

Common reasons for adding a K (black) ink include:

* Text is typically printed in black and includes finedetail (such as serifs), so to reproduce text or otherfinely detailed outlines using three inks without slightblurring would require impractically accurateregistration (i.e. all three images would need to bealigned extremely precisely).

* A combination of 100% cyan, magenta, and yellowinks soaks the paper with ink, making it slower to dry,and sometimes impractically so.

* A combination of 100% cyan, magenta, and yellowinks often results in a muddy dark brown color that doesnot quite appear black. Adding black ink absorbs morelight, and yields much “blacker” blacks.

* Using black ink is less expensive than using thecorresponding amounts of colored inks.

Page 7: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

CIE Chromaticity Diagram

Characteristics of color:•Brightness•Chromaticity:

• Hue - dominant colorseen by the observer

• Saturation - amount ofwhite light mixed withthe color

A chromaticity diagramplots the tristimulus valuesx,y and z of a color. This isbased upon X,Y and Z —the amounts of red, greenand blue needed torepresent a color.

x =X

X +Y + Z

y =Y

X +Y + Z

z =Z

X +Y + Zwhere x + y + z +1

The x-axis is red.

The

y-ax

is is

gree

n.

Blue is notplotted since is isequal to 1-x-y

The diagram shows all colors perceivable by the human eye.

Page 8: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

CIE Chromaticity Diagram

Characteristics of color:•Brightness•Chromaticity:

• Hue - dominant colorseen by the observer

• Saturation - amount ofwhite light mixed withthe color

The point of equal energy(x=0.33,y=0.33, impliedz=0.33) defines the CIEstandard for white light

The x-axis is red.

The

y-ax

is is

gree

n.

Any point on the boundaryis fully saturated(saturation=1)

Note that we candefine many kinds ofwhite near the CIEstandard for white.These include daylight(more blue), coolwhite (more red andgreen), and warmwhite (much more red)

Page 9: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Temperature

The x-axis is red.

The

y-ax

is is

gree

n. Color Temperature(measured in Kelvin)describes how "warm"or how "cool" the lightsource is. It is based onthe color of light emittedby an incandescentsource. As a piece ofmetal (a theoreticalBlackbody) is heated, itchanges color fromreddish to orange toyellowish to white tobluish-white. The colorof light emitted by anincandescent objectdepends only on thetemperature. We canuse this scale todescribe the color of alight source by its "ColorTemperature."

Page 10: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

CIE Chromaticity Diagram

Color printers are capableof far less color renditionthan a color monitor. Thetwo regions define typicallimits of printers andmonitors. Note that a monitor

(triangle) is incapable ofdisplaying colortemperatures below about1900˚K. A printer is evenworse.

Page 11: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

• Are constructed from threeoverlaid intensity maps.

• Each map represents theintensity of a different“primary” color.

• The actual hues of theprimaries do not matter aslong as they are distinct.

• The primaries are 3 vectors(or axes) that form a“basis” of the color space.

1999-2007 by Richard Alan Peters II

Color Images

Page 12: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

Each color corresponds to a point in a 3D vector space

1999-2007 by Richard Alan Peters II

Pixels — Coordinates or Vectors?

Page 13: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

for standard digital images

• primary image colors red, green, and blue

– correspond to R,G, and B axes in color space.

• 8-bits of intensity resolution per color

– correspond to integers 0 through 255 on axes.

• no negative values

– color “space” is a cube in the first octant of 3-space.

• color space is discrete

– 2563 possible colors = 16,777,216 elements in cube.

1999-2007 by Richard Alan Peters II

Color Space

Page 14: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

RGB Color Cube

The colors along thediagonal have equal amountsof red, green, and bluewhich defines gray. Buttheir intensity given byI=(R+G+B)/3 varies from 0(black) to 1 (white) alongthe cube’s diagonal.

Page 15: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

RGB Color Cube

Typically each color isdefined by three 8-bitnumbers for 24-bit color.Some computer programsalso support 48-bit color.

The top surface can be written as (R,G,255)

The bottom surface can be written as (R,G,0)

Page 16: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

1999-2007 by Richard Alan Peters II

Color Cube: Faces (outer)

The primary colors are at three vertices.The secondary colors are at threedifferent vertices

Page 17: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

1999-2007 by Richard Alan Peters II

Color Cube: Faces (inner andouter)

Cutting open the cube shows black at the origin.

Black and white form the remaining two vertices.

Page 18: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

RGB axes CMY axes

1999-2007 by Richard Alan Peters II

Different Axis Sets in Color Space

Page 19: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

The same color has different RGB and CMY coordinates.

1999-2007 by Richard Alan Peters II

Color With Respect To Different Axes

which may be related to each other.

Page 20: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Monitors

(0,G,B) (R,0,B) (R,G,0)

The monitor adds primary colors.

Page 21: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

“safe” Colors

Many systemsrestrict themselves to256 Internet “safe”colors for simplicityand ease ofgeneration.

Decreasing blue

Dec

reas

ing

gree

n

$00$33$66

$99$CC$FF

Red coordinate values

There are six safe grays.

$FF $00

$FF

$00

Page 22: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

“safe” colors

The Internet “safe” RGB color cube. All surface colors are “safe”.

Color printers and copiers convertRGB to CMY. To get a good black oncolor printers a separate “black” isused.

C

M

Y

=

1

1

1

R

G

B

Page 23: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

R G B

L a* b*

are represented by three bands (not uniquely)

e.g., R, G, & B; L, a*, & b*; or HSI

Red

Green

Blue

Luminance

a*-chroma

b*-chroma

Color Images

La*b* is a CIE color space designed to approximate human vision. L approximates thehuman perception of brightness. a* and b* are color opponents. There is no direct, simpleconversion from RGB to La*b* since it requires a reference white (specifically a diffuseCIE D65 light source). 1999-2007 by Richard Alan Peters II

The RGB color space results from simple ways to separate and combine color.

Page 24: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

Lu

min

an

ce

hu

esa

tura

tion

photo receptorsbrain

The eye has 3 types of photoreceptors: sensitive to red, green, or blue light.

The brain transforms RGB into separatebrightness and color channels (e.g., HSI).

RGB to HSI: A PerceptualTransformation

HSV Hue-Saturation-Value (also called HSB) is a perceptual system also called the Munsell colorsystem. I ranges from black to a saturated color or white. There is a separate hue and Saturation.

HSL Hue-Saturation Luminance (also called HLS or HSI) defines luminance as the “lightness”. L rangesfrom black to white. The half-way point is always a 50% gray.

1999-2007 by Richard Alan Peters II

How do humans perceive color?

Page 25: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

HSI Color Space

NOTE:GW uses the HSI color space

1. The black-whiteline defines the I-axis for the HSIcolor space.

2. Each plane ⊥ tothe I-axis containsall colors of thesame saturation,i.e., with the sameamount of white.

3. The plane ⊥ toboth the I-axis andthe saturationplane will contain allcolors of the samehue.

Page 26: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

HSI Color Space

Looking into the RGB color cube alongthe I-axis. White is closest to you inthis orientation. Dashed lines are theback of the cube.

The saturationplane asbounded by theRGB cube is ahexagon.

The hexagonalsaturation plane isusually more simplymodeled as atriangle or circle.

S (radius) and H (angle) are usually expressed in polar coordinates with red=0˚.

Page 27: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

HSI Color Space

The triangularand circularapproximationsto the RGBcube plotted in3-D.

Page 28: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

White Light

Red

Increasing saturationtowards edges.

Intensity ishighest at white;lowest at themost highlysaturated colors.

Page 29: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

RGB to HSI Conversion

I =1

3R +G + B( )

S = 13

R +G + Bmin R,G,B( )

H =if B G

360 if B > G

= cos 1

12

R G( ) + R B( )

R G( )2+ R B( ) G B( )

Page 30: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

HSI to RGB Conversion

B = I 1 S( )

R = I 1+S cosH

cos 60˚ H( )

G = 3I R + B( )

Page 31: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

RGB ↔ HSI

H component (angles):B/W are zero hueRed is 0˚ or black

S component [0:255]:These colors are fullysaturated (they are all onsurface of RGB cube)

I component:Average intensities

Primary/secondarycolors

Gray axis has zero hue and zero saturation.

Page 32: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

HSI Color Processing

S component:Reduce cyan saturationby 50%

I component:Reduce intensity ofwhite by 50%

Transform back to RGB:B & G become redCyan looks washed outWhite is now 50% gray

H component:Change blue and green tozero,i.e., this makesthem red.

Page 33: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Pseudocolor

If gray>li then color A

If gray<li then color B

Assign colors to grayscale values usingsome criterion. This technique is useda lot in data visualization.

Page 34: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Pseudocolor

Intensity slicing can also be described asan intensity transformation similar tothose found in Chapter 2.

Page 35: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Pseucocolor

In this example we map gray scales tomultiple colors (eight in this case).

Page 36: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Pseudocolor

If gray=255 then yellowelse blue.

Cracks in a weld allowhigh-intensity x-rayexposure.

Page 37: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Pseudocolor

Difficult to see the patterns ina gray-scale image. Colorallows easier visualization.

Page 38: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Transformations

We can perform simultaneous color transformations andcombine the result on an RGB monitor.

Page 39: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Transformations

These are periodictransformations designedto map intensities intospecific colors.

Transform 6.25(a) Transform 6.25(b)

Page 40: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Transformations

Page 41: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Color Transformations

More sophisticated color transformationscan be used to, for example, combinegrayscale images from different sensors.

Page 42: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Multi-Spectral Imaging

R G

B IR

RGB

RGIR

Page 43: Lecture #12engr.case.edu/merat_francis/eecs490f07/Lectures/Lecture... · 2012. 2. 16. · * Text is typically printed in black and includes fine detail (such as serifs), so to reproduce

EECS490: Digital Image Processing

© 2002 R. C. Gonzalez & R. E. Woods

Multi-Spectral Imaging

Color encoding of a varietyof different sensor inputs.

Red material was recentlyejected from a volcano.

Older ejected material(sulfur) is yellow.