Digital Image Processing
Digital Image Processing
Digital Image Processing
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).
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.
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.
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.
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.
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 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).
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.
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.
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.
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.