0% found this document useful (0 votes)
3 views18 pages

Image Processing - Quick Notes

Digital Image Processing (DIP) enhances image quality, reduces noise, and enables object detection through various techniques, making it essential in fields like medical imaging and robotics. Key advantages include improved storage and transmission, cost-effectiveness, and integration with AI for intelligent systems. Techniques such as power law transformation and image thresholding further enhance image visibility and facilitate object extraction for analysis.

Uploaded by

Ranjit Chauhan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views18 pages

Image Processing - Quick Notes

Digital Image Processing (DIP) enhances image quality, reduces noise, and enables object detection through various techniques, making it essential in fields like medical imaging and robotics. Key advantages include improved storage and transmission, cost-effectiveness, and integration with AI for intelligent systems. Techniques such as power law transformation and image thresholding further enhance image visibility and facilitate object extraction for analysis.

Uploaded by

Ranjit Chauhan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Advantages of Digital Image Processing

Digital Image Processing (DIP) is a technique used to perform operations on


digital images through computer algorithms. It improves image quality, enhances
features, and extracts useful information for analysis. It plays a major role in fields
like medical imaging, satellite communication, robotics, industrial inspection, and
multimedia applications.
1. Improved Image Quality
One of the main advantages of DIP is its ability to enhance the visual
appearance of an image. Using techniques such as contrast adjustment,
sharpening, and edge enhancement, images can be made clearer and more
detailed. In medical imaging, for example, enhanced images help doctors
observe finer details for accurate diagnosis.
2. Noise Reduction
During image capture or transmission, unwanted disturbances or “noise”
may appear. DIP techniques like mean, median, and Gaussian filtering
effectively remove such noise without losing essential image information.
This improves the accuracy and reliability of visual data in research and
industrial fields.
3. Image Restoration
Image restoration aims to recover images that have been degraded due to
motion blur, camera shaking, or sensor issues. Methods like deblurring and
inverse filtering help reconstruct the original image. It is widely used in
satellite images, astronomy, and restoring old or damaged photographs.
4. Easy Storage and Transmission
Digital images are easy to store, copy, and transmit over networks. They do
not degrade over time like analog images. With compression formats such
as JPEG and PNG, image files take up less space and can be shared faster—
very useful in communication and multimedia platforms.
5. Object Detection and Recognition
DIP enables automatic detection and recognition of objects using
algorithms like edge detection, segmentation, and pattern recognition. This
is applied in facial recognition, surveillance systems, autonomous vehicles,
and robotics for identifying and tracking objects accurately.
6. Image Compression
Image compression reduces file size without affecting much quality, saving
memory and improving transmission speed. Techniques like lossy (JPEG)
and lossless (PNG) compression are used depending on the need—web
images, for instance, rely heavily on JPEG compression.
7. Feature Extraction and Analysis
Digital image processing helps extract key features such as color, texture,
and shape. These features are useful in image classification, biometric
systems (like fingerprint or face recognition), remote sensing, and medical
image analysis, where quick and accurate interpretation is vital.
8. Multidimensional Image Processing
Modern DIP techniques can process not only 2D images but also 3D and 4D
data. In medical imaging, 3D reconstructions from CT or MRI scans allow
better visualization of organs and tissues, while in scientific fields, they help
study complex structures in detail.
9. Cost-Effective and Flexible
Digital systems are more affordable and flexible compared to traditional
analog systems. Software-based image processing allows easy modification,
automation, and experimentation, which makes it suitable for continuous
research and innovation.
[Link] with Artificial Intelligence
Combining DIP with Artificial Intelligence (AI) and Machine Learning (ML)
has led to intelligent vision systems. These systems can analyze and
interpret images automatically, used in smart surveillance, autonomous
driving, and medical diagnostics for improved efficiency and decision-
making.
Components of Image Processing
Computer A general-purpose computer, which may be anything from a PC to a
supercomputer, is used in an image processing system. Sometimes, specifically
built computers are utilized in specialized applications to reach a specified degree
of performance. Hardware for Specialized Image Processing It comprises the
digitizer and hardware that can carry out basic operations, including an Arithmetic
Logic Unit (ALU), which can carry out simultaneous arithmetic and logical
operations on whole pictures.

Computer
A general-purpose computer, which may be anything from a PC to a
supercomputer, is used in an image processing system. Sometimes, specifically
built computers are utilized in specialized applications to reach a specified degree
of performance.

Hardware for Specialized Image Processing


It comprises the digitizer and hardware that can carry out basic operations,
including an Arithmetic Logic Unit (ALU), which can carry out simultaneous
arithmetic and logical operations on whole pictures.

Massive Storing
In applications involving image processing, the skill is essential. The three main
types of digital storage for image processing applications are as follows:
Three types of storage exist
(1) short-term storage,
(2) online storage for quick recall
(3) archive storage, which is characterized by rare access.
Camera Sensors
The image sensor's primary function is to collect incoming light, transform it into
an electrical signal, measure that signal, and then output it to supporting
electronics. It consists of a two-dimensional array of light-sensitive components
that convert photons into electrons. Images are captured by equipment like digital
cameras using image sensors like CCD and CMOS. Two components are often
needed on image sensors to collect digital pictures. The first is an actual tool
(sensor) that can detect the energy emitted by the object we want to turn into an
image. The second is a digitizer, which transforms a physical sensing device's output
into digital form.

Software
The image processing software comprises specialized modules that carry out
functions.

Hardcopy Equipment
Laser printers, film cameras, heat-sensitive equipment, inkjet printers, and digital
equipment like optical and CDROM discs are just a few examples of the instruments
used to record pictures.

Networking
To send visual data through a networked computer, it is a necessary component.
The most important factor in picture transmission is bandwidth since image
processing applications require vast amounts of data.

Explain power law transformation on image.

Power Law Transformation, also known as Gamma Transformation, is an


important image enhancement technique used in Digital Image Processing (DIP).
It is used to correct the brightness and contrast of an image according to the
required visual appearance. This transformation helps improve the overall visibility
of image details in both dark and bright regions.
The power law transformation is mathematically expressed as:

𝑠 = 𝑐 ⋅ 𝑟𝛾

Where:

• s → output pixel intensity,


• r → input pixel intensity (normalized between 0 and 1),
• c → a constant (usually 1),
• γ (gamma) → the power law exponent that determines the type of
enhancement.

The value of gamma (γ) controls the brightness of the image:

• When γ < 1, the output image becomes brighter, which helps to enhance
details in dark regions.
• When γ > 1, the output image becomes darker, which helps to bring out
details in bright regions.
• When γ = 1, the image remains unchanged (same as input).

Power law transformation is often used for gamma correction, which adjusts the
image intensity to match the human eye’s nonlinear response to light. For example,
display devices like monitors and TVs do not respond linearly to pixel values, so
gamma correction ensures that the image appears natural to the viewer.

This transformation is very useful in applications such as medical imaging,


satellite image enhancement, and photography, where brightness and contrast
adjustments are necessary to reveal hidden details. It also helps in correcting
images captured under poor lighting conditions.

The advantage of power law transformation is its flexibility — by changing the


gamma value, different levels of enhancement can be achieved for different image
types. It can handle both dark and bright image corrections effectively.

In conclusion, power law transformation is a simple yet powerful technique for


image enhancement. By adjusting the gamma value, it provides effective control
over image brightness and contrast, improving the visual quality and
interpretability of digital images.
What is image thresholding? Explain Image thresholding
techniques.
Image Thresholding
Image Thresholding is a simple and effective technique in Digital Image
Processing used to separate objects from the background in an image. It converts
a grayscale image into a binary image by selecting a threshold value (T). All pixels
with intensity values greater than or equal to T are assigned one value (usually
white), and those less than T are assigned another value (usually black).
Mathematically, thresholding is defined as:
1, if 𝑓(𝑥, 𝑦) ≥ 𝑇
𝑔(𝑥, 𝑦) = {
0, if 𝑓(𝑥, 𝑦) < 𝑇

Where:
• f(x, y) → input image intensity,
• g(x, y) → output binary image,
• T → threshold value.
The main goal of thresholding is to extract meaningful objects (like text, shapes,
or regions of interest) from the background for further image analysis. It is widely
used in document image analysis, medical imaging, industrial inspection, and
object detection.

Image Thresholding Techniques


1. Global Thresholding
In this method, a single threshold value is chosen for the entire image. All
pixels are compared with this one value.
o Simple and fast.
o Works well when the lighting is uniform throughout the image.
o Example: Otsu’s Method automatically finds the best global threshold
by minimizing the variance between object and background regions.
2. Local (Adaptive) Thresholding
In images with non-uniform illumination, global thresholding may fail. Local
or adaptive thresholding divides the image into smaller regions and
calculates a different threshold for each region.
o Effective for images with varying lighting or shadows.
o Common algorithms: Mean Thresholding, Gaussian Adaptive
Thresholding.
3. Multi-level Thresholding
When an image contains more than two objects or intensity ranges,
multiple thresholds (T₁, T₂, …) are used to segment it into several classes.
o Useful in medical imaging and satellite images.
o Helps classify regions like dark, medium, and bright areas.

Advantages of Thresholding
• Simple and computationally efficient.
• Requires less processing time.
• Useful as a preprocessing step for object detection and segmentation.

Contrast Stretching
Contrast Stretching, also known as Normalization, is a technique in Digital Image
Processing used to improve the contrast and visibility of features in an image. It
enhances the difference between the light and dark areas so that important
details become clearer to the human eye or for further image analysis.
In many cases, images may have poor contrast due to low lighting, improper
exposure, or limitations of imaging sensors. In such images, most pixel values are
concentrated within a small range (for example, between 80 and 150 in an 8-bit
image). Contrast stretching spreads out these intensity values to cover the full
range (0–255), making the image appear sharper and more detailed.

Mathematical Expression
Contrast stretching can be represented as:
(𝑟 − 𝑟𝑚𝑖𝑛 )
𝑠= × (𝑠𝑚𝑎𝑥 − 𝑠𝑚𝑖𝑛 ) + 𝑠𝑚𝑖𝑛
(𝑟𝑚𝑎𝑥 − 𝑟𝑚𝑖𝑛 )

Where:
• r → input pixel value
• s → output pixel value
• rₘᵢₙ, rₘₐₓ → minimum and maximum intensity values in the input image
• sₘᵢₙ, sₘₐₓ → desired output intensity range (usually 0 to 255)
This formula ensures that the darkest pixel becomes black and the brightest pixel
becomes white, with other values spread proportionally between them.

How It Enhances Images


• Improves Visual Appearance: By stretching pixel values, the image becomes
more vivid and easily interpretable.
• Enhances Details: Features hidden in dark or bright regions become more
visible.
• Increases Dynamic Range: Expands the tonal range of the image, making it
more suitable for display and analysis.
• Preprocessing Step: Often used before edge detection, segmentation, or
object recognition to improve accuracy.

Example
If an image has pixel values only between 100 and 180, applying contrast
stretching maps 100 → 0 and 180 → 255. The intermediate values are spread out,
resulting in an image with better brightness and clarity.

Applications
• Medical Imaging: To highlight body structures clearly in X-rays or MRI scans.
• Satellite Imaging: To enhance terrain and object visibility.
• Industrial Inspection: To make faults or defects more noticeable.

Sobel and Prewitt Operators for Edge Detection


Edge detection is an important step in Digital Image Processing used to identify
points in an image where brightness changes sharply. These points often
represent object boundaries, shapes, or texture changes. The Sobel and Prewitt
operators are two commonly used gradient-based methods for detecting edges.
Both operators work by calculating the gradient of image intensity at each pixel
position. The gradient indicates how intensity changes in the neighborhood of a
pixel — a large gradient value represents a strong edge.

1. Prewitt Operator
The Prewitt operator uses two 3×3 convolution masks to detect edges in the
horizontal and vertical directions.
Horizontal mask (Gx):
−1 0 1
[−1 0 1]
−1 0 1

Vertical mask (Gy):


1 1 1
[0 0 0]
−1 −1 −1

These masks are convolved with the image to compute the gradients 𝐺𝑥 and 𝐺𝑦 .
The edge magnitude is calculated as:

𝐺 = √(𝐺𝑥2 + 𝐺𝑦2 )

and the edge direction (angle) as:


𝐺𝑦
𝜃 = tan⁡−1 ( )
𝐺𝑥

The Prewitt operator gives good results for simple edge detection and is
computationally less expensive, but it is more sensitive to noise.

2. Sobel Operator
The Sobel operator is similar to the Prewitt operator but gives more weight to the
center pixels, making it more accurate and less sensitive to noise.
Horizontal mask (Gx):
−1 0 1
−2 0 2
−1 0 1
Vertical mask (Gy):
1 2 1
0 0 0
−1 −2 −1

These masks emphasize the center row or column, providing better edge
detection results, especially for diagonal and curved edges. Like Prewitt, the
gradient magnitude and direction are calculated using the same formulas.

Morphological Operations in Image Processing


Morphological operations are image processing techniques used mainly on
binary images (black and white) to analyze and process the structure or shape of
objects within an image. These operations are based on set theory and make use
of a small pattern or matrix called a structuring element (SE), which defines how
the operation is applied to the image.
The main goal of morphological operations is to simplify, refine, or extract
important structures in an image. They are widely used for object detection,
image segmentation, boundary extraction, noise removal, and shape analysis.
The two fundamental morphological operations are Erosion and Dilation. All
other operations like opening, closing, boundary extraction, etc., are derived from
these two.

1. Erosion
Erosion is a process that shrinks or thins the objects in a binary image. It removes
pixels on object boundaries and makes white (foreground) regions smaller.
Mathematically, erosion is represented as:
𝐴 ⊖ 𝐵 = {𝑧 ∣ (𝐵)𝑧 ⊆ 𝐴}
where A is the image and B is the structuring element.
Working:
• The structuring element slides over the image.
• The output pixel is set to 1 (white) only if all pixels under the structuring
element fit inside the object in the original image.
• Otherwise, it becomes 0 (black).
Effect:
• Removes small white noises.
• Disconnects two objects that are close to each other.
• Reduces the size of foreground regions.
Example:
Used to remove small white spots or to separate touching objects in images.

2. Dilation
Dilation is the opposite of erosion. It expands or thickens the objects in a binary
image by adding pixels to the boundaries of objects.
Mathematically, dilation is represented as:

𝐴 ⊕ 𝐵 = {𝑧 ∣ (𝐵̂)𝑧 ∩ 𝐴 ≠ ∅}

where A is the image and B is the structuring element.


Working:
• The structuring element slides over the image.
• The output pixel is set to 1 (white) if any of the pixels under the structuring
element overlap with a white pixel in the input image.
Effect:
• Fills small holes and gaps inside objects.
• Connects nearby objects.
• Increases the size of bright regions.
Example:
Used to highlight boundaries or join broken parts of objects.

Gaussian Pyramid in Image Processing


A Gaussian Pyramid is a multiscale image representation technique used in Digital
Image Processing to analyze images at different resolutions or scales. It is called a
“pyramid” because the image resolution decreases progressively from one level to
the next, forming a structure that looks like a pyramid — the original (highest
resolution) image at the bottom and the smallest (lowest resolution) image at the
top.
The Gaussian pyramid is mainly used for image compression, blending,
enhancement, object detection, and multi-resolution analysis.

Construction of Gaussian Pyramid


The process of constructing a Gaussian pyramid involves repeatedly smoothing
(blurring) and downsampling the image. Each level in the pyramid represents a
reduced (smaller and smoother) version of the previous one.
The steps are as follows:
1. Start with the original image as the base level of the pyramid (Level 0).
2. Apply Gaussian smoothing (using a Gaussian filter) to remove high-
frequency noise and fine details.
3. Downsample the image by reducing its size to half in both width and height
(usually by removing every second pixel).
4. Repeat the smoothing and downsampling process several times to form
multiple pyramid levels.
Each level is therefore both blurred and smaller than the one before it.
Applications of Gaussian Pyramid
1. Image Compression: Higher levels (smaller images) can represent low-detail
versions of the original image, reducing storage requirements.
2. Object Detection: Helps detect objects of different sizes by analyzing
images at multiple scales.
3. Image Enhancement: Used in noise reduction and detail preservation by
combining information from different levels.
4. Motion Detection: Useful in video processing for analyzing motion at
different resolutions.

What is a convex hull? List applications of convex hull.


A Convex Hull is a fundamental concept in computer vision and digital image
processing. It is defined as the smallest convex shape (or polygon) that
completely encloses all the points or objects in a given image or dataset.
In simple terms, imagine stretching a rubber band around a group of points —
when released, it will naturally form the convex hull, tightly wrapping around all
the outermost points.
Mathematically, for a set of points P = {p₁, p₂, …, pn}, the convex hull C is the
smallest convex set that contains all points in P.

Properties of Convex Hull


• The convex hull always forms a convex boundary (no inward curves).
• It is unique for a given set of points.
• All points of the convex hull lie on or inside the boundary.
• It can be represented as a polygon connecting the outermost boundary
points.

Steps for Finding Convex Hull


Algorithms like Graham’s Scan or Jarvis March (Gift Wrapping Algorithm) are
commonly used:
1. Identify the outermost points.
2. Sort them based on polar angles or coordinates.
3. Connect these points to form a closed convex boundary.

Applications of Convex Hull


1. Shape Analysis:
Used to find the shape boundary of objects and to compare object shapes
in computer vision.
2. Object Detection and Recognition:
Helps in identifying and enclosing object boundaries, making recognition
easier.
3. Image Segmentation:
Serves as a preprocessing step for dividing images into meaningful regions.
4. Collision Detection:
Used in robotics and gaming to check whether two objects intersect or
touch.
5. Pattern Recognition:
Assists in identifying geometric structures or groups of points in an image.
6. Medical Imaging:
Helps in analyzing the shape of organs or tumors and estimating their area.
7. Computational Geometry:
Forms the basis for algorithms like Voronoi diagrams and Delaunay
triangulations.

Explain how we can extract the boundary of an object in an image.


Boundary extraction is one of the most important tasks in digital image
processing. It refers to the process of identifying and outlining the edges or
borders of an object in an image. The boundary of an object separates it from the
background and other objects. Extracting the boundary helps in recognizing,
analyzing, and measuring the shape and size of the object.

1. Concept:
The boundary of an object can be defined as the set of pixels that represents the
outer edge of the object. These pixels have at least one neighboring pixel
belonging to the background.
Mathematically, if 𝐴is a set of pixels representing an object in a binary image, the
boundary 𝐵can be expressed as:
𝐵 = 𝐴 − (𝐴 ⊖ 𝐵)

where ⊖denotes morphological erosion and 𝐵is a structuring element.

2. Methods for Boundary Extraction:


a) Using Edge Detection Operators:
One of the most common methods to extract boundaries is to use edge detection
algorithms such as:
• Sobel Operator
• Prewitt Operator
• Roberts Operator
• Canny Edge Detector
These operators work by detecting areas in an image where there is a sudden
change in intensity (i.e., high gradient), which usually corresponds to object
boundaries.

b) Using Morphological Operations:


In binary images, morphological operations are widely used for boundary
extraction.
• Erosion-based boundary extraction:
The boundary of an object can be found by subtracting the eroded version
of the image from the original image.

𝐵𝑜𝑢𝑛𝑑𝑎𝑟𝑦 = 𝑂𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝐼 𝑚𝑎𝑔𝑒


− 𝐸𝑟𝑜𝑑𝑒𝑑 𝐼 𝑚𝑎𝑔𝑒

This gives a thin outline around the object.


• Dilation-based methods can also be used to identify outer boundaries.

c) Contour Tracing Techniques:


In contour tracing, algorithms like Moore-Neighbor or Freeman Chain Code are
used to trace the outer boundary of connected components in a binary image.
These methods follow the edge pixels in a sequential manner to extract a
continuous boundary.
d) Region-based Segmentation:
After segmenting the image into regions, the boundary of a region can be
determined by identifying the pixels that lie at the interface between different
regions or between a region and the background.

3. Applications of Boundary Extraction:


• Object recognition and classification
• Shape analysis and measurement
• Image segmentation
• Medical image processing (detecting organs, tumors, etc.)
• Industrial inspection and object counting

You might also like