Title: BIM472 Image processing
1BIM472 Image processing
2Contents
- Color Image Processing
- Color Fundamentals
- Color Models
- RGB, CMY, CMYK, HSI
- Pseudocolor Image Processing
- Intensity Slicing
- Gray Level to Color Transformations
- MATLAB Exercises
3Why Color?
- Color is a powerful descriptor that often
simplifies object identification and extraction
from a scene. - Humans can discern thousands of color shades and
intensities, compared to about only two dozen
shades of gray.
4Color Image Processing
- Full-Color Processing
- Images are acquired with a full-color sensor,
such as a color TV camera or color scanner - Pseudo-Color Processing
- A color is assigned to a particular range of gray
levels
5Color Spectrum
6Color Fundamentals
- The colors that humans and some other animals
perceive in an object are determined by the
nature of the light reflected from the object. - A body that reflects light that is balanced in
all visible wavelengths appears white to the
observer. - Green objects reflect green light and absorbs
other colors.
7Color Fundamentals
- Achromatic Light
- Void of color
- Its only attribute is its intensity, or amount
- Gray level refers to a scalar measure of
intensity - Chromatic Light
- Colored light
- Spans the electomagnetic spectrum from
approximately 400nm-700nm
8Chromatic Light
- Radiance
- Total amount of energy that flows from the light
source - Measured in watts (W)
- Luminance
- Amount of energy that an observer perceives
- Measured in lumens (lm)
- Brightness
- Subjective descriptor that is practically
impossible to measure
9Human Vision
- Cones are the sensors in the eye responsible for
color vision - 6 to 7 million cones can be divided into three
principal sensing categories Red, green, blue - 65 are sensitive to red, 33 are sensitive to
green and 2 are sensitive to blue - Blue cones are the most sensitive
- Colors are seen as variable combinations of the
primary colors red, green and blue
10Absorption of Light by Cones
11Secondary Colors
- Primary colors can be added to produce the
secondary colors magenta, cyan, and yellow - Mixing the three primaries, or a secondary with
its primary color, in the right intensities
produces white light
12(No Transcript)
13Mixtures of Pigments
- On a color TV tube, red-green-blue lights are
emmitted from phospor dots and they are added. - On a printed paper, red-green-blue are absorbed
(or subtracted). Therefore primary colors for
pigments are cyan-magenta-yellow
14Characteristics of Colors
- Brightness
- Chromatic notion of intensity
- Hue
- Represents the dominant color perceived by an
observer - When we call an object red, orange, or yellow, we
are specifying its hue - Saturation
- Amount of white light mixed with hue (Inversely
proportional) - Hue and saturation taken together are called
chromaticity.
15Color Representation
- The amounts of red, green, and blue needed to
form any particular color are called the
tristimulus values and are denoted X, Y, and Z - A color is then specified by its trichromatic
coefficients
16(No Transcript)
17(No Transcript)
18Color Models
- A color model is a specification of a coordinate
system and a subspace within that system where
each color is represented by a single point - RGB
- Color monitors and video cameras
- CMY and CMYK
- Printers
- HSI
- Corresponds to how humans describe and interpret
color
19RGB Color Model
- Each color appears in its primary spectral
components of red, green, and blue - This model is based on Cartesian coordinate
system - If each of the red, green, and blue layers are
represented by 8 bits, then the full-color image
is said to be 24-bit RGB color image and
16,777,216 different colors can be represented.
20RGB Color Model
21RGB Color Cube
22(No Transcript)
23Safe RGB Colors
- Many systems are limited to 256 colors
- Some systems cant use more than a few hundred
colors - The subset of colors that are likely to be
reproduced faithfully, reasonably independently
of viewer hardware capabilities is called the set
of safe RGB colors, or the set of
all-systems-safe colors
24Safe RGB Colors
25RGB Safe-Color Cube
26CMY and CMYK Color Models
- Equal amounts of cyan, magenta, and yellow should
produce black - In practice, combining these colors produces a
muddy looking black - In order to produce true black, a fourth color,
black is added and CMYK model is constructed
27HSI Color Model
- We dont describe color of an automobile as the
red, green, and blue components - We describe it by its hue, saturation and
brightness (intensity) - HSI model is an ideal tool for developing image
processing algorithms based on color descriptions
that are natural and intuitive to humans
28Relationship Between RGB and HSI
29(No Transcript)
30(No Transcript)
31Converting from RGB to HSI
32HSI Components of Color Cube
33HSI Components of Primary and Secondary Colors
34Manipulating HSI Components
35Pseudocolor Image Processing
- Pseudocolor (also called false color) image
processing consists of assigning colors to gray
values based on a specified criterion - The term pseudo or false color is used to
differentiate the process of assigning colors to
monochrome images from the processes associated
with true color images
36Intensity Slicing
- Gray-level image is interpreted as a 3D function
- Then the image is sliced by the planes parallel
to the coordinate axis - Each slice are represented by different colors
37(No Transcript)
38Alternative Representation
39Example
40(No Transcript)
41(No Transcript)
42Gray Level to Color Transformation
43(No Transcript)
44(No Transcript)
45If Several Monochrome Images are Available
46(No Transcript)
47(No Transcript)
48Using MATLAB for Image Processing
49Color Image Representation
- An RGB color image is an MN3 array of color
pixels, where each color pixel is a triplet
corresponding to the red, green, and blue
components of the image at a specified spatial
location
50Color Image Representation
51Forming an RGB Color Image
- rgb_image cat(3, fR, fG, fB)
- fR rgb_image(, , 1)
- fG rgb_image(, , 2)
- fB rgb_image(, , 3)
52Indexed Image
- An indexed image has two components A data
matrix of integers, X, and a colormap matrix,
map. Matrix map is m3 array of class double
containing floating point values in the range
0,1. - A colormap is stored with an indexed image and is
automatically loaded with the image when imread
is used to load the image. - imshow(X, map)
- image(X)
- colormap(map)
53Indexed Image
54RGB Values of Some Basic Colors
55Predefined Colormaps
- colormap(copper)
- colormap(autumn)
- colormap(gray)
- imshow(x, copper)
56(No Transcript)
57Examples
- Generating a 100x100 yellow-red flag
- r ones(100, 100)
- b zeros(100, 100)
- g zeros(100, 100)
- g(150, 150) 1
- g(51100, 51100) 1
- f cat(3, r, g, b)
- imshow(f)
- Changing the order of r, g, b components
- f cat(3, g, b, r)
- imshow(f)
58Examples
- Applying colormaps
- f imread('lena_gray.tif')
- imshow(f)
- imshow(f, autumn)
- imshow(f, copper)
- Applying colormaps using 'colormap' command
- imshow(f)
- colormap(copper)
- Applying a custom colormap
- map zeros(256, 3)
- map(1128, 1) 1
- map(129256, 3) 1
- imshow(f, map)