Skip to main content

1st long

 

Color Image Processing

1. Introduction

Color image processing is processing on colored images. 

Unlike grayscale images that only contain intensity values, color images offer a richer representation by using different color models. 

Color images processing is important for various applications such as object recognition, image enhancement, and computer vision.

2. Color Fundamentals





Color is observed based on the way objects absorb and reflect light. Different objects reflect different wavelengths of light, which our eyes interpret as color. For example:

  • A blue object reflects blue light while absorbing other colors.

  • Grey objects reflect and absorb all frequencies equally, appearing neutral.

The human eye detects colors using three types of cone cells, each sensitive to different wavelengths:

  • Red (700 nm) - 65% of cones are sensitive to this.

  • Green (546.1 nm) - 33% of cones are sensitive.

  • Blue (435.8 nm) - 2% of cones are sensitive but are the most responsive.

Hue, Saturation, and Intensity

  • Hue (H): Represents the dominant wavelength of a color, which determines the type of color (e.g., red, blue, green).

  • Saturation (S): Saturation shows how pure a color is. High saturation means the color is vivid, with no white mixed in. Low saturation is mixture of white, gray, or black that makes the color look faded or dull.

  • Intensity (I): Represents the brightness of a color, determined by the total amount of light energy.


3. Chromaticity Diagram

The chromaticity diagram represents all possible colors by plotting the proportions of red, green, and blue. where x + y + z = 1.


Diagram: Chromaticity Diagram (Insert chromaticity diagram from slide)








Explanation:

  • The diagram maps different color wavelengths.

  • White light is at the center, representing equal amounts of all wavelengths.

  • The curved boundary shows pure spectral colors, while the inside area represents mixtures.

4. Color Models

Different color models are used depending on the application. The three main models in image processing are RGB, CMY/CMYK, and HSI.

4.1 RGB Color Model

The RGB (Red, Green, Blue) model is an additive color model used in digital displays such as computer screens, televisions, and projectors. Colors are formed by combining different intensities of red, green, and blue light.

How It Works:

  • The three primary colors (Red, Green, Blue) mix to form other colors.

  • When all three colors are at full intensity, the result is white.

  • When no color is present, the result is black.

  • The mixing process is called additive color mixing.

Diagram: RGB Model (Insert RGB model diagram from slide)












4.2 CMY and CMYK Color Models

The CMY (Cyan, Magenta, Yellow) model is a subtractive color model mainly used in printing. Unlike RGB, which adds light, CMY works by subtracting light.

How It Works:

  • The primary colors are Cyan, Magenta, and Yellow.

  • These colors absorb light instead of emitting it.

  • When all three colors mix, they ideally create black, but in reality, it results in dark brown.

  • To get a true black, Black (K) is added, forming the CMYK model.

Diagram: CMY Model (Insert CMY model diagram from slide)






5. Comparison of RGB and CMY/CMYK Models

FeatureRGB ModelCMY/CMYK Model
TypeAdditiveSubtractive
Primary ColorsRed, Green, BlueCyan, Magenta, Yellow (+ Black)
Mixing ProcessAdding lightAbsorbing light
All Colors CombinedWhiteBlack
Used InScreens, digital displays                    Printing, painting


HSI (Hue, Saturation, Intensity) and HSV

HSI (Hue, Saturation, Intensity) and HSV (Hue, Saturation, Value) are two color models used to represent colors in a way that aligns more closely with human perception than the traditional RGB model.

  • HSI Model: Focuses on Hue (color type), Saturation (color purity), and Intensity (brightness level). It is useful for image processing and vision applications because intensity is separated from color information.
  • HSV Model: Uses Hue (color type), Saturation (color vividness), and Value (lightness/darkness). It is popular in graphics and digital design since the "Value" component directly affects brightness.

Both models describe color using three parameters but handle brightness differently.



6. Color Image Representation in MATLAB

MATLAB supports various image types used in digital image processing.

6.1 Types of Images:

  • Intensity images – Grayscale images (no color information).

  • Binary images – Black-and-white images (0 or 1 values).

  • RGB images – Color images stored in three channels.

  • Indexed images – Use a color map for representation.

6.2 MATLAB Code Examples:

% Read an image
I = imread('filename');
imshow(I);

% Convert to grayscale
gray_image = rgb2gray(I);
imshow(gray_image);

7. Color Transformations

Color transformations adjust the colors in an image for various purposes.

7.1 Types of Color Transformations:

  1. Intensity Transformations: Adjust brightness by scaling pixel values.

    • Example: g(x,y) = k * f(x,y) where 0 < k < 1.

  2. Color Complements: Convert colors to their opposites.

    • Example: Complement of cyan is red, magenta is green, and yellow is blue.

  3. Color Space Conversions: Change between RGB, CMY, and HSI models.

8. Applications of Color Image Processing

Color image processing is widely used in different fields:

8.1 Skin Color Detection

  • Used in face detection and human tracking.

  • Algorithms analyze HSI for skin tone identification.

8.2 Object Recognition

  • Colors help distinguish different objects in computer vision.

  • Used in automated quality inspection and traffic sign recognition.

8.3 Image Enhancement

  • Adjusting contrast, brightness, and color balance improves image visibility.

  • Used in medical imaging, satellite images, and photography.

Comments

Popular posts from this blog

Chap#10

Network topologies Definition: Network topologies define how nodes (processors/computers) are interconnected in parallel and distributed systems. The choice of topology affects performance, scalability, and cost. Key Metrics: Degree: Number of links per node. (Formula: deg = connections per node) Example: In a linear array, each node (except ends) has 2 links. Diameter: Longest shortest path between any two nodes. (Formula: diam = max distance) Example: Linear array with 8 nodes has diameter 7 (P₀ to P₇). Bisection Width: Minimum links to cut to split the network into two halves. (Formula: bw = min cuts) Example: Binary tree has bw=1 (cutting the root disconnects it).4 1. Linear Array Define : Nodes are connected one after another in a straight line. Each node (except the ends) connects to two neighbors one on the left and one on the right. Explanation : Simple to build and easy to understand, but not efficient for large networks. Long distance between farthest nodes makes comm...
Asymmetric-key algorithms are algorithms used in cryptography that use two different keys  a public key for encryption and a private key for decryption. These keys are mathematically related, but the private key cannot be easily derived from the public key. Types: RSA (Rivest–Shamir–Adleman): It uses large prime numbers to generate the key pair and supports both encryption and digital signatures DSA (Digital Signature Algorithm): DSA is primarily used for creating digital signatures, ensuring the authenticity. Symmetric-key algorithms are algorithms for cryptography that use the same cryptographic keys for both encryption of plaintext and decryption of ciphertext  Types: Stream Cipher:  Stream Cipher Converts the plain text into cipher text by taking 1 byte of plain text at a time. Block cipher: Converts the plain text into cipher text by taking plain text's block at a time DES? DES stands for Data Encryption Standard . It is a symmetric-key algorithm used to enc...

Ai Mental Health & Cyber Safety Presentation

Module A - The Normalization Engine Linguistic Challenge: Roman Urdu lacks standardized orthography (e.g., "kesa" vs "kaisa"), creating orthographic "noise" that significantly degrades the accuracy of downstream AI models. Technical Role: Acts as a Sequence-to-Sequence (Seq2Seq) transliteration and lexical normalization layer to standardize inputs before analysis. Model: A specialized transformer architecture, specifically m2m100 fine-tuned on parallel corpora or UrduParaphraseBERT. Primary Dataset: Roman-Urdu-Parl (RUP). A large-scale parallel corpus of 6.37 million sentence pairs designed to support machine transliteration and word embedding training. Link: https://arxiv.org/abs/2503.21530 Outcome: Reduces orthographic noise by achieving up to 97.44% Char-BLEU accuracy for Roman-Urdu to Urdu conversion, ensuring Module B receives high-quality "clean" data for risk analysis. Module B - Risk Stratification (BERT) Heading: The "Safety ...