Sie sind auf Seite 1von 14

Color Fundamentals (I)

Color Image Processing

Image Processing with Biomedical Applications ELEG-475/675 Prof. Barner

The visible light spectrum is continuous Six Broad regions:

Violet, blue, green, yellow, orange, and red

Object color depends on what wavelengths it reflects Achromatic light is void of color (flat spectrum)

Characterization: intensity (gray level)


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Color Image Processing


Color Fundamentals (II)

Full-color and pseudo-color processing Color vision Color space representations Color processing

Correction Enhancement Smoothing/sharpening Segmentation


Prof. Barner, ECE Department, University of Delaware 2

Chromatic light spectrum: 400-700 nm Descriptive quantities:


Radiance total energy that flows from a light source (Watts) Luminance amount of energy and observer perceives from a light source (lumens) Brightness subjected descriptor of intensity
Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Image Processing Color Image Processing

Vision Response

Brightness and Chromaticity


Cone response:

6-7 million receptors Red sensitive: 65% Green sensitive: 33% Blue sensitive: 2%

Brightness notion of intensity Hue an attribute associated with the dominant wavelength (color)

The color of an object determines its hue

Most sensitive receptors

Saturation relative purity, or the amount of white light mixed with a hue

Primary colors: red (R), green (G), blue (B) International Commission on Illumination (CIE) standard definitions:

Pure spectrum colors are fully saturated, e.g., red Saturation is inversely proportional to the amount of white light in a color A color may be characterized by its brightness and chromaticity
Prof. Barner, ECE Department, University of Delaware

Chromaticity is hue and saturation together

Blue (435.8 nm), Green (546.1 nm), Red (700 nm)

Defined in 1931 doesnt exactly match human perception


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Image Processing Color Image Processing

Primary and Secondary Colors

Tristimulus Representation

Add primary colors to obtain secondary colors of light:

Magenta, cyan, and yellow Light sources

Tristimulus values: X red; Y green; Z blue Trichromatic coefficients: X


x= X +Y + Z

Primarily colors of:

y= z=

Red, green, blue

Y X +Y + Z Z X +Y + Z

Pigments absorbs (subtracts) a primary color of light and reflects (transmits) the other two

x + y + z =1

alternate approach: chromaticity diagram

Magenta (absorbs green), cyan (absorbs red), and yellow (absorbs blue) Secondary pigments:

Gives color composition as a function of red (x) and green (y)

Solve for blue (z) according to the above

Red, green, and blue


Prof. Barner, ECE Department, University of Delaware

Projects 3-D color space on to two dimensions


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Image Processing Color Image Processing

Chromaticity Diagram

The RGB Color Model (Space)

Pure colors are on the boundary

Fully saturated

Interior points are mixtures

RGB is the most widely used hardware-oriented color space

A line between two colors indicates all possible mixtures of the two colors

Color gamut triangle defined by three colors


Three color mixtures are restricted to the gamut No three-color gamut completely encloses the chromaticity diagram

Graphics boards, monitors, cameras, etc. testing Normalized RGB values Grayscale is a diagonal line through the cube Quantization determines color depth

Full-color: 24-bit representations (16,777,216 colors)


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

11

Color Gamut Examples

Color Image Generation

RGB monitor color gamut

Regular (triangular) shaped Based on three highly controllable light primaries

Monochrome images represent each color component

Hyperplane examples:

Printing device color gamut

Combination of additive and subtracted color mixing Difficult control process

Fix one dimension Example shows three hidden sides of the color cube

Neither gamut includes all colors

Acquisition process reverse operations

Monitor is better
Prof. Barner, ECE Department, University of Delaware

Filter light to obtain RGB components


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

10

Image Processing Color Image Processing

12

Safe RGB Colors (I)


The CMY and CMYK Color Spaces

Consistent color reproduction is problematic

Plethora of hardware from different manufacturers

CMY cyan, magenta, and yellow

Define a subset of colors to be faithfully reproduced on all hardware

CMYK adds black


256 colors

Black is difficult (and costly) to produce with CMY Four-color printing

Sufficient number to produce good images Small enough set to be accurately reproduced 40 of these yield hardware specific results Formed as RGB triplets of values below

Subtracted primaries widely used in printing


C 1 R M = 1 G Y 1 B

De facto safe RGB/Web/browser colors: 216 colors

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

13

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

15

Safe RGB Colors (II)


The HSI Color Space (I)

216 safe RGB colors 256 color RGB system includes 16 gray levels

Hue, saturation, intensity


Six are in the 216 safe colors (underlined)

RGB said-color cube

human perceptual descriptions of color Decouples intensity (gray level) from hue and saturation Rotate RGB cube so intensity is the vertical axis

The intensity component of any color is its vertical component Saturation distance from vertical axis

Zero saturation: colors (gray values) on the vertical axis Fully saturated: pure colors on the cube boundaries

Hue primary color indicated as an angle of rotation


Prof. Barner, ECE Department, University of Delaware 16

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

14

Image Processing Color Image Processing

The HSI Color Space (II)

HSI to RGB Conversion Three Cases

View the HSI space from top down

Case 1: RG sector (0H120)


B = I (1 S )

Slicing plane perpendicular to intensity

S cos H R = I 1 + cos(60 H ) G = 1 ( R + B)

Intensity height of slicing plane Saturation distance from center (intensity axis) Hue rotation angle from Red Natural shape: hexagon

Case 2: GB sector (120H240)


H = H 120 R = I (1 S )
S cos H G = I 1 + cos(60 H ) B = 1 (R + G)

Case 3: BR sector (240H360)


H = H 240

Normalized to circle or triangle

G = I (1 S )
S cos H B = I 1 + cos(60 H ) R = 1 (G + B)

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

17

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

19

RGB to HSI Conversion


HSI Component Example (I)

Common HSI representations RGB to HSI conversion


H = { 360
if B G if B >G

1 [( R G ) + ( R B)] 2 = cos 1 1 2 ( R G ) 2 + ( R B)(G B) 3 S = 1 [ min( R, G, B)] ( R + G + B)


1 I = ( R + G + B) 3

HSI representations of the color cube


Result for normalized (circular) HSI representation Take care to note which HSI representation is being used!

Normalized values represented as gray values Only values on surface of cube shown Sharp transition in hue Dark and light corners in saturation Uniform intensity
Prof. Barner, ECE Department, University of Delaware 20

Explain:

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

18

Image Processing Color Image Processing

HSI Component Example (II)

Density Slicing Example (I)

Primary and secondary colors

Eight color density slicing of thyroid Phantom

HSI representation
Prof. Barner, ECE Department, University of Delaware 21

Density slicing enables visualization of variations and details


Prof. Barner, ECE Department, University of Delaware 23

Image Processing Color Image Processing

Image Processing Color Image Processing

Pseudocolor Image Processing

Density Slicing Example (II)

Assigning colors to gray values yields Pseudocolor (false color) images

X-ray image of a weld

assignment criteria is application-specific Assign colors based on gray value relation to slicing plane
f ( x, y ) = ck if f ( x, y ) Vk

Density slicing to help visualize cracks

Intensity (density) slicing

Special case: Thresholding


Prof. Barner, ECE Department, University of Delaware Image Processing Color Image Processing Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

22

24

Density Slicing Example (III)

Example: Airport x-ray Scanning System

Sinusoidal color mappings

Phase changes between components yield different results Greatest color changes at sinusoidal troughs

Largest derivative

First mapping:

Highlights explosives Explosives and bag have similar mappings

Second mapping:

Explosive is transparent

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

25

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

27

Gray Level to Color Transformations

Multispectral Extensions

Each color can be a dependent/independent function of gray level


Pseudo coloring is often used in the visualization of multispectral images

Example: RGB processing Goal: highlight (color) objects or features of interest


Prof. Barner, ECE Department, University of Delaware 26

Examples: Satellite and astronomy images

Visible spectrum, infrared, radio waves, etc.

Transformations are applications and spectral band dependent


Prof. Barner, ECE Department, University of Delaware 28

Image Processing Color Image Processing

Image Processing Color Image Processing

Wash. DC LANDSAT Example (I)

Galileo Spacecraft Example

Multispectral image of

Jupiters moon: Ito Multispectral bands are chemical composition sensitive Highlights volcanic activity

Pseudocolor image

New deposits: red Old deposits: yellow

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

29

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

31

Wash. DC LANDSAT Example (II)


Full-Color Image Processing

Images in bands 1-4 Color composite image using


Band 1 (visible blue) as blue Band 2 (visible green) as green Band 3 (visible red) as red Result is difficult to analyze

Samples in observation window

Vectors

cR ( x, y ) R ( x , y ) c ( x, y ) = cG ( x, y ) = G ( x, y ) cB ( x, y ) B ( x, y )

Color composite image using


Bands 1 and 2 as above Band 4 (near infrared) as red Better distinguishes between biomass (red dominated) and man-made structures

General transformation:
g ( x , y ) = T [ f ( x, y ) ]

Restrict transformation to be a set {T1,T2, ,Tn} of transformations or color mappings


si = Ti (r1 , r2 ,..., rn )

RGB: n=3; HSI: n=3; CMYK: n=4


Prof. Barner, ECE Department, University of Delaware 32

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

30

Image Processing Color Image Processing

Image & Components

Color Complements

Image and CMYK, RGB, and HSI components Simple application:


Intensity scaling HSI space: s3=kr3 RGB space: si=kri i=1,2,3 CMY space: si=kri +(1-k) i=1,2,3

Color circle

Circular connection of visible spectrum Color negatives Shown transformations


Color complementation

RGB: exact HSI: approximation

S component not independent of H&I


Prof. Barner, ECE Department, University of Delaware

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

33

Image Processing Color Image Processing

35

Scaling Result

Color Management Systems (CMS)

All devices have their own profile Goal: device independent color model

Scaling result for k=0.7

Shown: RGB, CMY, and HSI transformations

Must be able to represent the entire color gamut Shown:


(HS and I transformations swapped)


Prof. Barner, ECE Department, University of Delaware 34

RGB monitor gamut Full gamut


Prof. Barner, ECE Department, University of Delaware 36

Image Processing Color Image Processing

Image Processing Color Image Processing

CIE L*a*b* Color Space (I)

Tone Corrections

Desired color space attributes


Color metric colors perceived as matching are identically coded Perceptually uniform color differences among various hues are perceived uniformly

Change intensity, not color

Distance in color space matches perceived difference in colors

Device independent independent of specific device display characteristics

RGB and CMYK space: uniformly scale components HSI space: scale intensity (luminance)

Gamut encompasses entire visible spectrum

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

37

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

39

CIE L*a*b* Color Space (II)

Color Imbalances

Tristimulus to L*a*b* conversion: Y


L* = 116 h 16 YW X Y a* = 500 h h X W YW Y Z b* = 200 h h YW ZW

Components:

Intensity (lightness): L* Color:


Red minus green: a* Green minus blue: b*

Color in balances are normally addressed in the RGB or CMYK spaces

where

Appropriate for applications that require:

Corrective mappings shown

h (q) =

3q q > 0.008856 7.787 q +16 /116 q 0.008856

Reference white tristimulus values:

XW=0.3127, YW=0.3290, and ZW=1-XW-YW

Full color space representation Color space distance and perceptual difference matching Drawbacks: computational cost
38 Image Processing Color Image Processing Prof. Barner, ECE Department, University of Delaware 40

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

10

Histogram Processing

HSI Processing

Perform histogram equalization on Intensity

Avoids generation of new colors

Independent component processing is undesirable

Improves statistics of intensity Does impact vibrancy of colors

Alternative approach: process Intensity

Solution: increase saturation

Useful for extending grayscale procedures to color

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

41

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

43

Separable Functions

RGB HSI Smoothing Comparison

Simple separable linear functions can be applied to components independently

Example: spatial averaging


c ( x, y ) = 1 K
( x , y )S xy

c( x, y )

1 R ( x, y ) K ( x , y )S xy 1 ( , ) c ( x, y ) = G x y K ( x , y )S xy 1 B x y ( , ) K ( x , y ) S xy

Similar, but not identical results

Apply on RGB components

RGB processing introduces new colors

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

42

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

44

11

RGB HSI Sharpening Comparison

Vector Gradient

RGB unit vectors: r, g, b Directional derivatives:


u=

v=

R G B r+ g+ b x x x R G B r+ g+ b y y y
2

Dot products:
T

R + x 2 R g yy = v v = v v = + y g xx = u u = uT u =

G + x 2 G + y
2

B x 2 B y
2

g xy = u v = uT v =

Laplacian reduces to component-wise application


R( x, y ) 2 [c( x, y ) ] = 2G ( x, y ) 2 B( x, y )
2

Direction of maximum change: Magnitude of maximum change:

R R G G B B + + x y x y x y

= tan 1

1 2

2 g xy ( g xx g yy )

Application on Intensity yields similar results


Prof. Barner, ECE Department, University of Delaware 45 Image Processing Color Image Processing

1 2 F ( ) = [( g xx + g yy ) + ( g xx g yy ) cos 2 + 2 g xy sin 2 ] 2
Prof. Barner, ECE Department, University of Delaware 47

Image Processing Color Image Processing

Edge Detection in Color Images

Gradient Example

Shown

Gradient operators applied independently to color components yields poor results RGB example: step edges in individual color planes

Input image RGB space vector gradient RGB space independent component gradient

Case 1: aligned edges Case 2: two aligned edges, one orthogonal edge Both cases yield identical gradients at image center

Results summed

Color change more significant in Case 1


Prof. Barner, ECE Department, University of Delaware

Difference image
Prof. Barner, ECE Department, University of Delaware 48

Image Processing Color Image Processing

46

Image Processing Color Image Processing

12

Component Gradients

Noise and Color Space Conversion

Independent Gaussian noise in the RGB channels

RGB component gradients

Resulting color image Note introduced colors

Note broken edges in individual components

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

49

Image Processing Color Image Processing

Prof. Barner, ECE Department, University of Delaware

51

Noise in Color Images

HSI Representation of Noisy Image

The general degradation model holds in the color case Noise affecting individual color planes usually has the same characteristics

Usually modeled as independent Differences in channel illumination levels

Hue and saturation are severely degraded

Possible differences:

Nonlinear transformations from the RGB space

Involves cosine and minimum operators

Red (filtered) channel in a CCD camera tends to have lower illumination (higher noise)

Intensity component is smoothed

Bad sensors in an individual channel


Prof. Barner, ECE Department, University of Delaware 50

Average of RGB components


Prof. Barner, ECE Department, University of Delaware 52

Image Processing Color Image Processing

Image Processing Color Image Processing

13

Single Channel Corruption

Single channel corruption

Salt and pepper noise in the green channel p=0.05

Color space conversion


Spreads noise Changes statistics Shown: HSI components


Prof. Barner, ECE Department, University of Delaware 53

Image Processing Color Image Processing

14

Das könnte Ihnen auch gefallen