DIP Semester
DIP Semester
Ans: To derive the Discrete Cosine Transform (DCT) coefficients from the definition of
the Discrete Fourier Transform (DFT) in digital image processing, we first need to recall
the basic definitions of the DFT and the DCT.
➢ Discrete Fourier Transform (DFT)
The DFT of a 1D sequence x[n]x[n]x[n] of length NNN is defined as:
1
The goal of image restoration is to recover the original image f(x, y) from the degraded
image g(x, y). There are several techniques used for this purpose:
➢ Inverse Filtering: Directly inverts the degradation function.
➢ Wiener Filtering: Optimal approach minimizing the mean square error between
the restored and original image.
➢ Regularization Methods: Introduce additional constraints or prior knowledge to
stabilize the inversion process.
➢ Blind Deconvolution: Used when the degradation function HH is unknown.
2
o Characteristics: All values within a specified range are equally likely.
o Cause: Can occur due to quantization effects in analog-to-digital
conversion.
4. Differentiate image enhancement and image restoration.
Ans:
3
➢ Edge Detection Filters: Edge detection filters highlight areas where there are
significant intensity changes in an image, usually at object boundaries.
➢ Noise Reduction Filters: These filters aim to remove noise from an image.
8. What are the different types of image smoothing filters? Discuss their
disadvantages.
Ans: In digital image processing, image smoothing filters are used to reduce noise and
smooth out the intensity variations in images. Here are some commonly used smoothing
filters along with their disadvantages:
Types of Image Smoothing Filters
5
➢ Mean Filter: Averages the pixel values within a specified window around each
pixel.
o Disadvantages: Can blur edges and fine details.
➢ Gaussian Filter: Uses a Gaussian function to weigh the pixel values within a
window, giving more importance to the central pixels.
o Disadvantages: Computationally more intensive due to the Gaussian
kernel.
➢ Median Filter: Replaces each pixel value with the median value of the pixels
within a specified window.
o Disadvantages: Can result in loss of fine detail.
➢ Bilateral Filter: Preserves edges while smoothing by combining the intensity and
spatial closeness of pixels.
o Disadvantages: Computationally expensive.
➢ Non-Local Means Filter: Averages pixels with similar intensities, even if they are
far apart, to better preserve textures.
o Disadvantages: Very computationally intensive.
9. Explain RGB, CMY & HIS color models emphasising on their respective
applications & significance.
Ans:
RGB Color Model
Description:
Components: Red (R), Green (G), Blue (B).
Colors are created by combining light of these three primary colors. By adjusting the
intensity of each color, a wide spectrum of colors can be produced.
Applications: Used in monitors, televisions, and camera sensors where colors are
generated by emitting light.
Significance: The RGB model aligns well with human vision, making it intuitive for
most digital display technologies.
7
➢ Image Compression: By representing images at multiple resolutions, image
pyramids can help in efficient compression algorithms, like those used in JPEG
encoding.
➢ Image Blending and Seam Carving: Used in creating seamless transitions
between images, such as in panorama stitching or object removal.
➢ Object Detection and Recognition: Helps in detecting objects at different scales
and orientations by analysing images at multiple resolutions.
8
• Applies the wavelet transform separately along the rows and columns of an
image, resulting in a multi-resolution representation.
Structure:
• Decomposition: The image is decomposed into four sub-bands: approximation
(LL), horizontal details (LH), vertical details (HL), and diagonal details (HH).
• Reconstruction: The original image can be reconstructed by combining the sub-
bands and inverting the filters.
Applications
• Image Denoising: Removing noise from images while preserving edges and
details.
• Image Fusion: Combining images from different sources to create a single,
enhanced image.
Advantages: Provides both time and frequency localization, offering better analysis of
non-stationary signals and images.
Example: The simplest and most basic wavelet, often used for educational purposes.
12. What do you mean n by color model? Explain the various color models.
Ans: A color model is a mathematical representation of colors using a set of primary
colors and a methodology for combining them. These models are essential for
processing, storing, and displaying color information in digital systems.
Various Color Models in Digital Image Processing
1. RGB (Red, Green, Blue) Color Model:
o Components: Red, Green, Blue.
o Additive Color Model: Combines light of different colors to create new
colors. By varying the intensity of these three components, a wide spectrum
of colors can be produced.
o Applications: Used in digital displays like monitors, TVs, and camera
sensors. Common in image editing and graphic design.
o Significance: Aligns well with human vision and digital display
technologies.
2. CMY (Cyan, Magenta, Yellow) Color Model:
o Components: Cyan, Magenta, Yellow.
9
o Subtractive Color Model: Subtracts light using coloured inks or dyes to
create new colors. This model is often extended to CMYK, where K stands
for Key (black).
o Applications: Used in color printing processes like inkjet and laser printers.
o Significance: Directly relates to the physical process of color printing,
essential for accurate color reproduction.
3. HIS (Hue, Saturation, Intensity) Color Model:
o Components: Hue, Saturation, Intensity.
o Perceptual Model: Represents colors in terms of how humans perceive
them.
o Applications: Useful in image processing tasks like color segmentation,
enhancement, and computer vision.
o Significance: Provides an intuitive way to manipulate colors based on
human visual perception.
4. HSV (Hue, Saturation, Value) Color Model:
o Components: Hue, Saturation, Value.
o Perceptual Model: Similar to HIS, but Value replaces Intensity.
o Applications: Common in graphics software for color selection and
adjustment.
o Significance: Separates chromatic content from brightness, simplifying
color adjustments.
13. Explain the various image compression methods with necessary block
diagrams.
Ans: Image compression techniques aim to reduce the amount of data required to
represent an image while preserving its visual quality. They can be broadly categorized
into lossless and lossy compression methods.
1. Lossless Compression: Lossless compression algorithms reduce file size without
losing any data, ensuring the original image can be perfectly reconstructed.
Methods:
➢ Run-Length Encoding (RLE): Replaces sequences of the same pixel value with a
single value and a count.
10
➢ Huffman Coding: Uses variable-length codes for different pixel values based on
their frequencies.
➢ Lempel-Ziv-Welch (LZW): Builds a dictionary of commonly occurring
sequences and replaces them with shorter codes.
2. Lossy Compression: Lossy compression algorithms reduce file size by discarding
some of the image data, which may result in a loss of quality.
Methods:
➢ Discrete Cosine Transform (DCT): Transforms the image into the frequency
domain, quantizes the coefficients, and encodes them.
➢ JPEG Compression: Combines DCT, quantization, and Huffman coding.
➢ Wavelet-Based Compression: Uses wavelet transforms to decompose the image
into different frequency sub-bands and then quantizes and encodes them.
Applications
• Lossless Compression: Used in medical imaging, technical drawings, and
archival storage where loss of data is unacceptable.
• Lossy Compression: Used in everyday applications like web images, digital
photography, and streaming videos where some loss of quality is acceptable to
achieve higher compression ratios.
15. Explain smoothing & sharpening filters in the context of spatial filtering.
Ans: Spatial filtering in digital image processing involves using a filter (or kernel) that
moves across an image to perform operations like smoothing and sharpening. Let's
explore both types of filters:
Smoothing Filters
Smoothing filters are designed to reduce noise and smooth out variations in an image.
They work by averaging the pixel values within a neighbourhood, thereby reducing
sharp transitions in intensity.
13
➢ Mean Filter:
o Description: Calculates the average of the pixel values within the kernel
and assigns this average to the central pixel.
o Original Image → Mean Filter → Smoothed Image
o Effect: Blurs the image and reduces noise, but can also blur edges and fine
details.
➢ Gaussian Filter:
o Description: Uses a Gaussian function to weight the pixels within the
kernel, giving more importance to the central pixels.
o Original Image → Gaussian Filter → Smoothed Image
o Effect: Provides a smoother and more natural blurring effect compared to
the mean filter, with reduced edge blurring.
➢ Median Filter:
o Description: Replaces each pixel value with the median value of the pixels
within the kernel.
o Original Image → Median Filter → Smoothed Image
o Effect: Effective at reducing salt-and-pepper noise while preserving edges
better than mean and Gaussian filters.
Sharpening Filters
Sharpening filters enhance edges and fine details in an image by emphasizing high-
frequency components.
➢ Laplacian Filter:
o Description: Uses the second derivative of the image to highlight regions of
rapid intensity change.
o Original Image → Laplacian Filter → Sharpened Image
o Effect: Emphasizes edges, but can also amplify noise.
➢ Sobel Filter:
o Description: Computes the gradient magnitude of the image using two 3x3
kernels for horizontal and vertical gradients.
o Original Image → Sobel Filter → Edge-Enhanced Image
o Effect: Highlights edges in specific directions, useful for edge detection.
➢ Unsharp Masking:
14
o Description: Enhances edges by subtracting a blurred version of the image
from the original image.
o Original Image → Gaussian Blur → Subtract from Original → Sharpened
Image
o Effect: Enhances edges without significantly amplifying noise, commonly
used in photo editing.
Practical Applications
• Smoothing Filters: Used for noise reduction, background smoothing, and pre-
processing before further analysis.
• Sharpening Filters: Employed in edge detection, feature extraction, and image
enhancement for better visual quality.
16. What is noise? Differentiate between Gaussian noise & Impulsive noise?
Ans: Noise in digital image processing refers to random variations in pixel values that
can degrade the quality of an image. It often arises from various sources like electronic
sensor errors, environmental conditions, or transmission errors. Noise can obscure
important image details, making it challenging to analyze or interpret the image
accurately.
Gaussian Noise
Characteristics:
• Distribution: Gaussian noise, also known as normal noise, follows a normal
distribution with a bell-shaped probability density function.
• Parameters: Defined by its mean (average value) and standard deviation (spread).
• Appearance: Appears as grainy texture evenly distributed across the image.
Sources:
• Arises from thermal vibrations in electronic circuits and sensors.
• Common in low-light conditions where sensor noise is more prominent.
Effects:
• Can blur fine details.
• Reduces overall image clarity.
Impulsive Noise
Characteristics:
15
• Distribution: Impulsive noise, also known as salt-and-pepper noise, introduces
random occurrences of black and white pixels.
• Appearance: Manifests as sparsely scattered white (salt) and black (pepper) pixels
against the original image.
Mathematical Model: Typically modelled as a random process where pixel values are
replaced by maximum or minimum intensity values with certain probabilities.
Sources:
• Caused by errors in data transmission or malfunctioning pixels in sensor arrays.
• Often arises in digital communication systems and faulty hardware.
Effects:
• Creates distinct spots or specks that can be visually disruptive.
• Can significantly affect image analysis and processing tasks.
Key Differences
• Distribution: Gaussian noise has a continuous distribution affecting all pixel
values, while impulsive noise affects specific pixels with high-intensity values.
• Appearance: Gaussian noise appears as a smooth, grainy texture, whereas
impulsive noise appears as distinct black and white specks.
16