Professional Documents
Culture Documents
Q.1 What are the elements of digital image processing systems. Explain with
Diagram.
A.
1. Image Acquisition : This is the first step or process of the fundamental steps of digital
image processing. Image acquisition could be as simple as being given an image that is
already in digital form. Generally, the image acquisition stage involves preprocessing,
such as scaling etc.
2. Image Enhancement : Image enhancement is among the simplest and most appealing
areas of digital image processing. Basically, the idea behind enhancement techniques is to
bring out detail that is obscured, or simply to highlight certain features of interest in an
image. Such as, changing brightness & contrast etc.
3. Image Restoration : Image restoration is an area that also deals with improving the
appearance of an image. However, unlike enhancement, which is subjective, image
restoration is objective, in the sense that restoration techniques tend to be based on
mathematical or probabilistic models of image degradation.
4. Color Image Processing : Color image processing is an area that has been gaining its
importance because of the significant increase in the use of digital images over the
Internet. This may include color modeling and processing in a digital domain etc.
5. Compression :Compression deals with techniques for reducing the storage required to
save an image or the bandwidth to transmit it. Particularly in the uses of internet it is very
much necessary to compress data.
6. Image segmentation: to partitions an input image into its constituent parts or objects.
7. Image recognition: to assign a label to an object based on the information provided by
its descriptors.
8. Image representation and description :Representation is to convert the input data to a
form suitable for computer processing. Description is to extract features that result in
some quantitative information of interest or features that are basic for differentiating one
class of objects from another.
z4 z5 z6
z7 z8 z9
w4 w5 w6
w7 w8 w9
● Smoothing Non-Linear Filters: They are also known as Ordered Statistic Filters.
Examples of Non-Linear filters are Median, Max and Min Filter.
● Sharpening First Order Derivative Filters: Examples are Robert, Prewit, Sobel and
Fri-Chen filter.
● Sharpening Second Order Derivative Filters: Examples are Laplacian, High Pass and
High Boost Filter.
Q.5 What is image segmentation? Explain the following methods of image
segmentation. i) Region growing ii) Region splitting iii) Thresholding.
A.Image segmentation means assigning a label to each pixel in the image such that pixels with
same labels share common visual characteristics. It makes an image easier to analyze in the
image processing tasks. There are many different techniques available to perform image
segmentation.
Region based segmentation:
Region based methods are based continuity. These techniques divide the entire image into sub
regions depending on some rules like all the pixels in one region must have the same gray level.
Region-based techniques rely on common patterns in intensity values within a cluster of
neighboring pixels. The cluster is referred to as the region, and the goal of the segmentation
algorithm is to group the regions according to their anatomical or functional roles
1. Region Growing:Region growing is a procedure that group’s pixels in whole image into
sub regions or larger regions based on predefined criterion . Region growing can be
processed in four steps:-
(i)Select a group of seed pixels in original image.
(ii) Select a set of similarity criterion such as grey level intensity or color and set up a
stopping rule.
(iii)Grow regions by appending to each seed those neighboring pixels that have
predefined properties similar to seed pixels.
(iv)Stop region growing when no more pixels met the criterion for inclusion in that
region (i. e. Size, likeness between a candidate pixel & pixel grown so far, shape of the
region being grown).
2. Region Splitting and Merging: Rather than choosing seed points, user can divide an
image into a set of arbitrary unconnected regions and then merge the regions in an
attempt to satisfy the conditions of reasonable image segmentation. Region splitting and
merging is usually implemented with theory based on quadtree data.
3. Thresholding: The simplest thresholding methods replace each pixel in an image with a
black pixel if the image intensity I{i,j} is less than some fixed constant T (that is,
I{i,j}<T}), or a white pixel if the image intensity is greater than that constant. In the
example image on the right, this results in the dark tree becoming completely black, and
the white snow becoming completely white.
Give example of each technique that mam has taught in the lectures.
Q.6 Explain with an example that the first difference of a chain code normalizes it
to rotation.
A.Chain codes describe the object by a sequence of unit size line segments with a given
orientation. The process to compute the chain code is as follows:
1. Select starting point of contour.
2. Represent this point by its absolute coordinates in the image
3. Represent every consecutive point by a chain code showing the transition needed to go
from current position to next point on the contour.
4. Stop if the next point is the initial point or the end of the contour.
5. Store the lengths of the contour into the file
First Difference Calculation:
● Normalization for starting point: Treat the code as a circular sequence and redefine the
starting points that the resulting sequence of numbers forms an integer of minimum
magnitude.
● Normalization for rotation: Use the first difference of the chain code instead of the
code itself. The difference is simply by counting (counter-clockwise) the number of
directions that separate two adjacent elements of the code.
Solve the example that we have solved in IP assignment 1 with proper explanation of each step.
5 6 7 2
3 4 6 7
7 6 2 4
Sample calculation: for first pixel, r=1, L=8, a=3. ‘r=1’ is less than ‘a=3’. The the output should
be ‘0’. According to the formula given above we get the result as follows:
0 0 0 7
7 7 7 0
0 7 7 7
7 7 0 7
3. Digital Negative Transformation:the digital negative is an opposite image of input. In
digital negative transformation the darker part in input becomes brighter in output and
bright parts become darker. The technique is most commonly used in X-ray.
S = 255- r if rmax=255
(L-1)- r
For 8 gray levels, S = (8-1)-r=7-r
For example,
0 1 4 6
2 5 7 3
1 2 3 4
6 7 2 4
5 2 0 4
6 5 4 3
1 0 5 3
4. Intensity level Slicing: it is also called as gray level slicing. It has two forms- with
background and without background. This transformation is used in X-ray images(with
background) and CT SCAN, MRI(with background). We need to highlight specific range
of gray levels like enhancing the flaws in an X-ray or CT image.
With Background: S= L-1 if a<=r<b
r otherwise
Without Background: S= L-1 if a<= r <= b
0 otherwise
5. Bit plane slicing: in this technique, we find out the contribution made by each bit to the
final image. Consider the LSB value of each pixel and plot the image using only LSB.
you continue doing this for each bit till we come to the MSB. We will get different binary
images. In bit plane slicing, the high order bits contain majority of visually significant
data while lower bits contain the subtle details in the image. It can be used in image
compression. We can transmit only higher order bits and remove lower order bits. It is
also used in steganography.
Q.8 Write a short note on ‘Edge linking using Hough Transform’.
A. Hough transform can be used for pixel linking and curve detection. The straight line
represented by y=mx+c can be expressed in polar coordinate system as,
ρ = xcos(θ)+ ysin(θ) …………………..(i)
Where ρ,θ defines a vector from the origin to the nearest point on the straight line y=mx+c. this
vector will be perpendicular from the origin to the nearest point to the line as shown in the below
figure.
Any line in the x, y plane corresponds to the point in the 2D space defined by the parameter and
θ. This the Hough transform of a straight line in the x,y plane is a single point in the ρ, θ space
and these points should satisfy the given equation with x1,y1 as constants. Thus the locus of all
such lines in the x, y plane corresponds to the particular sinusoidal curve in the ρ, θ space.
Suppose we have the edge points xi,yi that lie along the straight line having parameters ρ0,θ0.
Each edge point plots to a sinusoidal curve in the ρ,θ space, but these curves must intersect at a
point ρ0,θ0. Since this is a line they all have in common.
For example considering the equation of a line: y1= ax1+b
Using this equation and varying the values of a and b, infinite lines can pass through this point
(x1,y1).
However, if we write the equation as
B= -ax1+y1
And then consider the ab plane instead of xy plane, we get a straight line for a point (xi,yi). This
entire line in the ab plane is due to a single point in the xy plane and different values of and b.
Now consider another point (x2, y2) in the xy plane. The slope intercept equation of this line is,
Y2= ax2+ b………………….(1)
Writing the equation in terms of the ab plane we get,
B= -ax2+y2………………..(2)
This is another line in the ab plane. These two line will intersect each other somewhere in the ab
plane only if they are part of a straight line in the xy plane. The point of intersection in the ab
plane is noted as (a’,b’). using this (a’,b’) in the standard slope-intercept form i.e. y=a’x+b’, we
get a line that passes through the points (x1 , y1) and (x2, y2) in the xy plane.
Diagonal connectivity:
● The four diagonal neighbors of p(x,y) are given by, (x+1, y+1), (x+1, y-1), (x-1, y+1),
(x-1 ,y-1)
● This set is denoted by ND(P).
● Each of them are at Euclidean distance of 1.414 from P.
8-connectivity:
● The points ND(P) and N4(P) are together known as 8-neighbors of the point P, denoted
by N8(P).
● Some of the points in the N4, ND and N8 may fall outside image when P lies on the
border of image.
M-connectivity:
● Two pixels p and q with values from V are m-adjacent if,
- q is in N 4(P).
- q is in N D(p) and the set [N4(p) intersect N4(q) ] is empty (has no pixels whose
values are from V).
Give examples that mam has taught in the lectures.
Q.10 Write a short note on Hit or Miss Transform.
A.The Hit or Miss Transform is the morphological operator used for finding local patterns of
pixels i.e. the size of the structuring element.
Method:
Method is quite simple .A small odd sized mask(structuring element ),typically 3x3 is scanned
over a binary image. If the binary-valued pattern of the structuring element matches the state of
the pixels under the structuring element(HIT),the output pixel in spatial correspondence to the
center pixel of the structuring element is set to some desired binary state (usually 1).If the binary
pattern of the structuring element does not match the state of the pixels under the structuring
element(MISS), the output pixel in the spatial correspondence to the center pixel of the
structuring element is set to the opposite binary state(usually 0).
Let B=(B1,B2)B=(B1,B2) be the structuring element.Here B1B1 is a set formed from elements
of B Associated with the objects and B2B2 is a set of elements of B associated with the
corresponding background.B=(B1,B2)B=(B1,B2) is called a composite structuring element.The
HIT and MISS transformation of a set A with structuring element B is given by the equation
A⊗B=a|B1ЄAandB2ЄAcA⊗B=a|B1ЄAandB2ЄAc
Where A is the image set ,AcAc is the complement of the image set and B is the structuring
elements.
If the foreground and background pixels in the structuring element exactly match the foreground
and background pixels in the image, then the pixels underneath the origin of the structuring
element is set to foreground colour. If it doesn’t match, that pixel is set to background colour.
Q.11 Write 8x8 Hadamard transform matrix and its signal flow graph. Using the
Butterfly diagram, compute Hadamard transform for x(n) = { 1,2,3,4, 1,2, 1,2}
A.
Q.12 Write an expression for a 2-D DFT . What is its relationship with one
dimensional DFT? How one-dimensional FFT algorithm can be used to compute
two dimensional DFT of an digital image.
A.
By 2D Fourier Transform,
Row Transform∶
Column Transform∶
2D Fourier Transform of input image can be obtained by performing row-wise 1D transform
followed by column-wise 1D Fourier Transform.
Fast Fourier Algorithm to find DFT of an image:
● Perform row-wise transform using FFT Flowgraph.
● Perform column-wise transform using FFT Flowgraph.
● Scale by 1 /N.
Q.13 Classify image compression methods in detail along with the different
redundancies that can be present in digital images.
1. Data compression is defined as the process of encoding data using a representation that
reduces the overall size of data. This reduction is possible when the original dataset
contains some type of redundancy.
2. Digital image compression is a field that studies methods for reducing the total number of
bits required to represent an image. This can be achieved by eliminating various types of
redundancy that exist in the pixel values.
3. Psycho-visual Redundancy: It is a redundancy corresponding to different sensitivities to
all image signals by human eyes. Therefore, eliminating some less relative important
information in our visual processing may be acceptable.
4. Inter-pixel Redundancy: It is a redundancy corresponding to statistical dependencies
among pixels, especially between neighboring pixels.
5. Coding Redundancy: The uncompressed image usually is coded with each pixel by a
fixed length. For example, an image with 256 gray scales is represented by an array of
8-bit integers. Using some variable length code schemes such as Huffman coding and
arithmetic coding may produce compression
Generally most lossy compressors are three-step algorithms, each of which is in accordance
with three kinds of redundancy mentioned above.
The first stage is a transform to eliminate the inter-pixel redundancy to pack information
efficiently. Then a quantizer is applied to remove psycho-visual redundancy to represent the
packed information with as few bits as possible. The quantized bits are then efficiently encoded
to get more compression from the coding redundancy.
Lossless Compression Methods:
Lossless compressors are usually two-step algorithms. The first step transforms the original
image to some other format in which the inter-pixel redundancy is reduced. The second step uses
an entropy encoder to remove the coding redundancy. The lossless decompressor is a perfect
inverse process of the lossless compressor.
2. Closing
1) The closing operation is the opposite of the opening operation. It is a dilation operation
followed by an erosion operation.
2) The closing operation fills the small holes and gaps in a single-pixel object.’
3) It is has the same effect of an opening operation, in that it smoothes contours and maintains
shapes and sizes of object.
4) The closing process can be mathematically represented as X.B = (X exor B) exnor B Where X
is an input image and B is the structuring element.
5) Closing protects coarse structure, closes small gaps and round off concave corners.
5 MARKS
Q.15 What is unitary transform matrix? Explain with examples.
A.refer mam’s lecture notes
Q.16 Explain in short sampling and quantization method for digital image.
A.
Sampling:
Sampling is the reduction of a continuous signal to discrete signal. A common example is the
conversion of a sound wave to a sequence of samples, a sample refers to a value or set of values
at a point in time or space. It is subsystem or operation that extracts samples from continuous
signals. Sampling can be done for functions varying in space, time or any other dimensions and
similar results are obtained in two or more dimensions.
The equation suggests that a sampled 2-D function defined over a domain size
M▲x X N▲y can be considered as an 2D array {f (0, 1), f (0, 1),………………….}
This means that the function is represented as an M X N uniformly spaced sample. Apart from
the sampling interval in x and y direction, another important choice relevant to the image
sampling is the spatial arrangement of the sample points called as Tessellation.
Quantization:
The values obtained by sampling a continuous function usually comprise of an infinite set or real
numbers ranging from a minimum to maximum depending upon the sensors calibration. These
values must be represented by a finite number of bits usually used in computer to store or
process any data. In practice the sampled signal values are represented by a finite et of integer
values. This is known as quantization. Every image that is seen on the monitor is actually this
matrix. Each element of the matrix is called as pixel. Whenever we see the image on the screen
of computer it is actual matrix consisting of N X M pixels is known and each pixel is considered
to be a simple. Hence more the pixels, more the sample, higher the sampling rate hence better the
spatial resolution. The value of each pixel is known as the grey level. Computer understands only
ones and zeros. Hence these grey levels needs to be represented in terms of zeros and ones. If we
have two bits to represent the grey levels, only 4 different grey levels (2) can be identified viz.
00,01 10, 11, where 00 is back, 11 is white and other two are different shades of grey. Similarly,
if we have 8 bits, to represent the grey levels, we will have 256 grey levels (2). Hence more the
bits, more are the grey levels and better is the tonal clarity (quantization). The total size of the
image is N X M X m, where m is the number of bits used. As we know, more the samples and
the bits, better is the image. This answer will vary from image to image. As the sampling and the
quantization increase, the number of bits required to store the image increases tremendously. The
clarity increases, but storage space required increases too.
Q.17 Enhancement process does not add any information to the image. Justify
Contradict.
A.
1. The principle objective of enhancement technique is to process a given image so that the
result is more suitable than the original image for a specific application.
2. Image enhancement refers to sharpening of image features such as edges, boundaries or
contrast to make a graphic display more useful for display and analysis.
3. Image enhancement include gray levels and contrast manipulation, noise reduction,
edge-sharpening, filtering, interpolation, magnification, pseudo-coloring and so on.
4. Image enhancement techniques take the input image pixel and modify it to new value
without adding any information to it.
5. The enhancement process does not increase the inherent information content in the data
but it does increase the dynamic range of the chosen feature so that they can be detected
easily
Let us take a starting point which is arbitrarily chosen (p). From this point on, the cursor follows
the contour, usually in the clockwise direction. For every pixel the direction is noted.
The 4-chain code is given edge is
0 0 3 0 3 3 2 2 2 1 1 1
Hence instead of storing the coordinates of each pixel, we can store the chain code and starting
coordinates. Remember 8-connectivity is closer to the human eye than 4-connectivity. The chain
code allows an edge to be described using vertical, horizontal as well as diagonal descriptors at
45 degrees,135 degrees,225 degrees and 315 degrees.
1 Excellent An image of extremely high quality as good as you could desire.
2 Fine An image of high quality providing enjoyable viewing. Interference is
somewhat objectionable.
3 Passable An image of acceptable quality. Interference is somewhat objectionable.
4 Marginal An image of poor quality that you wish could be improved. Interference is
somewhat objectionable.
5 Inferior A very poor image but can be viewed. Objectionable interference is
definitely present.
6 Unusable An image so bad that it cannot be viewed.
-1 8 -1
-1 -1 -1
● A point has been detected at the location on which the mask is centered if |R|>T where T
is non-negative threshold and.
● The idea is that the gray level of an isolated point will be quite different from the gray
levels of its neighbors.
● The mask operation measures the weighted differences between the centre point and its
neighbors. The differences that are large enough are determined by T considered isolated
points in the image of interest.
Line Detection:
● The various masks present for line detection are :
a) Horizontal mask
-1 -1 -1
2 2 2
-1 -1 -1
-1 2 -1
2 -1 -1
-1 2 -1
-1 -1 2
-1 2 -1
-1 2 -1
● If the horizontal mask is moved around an image it would respond more strongly to lines
oriented horizontally.
● With constant background the maximum response would result when the line is passing
through the middle row of the mask.
Edge Detection:
● Edges characterize object boundaries are therefore useful for segmentation and
identification of objects in scene.
● Edge point can be thought of as pixel location of abrupt gray levels. It is the boundary
between two regions with relatively distinct gray level properties.
● There are two types of edges step and ramp edge.
● The step edges are detected using first order derivative filters like Robert, Sobel and
Prewitt.
● The ramp edges can be detected using second order derivative line Laplacian filter.
1. The technique involves some loss of 1. Involves no loss of information.
information.
2. Data that has been compressed using 2. If data has been (lossless) compressed, the
this technique can’t be recovered and original data can be recovered from the
reconstructed exactly. compressed data.
3. Used for application that can tolerate 3. Used for application that can’t tolerate any
difference between the original and difference between original and reconstructed
reconstructed data. data.
4. In return for accepting this distortion in 4. No loss in information so compression rate is
reconstructed data we obtain high small.
compression rate
5. Sound and Image compression uses 5. Text compression uses lossless compression
lossy compression.
6. More data can be accommodated in 6. Less data can be accommodated in channel.
channel.
For Image A and structuring element B as in Z2 (2D integer space),
Erosion:
Erosion is defined as: A ϴ B={Z|(B ̂)Z ϵ A}
This equation indicates that erosion of A by B is the set of all points Z such that B, translated
(Shifted by Z), is a subset of A i.e., B is entirely contained within A . Erosion reduces the
number of pixels from the object boundary. The number of pixels removed depends on the size
of the structuring element.
Example: A={(1,0),(1,1),(1,2),(0,3),(1,3),(2,3),(3,3),(1,4)} and B={(0,0),(1,0)}
Then, A B={(0,3),(1,3),(2,3)}