Improcs
Improcs
Q. Discuss color models used in Digital Image Processing. 4. YIQ (Used in TV Broadcasting)
### **Color Models in Digital Image Processing** o Y: Luminance (brightness).
Color models are mathematical systems used to represent colors in a way that both o I, Q: Chrominance (color information).
humans and computers can understand. They are essential for **image processing,
storage, and display**. ### **Conclusion**
#### **1. RGB Color Model** - **RGB** → Used in displays and sensors.
- **Definition**: Represents colors using three components – **Red (R), Green (G), and - **CMYK** → Used in printing. 3. Definition of DFT
Blue (B)**.
- **HSV/HSI** → Useful for segmentation and human perception tasks. The Discrete Fourier Transform (DFT) represents a sequence in terms of
- **Range**: Each component ranges from 0 to 255 in digital images (8-bit). sinusoidal functions (sine + cosine).
- **YCbCr** → Ideal for image compression and video.
- **Usage**: Used in monitors, cameras, scanners. Formula:
Q. What is Discrete Cosine Transfom (DCT) and how does it differ from the Discrete
- **Advantage**: Simple and directly related to human vision. Fourier Transform (DFT)?
#### **2. CMY/CMYK Color Model** Discrete Cosine Transform (DCT) and Its Difference from Discrete Fourier Transform
(DFT)
- **Definition**: Based on **Cyan (C), Magenta (M), Yellow (Y), and Key/Black (K)**.
1. Definition of DCT
- **Principle**: Subtractive color model (used in printing).
The Discrete Cosine Transform (DCT) is a mathematical technique used to Produces complex output (real + imaginary parts).
- **Usage**: Printers, publishing, and graphic design. transform a signal or image from the spatial domain (pixels) into the frequency
Used in spectrum analysis, filtering, and signal processing.
domain (coefficients).
- **Advantage**: Produces high-quality printed colors.
It uses only cosine functions to represent the signal.
#### **3. HSV / HSI Color Model**
Formula for 1D DCT:
- **HSV (Hue, Saturation, Value)**
- **Usage**: Image enhancement, segmentation, and computer vision. Feature DCT DFT
2. Properties of DCT
- **Advantage**: Matches human perception better than RGB. Sine + Cosine (complex
Energy compaction: Most signal energy is concentrated in few low-frequency Basis Functions Cosine only
exponentials)
components.
#### **4. YCbCr Color Model** Output Real values only Complex values (real + imaginary)
Uses real values only (no complex numbers).
- **Definition**: Separates image into **luma (Y)** and **chroma (Cb, Cr)**. Reduces redundancy and is efficient for compression. Energy
Higher (good for compression) Lower compared to DCT
Compaction
- **Y → Luminance** (brightness), **Cb/Cr → Chrominance** (color information).
Feature DCT DFT Q3. What is Image Compression and why is it important in digital imaging?
Image Compression and Its Importance
JPEG, MPEG, image/video Signal analysis, filtering, audio
Applications 1. Definition of Image Compression
compression processing
Image compression is the process of reducing the size of an image file without
More efficient, fewer coefficients More storage due to complex significantly affecting its visual quality.
Computation
needed numbers
It works by removing redundancies in image data (spatial, spectral, or psycho-
visual redundancies).
5. Conclusion Compression can be:
DCT is mainly used in image and video compression because it represents o Lossless → Original image can be exactly reconstructed.
signals with fewer coefficients (energy compaction).
o Lossy → Some data is lost, but human eyes may not notice the difference.
DFT is more general and used in signal/spectrum analysis but is less efficient
for compression due to complex values.
[1 1 1 1] o No data is lost.
2. Lossy Compression
7) Note on normalization (exam remark) 1. Storage Efficiency → Reduces memory requirements, allowing more images to be
stored.
If your convention uses a 1/(MN)1/(MN)1/(MN) factor in the forward DFT, then the DC
becomes 16/(16)=116/(16)=116/(16)=1. With the standard unnormalized forward DFT 2. Transmission Speed → Smaller image files upload/download faster (important in
(as above), the DC is 16. Always state your convention internet and mobile communication).
3. Cost Reduction → Saves storage costs and reduces bandwidth usage. Example: hard disk, network, cloud storage, etc. 1. Prediction
4. Real-time Applications → Essential for video conferencing, streaming, and 5. Entropy Decoder o A predictor estimates the current pixel value using previously encoded
telemedicine where speed is crucial. neighboring pixels (e.g., left, top, diagonal).
Reverse process of entropy encoder.
5. Standardization → Formats like JPEG, MPEG use compression to ensure 2. Error Calculation
Recovers quantized transform coefficients from compressed bitstream.
interoperability.
o Prediction error = Actual pixel − Predicted pixel.
6. Dequantizer
3. Quantization (Lossy Step)
Reconstructs approximate values of original transform coefficients.
5. Conclusion
o The prediction error is quantized to reduce the number of bits.
Exact recovery in lossless, approximate in lossy compression.
Image compression is crucial in digital imaging because it makes storage,
o This step causes loss of exact information.
processing, and transmission of images more efficient. 7. Source Decoder (Inverse Transform)
4. Encoding
Depending on the application, either lossless or lossy compression is chosen to Applies inverse transform (e.g., IDCT, Inverse Wavelet Transform).
balance quality and size. o Quantized errors are encoded using entropy coding (e.g., Huffman or
Reconstructs the image back into the spatial domain for viewing.
Arithmetic coding).
Q. What are the basic components of an image compression model?
Block Diagram (conceptual)
5. Decoding
Basic Components of an Image Compression Model
Original Image → Source Encoder → Quantizer → Entropy Encoder → Channel/Storage
o At the receiver, the same predictor is used.
An image compression model consists of several functional blocks that work together
to reduce the size of image data while retaining acceptable quality. ← Source Decoder ← Dequantizer ← Entropy Decoder ←
o The quantized prediction error is added to the predicted value to reconstruct
. Source Encoder the pixel.
1. Source Encoder (or Transformer Stage)
. Quantizer 3. Example
Removes redundancies from image data.
. Entropy Encoder Suppose predicted pixel = 125, actual pixel = 130.
Common methods: Discrete Cosine Transform (DCT), Wavelet Transform, or
Predictive Coding. Error = 130 − 125 = 5.
. Channel/Storage
Converts spatial domain image into frequency domain for better energy After quantization, error = 4 (approx).
. Entropy Decoder
compaction.
. Dequantizer Reconstructed pixel = 125 + 4 = 129 (close to original 130).
2. Quantizer
. Source Decoder 4. Advantages
Reduces the precision of transformed coefficients.
Q. Expalin the concept of Lossy Predictive Coding in Image Compression. High compression ratio compared to lossless predictive coding.
Introduces loss in lossy compression, but achieves high compression ratio.
Lossy Predictive Coding in Image Compression Exploits correlation between pixels effectively.
Example: In JPEG, high-frequency DCT coefficients are quantized to near zero.
1. Concept Suitable for images where slight loss is acceptable (photographs, videos).
Predictive coding works on the idea that neighboring pixels in an image are 5. Disadvantages
3. Entropy Encoder (Lossless Compression Stage)
highly correlated.
Introduces distortion due to quantization.
Encodes quantized values efficiently to reduce bit rate.
Instead of storing each pixel value directly, the encoder predicts a pixel from its
Not suitable for applications needing exact image reconstruction (e.g., medical
Removes coding redundancy. neighbors and encodes the difference (error) between the actual and predicted
images).
value.
Methods: Huffman Coding, Run-Length Encoding (RLE), Arithmetic Coding. 6. Applications
In lossy predictive coding, this prediction error is quantized, which introduces
4. Channel (Transmission/Storage Medium) some distortion but achieves higher compression. JPEG-LS (predictive mode).
Represents the medium where compressed data is stored or transmitted. 2. Working Steps
Video coding standards like H.264 and MPEG use lossy predictive coding for Q. Discuss the advantages and limitations of Weiner filtering in image
inter-frame compression. restoration.
Advantages and Limitations of Wiener Filtering in Image Restoration
Conclusion
1. Concept Recap
Lossy predictive coding is a technique that compresses images by predicting pixel
values, encoding only the quantized error, and thus reducing redundancy. While it Wiener filtering is an optimal filtering technique used for image restoration.
introduces minor distortion, it provides efficient compression for natural images and
It restores a degraded image by considering both the degradation function
videos.
H(u,v)H(u,v)H(u,v) and the statistical characteristics of noise.
Q. Expalin the concept of inverse filtering and its applications in image
Formula:
restoration.
3. Limitations
If blur is modeled as an averaging filter H(u,v)H(u,v)H(u,v), dividing the degraded o Widely applied in astronomy, medical imaging, and satellite imaging
spectrum by this filter restores edges and sharpness. where both blur and noise are present.
5. Conclusion- Inverse filtering is a basic image restoration technique that 3. Limitations of Wiener Filtering
mathematically reverses the effect of degradation. While effective when noise is
1. Requirement of Prior Knowledge
absent, its practical use is limited due to noise amplification. For real-world
cases, improved methods like Wiener filtering are preferred. o Needs information about power spectra of noise and original image,
which is often difficult to obtain in practice.
2. Computational Complexity
o More complex than inverse filtering due to statistical modeling. 2. Local (Adaptive) Thresholding (a) Transform Coding vs. Wavelet Coding
3. Not Effective for Non-Linear Distortions o Different thresholds are chosen for different regions of the image. Aspect Transform Coding Wavelet Coding
Basic Idea Uses mathematical transforms Uses wavelet transform to
o Works well for linear degradations (blur + additive noise), but not for non- o Useful when illumination is uneven.
(e.g., DCT, FFT) to represent represent image in both
linear distortions. 3. Multi-level Thresholding image in frequency domain. frequency and spatial domains.
Energy Good energy compaction (e.g., Better energy compaction across
4. Over-Smoothing o More than one threshold is used to segment an image into multiple regions (e.g., Compaction DCT concentrates energy in low- multiple scales.
separating background, object, and shadow). frequency coefficients).
o May blur fine details when noise power is high. Localization Poor spatial localization (frequency Provides both spatial and
3. Role in Separating Objects from Background only). frequency localization.
5. Degradation Function Sensitivity
Blocking May cause blocking artifacts (e.g., Less prone to blocking artifacts
Enhances Object Detection → Clearly separates regions of interest (objects) from
o Requires accurate knowledge of degradation function H(u,v)H(u,v)H(u,v). Artifacts in JPEG at high compression). (used in JPEG2000).
irrelevant background.
Errors in H(u,v) reduce performance. Applications Used in JPEG image Used in JPEG2000, medical
Simplifies Processing → Converts grayscale image into binary form, reducing complexity compression. imaging, scalable coding.
4. Conclusion for further analysis.
Wiener filtering is a powerful image restoration technique that outperforms Used in Pre-processing → Essential for feature extraction, shape analysis, and
inverse filtering in noisy conditions by minimizing error statistically. recognition tasks.
However, its dependence on prior knowledge and computational cost limit its Application Examples:
practical use.
o Document image processing (text vs background).
(b) Mean Filters vs. Adaptive Filters
In real-world applications, it is often used with approximations or adaptive o Medical imaging (tumor vs normal tissue).
methods. Aspect Mean Filters Adaptive Filters
o Industrial inspection (defect detection). Definition Linear filter that replaces each Filter that adapts its behavior
Q. Describe the concept of Thresholding in image segmentation and its role in pixel with the average of its based on image characteristics (e.g.,
separating objects from the background. 4. Advantages
neighborhood. local variance, edges).
Simple and fast to implement. Noise Effective for reducing random Reduces noise while preserving
Thresholding in Image Segmentation Handling noise but also blurs edges and edges and details.
Effective when object and background intensity distributions are distinct. fine details.
1. Concept of Thresholding
Adaptability Fixed – same operation for all Variable – changes filtering strength
5. Limitations pixels. depending on local statistics.
Thresholding is a simple and widely used technique in image segmentation.
Complexity Simple and computationally More complex, requires additional
Fails when there is poor contrast or overlapping intensities.
It separates an image into object (foreground) and background based on efficient. calculations.
intensity values of pixels. Sensitive to noise and illumination variations. Applications Smoothing, removing Gaussian Medical imaging, satellite images,
noise. where edge preservation is
A threshold value TTT is chosen, and segmentation is done as: 6. Conclusion important.
Mean filters are simple but blur details, whereas adaptive filters are advanced
and preserve important structures.
2. Types of Thresholding
o A single threshold value is used for the entire image. (a) Histogram Processing
o Works well when background and objects have distinct intensity ranges. Histogram processing is an important technique in digital image enhancement, as it
provides a graphical representation of the intensity distribution of an image. The x-axis
represents intensity levels (0–255 for an 8-bit image), while the y-axis represents the Filters are used in image processing to suppress unwanted frequency components o Image quality degrades at very high compression (blurring, blocking
frequency of occurrence of these levels. This information helps in understanding such as noise or to smooth an image. Two common types are Butterworth and artifacts).
contrast, brightness, and overall quality of the image. Gaussian filters, both of which are better than the Ideal filter as they avoid sharp
o Cannot be used where exact reproduction is required (e.g., medical images).
cutoffs.
Main Methods of Histogram Processing:
Applications: JPEG compression for photos, MPEG/MP4 for videos, multimedia
Butterworth Filter:
1. Histogram Equalization → Improves the global contrast of the image by streaming, and online image sharing where storage and speed are critical.
redistributing pixel intensities evenly. It is particularly useful in images with o Has a frequency response controlled by its order (n), which defines the
poor lighting, medical X-rays, and remote sensing. sharpness of cutoff. Q.Describe briefly the fundamental steps in digital image processing
2. Histogram Matching (Specification) → Adjusts the histogram of an image o Provides a smoother transition compared to Ideal filters and reduces Fundamental Steps in Digital Image Processing
to match a predefined histogram, giving more control over brightness and artifacts like ringing.
contrast. Digital Image Processing (DIP) involves a sequence of operations performed on images to
Gaussian Filter: improve their quality, extract information, or prepare them for further analysis. The
3. Local Histogram Processing → Enhances small regions of an image instead steps form a pipeline starting from image acquisition to interpretation.
o Based on the Gaussian function, it has a bell-shaped response in frequency
of the whole image, useful for non-uniform illumination.
domain.
Applications: Enhancing low-contrast photographs, medical imaging, satellite
o Provides very smooth transitions with no sharp edges, ensuring minimal Steps (with explanation):
image analysis, and preprocessing in computer vision tasks.
distortion.
1. Image Acquisition
Applications: o The first step is capturing the image using sensors like cameras or
(b) Optimum Notch Filtering scanners.
o Noise removal and image smoothing.
o It may include preprocessing such as resizing, noise removal, or enhancing
Optimum notch filtering is a frequency-domain restoration technique used to remove brightness for better quality.
periodic or structured noise from digital images. Periodic noise, such as stripes or o Preprocessing in computer vision tasks such as object detection.
2. Image Preprocessing
repeated patterns, appears as bright spots at specific frequencies in the Fourier o Used in medical imaging, photography, and pattern recognition for better o Enhances the image for further processing.
transform of an image. o Includes operations like noise reduction, contrast enhancement,
image quality.
sharpening, and image resizing.
Working Process: o Goal: improve visual appearance and prepare image for analysis.
3. Image Enhancement
1. Perform Fourier Transform of the noisy image. (d) Lossy Compression o Improves the visual quality of the image.
o Techniques: histogram equalization, smoothing, sharpening, and contrast
2. Identify noise frequencies in the spectrum. Lossy compression is a method of reducing image size where some data is permanently adjustment.
discarded. Unlike lossless compression, it does not allow exact reconstruction, but o Useful in medical imaging, satellite images, etc.
3. Design notch filters to block these specific frequencies while retaining 4. Image Restoration
instead aims to maintain acceptable visual quality while saving storage.
others. o Removes degradations caused by blurring, noise, or distortion.
Techniques Used: o Unlike enhancement, it is based on mathematical and probabilistic models
4. Apply the inverse Fourier transform to reconstruct the restored image. to recover the original image.
1. Transform Coding (DCT, Wavelet) → Converts image into frequency 5. Color Image Processing
Advantages:
domain. High-frequency details that are less important to the human eye are o Deals with processing colored images in different color models (RGB, HSV,
o Selectively removes unwanted periodic noise without affecting overall image discarded. CMY).
o Includes color transformations, enhancement, and segmentation.
detail.
2. Quantization → Rounds off or removes small frequency coefficients. 6. Wavelets and Multiresolution Processing
o Preserves important frequency information. o Used to represent images at multiple levels of resolution.
3. Entropy Coding → Further compresses the remaining data efficiently. o Important in image compression and image analysis (e.g., JPEG2000
Applications: Useful in satellite imagery correction, removing interference from standard).
Advantages: 7. Image Compression
scanned documents, industrial imaging, and medical imaging where periodic
o Reduces the size of image data for storage and transmission.
artifacts may distort diagnostic results. o Achieves very high compression ratios (10:1 to 50:1). o Techniques: Lossless (PNG) and Lossy (JPEG).
o Essential for multimedia, internet, and medical data storage.
o Saves memory and reduces bandwidth needs for transmission. 8. Morphological Processing
(c) Butterworth and Gaussian Filters o Focuses on the shape or structure of objects in an image.
Limitations:
o Operations: erosion, dilation, opening, and closing.
o Mostly used for binary images. Example: Image enhancement
9. Image Segmentation Image compression
o Divides an image into meaningful regions or objects. A 1-bit image can represent only 2 levels (black or white). Feature extraction
o Techniques: thresholding, edge detection, region growing. An 8-bit image can represent 256 levels of gray. Filtering and restoration
o Critical for object recognition and computer vision tasks. A 24-bit color image can represent 16.7 million colors.
10. Representation and Description Common transforms: Fourier Transform, Discrete Cosine Transform (DCT), Walsh
o After segmentation, objects are represented in suitable formats (boundaries, Transform, Hadamard Transform, Wavelet Transform.
regions).
o Description (features like shape, texture, color) is extracted to make them 3. Relation between Sampling and Quantization
useful for recognition.
11. Object Recognition Sampling controls the spatial resolution of the image (number of pixels). Image Enhancement by Contrast Stretching (Intensity Transformation)
o Assigns a label to objects based on their features. Quantization controls the intensity resolution of the image (number of
o Example: detecting vehicles, faces, or medical abnormalities. shades/colors). 1. Intensity Transformation
12. Knowledge-Based Image Analysis (Interpretation) Together, they convert an analog image into a digital image.
o The final step where high-level reasoning and prior knowledge are applied. Intensity transformation functions directly map the input pixel values (gray levels) to
o Helps in decision-making, e.g., medical diagnosis, satellite image analysis. new output values to improve visibility.
High sampling rate → more pixels → better quality (fine details visible). Example 128×128 vs 512×512 resolution of 2-level (black & white) vs 256-level gray
Low sampling rate → fewer pixels → poor quality (image looks blocky or same image. scale of same image.
pixelated).
Role in First step: selects where pixels are Second step: assigns intensity values to
Example: Digitization located. each pixel.
If you sample an image at 512 × 512 pixels, you get more detail than at 64 × 64 pixels.
Image Transform
Definition: Smoothing filters (remove noise, blur): e.g., average filter, Gaussian filter.
An image histogram is a graphical representation of the frequency distribution of pixel Sharpening filters (highlight edges): e.g., Laplacian, Sobel operator.
intensity values in a digital image.
The x-axis represents possible intensity levels (e.g., 0–255 for an 8-bit image).
The y-axis represents the number of pixels that have each intensity value.
Interpretation: Result
If histogram is concentrated in the middle → medium contrast image. Histogram after equalization is more spread out, covering the full intensity range.
If histogram is narrow (clustered) → low contrast image. Image contrast is significantly improved.
If histogram covers full range (0–255) → high contrast, good quality image.
Example:
Example (Simple)
A dark image → histogram clustered on the left.
A bright image → histogram shifted to the right. Suppose an image’s intensity values lie mostly between 100 and 150 (narrow
A low-contrast image → histogram concentrated in a small region. range).
Histogram equalization redistributes them into 0–255 range.
The resulting image looks sharper with better contrast.
Noise reduction
Edge detection
Computation Simple, faster for small masks. More complex, requires transforms (FT
Image Smoothing
& IFT).
Filter Type Linear filters (average, Gaussian), Low-pass, high-pass, band-pass filters.
Definition
non-linear (median). o Sharpened image = Original image + Laplacian of image.
Gradient-based Operators (First Derivative) Image smoothing is a digital image processing technique used to reduce noise,
Applications Noise removal, smoothing, edge Large-scale filtering, compression, o Sobel, Prewitt, Roberts operators compute the gradient (rate of change) in variations, and small details in an image. It works by averaging or modifying pixel
detection (small scale). enhancement. intensity. values to create a smoother appearance. The main goal is to blur unwanted details or
o They highlight horizontal and vertical edges. random noise, while still retaining the important overall shapes and objects.
Efficiency Efficient for small neighborhood Efficient for large, complex filters.
operations. In simple words, smoothing filters try to “soften” images, reducing sharp transitions and
Examples Mean filter, Sobel, Laplacian, Median Ideal LPF, HPF, Gaussian filter in making them visually more pleasant.
filter. frequency domain. 2. Frequency Domain Methods
Images often appear blurred due to camera motion, focus issues, or noise. Advantages of Image Sharpening They are divided into two main types:
Sharpening enhances edges, lines, and textures that are crucial for human
interpretation or computer vision. Improves edge visibility.
It makes objects more defined and clearer for analysis. Makes objects more distinguishable. 1. Linear Smoothing Filters
Useful for pattern recognition, OCR (Optical Character Recognition), medical
analysis. Linear filters compute the new pixel value as a weighted average of neighboring pixel
values. Since the operation is linear (convolution), they are mathematically simple.
a) Averaging Filter (Mean Filter) b) Min and Max Filters Watershed Algorithm of Image Segmentation
Each output pixel is the average of neighboring pixels. Min filter: Replaces pixel with the minimum intensity in neighborhood → reduces
The Watershed algorithm is a region-based segmentation method inspired by
Removes noise effectively but also blurs edges. salt noise (white dots).
Example: 3×3 mean filter Max filter: Replaces pixel with the maximum intensity → reduces pepper noise topography (the study of landscapes). Imagine an image as a 3D surface where:
(black dots).
Pixel intensities = elevation.
High intensity = peaks, low intensity = valleys.
c) Mode Filter
The idea is to flood the valleys with water and build dams where water from different
Replaces each pixel with the most frequently occurring value in the neighborhood. valleys would meet. These dams represent the segmented boundaries.
Useful in categorical images or images with repeating noise patterns.
a) Median Filter Need for Image Segmentation Very sensitive to noise and small intensity variations → can cause over-
segmentation.
Replaces each pixel with the median value of its neighborhood. To simplify image representation. Requires preprocessing (smoothing, filtering, or marker-based techniques) to give
Very effective in removing salt-and-pepper noise while preserving edges. To make image analysis (like object detection, recognition, measurement) easier. good results.
Example: Neighborhood values [12, 15, 200, 14, 16] → median = 15 (replaces To identify boundaries, edges, and regions in complex images.
noisy pixel 200). Applications: medical imaging (tumor detection), satellite images, OCR, traffic
monitoring.
Medical imaging (tumor, cell, or organ boundary detection). Instead of dividing image into just 2 classes (object & background), multiple
Document image analysis (character separation). thresholds are used to separate into more than two regions.
Industrial inspection (detecting defects in manufactured items). Example: Segmenting a satellite image into water, vegetation, and land regions. Q.Principal Component Analysis (PCA)
Remote sensing (separating land, water, vegetation regions).
Definition
2200=(11001000)^2
Basic Components of an Image Compression Model
Disadvantages
Applications
Lossless Predictive Coding Now instead of storing/transmitting the large pixel values (120–124), we only need to
store small numbers (0,1,2,1) → easier to compress.
In Image Processing Lossless predictive coding is a compression technique used in image and signal
processing.
Images can be represented in the frequency domain using Fourier Transform. It works on the idea that neighboring pixels (or samples) are often similar, so instead
Some patterns (like periodic noise, stripes, or interference) appear as bright spots of storing/transmitting the actual pixel value, we store/transmit the difference Advantages
in the frequency spectrum. (prediction error) between the actual value and a predicted value.
A notch filter is applied to “notch out” (remove) those frequencies, while keeping No information is lost (perfect reconstruction).
the rest. Since differences are usually smaller and have less variation, they can be represented Works well for images with high correlation between neighboring pixels (like
with fewer bits, making compression possible without losing information. medical images, scanned documents).
👉 This is especially useful for removing periodic noise in images.
Applications
2. Connectivity:
o 4-connectivity: Pixels connected if they are 4-neighbors.
3. Distance Measures:
o Euclidean Distance: Straight-line distance between pixels.