SYDE 575: Introduction to Image Processing · Mixture of pigment primaries subtractive Source:...

Preview:

Citation preview

SYDE 575: Introduction to Image Processing

Color Image Processing

Visible Light

● Visible light composed of relatively narrow band of frequencies in electromagnetic spectrum

● Chromatic light spans EM spectrum from around 400 to 700 nm

Source: Gonzalez and Woods

Color Perception

● Perceived color of an object based on nature of light reflected from object

● Examples:– If object reflects light that's balanced

from all visible wavelengths, object is perceived as white

– If object reflects light with wavelengths mainly in the 575 to 625nm range, object is perceived as red

Cones Revisited

● 6 to 7 million cones in the human eye● Divided into three main types:

– L cones (65%)● Maximally sensitive to long wavelengths (e.g., red)

– M cones (33%)● Maximally sensitive to medium wavelengths (e.g., green)

– S cones (2%)● Maximally sensitive to short wavelengths (e.g., blue)

Light Absorption of Cones

● Visible colors can be visualized as weighted combination of primary colors red, green, and blue

Source: Gonzalez and Woods

Mixtures of Light vs. Mixtures of Pigments

● Mixture of light primaries additive● Mixture of pigment primaries subtractive

Source: Gonzalez and Woods

CIE Chromaticity Diagram

● A method for specifying colors● Specifies color composition as function of x

(red) and y (green)● For any value of x and y, value of z (blue)

can be found as

● The (x,y,z) values of a color specifies percentage of red, green, and blue needed to form the color (Trichromatic Coefficients)

1 ( )z x y= − +

CIE Chromaticity Diagram

Source: Gonzalez and Woods

CIE Chromaticity DiagramInterpretation

● Pure spectrum colors located around boundary

● All non-boundary colors are mixture of spectrum colors

● Point of equal energy corresponds to equal fractions of the three primary colors– CIE standard for white light

● Straight line segment joining to points define all colors that can be created by mixing these two colors additively

RGB Color Model

● Primarily used for displays and cameras● Based on Cartesian coordinate system● Three axis represents intensities of red,

green, and blue● Gray scale (points of equal RGB values)

extends from black (0,0,0) to white (1,1,1)● Example: 24-bit color (Truecolor)

– 8-bits (256 levels) are used to represent each channel

– Gives a total of (256)3=16,777,216 possible colors!

RGB Color Model Visualization

Source: Gonzalez and Woods

CMY/CMYK Color Models

● Primarily used for printing● Based on primary colors of pigments● For CMY, the three axis represent the

amount of cyan, magenta, and yellow pigments to put in to produce a certain color

111

C RM GY B

= −

Why K?

● In theory, equal amounts of cyan, magenta, and yellow produces black

● In practice, combining them results in muddy-looking black

● To produce true black in printing, a fourth color (black) is added to produce the CYMK color model

Pros and Cons of RGB

● Advantages of RGB model:– Straightforward (great for hardware

implementation)– Matches well with human vision system's

strong response to red, green, and blue● Disadvantage of RGB model:

– Difficult for human description of color (e.g., humans don't describe color as RGB percentages)

– Highly redundant and correlated (e.g., all channels hold luminance information, reduces coding efficiency)

HSI Color Model

● Useful for human color interpretation● Three axis represent:

– Hue● Describes pure/dominate color perceived by

observer (e.g., pure yellow, orange, red)– Saturation (Purity of color)

● Amount of white light mixed with hue ● High saturation = high purity = little white

light mixed with hue– Intensity

● Brightness

Relationship between RGB and HSI

Source: Gonzalez and Woods

● Hue: all colors on plane defined by white, black, and a pure color corner point have same hue

● Saturation: distance from associated pure color● Intensity: projection to gray scale line

HSI Color Model Visualization

Source: Gonzalez and Woods

Example: Decomposing image into HSI components

Source: Gonzalez and Woods

YCbCr Color Model

● Useful for image and video compression (e.g, JPEG, MPEG)

● Three axis represent:– Y: Luma– Cb: Blue difference (Blue – Luma)– Cr: Red difference (Red-Luma)

● Separates luma from chroma channels so they can be treated separately

● More closely related to human vision system– Recall: Luminance vs. Chroma sensitivity

● More perceptually uniform (i.e., color differences among hues perceived uniformly)

Pseudocolor Image Processing

● Goal– Assign color to gray levels to convert

grayscale image into color image● Why?

– Improve visualization of image information

● Motivation– Humans can discern thousands of color

shades but only two dozen or so gray shades

Intensity Slicing

● One of the simplest methods for pseudocolor image processing

● Grayscale image can be viewed as 3D function (x,y, and intensity)

● Suppose we define P planes perpendicular to intensity axis

● Each plane i is associated with a color Ci

● Pixels with intensities lying along a particular plane i is assigned the color C

i

corresponding to the plane

Visualization of Intensity Slicing

Source: Gonzalez and Woods

Example: Rainfall Monitoring

Source: Gonzalez and Woods

Gray Level to Color Transformations

● Intensity slicing limits range of pseudocolor enhancement results– Fixed one-to-one relationship between

intensity and specified colors● Alternative solution:

– Process grayscale image using independent transformations

– The results of the transformations are combined to create one composite color image

Example using Three Transformations

Source: Gonzalez and Woods

Example: Security Screening

Source: Gonzalez and Woods

Explosive

Garment bag

Background

Transformation 1

Source: Gonzalez and Woods

● Garment bag mapped differently than explosive

● Easy to spot explosive

Transformation 2

Source: Gonzalez and Woods

● Garment bag mapped similar than explosive

● Hard to spot explosive

Multi-Image Pseudocoloring

Source: Gonzalez and Woods

Example: Multispectral Image Visualization

Source: Gonzalez and Woods

Point Operations in Color Image Processing

● Similar to point processing for grayscale images

1 2( , ,..., ), 1, 2,...,i i ns T z z z i n= =● Example: RGB color model

– n = 3– z

1,z

2,z

3 denotes red, green, blue

components of the input image

What are Color Complements?

● Hues opposite one another on the color circle

● Analogous to grayscale inverses● Useful for enhancing details in dark regions

of image

Source: Gonzalez and Woods

Example

Source: Gonzalez and Woods

Point Operations for Tone Correction

● Tonal range: general distribution of color intensities– Similar to intensity contrast in grayscale

images● High-key images

– Colors concentrated at high intensities● Low-key images

– Colors concentrated at low intensities● As with grayscale images, it is desirable to

distribute color intensities evenly

Point Operations for Tone Correction

● Before correcting color imbalances, tonal imbalances are first corrected

● Since colors are not changed, all color channels are transformed using the same transformation for color models where intensity information is spread across multiple channels (e.g., RGB, CMY)

● For HSI color model, only I channel is modified

● Operations are similar to intensity contrast adjustment for grayscale images

Tone Correction for Common Tonal Imbalances

● Flat images– Use an s-curve transformation to boost

contrast ● lighten highlight areas● darken shadow areas

● Light and dark images– Similar to power-law transformations– Stretch light regions and compress dark

regions for light images (high gamma)– Stretch dark regions and compress light

regions for dark images (low gamma)

Example Tonal Corrections

Source: Gonzalez and Woods

Point Operations for Color Correction

● Various ways to correct color imbalances● Perception of a color affected by

surrounding colors● Proportion of any color (e.g., magenta) can

be reduced by– Increasing its complementary color (e.g.,

green)– Decreasing portion of the two

immediately adjacent colors (e.g., red and blue)

Color Corrections

Source: Gonzalez and Woods

Histogram Equalization

Source: Gonzalez and Woods

● Histogram equalization on individual color channels leads to erroneous colors

● Better approach is to just equalize intensity component and leave colors (i.e., hues) unchanged

Recommended