Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Digital Image Processing - Color Image Processing

In today's lecture today's lecture, we will be discussing color image


processing and how the techniques we have learned so far can be applied
to color images. We will start with some definitions and fundamentals of
color, then introduce some widely used color models. We will go over
basic techniques in pseudo color image processing and finally cover more
advanced techniques in full color image processing.

In 1666, Isaac Newton discovered that when a beam of sunlight passes


through a glass prism, the emerging light consists of a continuous
spectrum of colors from violet to red. A body that reflects light balanced in
all visible wavelengths appears bright, while a body that favors reflectance
in a limited range of the visible spectrum shows shades of color. This
visible spectrum is only a tiny portion of the full range of wavelengths.

Before we continue, let's review some definitions. Monochromatic or


achromatic light is void of any color and is represented only by its
intensity or gray level. Chromatic light is the electromagnetic energy
spectrum from 400 to 700 nanometers. Radiance is the total amount of
energy that flows from a light source, measured in watts. Luminance is the
amount of energy an observer receives from a light source, measured in
lumens. Brightness is a subjective descriptor of light perception and
represents the achromatic notion of intensity.

In the human visual system, cones are responsible for color vision. We
have three different cone cells for red, green, and blue colors.

Now let's define primary colors and secondary colors. The standard
primary colors of light are red (700 nm), green (546 nm), and blue (435
nm). Primary colors do not mean that all visible colors can be generated by
these primary colors because each primary color has a specific wavelength.
Creating other colors requires accounting for the change in wavelength.
Secondary colors are made by adding two primary colors. The secondary
colors of light are magenta (red + blue), cyan (green + blue), and yellow
(red + green).

To distinguish different characteristics of colors, we have three properties:


brightness, hue, and saturation. Brightness represents the achromatic
notion of intensity. Hue represents the dominant wavelength in a mixture
of light waves or the dominant color perceived by an observer. Saturation
represents the relative purity or the amount of white light mixed with the
hue. Hue and saturation both contain color information, while brightness
does not.

Based on hue and saturation combined, we have chromaticity. The amount


of red, green, and blue to form any particular color is called a tristimulus
set of values, shown as xy and z. Any color is specified by trichromatic
coefficients, denoted by lowercase x, y, and z. Each coefficient adds up to 1
and is defined by the ratio of one of the tristimulus values to the sum of all
of them.

The standard CIE chromaticity diagram represents these colors. The


horizontal axis shows the x-axis, the vertical axis shows the y-axis. Each
point in this diagram represents a combination of red, green, and blue.

Now let's move on to different color models. The first and basic color
model is the RGB model, where each color appears in its primary spectral
components of red, green, and blue. The model is shown in a Cartesian
coordinate system. The primary values are at the three corners: red, green,
and blue. The secondary colors magenta, yellow, and cyan are at the other
three corners. This cube has eight different corners, including one corner
for black (where the amount of red, green, and blue is zero) and one
corner for white (where red, green, and blue are at the maximum).
Grayscale is represented by the line connecting the black and white
corners, where the amounts of red, green, and blue are equal.

For any color image shown in the RGB model, we have three color
components. If each component uses 8 bits to represent the range of
values, we end up with a 24-bit RGB color cube.
The CMY color model is another color model that uses the secondary
colors of light (cyan, magenta, and yellow) or the primary colors of
pigments. To go from RGB to CMY, the calculation is simple: cyan is 1
minus red, magenta is 1 minus green, and yellow is 1 minus blue. Each
secondary color of light can be created by adding two primary colors of
light. However, in practice, equal amounts of pigment primaries do not
produce pure black, so a fourth color, black (denoted as K), is added. This
is why we have both the CMY and CMYK color models.

The CIE XYZ color model is another commonly used color model.

The HSI (Hue, Saturation, Intensity) color model is better suited for human
interpretation of color because it aligns with how humans describe colors
based on hue, saturation, and brightness. In this model, the intensity
component is decoupled from the color information.

The equations to convert from RGB to HSI are derived using cosine and
mean functions. The H component represents the hue, which ranges from
0 to 360 degrees. The S component represents the saturation, which
indicates the purity of the color. The I component represents the intensity,
which is the average of the RGB values.

In the HSI color model, there is a discontinuity in the presentation of hue,


which can pose challenges in processing color images. However, HSI is
more intuitive for color description compared to RGB.

There are different color models available besides HSI and RGB.
Converting between color models can be done using standard equations
or readily available functions in software like MATLAB.

Pseudo color image processing involves assigning colors to grayscale


images for better visualization. Intensity slicing is a simple method where
grayscale values are divided into sections and assigned different colors.
This technique allows for better distinction of intensity variations in the
pseudo color image.
Full color image processing can be done by processing each color
component individually or directly processing the color pixels as vectors.
RGB, CMYK, and HSI are examples of color models that have different
numbers of components.

Color transformations can be represented using a simple equation, where


the output intensity values are determined by applying a transformation
function to the input intensity values. The transformation function can be
different for each color component.

Some operations are better suited for specific color models. For example,
smoothing and sharpening can be done in both HSI and RGB, but
segmentation may be more suitable in certain models.

It is often better to work in the RGB color model rather than the HSI model
for certain techniques. In the HSI color space, only the intensity
component needs to be modified, while the hue and saturation
components remain the same. In the RGB color model, all three
components are modified by the same constant. Each component has a
different meaning depending on the color model being used.

To modify the intensity of an image in the HSI color model, you simply
multiply the intensity component by a constant value between 0 and 1. In
the RGB color model, you modify all three components by the same
constant value. In the CMYK color model, the first three components (cyan,
magenta, and yellow) remain the same, while the transformation is only
applied to the black component.

Color complements are colors that are directly opposite each other on the
color wheel. In the RGB color model, the implementation of color
complement is straightforward - the color components of the result can be
calculated by subtracting the color components of the input image. In the
HSI color model, the computation is more complex because the saturation
component of the complement cannot be computed solely from the
saturation component of the input image. Therefore, different color
models may be better suited for different types of transformations.
Color slicing is a technique used to highlight a specific range of colors. It
involves defining a cube or sphere in the color space, and any colors that
fall inside the cube or sphere are preserved while colors outside are
replaced by a constant value.

Tonal and color corrections involve applying transformation functions to


the color components of an image. In the RGB and CMYK color models,
the same transformation function is applied to each component. In the HSI
color model, only the intensity component is modified. Examples of color
correction in RGB and CMYK color spaces are shown.

When working with color images, there are different types of


transformations and processing techniques that can be applied. One
common technique is histogram processing, which can improve the
contrast of an image. In the HSI color model, it is recommended to only
process the intensity component of the image and leave the hue and
saturation components unchanged. This can be done by applying
histogram equalization or histogram matching to the intensity component.

Smoothing can also be applied to color images. In the RGB color space,
smoothing can be done on all individual color components. In the HSI
color space, only the intensity component can be smoothed while leaving
the saturation and hue unchanged.

Image sharpening can be performed in both RGB and HSI color spaces. In
RGB, the Laplacian operator can be applied to each individual color
component. In HSI, the Laplacian can be applied only to the intensity
component.

Segmentation is commonly done using the saturation component in the


HSI color space. By creating a saturation mask, regions of interest can be
isolated. In RGB, segmentation can be done by providing a set of sample
color points and using a distance function to measure the distance of all
color points to the color of interest.

When it comes to edge detection, the gradient discussed for grayscale


images cannot be directly applied to color images. Instead, the gradient is
calculated by assuming unit vectors along the red, green, and blue axes of
the RGB color space.

ture, we will be discussing color image processing and how the techniques
we have learned so far can be applied to color images. We will start with
some definitions and fundamentals of color, then introduce some widely
used color models. We will go over basic techniques in pseudo color
image processing and finally cover more advanced techniques in full color
image processing.

In 1666, Isaac Newton discovered that when a beam of sunlight passes


through a glass prism, the emerging light consists of a continuous
spectrum of colors from violet to red. A body that reflects light balanced in
all visible wavelengths appears bright, while a body that favors reflectance
in a limited range of the visible spectrum shows shades of color. This
visible spectrum is only a tiny portion of the full range of wavelengths.

Before we continue, let's review some definitions. Monochromatic or


achromatic light is void of any color and is represented only by its
intensity or gray level. Chromatic light is the electromagnetic energy
spectrum from 400 to 700 nanometers. Radiance is the total amount of
energy that flows from a light source, measured in watts. Luminance is the
amount of energy an observer receives from a light source, measured in
lumens. Brightness is a subjective descriptor of light perception and
represents the achromatic notion of intensity.

In the human visual system, cones are responsible for color vision. We
have three different cone cells for red, green, and blue colors.

Now let's define primary colors and secondary colors. The standard
primary colors of light are red (700 nm), green (546 nm), and blue (435
nm). Primary colors do not mean that all visible colors can be generated by
these primary colors because each primary color has a specific wavelength.
Creating other colors requires accounting for the change in wavelength.
Secondary colors are made by adding two primary colors. The secondary
colors of light are magenta (red + blue), cyan (green + blue), and yellow
(red + green).

To distinguish different characteristics of colors, we have three properties:


brightness, hue, and saturation. Brightness represents the achromatic
notion of intensity. Hue represents the dominant wavelength in a mixture
of light waves or the dominant color perceived by an observer. Saturation
represents the relative purity or the amount of white light mixed with the
hue. Hue and saturation both contain color information, while brightness
does not.

Based on hue and saturation combined, we have chromaticity. The amount


of red, green, and blue to form any particular color is called a tristimulus
set of values, shown as xy and z. Any color is specified by trichromatic
coefficients, denoted by lowercase x, y, and z. Each coefficient adds up to 1
and is defined by the ratio of one of the tristimulus values to the sum of all
of them.

The standard CIE chromaticity diagram represents these colors. The


horizontal axis shows the x-axis, the vertical axis shows the y-axis. Each
point in this diagram represents a combination of red, green, and blue.

Now let's move on to different color models. The first and basic color
model is the RGB model, where each color appears in its primary spectral
components of red, green, and blue. The model is shown in a Cartesian
coordinate system. The primary values are at the three corners: red, green,
and blue. The secondary colors magenta, yellow, and cyan are at the other
three corners. This cube has eight different corners, including one corner
for black (where the amount of red, green, and blue is zero) and one
corner for white (where red, green, and blue are at the maximum).
Grayscale is represented by the line connecting the black and white
corners, where the amounts of red, green, and blue are equal.

For any color image shown in the RGB model, we have three color
components. If each component uses 8 bits to represent the range of
values, we end up with a 24-bit RGB color cube.
The CMY color model is another color model that uses the secondary
colors of light (cyan, magenta, and yellow) or the primary colors of
pigments. To go from RGB to CMY, the calculation is simple: cyan is 1
minus red, magenta is 1 minus green, and yellow is 1 minus blue. Each
secondary color of light can be created by adding two primary colors of
light. However, in practice, equal amounts of pigment primaries do not
produce pure black, so a fourth color, black (denoted as K), is added. This
is why we have both the CMY and CMYK color models.

The CIE XYZ color model is another commonly used color model.

The HSI (Hue, Saturation, Intensity) color model is better suited for human
interpretation of color because it aligns with how humans describe colors
based on hue, saturation, and brightness. In this model, the intensity
component is decoupled from the color information.

The equations to convert from RGB to HSI are derived using cosine and
mean functions. The H component represents the hue, which ranges from
0 to 360 degrees. The S component represents the saturation, which
indicates the purity of the color. The I component represents the intensity,
which is the average of the RGB values.

In the HSI color model, there is a discontinuity in the presentation of hue,


which can pose challenges in processing color images. However, HSI is
more intuitive for color description compared to RGB.

There are different color models available besides HSI and RGB.
Converting between color models can be done using standard equations
or readily available functions in software like MATLAB.

Pseudo color image processing involves assigning colors to grayscale


images for better visualization. Intensity slicing is a simple method where
grayscale values are divided into sections and assigned different colors.
This technique allows for better distinction of intensity variations in the
pseudo color image.
Full color image processing can be done by processing each color
component individually or directly processing the color pixels as vectors.
RGB, CMYK, and HSI are examples of color models that have different
numbers of components.

Color transformations can be represented using a simple equation, where


the output intensity values are determined by applying a transformation
function to the input intensity values. The transformation function can be
different for each color component.

Some operations are better suited for specific color models. For example,
smoothing and sharpening can be done in both HSI and RGB, but
segmentation may be more suitable in certain models.

It is often better to work in the RGB color model rather than the HSI model
for certain techniques. In the HSI color space, only the intensity
component needs to be modified, while the hue and saturation
components remain the same. In the RGB color model, all three
components are modified by the same constant. Each component has a
different meaning depending on the color model being used.

To modify the intensity of an image in the HSI color model, you simply
multiply the intensity component by a constant value between 0 and 1. In
the RGB color model, you modify all three components by the same
constant value. In the CMYK color model, the first three components (cyan,
magenta, and yellow) remain the same, while the transformation is only
applied to the black component.

Color complements are colors that are directly opposite each other on the
color wheel. In the RGB color model, the implementation of color
complement is straightforward - the color components of the result can be
calculated by subtracting the color components of the input image. In the
HSI color model, the computation is more complex because the saturation
component of the complement cannot be computed solely from the
saturation component of the input image. Therefore, different color
models may be better suited for different types of transformations.
Color slicing is a technique used to highlight a specific range of colors. It
involves defining a cube or sphere in the color space, and any colors that
fall inside the cube or sphere are preserved while colors outside are
replaced by a constant value.

Tonal and color corrections involve applying transformation functions to


the color components of an image. In the RGB and CMYK color models,
the same transformation function is applied to each component. In the HSI
color model, only the intensity component is modified. Examples of color
correction in RGB and CMYK color spaces are shown.

When working with color images, there are different types of


transformations and processing techniques that can be applied. One
common technique is histogram processing, which can improve the
contrast of an image. In the HSI color model, it is recommended to only
process the intensity component of the image and leave the hue and
saturation components unchanged. This can be done by applying
histogram equalization or histogram matching to the intensity component.

Smoothing can also be applied to color images. In the RGB color space,
smoothing can be done on all individual color components. In the HSI
color space, only the intensity component can be smoothed while leaving
the saturation and hue unchanged.

Image sharpening can be performed in both RGB and HSI color spaces. In
RGB, the Laplacian operator can be applied to each individual color
component. In HSI, the Laplacian can be applied only to the intensity
component.

Segmentation is commonly done using the saturation component in the


HSI color space. By creating a saturation mask, regions of interest can be
isolated. In RGB, segmentation can be done by providing a set of sample
color points and using a distance function to measure the distance of all
color points to the color of interest.

When it comes to edge detection, the gradient discussed for grayscale


images cannot be directly applied to color images. Instead, the gradient is
calculated by assuming unit vectors along the red, green, and blue axes of
the RGB color space.

You might also like