Dip Internals
Dip Internals
(DIP)
How it Works?
Advantages
Disadvantages
1. Medical
Advantages:
Disadvantages:
Advantages:
Disadvantages:
3. Industrial Inspection
Advantages:
Disadvantages:
4. Entertainment
Advantages:
Disadvantages:
5. Security
Disadvantages:
6. Advertising
Advantages:
Disadvantages:
7. Designing
Advantages:
Disadvantages:
8. Gaming
Advantages:
Disadvantages:
Definition
The human eye is a complex organ that functions as a
biological optical system, converting light into
electrical signals for the brain to process as visual
images. It is responsible for detecting light, colour,
and depth, allowing humans to perceive their
surroundings
Definition
A 2D signal is a function $f(x,y)$ that varies over two
independent variables, typically representing spatial
coordinates in an image. In digital image processing,
2D signals are used to encode intensity values at
different pixel locations.
Types of 2D Systems
6. Separable Sequence
7. Periodic Sequence
Disadvantages
Definition
Convolution:
Convolution is a mathematical operation that combines
two functions (or signals) to produce a third function.
In image processing, it is used to apply a filter (or
kernel) to an image to modify its appearance—such as
for smoothing, sharpening, or edge detection.
Correlation:
Correlation is similar to convolution; it measures the
similarity between an image and a template (or kernel)
as the template slides across the image. Unlike
convolution, correlation does not involve flipping the
filter. It is commonly used for pattern recognition and
template matching.
How It Works
Convolution Process:
Correlation Process:
Correlation Formula:
For correlation, the output r(x, y) is:
r(x, y) = Σ over m, n { f(m, n) * h(x + m, y + n) }
(Note: In practice, correlation usually means sliding
the kernel over the image without flipping it.)
Disadvantages:
• Both operations can be computationally expensive,
especially for large images or when using large
kernels.
• Convolution requires kernel flipping, which may add
complexity; meanwhile, correlation might be less robust
to variations in orientation unless specially designed.
matlab
CopyEdit
% Read a grayscale image
A = imread('cameraman.tif');
% Perform 2D Convolution
% The 'conv' option ensures convolution is used (i.e.,
kernel is flipped).
conv_result = imfilter(A, h, 'conv');
figure, imshow(conv_result), title('2D Convolution
Result');
% Perform 2D Correlation
% The 'corr' option applies the filter without flipping
it.
corr_result = imfilter(A, h, 'corr');
figure, imshow(corr_result), title('2D Correlation
Result');
● In the code:
○ imfilter is used with the options 'conv' and
'corr' to perform convolution and correlation,
respectively.
○ fspecial creates a Gaussian kernel used as the
filter.
Definition
The Fourier Transform is a mathematical tool that
converts a spatial domain signal (such as an image)
into its frequency domain representation. In essence,
it decomposes an image into a sum of sinusoidal
components, each with its own amplitude and phase. This
allows us to analyze the frequency content of an
image—identifying patterns like edges (high
frequencies) and smooth regions (low frequencies).
How It Works
● Decomposition: An image (a 2D signal) is expressed
as a combination of sinusoids with various
frequencies and orientations.
● Frequency Domain Representation:
○ Low Frequencies: Represent smooth variations
(gradual changes in intensity).
○ High Frequencies: Represent abrupt changes
(edges, noise).
● Filtering Advantage: Many image processing
operations (like filtering or compression) are more
efficient when performed in the frequency domain,
since convolution in the spatial domain becomes
simple multiplication in the frequency domain.
● Medical Imaging:
Techniques such as Magnetic Resonance Imaging
(MRI) rely on the Fourier Transform to reconstruct
images from raw frequency data.
● Image Compression:
Many compression algorithms, such as JPEG,
leverage frequency domain representations to
discard less important (usually high-frequency)
details.
Advantages
● Efficient Filtering: Convolution operations become
multiplication in the frequency domain, which can
simplify and speed up filtering tasks.
● Insight into Image Structure: Separates image
components into frequencies, helping identify and
process features like edges, textures, and noise.
● Wide Applications: Used in image reconstruction,
enhancement, compression, and pattern recognition.
7. Explain different types of image extension(
Q. Image file format --- Jpeg, gif , png,
tiff,svg, tsd, eps, bmp)
Below is the updated version with an extra sentence
added to each format’s definition, while keeping the
original sections for how they work, advantages, and
limitations.
● Definition:
A commonly used image format for photographs that
uses a lossy compression method. It is widely
adopted in digital cameras and online image sharing
due to its efficient storage capability.
● How It Works:
The image is divided into small blocks (typically
8×8 pixels). A Discrete Cosine Transform (DCT)
converts spatial data into frequency components,
which are quantized and entropy-coded to reduce
file size.
● Advantages:
○ Efficient compression
○ Widely supported
○ Adjustable quality
● Limitations:
○ Lossy (quality loss at high compression)
○ No transparency
○ Possible artifacts (blocking, blurring)
● Definition:
A lossless image format developed as an improved,
patent-free replacement for GIF, supporting full
color and transparency. It is commonly used when
image quality and detailed transparency are
required, especially in web design.
● How It Works:
PNG uses the DEFLATE compression algorithm with
predictive filtering, preserving image quality by
compressing data without loss. It supports true
color and an alpha channel for partial
transparency.
● Advantages:
○ No quality loss
○ Supports full transparency
○ Handles high color depths well
● Limitations:
○ Larger file sizes than JPEG
○ Not ideal for very large photographs
○ Does not support animation
● Definition:
A versatile format used for high-quality graphics,
often in professional imaging, scanning, and
publishing. It is preferred in professional
environments where preserving image detail and
color accuracy is critical.
● How It Works:
TIFF files can be stored uncompressed or with
lossless compression (e.g., LZW), and they support
multiple layers and high color depths. Metadata
tags store additional information about the image.
● Advantages:
○ Preserves high image quality
○ Supports multiple layers and extensive color
depths
○ Flexible compression options
● Limitations:
○ Very large file sizes
○ Not web-friendly
○ Limited browser support
● Definition:
Adobe Photoshop’s native file format that supports
layers and a variety of editing features. It is the
go-to format for graphic designers and
photographers for non-destructive editing and
complex image manipulation.
● How It Works:
PSD files store images along with all editing
information, such as layers, masks, and effects,
maintaining high quality for future modifications.
They do not typically compress data, which helps
preserve detail.
● Advantages:
○ Fully editable with layers
○ Retains high image quality
○ Supports advanced features like alpha
transparency
● Limitations:
○ Large file sizes
○ Requires Photoshop or compatible software
○ Not suitable for web display
● Definition:
A vector-based format used for high-quality
graphics exchange and printing. Its ability to
combine vector and bitmap elements makes it a
standard choice for professional printing and
design applications.
● How It Works:
EPS files are written in the PostScript language
and can contain both vector and raster data. They
are scalable to any size without loss of quality.
● Advantages:
○ Infinitely scalable
○ Ideal for professional printing
○ Widely supported by design software
● Limitations:
○ Can be large
○ Not optimized for web use
○ Editing requires specialized software
● Definition:
An XML-based vector image format designed
specifically for the web. Its text-based structure
allows for easy editing and dynamic scaling, making
it ideal for responsive designs and interactive
applications.
● How It Works:
SVG images are defined using XML tags that
describe shapes, lines, and colors mathematically.
They are rendered by web browsers and can include
animations and interactivity.
● Advantages:
○ Infinitely scalable
○ Small file sizes
○ Editable and interactive
● Limitations:
○ Not suitable for complex, photo-like images
○ Advanced features may have limited support in
older browsers
BMP (Bitmap)
● Definition:
A simple raster image format used primarily in
Windows environments. Although it retains high
image quality due to minimal processing, its lack
of compression results in large file sizes.
● How It Works:
BMP files store raw pixel data along with a header
containing information about image dimensions and
color depth. They are usually uncompressed, leading
to high-quality images at the cost of efficiency.
● Advantages:
○ Simple and widely supported in Windows
○ Maintains full image quality
● Limitations:
○ Extremely large file sizes
○ Not optimized for web use
○ Lacks advanced features like transparency
8. Elements of image processing ( image
acquisition, image storage)
2. Image Storage
● Video signals are analog, represented by electrical
signals conveying luminance and color with variable
voltage.
● Requires file formats such as JPEG, PNG, TIFF, BMP,
and RAW for digital storage.
● Compression techniques like lossy (JPEG) and
lossless (PNG, TIFF) are used to save storage
space.
● Storage can be local (hard drives, SSDs) or
cloud-based (Google Drive, AWS, Azure).
3. Image Processing
● Systems range from microcomputers to large
general-purpose computers.
● Digital image processing uses algorithms, primarily
implemented via software like MATLAB, OpenCV, and
Python libraries (PIL, TensorFlow, PyTorch).
● Common operations include:
○ Filtering (low-pass, high-pass, median
filtering)
○ Edge detection (Sobel, Canny, Prewitt filters)
○ Noise reduction (Gaussian blur, bilateral
filtering)
○ Image enhancement (histogram equalization,
contrast stretching)
○ Segmentation (thresholding, region growing,
clustering methods like K-means)
● Applications include medical imaging, satellite
imaging, object detection, and machine learning.
4. Display Devices
● Convert numerical data from an image array into a
visual format.
● Display types:
○ LCD, LED, OLED screens for digital images.
○ Projectors for large-scale visualization.
○ Holographic displays for advanced 3D rendering.
● Resolutions vary: 720p, 1080p (Full HD), 4K, 8K.
● Color models like RGB, CMYK, YUV affect image
rendering.
5. Image Transmission
● Images are transmitted over channels or networks
for remote processing and sharing.
● Transmission methods:
○ Wired (Ethernet, fiber optics, HDMI, VGA,
DisplayPort).
○ Wireless (Wi-Fi, Bluetooth, 5G, satellite
communication).
● Used in applications like video conferencing,
satellite imaging, and remote sensing.
● Compression techniques like JPEG, MPEG, H.264,
H.265 reduce bandwidth usage.
Unit 2
1. Walsh Transform
Definition
● Pattern recognition
● Image compression for binary or
low-gray-level images
CopyEdit
imshow(mat2gray(W));
Explanation of Code
2. Hadamard Transform
Definition
The Hadamard Transform uses a Hadamard matrix (a
square matrix whose entries are +1 or -1) to
transform the image. It is similar in spirit to
the Walsh Transform and is used in applications
where simplicity and speed are critical.
matlab
CopyEdit
n = 8;
H = hadamard(n);
block = double(img(1:n,1:n));
transformedBlock = H * block * H';
imshow(mat2gray(transformedBlock));
Explanation of Code
● JPEG compression
● Feature extraction in image recognition
CopyEdit
dctImage = dct2(img);
imshow(mat2gray(dctImage));
Explanation of Code
4. Haar Transform
Definition
matlab
CopyEdit
imshow(mat2gray(approxImg));
Explanation of Code
● Image compression
● Feature extraction and dimensionality
reduction in face recognition
matlab
CopyEdit
[m, n] = size(img);
covMatrix = cov(data);
[V, D] = eig(covMatrix);
projectedData = data * V;
imshow(mat2gray(pc1));
Explanation of Code
Definition:
Gray level slicing is an image enhancement technique
that highlights a specific range of gray values while
suppressing others. This is used to emphasize
particular features or regions in an image by mapping
selected intensity ranges to a higher (or lower) value.
How It Works:
matlab
CopyEdit
% Read a grayscale image
img = imread('cameraman.tif');
Definition:
Bit plane slicing decomposes a digital image into its
individual bit planes. Each bit plane is a binary image
representing one bit of the pixel values. This
technique helps in analyzing the contribution of each
bit to the overall image structure.
How It Works:
matlab
CopyEdit
% Read a grayscale image
img = imread('cameraman.tif');
matlab
CopyEdit
% Read a grayscale image
img = imread('cameraman.tif');
img = double(img); % Convert to double for processing
Explanation of Code:
How it Works
● A threshold TT is selected.
● Pixels with intensity values greater than or equal
to TT are set to white (255).
● Pixels with intensity values less than TT are set
to black (0).
● This technique is useful for segmenting objects
from the background.
● Variants include global thresholding, adaptive
thresholding, and histogram-based thresholding.
2. Histogram Equalization
Definition
How it Works
7. Homomorphic filter
[Not confirmed
How it Works
How it Works
3. High-Boost Filter
Definition
How it Works
4. Homomorphic Filter
Definition
🚀
only showing how to call the functions instead of full
code. Let me know if you need any refinements!