DIP Notes
DIP Notes
DIP Notes
1. Explain the fundamental steps in digital image processing which can be applied to
images.
Image processing is the process of transforming an image into a digital form and
performing certain operations to get some useful information from it. The image
processing system usually treats all images as 2D signals when applying certain
predetermined signal processing methods.
Fundamental Image Processing Steps
Image Acquisition: Image acquisition is the first step in image processing. This step is
also known as preprocessing in image processing. It involves retrieving the image from a
source, usually a hardware-based source.
Image Enhancement: Image enhancement is the process of bringing out and
highlighting certain features of interest in an image that has been obscured. This can
involve changing the brightness, contrast, etc.
Image Restoration: Image restoration is the process of improving the appearance of an
image. However, unlike image enhancement, image restoration is done using certain
mathematical or probabilistic models.
Color Image Processing:Color image processing includes a number of color modeling
techniques in a digital domain. This step has gained prominence due to the significant use
of digital images over the internet.
Wavelets and Multiresolution Processing: Wavelets are used to represent images in
various degrees of resolution. The images are subdivided into wavelets or smaller regions
for data compression and for pyramidal representation.
Compression:Compression is a process used to reduce the storage required to save an
image or the bandwidth required to transmit it. This is done particularly when the image
is for use on the Internet.
Morphological Processing: Morphological processing is a set of processing operations
for morphing images based on their shapes.
Segmentation: Segmentation is one of the most difficult steps of image processing. It
involves partitioning an image into its constituent parts or objects.
Representation and Description: After an image is segmented into regions in the
segmentation process, each region is represented and described in a form suitable for
further computer processing. Representation deals with the image’s characteristics and
regional properties. Description deals with extracting quantitative information that helps
differentiate one class of objects from the other.
Recognition:Recognition assigns a label to an object based on its description.
2. Define histogram equalization. Explain the procedure for histogram equalization.
Histogram Equalization is a computer image processing technique used to improve
contrast in images. It accomplishes this by effectively spreading out the most frequent
intensity values, i.e. stretching out the intensity range of the image. This method usually
increases the global contrast of images when its usable data is represented by close
contrast values. This allows for areas of lower local contrast to gain a higher contrast.
The histogram equalization process for digital images consists of four steps:
1. Find the running sum of the histogram values
2. Normalize the values from step1 by dividing by total number of pixels.
3. Multiply the values from step2 by the maximum gray level value and round.
4. Map the gray-level values to the results from step 3, using a one-toone
correspondence.
3. What is the purpose of image restoration? Explain the model of image degradation
and restoration process using suitable block diagram.
Ans: The purpose of image restoration is to "compensate for" or "undo" defects which
degrade an image. Degradation comes in many forms such as motion blur, noise, and
camera misfocus. In cases like motion blur, it is possible to come up with an very good
estimate of the actual blurring function and "undo" the blur to restore the original image.
In cases where the image is corrupted by noise, the best we may hope to do is to
compensate for the degradation it caused. In this project, we will introduce and
implement several of the methods used in the image processing world to restore images.
The Fig. 1 shows, the degradation process is modeled as a degradation function that,
together with an additive noise term, operates on an input image f(x, y) to produce a
degraded image g(x, y). Given g(x, y), some knowledge about the degradation function
H, and some knowledge about the additive noise term η(x, y), the objective of restoration
is to obtain an estimate f(x, y) of the original image. the estimate should be as close as
possible to the original input image and, in general, the more we know about H and η, the
closer f(x, y) will be to f(x, y).
where h (x, y) is the spatial representation of the degradation function and, the symbol *
indicates convolution. Convolution in the spatial domain is equal to multiplication in the
frequency domain, hence
where the terms in capital letters are the Fourier transforms of the corresponding terms in
above equation.
Fig. 1 model of the image degradation/restoration process.
FIG.2
When looking at this image, we can see there are some random variations in the signal
caused by noise. In sampling we reduce this noise by taking samples. It is obvious that more
samples we take, the quality of the image would be more better, the noise would be more
removed and same happens vice versa. However, if you take sampling on the x axis, the
signal is not converted to digital format, unless you take sampling of the y-axis too which is
known as quantization.Sampling has a relationship with image pixels. The total number of
pixels in an image can be calculated as Pixels = total no of rows * total no of columns. For
example, let’s say we have total of 36 pixels, that means we have a square image of 6X 6.
As we know in sampling, that more samples eventually result in more pixels. So it means
that of our continuous signal, we have taken 36 samples on x axis. That refers to 36 pixels
of this image. Also the number sample is directly equal to the number of sensors on CCD
array.
7. Define DFT. State and prove the following properties:
(i) Correlation (ii) Periodicity
The discrete-time Fourier transform (DFT) represents an image as a sum of complex
exponential of varying magnitudes, frequency and phases. Square functions as an image
representation of a square, while the natural images are the image representation with rich
local covariance. We can perform DFT for all these image types to improve their
qualities.
i. Circular Correlation
The Complex correlation property states
ii. Periodicity
Let x(n) and x(k) be the DFT pair then if
x(n+N) = x(n) for all n then,
X(k+N) = X(k) for all k
Thus periodic sequence xp(n) can be given as
8. Define compression and explain the general compression system model.
Compression: It is the process of reducing the size of the given data or an image. It will help us
to reduce the storage space required to store an image or File.
Image Compression Model: There are two Structural model and they are broadly Classified as
follows
1.An Encoder
2.ADecoder.
An Input image f(x,y) is fed in to encoder and create a set of symbols and after transmission over
the channel ,the encoded representation is fed in to the decode.
A General Compression system model:
The General system model consist of the following components, They are broadly classified as
1.Source Encoder
2.Channel Encoder
3.Channel
4.Channel Decoder
5.Souce Decoder
The Source Encoder Will removes the input redundancies. The channel encoder will increase the
noise immunity of the source encoder’s output. If the channel between encoder and decoder is
noise free then the channel encoder and decoder can be omitted
MAPPER: It transforms the input data in to a format designed to reduce the inter pixel
redundancy in the input image.
QUANTIZER: It reduce the accuracy of the mapper’s output.
SYMBOL ENCODER: It creates a fixed or variable length code to represent the quantizer’s
output and maps the output in accordance with the code
SYMBOL DECODER: The inverse operation of the source encoder’s symbol will be performed
and maps the blocks.
9. Explain the elements of an image processing system.
Image Processing System is the combination of the different elements involved in the
digital image processing. It consists of following components:-
Image Sensors: Image sensors senses the intensity, amplitude, co-ordinates and other
features of the images and passes the result to the image processing hardware. It
includes the problem domain.
Image Processing Hardware: Image processing hardware is the dedicated hardware
that is used to process the instructions obtained from the image sensors. It passes the
result to general purpose computer.
Computer: Computer used in the image processing system is the general purpose
computer that is used by us in our daily life.
Image Processing Software: Image processing software is the software that includes
all the mechanisms and algorithms that are used in image processing system.
Mass Storage: Mass storage stores the pixels of the images during the processing.
Hard Copy Device: Once the image is processed then it is stored in the hard copy
device. It can be a pen drive or any external ROM device.
Image Display: It includes the monitor or display screen that displays the processed
images.
Network: Network is the connection of all the above elements of the image processing
system.
10. Explain about the discrete cosine transform and write its applications.
Discrete cosine transform (DCT) is a transform that is mainly used in compression
algorithms. It transforms data points in a spatial domain into a frequency domain. This
makes it easier to find the repetition of patterns. Like any other transform, it is also
invertible. This means we can return the actual data points if the transforms are given.
Several formulas define DCT, but the most common one is given below:
𝜋𝑘(2𝑛 + 1)
𝑋(𝑘) = 2 𝑥(𝑛)cos ( )
2𝑁
Applications
As mentioned before, DCT does a great job of highlighting the frequencies. Which can
further show redundancies. This makes it perfect for compression applications. Some of
the applications of DCT are as follows:
A line can be described analytically in a variety of ways. One of the line equations uses the
parametric or normal notion: xcosθ+ysinθ=r. where r is the length of a normal from the origin to
this line and θ is the orientation as given in Figure.
The known variables (i.e., xi,yi) in the Image are constants in the parametric line equation,
whereas r and are the unknown variables we seek. Points in cartesian image space correspond to
curves in the polar Hough parameter space if we plot the potential (r, θ) values specified by each.
The Hough transformation for straight lines is this point-to-curve transformation. Collinear spots
in the cartesian image space become clearly obvious when examined in the Hough parameter
space because they provide curves that overlap at a single (r, θ) point. Where a and b are the
circle’s center coordinates, and r is the radius. Because we now have three coordinates in the
parameter space and a 3-D accumulator, the algorithm’s computing complexity increases. (In
general, the number of parameters increases the calculation and the size of the accumulator array
polynomially.) As a result, the fundamental Hough approach described here is only applicable to
straight lines.
15. a) What do you mean by image histogram?
b) Write down the steps of the Histogram Equalization method of image
enhancement.
c) Write down the differences between Histogram Equalization and Histogram
Matching.
We can define the histogram of an image as a 2D bar plot. The horizontal axis
represents the pixel intensities. The vertical axis denotes the frequency of each intensity.
Steps Involved
1. Get the input image
2. Generate the histogram for the image
3. Find the local minima of the image
4. Divide the histogram based on the local minima
5. Have the specific gray levels for each partition of the histogram
6. Apply the histogram equalization on each partition
The discrete Fourier transform (DFT) of an image f of size 𝑴 × 𝑵 is an image F of same size
defined as:
𝑴 𝟏𝑵 𝟏
𝒖𝒏 𝒗𝒏
𝒋𝟐𝝅(
𝑭(𝒖, 𝒗) = 𝒇(𝒎, 𝒏) 𝒆 𝑴 𝑵
𝒎 𝟎𝒏 𝟎
In the sequel, we note F the DFT so that F[f]=F
𝑭𝑻
𝑭[𝜹(𝒕)] = 𝟏 𝒐𝒓 𝜹(𝒕) ↔ 𝟏
That is, the Fourier transform of a unit impulse function is unity.
17. What is understood by spatial domain representation ?
In computer imaging, a two-dimensional image can be represented by a two-dimensional
function f{x, y) where x and y are the spatial coordinates in the 2- D image plane and f is
either a scalar describing the gray level or a vector containing three components
describing the intensities of the three primary colors at the location represented by
coordinates x and y.
18. a)Write down the types of redundancies that might be present in a typical image.
b) Define Run-Length code for a binary image.
In digital image compression, three basic data redundancies can be identified and
exploited: coding redundancy, interpixel redundancy, and psychovisual redundancy.
Coding Redundancy: In this, we utilize formulation to show how the gray-level
histogram of an image also can provide a great deal of insight into the construction of
codes to reduce the amount of data used to represent it.
Interpixel redundancy: Interpixel redundancy is due to the correlation between the neighboring
pixels in an image. That means neighboring pixels are not statistically independent. The gray
levels are not equally probable. The value of any given pixel can be predicated from the value of
its neighbors that is they are highly correlated.
Psychovisual Redundancy: Certain information simply has less relative importance than other
information in normal visual processing. This information is said to be psychovisually redundant.
It can be eliminated without significantly impairing the quality of image perception.
Run-length coding Method that works by counting the number of adjacent pixels with the
same grey-level value. This count, called the run length, is then coded and stored. Basic
methods are used primarily for binary images, but can be used for more complex images
that have been pre-processed by thresholding to reduce the number of gray levels to
two.Basic concept is to code each contiguous group of 1’s or 0’s encountered in a left to
right scan of a row by its length, and establishing a convention for determining the length
of the run.
The most common approaches for determining the value of the run are:-
(i) specify the value of the first run of each row, or
(ii) (ii) assume that the row begins with a white run, whose run-length
may in fact be zero.
19. Differentiate between spatial domain enhancement and frequency domain
enhancement.
20. Compute the Size of 800x600 image at 240 pixels per inch?
If the image is 800 pixels by 600 pixels at 240 pixels per inch, then the image size is (800
/ 240) by (600 / 240) or 31/3 by 21/2 inches.
21. What is the difference between lossy and lossless compression ?
22. Describe the region growing technique for image segmentation and mention the
problem associate with it.
Region Growing
In this method, you start with a small set of pixels and then start iteratively merging more
pixels according to particular similarity conditions. A region growing algorithm would pick
an arbitrary seed pixel in the image, compare it with the neighbouring pixels and start
increasing the region by finding matches to the seed point.
When a particular region can’t grow further, the algorithm will pick another seed pixel which
might not belong to any existing region. One region can have too many attributes causing it to
take over most of the image. To avoid such an error, region growing algorithms grow multiple
regions at the same time.
You should use region growing algorithms for images that have a lot of noise as the noise
would make it difficult to find edges or use thresholding algorithms.
Disadvantage: 1. The computation is consuming, no matter the time or power.
2. Noise or variation of intensity may result in holes or over segmentation.
3. This method may not distinguish the shading of the real images.
23. Difference between Huffman coding and Arithmetic coding.
The problem domain in this example consists of pieces of mail and the objective is to read the
address on each piece. Thus the desired output in this case is a stream of alphanumeric characters.
The first step in the process is image acquisition that is acquire a digital image .To do so requires an
imaging sensor and the capability to digitize the signal produced by the sensor. After the digital
image has been obtained the next step deals with preprocessing that image. The key function of this
is to improve the image in ways that increase the chances for success of the other processes. The next
stage deals with segmentation. Broadly defined segmentation partitions an input image into its
constituent parts or objects. The key role of this is to extract individual characters and words from the
background, The output of the segmentation stage usually is raw pixel data, constituting either the
boundary of a region or all the points in the region itself. Choosing a representation is only part of the
solution for transforming raw data into a form suitable for subsequent computer processing.
Description also called feature selection deals with extracting features that result in some quantitative
information of interest that are basic for differentiating one class of object from another. The last
stage involves recognition and interpretation. Recognition is the process that assigns a label to an
object based on the information provided by its descriptors. Interpretation involves assigning
meaning to an ensemble of recognized objects. Knowledge about a problem domain is coded into an
image processing system in the form of knowledge database. This knowledge may be simple as
detailing regions of an image where the information of interest is known to be located thus limiting
the search that has to be conducted in seeking that information. The knowledge base also can be quite
complex such as an interrelated list of all major possible defects in a materials inspection problem or
an image database containing high resolution satellite images of a region in connection with change
detection application. Although we do not discuss image display explicitly at this point it is important
to keep in mind that viewing the results of image processing can take place at the output of any step .
26. Write short notes on image segmentation.
Segmentation subdivides on image in to its constitute regions or objects. The level to
which the subdivides is carried depends on the problem being solved .
Examples: In autonomous air to ground target acquisition applications identifying
vehicles on a road is of interest.
The first step is to segment the road from the image and then to segment the elements
of the road down to objects of a range of sizes that correspond potential vehicles.
In target acquistition ,the system designer has no control of the environment. So the
usual approach is to focus on selecting the types of sensors most likely to enhance the
objects of interest
Example is the use of infrared imaging to detect objects with a strong heat
signature,such as tanks in motion.
Segmentation algorithms for monochrome images are based on one of the two
basic properties of gray level values . They are discontinuity and similarity.Based on the
first category ,the approach is based on abrupt changes in gray level and the areas of
interest based on this category are detection of isolated points and detection of lines and
edges in an image.Based on the second category the approach is based on thresholding,
region growing and region splitting and merging .
The concept of segmenting an image based on discontinuity or similarity of the
gray level values of its pixels is applicable to both static and dynamic images.
1. Remote sensing
2. Image transmission and storage for business application
3. Medical imaging
4. Astronomy
4 diagonal neighbors.