IPT Notes-Module 3
IPT Notes-Module 3
Point operations: A point operation is a pixel-based operation that is applied to each pixel in an
image independently of its neighbors. Point operations are often used to change the brightness,
contrast, or other properties of an image.
Brightness: This operation simply adds a constant value to each pixel in the image. For example,
adding 10 to each pixel will make the image brighter.
Contrast: This operation stretches or compresses the range of pixel values in an image. For example,
increasing the contrast will make the dark pixels darker and the light pixels lighter.
Thresholding: This operation converts an image into a binary image by setting all pixels below a
certain threshold to black and all pixels above the threshold to white.
Bit plane slicing: This operation separates an image into its individual bit planes, which can then be
used to create different effects, such as visualizing the edges of an image.
Point operations are a powerful tool for image processing. They can be used to improve the visibility
of an image, to correct for image defects, or to create special effects.
Logarithmic transformation: This operation maps pixel values to their logarithms. This can be used to
enhance the contrast of an image with a wide range of brightness values.
TRACE KTU
Exponential transformation: This operation maps pixel values to their exponentials. This can be used
to brighten an image or to create a "posterized" effect.
Gamma correction: This operation adjusts the contrast of an image according to the human eye's
response to light. This can be used to make an image look more natural or to improve its readability
on a computer monitor.
Point operations are a versatile tool that can be used to achieve a wide variety of effects in image
processing.
Clipping and Thresholding, Digital Negative. Intensity Level Slicing: Clipping and thresholding are two
image processing techniques that are used to alter the intensity levels of pixels in an image. Clipping
is a process of limiting the intensity values of pixels to a specified range. Thresholding is a process of
assigning a new intensity value to each pixel based on whether its original intensity value is greater
than or equal to a specified threshold.
A digital negative is an image that is created by subtracting each pixel value in an image from 255.
This results in an image that has the opposite brightness values of the original image. Digital
negatives are often used in image processing applications such as image segmentation and edge
detection.
Intensity level slicing is a technique that is used to divide an image into a number of bands, each of
which contains pixels with a specific range of intensity values. This can be used to isolate specific
features in an image, such as edges or regions of different colors.
Here are some examples of how clipping, thresholding, and intensity level slicing can be used to alter
images:
Clipping can be used to remove noise from an image. For example, if an image contains a lot of white
noise, you could clip all pixels with intensity values below a certain threshold to black.
Thresholding can be used to segment an image into different regions. For example, you could
threshold an image of a person to separate the person from the background.
Intensity level slicing can be used to highlight specific features in an image. For example, you could
slice an image of a flower into three bands, one for the petals, one for the leaves, and one for the
stem. This would allow you to easily see the different parts of the flower.
These are just a few examples of how clipping, thresholding, and intensity level slicing can be used to
alter images. These techniques can be used to improve the quality of images, to isolate specific
features, or to create new and interesting images.
Bit Extraction and range compression: Bit extraction is the process of extracting a specific bit
or group of bits from a binary number. This can be done using a variety of methods, such as
masking, shifting, and bit slicing. Range compression is a technique for reducing the number
of bits required to represent a range of values. This can be done by using a lookup table or
by encoding the values using a lossless compression algorithm.
Here are some examples of how bit extraction and range compression can be used to solve
problems:
Bit extraction can be used to extract the least significant bit (LSB) of a number. This can be
used to determine whether a number is even or odd.
TRACE KTU
Bit extraction can also be used to extract the most significant bit (MSB) of a number. This can
be used to determine the sign of a number.
Range compression can be used to reduce the number of bits required to represent a
temperature range. For example, if the temperature range is from 0 to 100 degrees Celsius,
you could use a lookup table to represent the temperature range using only 8 bits.
Range compression can also be used to encode the values of a color image. For example, if
the image has 256 possible colors, you could use a lossless compression algorithm to encode
the colors using only 8 bits per pixel.
These are just a few examples of how bit extraction and range compression can be used to
solve problems. These techniques can be used to improve the efficiency of data storage and
transmission.
Here are some additional problems that can be solved using bit extraction and range
compression:
Compressing audio and video files
Storing and transmitting sensor data
Encrypting data
Generating random numbers
Bit extraction and range compression are powerful techniques that can be used to solve a
variety of problems. These techniques are becoming increasingly important as the amount
of data that we generate and store continues to grow.
Spatial Convolution and Correlation: Spatial operations are operations that are applied to
images on a pixel-by-pixel basis. These operations can be used to enhance or modify the
appearance of images, or to extract specific features from images.
Convolution and correlation are two common spatial operations. Convolution is a linear
operation that involves multiplying each pixel in an image by a filter kernel and then adding
the results. Correlation is a similar operation, but the filter kernel is flipped before it is
multiplied by the image pixels.
TRACE KTU
* i and j are the coordinates of a pixel in the output image
* k and l are the coordinates of a pixel in the filter kernel
Correlation:
Here are some additional examples of how convolution and correlation can be used:
Blur an image to reduce noise and smooth out edges.
Sharpen an image to increase the contrast between edges and the surrounding pixels.
Detect edges in an image.
Convolution and correlation are just a few of the many spatial operations that can be used to
manipulate images. These operations are powerful tools that can be used to improve the
quality, accuracy, and usefulness of images.
TRACE KTU
Spatial averaging is a simple and effective way to reduce noise in images. It works by
averaging the values of neighboring pixels, which effectively replaces each pixel with the
average value of its neighbors. This can be useful for reducing Gaussian noise, which is a
type of noise that is evenly distributed across an image.
Spatial low pass filtering is a more sophisticated technique than spatial averaging. It works
by convolving the image with a filter kernel, which is a small array of numbers. The filter
kernel is designed to have a low response to high-frequency noise, while maintaining a high
response to low-frequency noise. This allows the filter to remove high-frequency noise from
the image, while preserving the low-frequency noise.
Directional smoothing is a type of spatial low pass filtering that only smooths in a specific
direction. This can be useful for preserving edges in images, while still reducing noise.
Directional smoothing is often used for edge detection and image segmentation.
Here are some examples of how spatial averaging, spatial low pass filtering, and directional
smoothing can be used:
Spatial averaging can be used to reduce noise in images. For example, you could use spatial
averaging to reduce Gaussian noise in a photograph.
Spatial low pass filtering can be used to remove noise and sharpen edges in images. For
example, you could use spatial low pass filtering to sharpen the edges in a photo of a
landscape.
Directional smoothing can be used to preserve edges in images while still reducing noise. For
example, you could use directional smoothing to remove noise from a satellite image of a
city.
Spatial averaging, spatial low pass filtering, and directional smoothing are all powerful tools
that can be used to improve the quality of images. These techniques are widely used in
image processing and computer vision applications.
Median Filtering:
Median filtering is a non-linear image processing technique used to remove noise from an
image while preserving its edges and fine details. It replaces each pixel value in the image
with the median value of its neighboring pixels. The median is calculated by sorting the pixel
values within a defined neighborhood and selecting the middle value.
The process of median filtering can be summarized as follows:
Define the size of the neighborhood (usually a square or rectangular window).
Place the center of the window on the first pixel of the image.
Sort the pixel values within the window.
TRACE KTU
Median filtering is effective in reducing impulse noise, such as salt-and-pepper noise, where
random pixels are corrupted with either the maximum or minimum intensity values.
Unsharp Masking:
Unsharp masking is an image sharpening technique that enhances the edges and fine details
in an image. It involves subtracting a blurred version of the image from the original image,
thereby amplifying the high-frequency components that correspond to the edges.
The process of unsharp masking can be summarized as follows:
Create a blurred version of the original image using a low-pass filter (e.g., Gaussian filter).
TRACE KTU
Here are the basic steps involved in filtering in the frequency domain:
Fourier Transform:
The Fourier Transform is applied to convert the image from the spatial domain to the
frequency domain. It decomposes the image into its frequency components, representing
different spatial frequencies. The transform provides information about the magnitude and
phase of each frequency component.
Frequency Analysis:
In the frequency domain, the image can be visualized as a 2D spectrum, often referred to as
the magnitude spectrum. The magnitude spectrum represents the distribution of frequency
magnitudes in the image. It shows which spatial frequencies are present and their
corresponding strengths. Typically, low frequencies are located at the center of the
spectrum, while high frequencies are located towards the edges.
Frequency Filtering:
Various filtering operations can be applied to modify the frequency content of the image.
These operations aim to remove or enhance specific frequency components, depending on
the desired outcome. Common types of frequency filters include low-pass filters, high-pass
filters, band-pass filters, and notch filters.
Low-pass filters allow low-frequency components to pass through while attenuating high-
frequency components. They are used to remove high-frequency noise or blur an image.
High-pass filters allow high-frequency components to pass through while attenuating low-
frequency components. They are used to enhance edges or emphasize fine details.
Band-pass filters allow a specific range of frequencies to pass through while attenuating
others. They are used to isolate frequency bands of interest.
Notch filters attenuate a specific frequency or range of frequencies. They are used to remove
specific interference or noise.
Filtering Operation:
The frequency filtering operation involves applying the desired filter to the magnitude
spectrum of the image. This is typically done by multiplying the magnitude spectrum with
the filter function in the frequency domain.
Inverse Fourier Transform:
After filtering the image in the frequency domain, the inverse Fourier Transform is applied to
convert the filtered image back to the spatial domain. This process reconstructs the image
using the modified frequency components.
TRACE KTU
Filtering in the frequency domain allows for selective manipulation of the frequency content
of an image. It is particularly useful for tasks such as noise removal, image enhancement,
edge detection, and frequency band selection. By manipulating the frequency components,
one can achieve different visual effects and extract specific features from an image.
Smoothing Frequency Domain Filters : Ideal Low Pass Filter; Gaussian Low Pass Filter; Butterworth
Low Pass Filter:
Smoothing filters in the frequency domain are used to reduce noise and blur an image by attenuating
high-frequency components while preserving low-frequency components. Three commonly used
smoothing filters in the frequency domain are the Ideal Low Pass Filter, Gaussian Low Pass Filter, and
Butterworth Low Pass Filter. Here's an overview of each:
The Ideal Low Pass Filter (ILPF) is a frequency domain filter that allows low-frequency components to
pass through while completely blocking high-frequency components. It has a sharp cutoff at a
specific frequency known as the cutoff frequency.
For frequencies lower than the cutoff frequency, the filter's response is 1, allowing those frequencies
to pass through.
For frequencies higher than the cutoff frequency, the filter's response is 0, blocking those
frequencies completely.
The main drawback of the ILPF is that it has a very abrupt transition from passing to blocking
frequencies, resulting in the appearance of ringing artifacts in the filtered image.
The Gaussian Low Pass Filter (GLPF) is a frequency domain filter that attenuates high-frequency
components smoothly using a Gaussian-shaped frequency response. It provides a more gradual
transition between passing and blocking frequencies compared to the ILPF.
The filter's response decreases with increasing frequency following a Gaussian curve.
The cutoff frequency determines the point where the response drops to a specified fraction (e.g.,
0.5) of its peak value.
The GLPF offers a smoother transition between frequency components, resulting in less ringing
artifacts compared to the ILPF. It is widely used in image processing applications.
The Butterworth Low Pass Filter (BLPF) is a frequency domain filter that provides a customizable
trade-off between smoothness and sharpness of the cutoff frequency. It is named after the physicist
Stephen Butterworth.
The BLPF is defined by the order parameter, which determines the sharpness of the filter's cutoff
frequency. A higher order results in a steeper roll-off but may introduce some ripple effects in the
frequency response.
TRACE KTU
The BLPF is defined as follows:
The cutoff frequency determines the point at which the response drops to a specified fraction (e.g.,
0.5) of its peak value.
The BLPF allows for control over the sharpness of the cutoff frequency, making it a versatile choice
for smoothing applications.
It's important to note that when using these filters in the frequency domain, the size of the filter and
its placement within the frequency spectrum can also affect the filtering results. Additionally, after
filtering, the image should be transformed back to the spatial domain using the inverse Fourier
Transform to obtain the smoothed image.
Sharpening filters in the frequency domain are used to enhance edges and fine details in an
image by emphasizing high-frequency components. Three commonly used sharpening filters
in the frequency domain are the Ideal High Pass Filter, Gaussian High Pass Filter, and
Butterworth High Pass Filter. Let's discuss each of them:
Ideal High Pass Filter:
The Ideal High Pass Filter (IHPF) is a frequency domain filter that allows high-frequency
components to pass through while blocking low-frequency components. It has a sharp cutoff
at a specific frequency known as the cutoff frequency.
The IHPF is defined as follows:
For frequencies higher than the cutoff frequency, the filter's response is 1, allowing those
frequencies to pass through.
For frequencies lower than the cutoff frequency, the filter's response is 0, blocking those
frequencies completely.
The IHPF emphasizes high-frequency components, which correspond to edges and fine
details in an image. However, it may introduce ringing artifacts in the filtered image due to
its abrupt transition.
Gaussian High Pass Filter:
The Gaussian High Pass Filter (GHPF) is a frequency domain filter that attenuates low-
frequency components smoothly using a Gaussian-shaped frequency response. It provides a
more gradual transition between passing and blocking frequencies compared to the IHPF.
The GHPF is defined as follows:
The filter's response decreases with decreasing frequency following a Gaussian curve.
The cutoff frequency determines the point where the response drops to a specified fraction
(e.g., 0.5) of its peak value.
The GHPF enhances high-frequency components while preserving the overall image quality.
artifacts.
TRACE KTU
It produces sharper results compared to the IHPF and reduces the likelihood of ringing
Similar to the smoothing filters, when using sharpening filters in the frequency domain, the
size and placement of the filter within the frequency spectrum can affect the results. After
filtering, the image should be transformed back to the spatial domain using the inverse
Fourier Transform to obtain the sharpened image.
TRACE KTU