Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
UNIT-1 Digital Image Fundamentals
What is a Digital Image?
• A digital image can be thought of as a picture made up of tiny dots called pixels.
• Each pixel has a position (where it is in the picture) and a value (how bright or what color it is).
Mathematically, we write it as:
f(x,y)
• x → horizontal coordinate (position along the width)
• y → vertical coordinate (position along the height)
• f(x, y) → intensity (brightness or gray level) or color value at that point
1. Binary Image
• Each pixel has only two values: 0 or 1.
• 0 = black, 1 = white
• Used for simple shapes, text, or document scanning.
• Example: Scanned signature or barcode.
2. Grayscale Image
• Each pixel shows a shade of gray between black and white.
• Pixel values range from 0 (black) to 255 (white) in 8-bit images.
• Example: Black-and-white photos.
3. Color Image
• Each pixel contains color information, usually in RGB (Red, Green, Blue) format.
• By mixing different intensities of R, G, and B, millions of colors can be represented.
• Example: Any colored photograph.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
4. Multispectral Image
• Captures images in multiple bands of the electromagnetic spectrum (like visible + infrared).
• Used in satellite imaging, remote sensing.
5. Hyperspectral Image
• Captures images in dozens or hundreds of spectral bands for more detailed analysis.
• Used in scientific research, agriculture, mineral exploration.
What is Digital Image Processing?
• Digital Image Processing means processing images with the help of a digital computer. It
converts a physical image into digital form using an image digitizer and then applies
mathematical operations to improve or analyze the image.
• An image is divided into small elements called pixels.
• Each pixel has a value that shows its brightness or color.
• The process of converting an image into digital form is called digitization
• Digital Image Processing helps in enhancing image quality, removing noise, extracting
features, and recognizing patterns.
Applications of Digital Image Processing
1. Gamma-ray Imaging
a. Used in nuclear medicine and astronomical observations.
b. Helps in detecting radioactive activity inside the body and studying space phenomena.
2. X-ray Imaging
a. Widely used in medical diagnostics for detecting fractures, lung infections, etc.
b. Also used in astronomy for studying celestial bodies.
3. Ultraviolet Imaging
a. Applications in microscopy, biological imaging, and laser technology.
b. Used in industrial inspection and astronomical observations.
4. Satellite Imaging
a. Used in weather forecasting, mapping, environment monitoring, and disaster
management.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
5. Medical Imaging
a. Techniques like MRI, CT scan, and ultrasound use digital image processing for clear and
accurate results.
6. Robotics and Computer Vision
a. Robots use image processing to recognize objects, navigate, and perform tasks.
7. Face Recognition and Security
a. Used in biometric systems, mobile face unlock, and surveillance cameras.
8. Industrial Applications
a. Used in quality control, defect detection in manufacturing, and process automation.
Steps in Digital Image Processing
1. Image Acquisition
a. The first step is to capture the image using a camera, scanner, or sensor.
b. The captured image is converted into a digital form using an image digitizer.
c. Example: Taking a photo using a mobile camera.
2. Image Preprocessing
a. This step improves the quality of the image for further processing.
b. It includes noise removal, contrast adjustment, and brightness enhancement.
c. Example: Removing blur or adjusting brightness in an image editor.
3. Image Segmentation
a. In this step, the image is divided into regions or objects for easy analysis.
b. It separates important parts of the image from the background.
c. Example: Detecting a person’s face in a photo.
4. Feature Extraction
a. Important features such as edges, corners, shapes, colors, and textures are extracted.
b. These features help in identifying and classifying objects.
c. Example: Detecting eyes, nose, and mouth in face recognition.
5. Image Representation and Description
a. The extracted features are represented in a suitable format for recognition and
interpretation.
b. Example: Representing objects using boundary lines or shape descriptors.
6. Image Recognition
a. The system identifies or classifies objects in the image based on the extracted features.
b. Example: Face unlock in smartphones identifies the correct person.
7. Image Compression and Storage
a. The processed image is compressed to save storage space and allow easy transmission.
b. Example: JPEG compression in photos to reduce file size.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
Components of an Image Processing System:
A typical image processing system consists of the following components:
1. Image Sensors:
a. Used for sensing and capturing the image.
b. Converts incoming light into an electrical signal.
c. Common sensors: CCD (Charge Coupled Device) and CMOS.
2. Specialized Image Processing Hardware:
a. Hardware that performs functions like digitization, enhancement, and filtering.
b. Ensures fast image processing.
3. Computer:
a. Acts as the central processing unit of the system.
b. Runs image processing software and performs necessary computations.
4. Image Processing Software:
a. Consists of algorithms for image enhancement, segmentation, and analysis.
b. Example: MATLAB, OpenCV.
5. Mass Storage:
a. Used for storing image data and programs.
b. Example: Hard disks, SSDs, cloud storage.
6. Image Displays:
a. Displays processed images to the user.
b. Example: Monitor or LCD screen.
7. Hardcopy Devices:
a. Provides physical copies of the processed image.
b. Example: Printers, plotters.
[Link]: Enables sharing of images and data between systems.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
Advantages
1. Image Enhancement
Improves image quality by adjusting brightness, contrast, and sharpness, making images clearer
for analysis.
2. Noise Removal
Reduces unwanted signals or distortions in images using filters.
3. Data Compression
Reduces image size for storage and transmission without significant loss of quality.
4. Restoration and Reconstruction
Restores damaged or corrupted images (e.g., old photographs or medical images).
5. Flexibility
Can apply various operations (rotation, scaling, color adjustment) easily using algorithms.
6. Automation
Enables automated analysis and recognition (e.g., facial recognition, object detection).
7. Integration with AI
Works well with machine learning and computer vision for real-time applications.
Disadvantages
1. High Computational Cost
Requires powerful processors and large memory for real-time processing.
2. Complex Algorithms
Many image processing techniques are mathematically complex and require expertise.
3. High Initial Setup Cost
Expensive hardware and software for advanced image processing systems.
4. Data Storage Requirement
High-resolution images require large storage space even after compression.
5. Processing Time
Large images or videos take more time for processing if not optimized.
6. Loss of Quality
Some operations (like compression) can lead to degradation of image quality.
7. Dependence on Good Input
Poor quality input images limit the effectiveness of processing techniques.
Digital Image Representation
A digital image can be defined as a two-dimensional signal that varies over spatial coordinates (x,y)(x,
y)(x,y) and can be represented mathematically as:
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
f(x,y)f(x, y)f(x,y) .Where:
• x → row (horizontal coordinate)
• y→ column (vertical coordinate)
• f(x,y) → intensity (gray level or color value) at pixel (x,y)
For an image of size X×Y:
Key points:
1. Rows (X) = Vertical resolution
2. Columns (Y) = Horizontal resolution
3. Bit depth = Number of bits per pixel (e.g., 8 bits for grayscale → 256 levels)
4. Total storage = Rows × Columns × Bit depth
5. For color images, use three matrices for R, G, B channels.
Elements of Visual Perception
1. Structure of the Eye (Input Device of Vision)
• The eye works like a camera:
o Cornea: Transparent outer layer, bends (refracts) light.
o Pupil: Hole that controls how much light enters (like camera aperture).
o Lens: Focuses light rays on retina (like a camera lens).
o Retina: Inner layer with light-sensitive cells.
▪ Rods: Work in dim light, detect brightness (black & white vision).
▪ Cones: Work in bright light, detect colors (red, green, blue).
o Optic Nerve: Transfers signals from retina to brain.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
2. Image Formation
• Light from objects passes through the cornea and lens.
• Lens focuses light rays onto retina → forms an inverted image.
• Brain flips and interprets it correctly.
3. Light and Color Perception
• Color vision comes from cones:
o Red-sensitive cones
o Green-sensitive cones
o Blue-sensitive cones
• Brain mixes signals to perceive millions of colors.
• Example: Yellow = activation of red + green cones.
4. Brightness Adaptation and Discrimination
• Brightness adaptation: Eyes adjust to different lighting.
o Dark room → pupils enlarge (dilation), rods active.
o Bright sunlight → pupils shrink (constriction), cones active.
• Brightness discrimination: Ability to tell the difference between light and dark areas.
5. Contrast Sensitivity
• Contrast = difference between lightest and darkest areas.
• Helps in detecting edges, patterns, and shapes.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• Example: Black text on white paper is easy to read because of high contrast.
6. Spatial Resolution (Sharpness of Vision)
• Ability to see fine details.
• Depends on:
o Density of cones in retina (sharpest at fovea – central vision).
o Eye’s focusing power (lens).
o Health of optic nerve and brain processing.
7. Perceptual Organization (Brain’s Role)
• Brain processes raw image signals and organizes them into:
o Shapes (outline detection)
o Depth (3D vision using both eyes – binocular vision)
o Motion perception (detects movement)
o Recognition (matching with memory, e.g., identifying a face).
Analog to Digital Image Conversion
When we convert a real-world image (analog/continuous) into digital form, two key operations are
done:
1. Sampling → decides the number of pixels.
2. Quantization → decides the number of gray levels (brightness/color).
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
1. Sampling
Sampling is the process of measuring the amplitude of an image at discrete intervals of space. In
simple words, it means choosing how many pixels represent the image.
• The continuous image is divided into a grid (rows and columns).
• Each small square in the grid is called a pixel (picture element).
• The more divisions we make, the more pixels we get.
Effect of Sampling:
• High sampling rate (more pixels) → high resolution, sharp image.
• Low sampling rate (fewer pixels) → low resolution, image looks blocky or blurry.
Example:
• A 100 × 100 sampled image has 10,000 pixels.
• A 1000 × 1000 sampled image has 1,000,000 pixels (much more detail).
Types of Sampling
Sampling = selecting how many pixels represent an image.
There are different ways to sample an image:
1. Uniform Sampling
• Pixels are chosen at equal intervals in both horizontal and vertical directions.
• Most common method in digital images.
• Example: A 512×512 image grid.
2. Random Sampling
• Pixels are chosen at random positions.
• Used in cases where uniform sampling is not possible.
• Example: Satellite images where sensor points may vary.
3. Adaptive Sampling
• Sampling rate changes depending on image detail.
• High sampling in complex regions (edges, textures), low sampling in smooth regions.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• Saves memory while keeping quality.
2. Quantization
Quantization is the process of assigning finite discrete intensity values to each sampled pixel.
Process:
• After sampling, each pixel has a brightness (gray level) or color value.
• In real life, brightness can vary continuously (infinite values).
• But a digital system stores only a limited number of values (e.g., 2, 16, 256).
• This limiting process is called quantization.
Effect of Quantization:
• More quantization levels → smoother image (good quality).
• Fewer quantization levels → image looks patchy or posterized.
Example:
• 1-bit (2 levels) → black & white only.
• 8-bit (256 levels) → grayscale image.
• 24-bit (16 million levels) → color image.
Types of Quantization
Quantization = deciding how many intensity (gray/color) levels a pixel can take.
1. Uniform Quantization
• Range of gray levels is divided into equal-sized intervals.
• Simple and commonly used in images.
• Example: 8-bit image (0–255 levels, each interval = 1).
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
2. Non-Uniform Quantization
• Intervals are not equal; more levels are assigned to frequently used intensity ranges.
• Gives better quality with fewer bits.
• Example: Human eye is more sensitive to dark shades → assign more levels in darker region.
3. Scalar Quantization
• Each pixel value is quantized individually.
• Simple but may cause loss of detail.
4. Vector Quantization
• Group of pixels is quantized together as a block/vector.
• Used in image compression (e.g., JPEG).
Levels of Image Processing
Image processing is generally divided into three levels: low-level, mid-level, and high-level. Each level
deals with different kinds of operations and produces different types of outputs.
1. Low-Level Image Processing
• What it does: Works directly on the raw pixel values of the image.
• Purpose: To improve image quality or make it suitable for further processing.
• Examples:
o Noise Removal: Cleaning unwanted dots or grains.
o Image Enhancement: Increasing brightness, contrast, or sharpness.
o Edge Detection: Finding boundaries of objects in an image.
• Key Point: Input → Image, Output → Image (only quality/clarity is improved).
2. Mid-Level Image Processing
• What it does: Focuses on extracting features (useful information) from the image.
• Purpose: To represent objects in a simpler form instead of the whole image.
• Examples:
o Segmentation: Dividing an image into parts (e.g., separating background and objects).
o Feature Extraction: Identifying shapes, corners, or textures.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
o Object Detection: Finding objects of interest like a car or face.
• Key Point: Input → Image, Output → Attributes/features (not full image, but information).
Example: Detecting tumor boundaries in MRI scans or extracting roads from satellite images.
3. High-Level Image Processing
• What it does: Deals with understanding and interpreting the image like a human brain.
• Purpose: To make decisions based on the image.
• Examples:
o Image Recognition: Recognizing faces in a photo.
o Scene Understanding: Identifying that an image shows a road with vehicles.
o Image-to-Text: Converting image content into meaningful description (like OCR).
• Key Point: Input → Features, Output → Knowledge/decision (machine “understands” the scene).
Example: Recognizing a pedestrian and stopping a self-driving car.
Relationships Between Pixels
In digital images, pixels are the smallest elements that represent intensity or color. To analyze images,
we need to study how pixels are related to each other. These relationships are based on neighborhood,
adjacency, connectivity, paths, and distance measures.
1. Neighborhood of a Pixel
Neighborhood means nearby pixels around a given pixel.
Example: In a 2D grid, the left, right, top, and bottom pixels are called 4-neighbors, and when diagonal
pixels are also included, they become 8-neighbors.
Neighborhood tells us which pixels are “close” to each other.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
2. Adjacency and Connectivity
• Adjacency: Two pixels are adjacent if one pixel is a neighbor of the other and both satisfy some
condition (e.g., having same gray level or color).
• Connectivity: Describes whether two pixels are connected in a path or region.
o 4-Connectivity: Pixels are connected using only 4-neighbors.
o 8-Connectivity: Pixels are connected using all 8-neighbors.
o m-Connectivity (mixed): A combination of 4- and 8-connectivity. It is used to avoid
multiple paths (ambiguity) when connecting pixels.
a) 4-Adjacency
• Neighbors: Left, Right, Top, Bottom.
• Does not include diagonals.
Example (Binary Image)
0 1 0 1
0 0 1 0
0 0 1 0
1 0 0 0
If we take pixel P = 1 (second row, third column)
• Its 4-adjacent neighbors = (top, left, right, bottom).
• Only those neighbors which are 1 (from set V = {1}) are counted.
Example: In image segmentation, connectivity is used to group pixels into meaningful regions.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
b) 8-Adjacency
• Neighbors: Left, Right, Top, Bottom + Diagonals.
• Includes all 8 surrounding pixels.
Example (Grayscale Image)
54 10 100 8
81 150 2 34
201 200 3 45
7 70 147 56
Let’s take pixel P = 2 (row 2, col 3).
• Set V = {1,2,3,…,10} (values between 1 and 10).
• Neighbors are all 8 surrounding pixels.
• From these, P is adjacent to those whose value also belongs to V.
So, P(=2) is adjacent to 3 (below) and 10 (top-left).
c) m-Adjacency (Mixed Adjacency)
• Combination of 4- and diagonal adjacency.
• A diagonal pixel is considered adjacent only if the two connecting 4-neighbors are not in set V
(to avoid double connections).
Example
If two diagonal 1’s are connected through another 1 in between (through 4-neighbor), then we don’t
count the diagonal separately.
3. Paths and Connected Components
• Path: A path between two pixels is a sequence of pixels where each pair is connected according
to the chosen connectivity (4, 8, or m).
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• Connected Components:
A connected component is a set of pixels that are all connected to each other and share the
same property (like intensity). Images can be divided into connected components for object
detection.
Example: Counting the number of objects in a binary image requires finding connected components.
4. Distance Measures
Distance tells us how far one pixel is from another.
Here are the main distance measures between pixels:
1.- Euclidean Distance (Straight-line distance)
• Formula:D=sqrt(x1 −x2 )2+(y1 −y2 )2
• Meaning: The shortest path (like using a ruler).
• Example: Pixel at (2,3) and pixel at (5,7) →
D=(5−2)2+(7−3)2 = 9+16 =5
2. City-Block Distance
Formula:D=∣x1−x2∣+∣ y1 −y2 |
• Meaning: Distance if you can only move horizontally or vertically (like on city blocks).
Example: (2,3) → (5,7)
• D=∣5−2∣+∣7−3∣=3+4=7
3. Chessboard Distance
• Formula: D (p,q)=max(∣x1 −x2 ∣,∣y1 −y2 ∣)
Meaning: Distance if you move like a king in chess (horizontal, vertical, or diagonal).
• Example: (2,3) → (5,7)
D=max (3,4)=4
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
Color Image Fundamentals
1. Hum an Visual System and Color
• Eye is the most sophisticated sensor for image perception.
• It contains:
o Rods → ~120 million, sensitive to brightness (black & white vision). Work well in dim light.
o Cones → ~6 million, sensitive to color. Three types:
▪ Red-sensitive (long wavelength),
▪ Green-sensitive (medium wavelength),
▪ Blue-sensitive (short wavelength).
• Tristimulus Theory: Human color perception is based on the response of 3 cones (RGB).
• Eye converts light wavelength → nerve signals → brain interprets as color.
2. Color Models
Color models are mathematical ways to represent colors in images.
(1) RGB Color Model (Additive)
The RGB color model is an additive color model in which colors are created by combining the three primary light
colors:
R → Red G → Green B → Blue
It is widely used in digital displays, cameras, scanners, and image processing because electronic devices emit
light in red, green, and blue.
Principle of RGB Model (Additive Mixing)
When you add light of Red, Green, and Blue in different intensities, you get a wide range of colors.
Additive mixing rules:
Red + Green = Yellow
Red + Blue = Magenta
Green + Blue = Cyan
Red + Green + Blue (full intensity) = White
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
No light (0,0,0) = Black
Example in 8-bit systems (0–255 scale):
(255, 0, 0) → Pure Red
(0, 255, 0) → Pure Green
(0, 0, 255) → Pure Blue
(255, 255, 255) → White
(0, 0, 0) → Black
(128, 128, 128) → Gray
So, each channel has 256 possible values.
➡ Total possible colors = 256 × 256 × 256 = 16,777,216 (≈16 million colors)
Limitations of RGB Model
1. Not perceptually uniform → A change in RGB values does not always mean the same change in
human perception of color.
2. Device-dependent → The same RGB values can look different on two devices (e.g., phone vs.
monitor).
3. Not suitable for printing → Printers use the CMYK (subtractive) model, not RGB.
Applications of RGB Model
Computer Graphics → Image creation, video games, animation.
Digital Imaging → Cameras, scanners, and photo editing software.
Displays → TVs, monitors, projectors, smartphones.
Web Design → HTML, CSS use RGB codes (#RRGGBB in hexadecimal).
Image Processing → Histogram analysis, filtering, segmentation.
RGB Color Cube
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• RGB model is often visualized as a 3D cube:
o Each axis represents one color component (R, G, B).
o The cube’s corners represent primary, secondary, black, and white.
Example (corners of RGB cube):
• (0,0,0) → Black
• (1,0,0) → Red
• (0,1,0) → Green
• (0,0,1) → Blue
• (1,1,0) → Yellow
• (1,0,1) → Magenta
• (0,1,1) → Cyan
• (1,1,1) → White
(2) CMY / CMYK Color Model (Subtractive)
Introduction
The CMY color model is a subtractive color model used mainly in printing and physical media.
• C → Cyan
• M → Magenta
• Y → Yellow
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
These are the secondary colors of the RGB model.
When combined, they subtract (absorb) light from white, producing other colors.
In practical printing, a fourth color K (Black) is added → CMYK model.
Subtractive Principle
Unlike RGB (which is additive → adds light), CMY works by subtracting light from white.
• Start with White paper (which reflects all colors).
• Adding ink absorbs some wavelengths:
o Cyan absorbs Red.
o Magenta absorbs Green.
o Yellow absorbs Blue.
Mixing rules:
• Cyan + Magenta = Blue
• Magenta + Yellow = Red
• Yellow + Cyan = Green
• Cyan + Magenta + Yellow (full) = ideally Black (but in practice, dark muddy brown → that’s why K =
Black is added)
Representation in Digital Systems
• Each color is represented as a triplet (C, M, Y) or quadruplet (C, M, Y, K).
• Values are usually in percentages (0–100%) or decimal (0–1).
Example (CMYK, in percentages):
• (0, 100, 100, 0) → Red
• (100, 0, 100, 0) → Green
• (100, 100, 0, 0) → Blue
• (0, 0, 0, 100) → Black
• (0, 0, 0, 0) → White
CMY vs. RGB Relationship
CMY is the inverse of RGB.
Mathematically:
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• C=1–R
• M= 1 –G
• Y= 1 –B
If RGB = (1, 0, 0) → pure Red,
then CMY = (0, 1, 1) → no Cyan, full Magenta + Yellow.
Limitations of CMY/CMYK
Not as wide a color range as RGB.
CMY mixing doesn’t produce a perfect black → muddy dark → need K (black).
Device-dependent (different printers produce slightly different results).
Requires more ink control for high-quality printing.
Applications
• Printing industry → magazines, newspapers, posters.
• Paints & dyes → mixing pigments.
• Scanners & photocopiers → use CMY filters.
• Photography (film) → color negatives use CMY layers.
CMY Color Cube
Like RGB, CMY can be visualized as a cube model:
• (0,0,0) → White
• (1,1,1) → Black
• Corners show pure Cyan, Magenta, Yellow, and mixtures forming Red, Green, Blue.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
(3.)HSI Color Model (Hue, Saturation, Intensity)
Introduction
• HSI stands for:
o H → Hue (type of color: red, green, blue, etc.)
o S → Saturation (purity of color, from dull/gray to pure color)
o I → Intensity (brightness of the color)
Why HSI?
• RGB is good for devices but not intuitive for humans.
• For image analysis and processing (like segmentation, enhancement), HSI is better because:
o Hue represents the actual “color”.
o Saturation shows how much color is diluted by white light.
o Intensity gives overall brightness.
a) Hue (H)
• Describes the type of color (red, blue, yellow, etc.).
• Measured as an angle (0°–360°) around a color wheel.
o 0° = Red
o 120° = Green
o 240° = Blue
o Values in between give other colors (e.g., 60° = Yellow, 300° = Magenta).
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
(b) Saturation (S)
• Describes the purity of the color.
• Range: 0–1 or 0–100%
o 0 → Gray (no color, completely desaturated)
o 1 → Fully saturated (pure vivid color)
(c) Intensity (I)
• Describes the brightness or lightness of the color.
• Range: 0 (black) → 1 (white)
Limitations of HSI Model
More complex mathematical conversion from RGB.
Not directly supported by hardware (screens use RGB).
Sensitive to noise in low-intensity regions.
Applications of HSI
• Image analysis → extracting color features.
• Face recognition → skin color detection.
• Medical imaging → highlighting tissues.
• Remote sensing → separating land, water, vegetation.
2D Mathematical Preliminaries
1. Introduction
• In digital image processing, mathematical tools are needed to analyze and process images.
• Mathematical preliminaries cover vectors, linear operations, and transforms like DFT & DCT.
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
1.2-Vectors & Vector Spaces
• An image of size M×N can be represented as a vector of length MN.
• This allows the use of linear algebra for image operations.
• Example:
=> [100,150,200,250]
1.3- Linear Operations on Images
• Addition: f(x,y)+g(x,y) → combines two images.
• Scalar Multiplication: a⋅f(x,y) → increases/decreases brightness.
• Filtering (Matrix Multiplication/Convolution): blurring, sharpening.
1.4- Neighborhoods & Connectivity
• 4-neighbors: Up, down, left, right
• 8-neighbors: Includes diagonals
• Connectivity: How pixels are connected affects object detection.
1.5-Sampling and Quantization
• Sampling: Choosing pixel positions (x,y).
• Quantization: Converting intensity values into discrete levels (e.g., 256 levels for grayscale).
2. Discrete Fourier Transform (DFT)
Fourier Transform converts a signal from the spatial domain (pixels) to the frequency domain
(sinusoids).
• Low frequency → Smooth variations (background)
• High frequency → Sharp variations (edges, details)
1D Discrete Fourier Transform (DFT)
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
2D Discrete Fourier Transform (DFT)
Formula (Forward DFT):
Where:
• f(x,y)= input image (spatial domain)
• F(u,v) = frequency domain representation
• u,v= frequency coordinates
• M,N= image dimensions
Inverse 2D DFT:
Properties:
1. Linearity
2. Periodicity
3. Shift property
4. Separability
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
Applications:
• Frequency domain filtering (low-pass, high-pass)
• Image enhancement (sharpening, smoothing).
• Image compression (JPEG uses DCT, related to DFT).
• Pattern recognition & feature extraction.
• Noise removal.
3.-Discrete Cosine Transform (DCT)
Definition:
• Similar to DFT, but uses only cosine functions.
• Produces real coefficients and provides energy compaction
1D Discrete Cosine Transform (DCT)
2D Discrete Cosine Transform (DCT)
Properties:
1. Produces only real values
2. Strong energy compaction → few coefficients represent most information
3. Used in block processing (8×8 in JPEG)
Applications:
• JPEG image compression
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
• Video compression (MPEG)
• Feature extraction & watermarking
4.-Correlation
Definition:
Correlation measures similarity between two signals (or functions) by shifting one signal over the other
and checking how similar they are at each position.
• Think of it like template matching:
o You have an image and a small pattern (template).
o You slide the template over the image.
o At each position, you check how similar the two are.
Mathematical Formula (1D):
For two functions f(t) and g(t), the correlation is:
(f⋆g)(t)=∫f(τ) g(τ+t) dτ
Here:
• f = input signal (or image)
• g= template/filter
• n= shift amount
2. Convolution
Definition:
Convolution is very similar to correlation but with one main difference: the filter (kernel) is flipped
before sliding over the signal.
• This flipping makes convolution useful in systems like linear time-invariant (LTI) systems and in
image processing filters (e.g., blurring, edge detection).
Mathematical Formula (1D):
For two functions f(t) and g(t):
Vision Institute of Image Processing
Technology, Aligarh Sub Code-BCS057
(f∗g)(t)=∫f(τ) g(t−τ)