Professional Documents
Culture Documents
1.Define image. Explain digital and analog image. Explain digital image processing.
Ans:-
Image:An image is a visual representation or depiction of an object, scene, or phenomenon.
It is typically a two-dimensional representation composed of a grid of picture elements,
commonly referred to as pixels. Images can be captured, generated, or stored in various
formats and can represent different types of visual information, such as photographs,
graphics, or digital illustrations.
Digital Image :A digital image is a representation of visual information in a digital format. It is
composed of discrete elements called pixels, where each pixel represents a specific color or
grayscale value. Digital images are typically stored as binary data, where each pixel's value is
represented by a binary number. The resolution of a digital image refers to the number of
pixels in width and height, determining the level of detail and clarity.
Analog Image: An analog image, also known as a continuous-tone image, is a representation
of visual information in an analog format. It is characterized by continuous variations in
intensity or color values across the image. Analog images are typically captured using
traditional photographic techniques or analog cameras, and they exist as continuous physical
representations without discrete pixel elements. Examples of analog images include
photographs developed from film or printed images.
Digital Image Processing: Digital image processing (DIP) is the manipulation and analysis of
digital images using computer algorithms and techniques. It involves applying various
operations, filters, and transformations to enhance, modify, or extract useful information
from digital images. DIP techniques can be used to improve image quality, remove noise,
adjust brightness and contrast, perform image segmentation, detect objects or features, and
much more.
common operations in digital image processing include image filtering, image restoration,
image compression, image enhancement, and image analysis. Digital image processing finds
applications in various fields, such as medical imaging, remote sensing, computer vision,
multimedia processing, and scientific research.
2.Describe fundamental steps in image processing.
ANS:-
The fundamental steps in image processing typically involve the following:
1. Image Acquisition: The process of capturing or obtaining an image using cameras,
scanners, or other imaging devices. This step involves converting the physical image into a
digital representation.
2. Image Preprocessing: This step involves preparing the acquired image for further
processing. It includes operations such as noise removal, image resizing, color space
conversion, and adjusting brightness or contrast. Preprocessing aims to enhance image
quality, correct artifacts, and improve the suitability of the image for subsequent analysis.
3. Image Enhancement: Image enhancement techniques are applied to improve the visual
quality or perception of the image. This step can involve adjusting brightness and contrast,
enhancing sharpness, reducing noise, and improving color accuracy. The goal is to highlight
important features, improve visibility, and make the image visually appealing.
4. Image Restoration: Image restoration techniques are employed to recover or reconstruct
degraded or damaged images. This can involve removing blur, deconvolution to restore
sharpness, correcting geometric distortions, or eliminating artifacts caused by sensor or
transmission errors. Image restoration aims to reverse the effects of image degradation and
restore the original image as much as possible.
5. Image Segmentation: Image segmentation involves dividing the image into meaningful
and distinct regions or objects. It aims to identify and separate different areas based on their
properties such as color, texture, or intensity. Segmentation is useful for object recognition,
tracking, and further analysis of specific regions within the image.
6. Feature Extraction: Feature extraction is the process of identifying and extracting relevant
visual information or features from the image. These features can be edges, corners,
textures, shapes, or other characteristics that are essential for subsequent analysis or
recognition tasks. Feature extraction helps in reducing the complexity of the image and
capturing meaningful information for further processing.
7. Image Analysis and Interpretation: In this step, the extracted features or processed image
are analyzed and interpreted to extract meaningful information. This can involve object
detection, pattern recognition, classification, or measurement of specific properties. Image
analysis aims to understand the content and context of the image and extract useful
information for decision-making or further applications.
8. Image Compression: Image compression techniques are applied to reduce the storage
space required for storing or transmitting images. Compression algorithms exploit
redundancies and eliminate unnecessary information while preserving important visual
details. Lossless compression techniques preserve the original image quality, while lossy
compression methods sacrifice some details to achieve higher compression ratios.
The term image acquisition refers to the process of capturing real-world images and
storing them into a computer.
Digital cameras which capture images directly in digital form are more popular
nowadays.
Films are not used in digital cameras. Instead, they use a charge-coupled device or
CMOS device as the image sensor that converts light into electrical charges.
Most of the digital cameras use either a CCD or a CMOS image sensor.
The charge packet is then transferred through the transport mechanism to the
output circuit where it is converted into a measurable voltage.
The human visual system can detect the range of light spectrum from about 400 nm
to about 700 nm.
Vision and hearing are the two most important means by which humans perceive the
outside world.
The complex aspects of visual perception are best introduced by a brief description
of the anatomy of the human visual system.
The photoreceptors responsible for colour vision are the cones. There are three types
of cones in the retina. They are
(i) L-receptors which are sensitive to light of long wavelengths
(ii) M-receptors which are sensitive to light of middle wavelengths
(iii) S-receptors which are sensitive to light of short wavelengths
It is customary to denote the RGB sensors with the Greek letters rho (red), gamma
(green) and beta (blue).
The sensitivity curves of the rho, gamma and beta sensors in the human eye
determine the intensity of the colours that one perceives for each of the wavelengths
in the visual spectrum.
Selective sensing of different light wavelengths allows the visual system to create the
perception of colour.
Q9. Write a short note on Sampling and Quantization.
Ans:-
Sampling:
Quantization:
Q10. Explain the different types of connectivity of pixels with suitable example.
Ans:-
1. the term "connectivity" refers to the relationships between pixels in an image. It
describes how pixels are connected or adjacent to each other based on their spatial
arrangement.
2. There are different types of connectivity, commonly known as neighborhood
systems, which define the set of pixels considered as neighbors of a given pixel. Here
are some examples:
a. 4-connectivity: In 4-connectivity, also known as the Von Neumann neighborhood,
a pixel is connected to its four immediate neighbors - the pixels above, below, to
the left, and to the right. This type of connectivity forms a square shape around
each pixel. Here's an example:
00000
01100
01100
00000
In this example, the pixel with value 1 is connected to its four neighboring pixels with
value 1.
b. · 8-connectivity: In 8-connectivity, also known as the Moore neighborhood, a
pixel is connected to its eight immediate neighbors - the four neighbors from 4-
connectivity plus the diagonally adjacent pixels. This type of connectivity forms a
square shape with diagonals around each pixel. Here's an example:
00000
01110
01110
01110
00000
In this example, the pixel with value 1 is connected to its eight neighboring pixels with
value 1.
c. N-connectivity: N-connectivity is a more generalized form of connectivity, where
the value of N determines the number of connected neighbors. For example, in 5-
connectivity, a pixel is connected to its four immediate neighbors and one
diagonal neighbor. Similarly, in 6-connectivity, a pixel is connected to its four
immediate neighbors and two diagonal neighbors. The pattern continues, and
higher values of N result in more connected neighbors
Q11. List and explain elements of image processing system?
Ans:-
1. An image processing system consists of several key elements that work together to
analyze and manipulate images. Here are the main elements of an image processing
system:
a. Image Acquisition: Image acquisition involves the process of receiving and
digitizing the image data from the input devices.
It includes tasks such as sampling, quantization, and color space conversion to represent
the image in a suitable digital format.
b. Preprocessing: Preprocessing refers to the initial stage of image processing where
various techniques are applied to enhance the quality of the input image.
This may involve operations such as noise reduction, image resizing, color correction,
and image enhancement.
c. Image Enhancement: Image enhancement techniques are used to improve the
visual quality of an image or to extract useful information from it.
These techniques can include contrast enhancement, brightness adjustment,
sharpening, filtering, and histogram equalization.
d. Input Devices: Input devices capture the raw image data and convert it into a
digital format that can be processed by the system. Examples of input devices
include digital cameras, scanners, and video capture devices.
e. Image Compression: Image compression is the process of reducing the size of an
image while maintaining an acceptable level of quality. It involves techniques
such as lossless compression or lossy compression to achieve efficient storage or
transmission of images.
f. Input Devices: Input devices capture the raw image data and convert it into a
digital format that can be processed by the system. Examples of input devices
include digital cameras, scanners, and video capture devices.
Q12. Explain the term (a) Thresholding (b) Log Transformation (c) Negative
Transformation
Ans:-
a. Thresholding:
1. Thresholding is a simple and commonly used technique in image processing for
image segmentation.
2. It involves converting a grayscale or color image into a binary image by assigning
different intensity values to pixels based on a predefined threshold value.
3. The threshold value separates the image pixels into two categories: those below the
threshold are assigned one value (usually 0 or black), and those above or equal to
the threshold are assigned another value (usually 255 or white).
4. Thresholding is useful for separating objects from the background or separating
regions of interest in an image.
5. It is often applied in scenarios where there is a clear distinction between foreground
and background intensities.
6. However, thresholding can be sensitive to noise and lighting variations, and choosing
an appropriate threshold value can be challenging in some cases.
b. Log Transformation:
1. The log transformation, also known as logarithmic transformation or logarithmic
correction, is a nonlinear image enhancement technique that adjusts the pixel
values based on the logarithm function.
2. It is used to expand or compress the dynamic range of an image.
3. The log transformation is applied to the intensity values of the pixels in an image
using the formula:
4. Output pixel value = c * log(1 + Input pixel value)
5. The log transformation is particularly useful when dealing with images that have
a wide range of intensity values, such as images with high contrast or images with
a predominance of dark or bright regions.
6. It can help to enhance the details in the darker areas while compressing the
brighter areas, resulting in a more visually pleasing image.
c. Negative Transformation:
1. The negative transformation, also called image negation, is a simple image
processing operation that produces the inverse of an image's original intensity
values. It involves subtracting each pixel value from the maximum intensity value
(e.g., 255 for an 8-bit image) to obtain the new pixel value.
2. The formula for negative transformation is:
Output pixel value = Maximum pixel value - Input pixel value
3. This transformation converts dark pixels to bright ones and vice versa. It
effectively produces a "negative" version of the original image, similar to the
concept of a photographic negative.
4. The negative transformation is often used for artistic purposes, visual effects, or
to enhance certain features in an image by highlighting areas that were originally
dark.
The negative transformation does not alter the overall structure or content of the image
but changes the visual appearance by inverting the pixel intensities.
13. Explain the following (a) Contrast stretching (b) Grey level slicing.
ANS:-
CONTRAST STRETCHING:-
Many times we obtain low Contrast image due to poor illumination or due to wrong
setting of the aperture.
The idea behind contrast stretching is to increase the contrast of the image by
making the dark portion darker and bright portion brighter.
The dotted line indicates the identity transformation and the centre line is the
contrast stretching information.
We make dark grey level darker by assigning a slope of <1 and make bright grey level
by assigning the slopes >1.
The formulation of the contrast stretching algorithm is :
GREY LEVEL SLICING:
The purpose of gray-level slicing is to highlight a specific range of gray values. Two
different approaches can be adopted for gray-level slicing.
A. Gray-level Slicing without Preserving Background:-
This displays high values for a range of interest and low values in other areas.
The main drawback of this approach is that the background information is discarded.
B. Gray-level Slicing with Background:-
In gray-level slicing with background, the objective is to display high values for the
range of interest and original gray level values in other areas.
The intensity of light generated by a physical device such as a CRT is not a linear
function of the applied signal. The intensity produced at the surface of the display is
approximately the applied voltage, raised to the power of 2.5.
where f(m, n) is the input image and g(m, n) is the output image. Gamma (γ) can take
either integer or fraction values.
The gray level of each pixel in a digital image is stored as one or more bytes in a
computer.
The bit in the far left side is referred as the Most Significant Bit (MSB), because a
change in that bit would significantly change the value encoded by the byte.
The bit in the far right is referred as the Least Significant Bit (LSB).
Bit-plane slicing is a method of representing an image with one or more bits of the
byte used for each pixel.
One can use only the MSB to represent a pixel, which reduces the original gray level
to a binary image.
The human visual system has the ability to operate over a wide range of illumination
levels.
Dilation and contraction of the iris of the eye can account for a change of only 16
times in the light intensity falling on the retina.
The process which allows great extension of this range by changes in the sensitivity
of the retina is called brightness adaptation.
BRIGHTNESS DISCRIMINATION:-
Our visual system can detect differences in brightness levels as small as one
percent.
16. Apply the following image enhancement techniques for the given 3 bits per pixel
image
segment. Digital Negative
Thresholding T=5
I=
[2 1 2 1 0
71432
24137
13463
1 4 1 3 4]
SOLN:-
17) Explain the following (a) Contrast stretching (b) Grey level slicing ?
ANS:-
a) Contrast stretching :
1) is an image enhancement technique that improves the contrast of an image by stretching
the range of intensity values it contains to span a desired range of values. 2) This is done by
mapping the original intensity values to new intensity values that are linearly distributed
between 0 and 255.
3) For example, if an image has a low contrast, the contrast stretching technique can be
used to stretch the range of intensity values so that the image has a higher contrast.
4) This can make the image easier to see and can also help to highlight certain features in
the image.
Gray level slicing :
1) is another image enhancement technique that is used to highlight specific ranges of
intensity values in an image.
2) This is done by assigning different output values to different input values within a
specified range.
3) For example, if you want to highlight all of the pixels in an image that are between 100
and 200, you could use gray level slicing to assign a value of 255 to all of those pixels and a
value of 0 to all of the other pixels.
4) This would effectively create a mask that would only allow the pixels in the specified
range to be seen.
Both contrast stretching and gray level slicing are simple image enhancement techniques
that can be used to improve the quality of an image. However, it is important to note that
these techniques can also introduce artifacts into an image. For example, contrast stretching
can introduce banding artifacts, which are visible stripes that can appear in an image. Gray
level slicing can also introduce edge artifacts, which are visible lines that can appear around
the edges of objects in an image.
Here are some examples of how contrast stretching and gray level slicing can be used to
enhance images:
Contrast stretching can be used to improve the contrast of a low-contrast image,
making it easier to see.
Gray level slicing can be used to highlight specific features in an image, such as edges
or objects of a certain color.
Contrast stretching and gray level slicing can be used together to create more
complex image enhancements.
def hist_equalize(img):
hist, bins = np.histogram(img.ravel(), 256, [0, 256])
cdf = np.cumsum(hist)
cdf_m = np.max(cdf)
new_img = np.zeros_like(img)
for i in range(img.shape[0]):
for j in range(img.shape[1]):
new_img[i, j] = cdf[img[i, j]] * 255 / cdf_m
return new_img
img = cv2.imread('lena.png')
3. HSI stands for Hue, Saturation and Intensity : HSI is a cylindrical color model that
represents colors based on their hue, saturation, and lightness values. Hue represents the
actual color, saturation determines the purity or intensity of the color, and lightness
represents the brightness or darkness of the color. HSI is often used for color selection and
manipulation as it provides an intuitive way to adjust color properties.
4. YIQ Colour Model
The YIQ colour model is defined by the National Television System Committee (NTSC). In this
model, Y represents the luminance; and I and Q describe the chrominance. Conversion
between RGB and YIQ is given below.
5. YCbCr Colour Coordinate:
The YCbCr colour coordinate was developed as part of the ITU-R BT.601 during the
establishment of a worldwide digital video component standard.
The YCbCr signals are scaled and offset versions of the YIQ format. Y is defined to have a
nominal range of 16 to 235; Cb and Cr are defined to have a range of 16 to 240, with zero
signal corresponding to level 128.
There are several YCbCr formats such as 4:4:4, 4:2:2 and 4:1:1.
The sampling format implies that the sampling rates of Cb and Cr are one-half of that of Y.
These are just a few examples of color models used in image processing. Each model has its
own advantages and applications, and the choice of color model depends on the specific
task at hand.
34 draw and explain block diagram of jpeg encoder and decoder .
35 Generate the huffmon code for the word "COMMITTEE" 452
Ans:-
Total number of symbols in the word ‘COMMITTEE’ is 9.
Step 1 Arrange the symbols into descending order according to the probability.
Algorithms used
Algorithms used
in Lossy compression are:
in Lossless compression are: Run
5 Transform coding, Discrete Cosine
Length Encoding, Lempel-Ziv-
. Transform, Discrete Wavelet
Welch, Huffman Coding,
Transform, fractal compression
Arithmetic encoding etc.
etc.
OR
By using lossy compression, you can get Even unnoticeable bytes are retained with
Data
rid of bytes that are regarded as lossless compression.
Elimination
unnoticeable.
Key Lossy Compression Lossless Compression
After lossy compression, a file cannot be After lossless compression, a file can be
Restoration
restored to its original form. restored to its original form.
Lossy compression reduces the size of a Lossless compression reduces the size but
Size
file to a large extent. less as compared to lossy compression.
The data holding capacity of the lossy Lossless compression has low data holding
Capacity
compression approach is quite significant. capacity as compared to lossy compression.
The source encoder and decoder pair is commonly referred as source codec module,
whereas the channel encoder and decoder pair is commonly referred as channel
codec module.
Over the past decades, the separate designs of the two coding modules was justified
by Shannon’s classic separation theorem.
Source Coding The goal of source coding is efficient conversion of the source data
(input image data) into a sequence of bits. The source coder reduces the entropy,
which means decrease in the average number of bits required to represent the
image.
The channel decoder exploits the redundancy in the bit sequence to reproduce the
compressed bits.
39. Write down steps of Shannon-Fano coding.
Ans:- The Shannon–Fano Coding
In arithmetic coding, the interval from zero to one is divided according to the
probabilities of the occurrences of the intensities.
Arithmetic coding does not generate individual codes for each character but performs
arithmetic operations on a block of data, based on the probabilities of the next
character.
Arithmetic coding performs very well for sequences with low entropy where Huffman
codes lose their efficiency.
41. What is Structuring Element? What is the use of it in morphological operation?
ANS:-
The structuring element in a morphological operation plays an important role with its
different shape and size.
Shape and size are defined by a number of 0s and 1s in the structuring elements.
The circle shown in Fig. is called the centre pixel, where the resultant value is applied.
This circle can be anywhere in the structuring element according to the user
perspective.
Morphological operations are defined by moving a structuring element over the
binary image to be modified, in such a way that it is centred over every image pixel at
some point.
When the structuring element is centred over a region of the image, a logical
operation is performed on the pixels covered by the structuring element, yielding a
binary output.
The binary result of that logical operation is stored in the output image at that pixel
position.
The effect created depends upon the size and content of the structuring element and
the nature of the logical operation.
The binary image and structuring element sets need not be restricted to sets in the
2D plane, but could be defined in 1, 2, 3 (or higher) dimensions.
If the structuring element is perfectly fit on to the binary image then perform the
logical operation; else do not perform any operation into resultant binary image
pixel.
42. What is dilation and erosion of and erosion of an image? State its applications.
Dilation:
Dilation is a process in which the binary image is expanded from its original shape.
The way the binary image is expanded is determined by the structuring element.
This structuring element is smaller in size compared to the image itself, and normally
the size used for the structuring element is 3 × 3.
The dilation process is similar to the convolution process, that is, the structuring
element is reflected and shifted from left to right and from top to bottom, at each
shift; the process will look for any overlapping similar pixels between the structuring
element and that of the binary image.
If there exists an overlapping then the pixels under the centre position of the
structuring element will be turned to 1 or black. Let us define X as the reference
image and B as the structuring element.
where Bˆ is the image B rotated about the origin.
Equation states that when the image X is dilated by the structuring element B, the
outcome element z would be that there will be at least one element in B that
intersects with an element in X.
If this is the case, the position where the structuring element is being centred on the
image will be ‘ON’. This process is illustrated in given Fig. .
Initially, the centre of the structuring element is aligned at position *. At this point,
there is no overlapping between the black squares of B and the black squares of X;
hence at position * the square will remain white. This structuring element will then
be shifted towards right.
Similarly, the structuring element B is shifted from left to right and from top to
bottom on the image X to yield the dilated image as shown in Fig.
The dilation is an expansion operator that enlarges binary objects. Dilation has many
uses, but the major one is bridging gaps in an image, due to the fact that B is
expanding the features of X.
Erosion:
The structuring element is normally smaller than the image with a 3 × 3 size. This will
ensure faster computation time when compared to larger structuring-element size.
Almost similar to the dilation process, the erosion process will move the structuring
element from left to right and top to bottom.
At the centre position, indicated by the centre of the structuring element, the
process will look for whether there is a complete overlap with the structuring
element or not. If there is no complete overlapping then the centre pixel indicated by
the centre of the structuring element will be set white or 0.
Let us define X as the reference binary image and B as the structuring element.
Erosion is defined by the equation
Equation states that the outcome element z is considered only when the structuring
element is a subset or equal to the binary image X.
This process is depicted in Fig. Again, the white square indicates 0 and the black
square indicates 1.
The erosion process starts at position *. Here, there is no complete overlapping, and
so the pixel at the position * will remain white.
The structuring element is then shifted to the right and the same condition is
observed. At position **, complete overlapping is not present; thus, the black square
marked with ** will be turned to white.
The structuring element is then shifted further until its centre reaches the position
marked by ***. Here, we see that the overlapping is complete, that is, all the black
squares in the structuring element overlap with the black squares in the image.
Hence, the centre of the structuring element corresponding to the image will be
black.
Figure shows the result after the structuring element has reached the last pixel.
Erosion is a thinning operator that shrinks an image. By applying erosion to an image,
narrow regions can be eliminated, while wider ones are thinned.
43. Explain the morphological image operations on an image. (imp)
ANS:-
Different groups must not intersect with each other, and adjacent groups must be
heterogeneous.
Local segmentation deals with segmenting sub-images which are small windows
on a whole image.
The number of pixels available to local segmentation is much lower than global
segmentation.
This makes estimated parameter values for global segments more robust.
In the boundary approach, the attempt is to locate directly the boundaries that
exist between the regions.
In the edge approach, the edges are identified first, and then they are linked
together to form required boundaries.
All the three approaches are useful for visualising the problem and implementing
a solution.
The clustering technique attempts to access the relationships among patterns of the
data set by organising the patterns into groups or clusters such that patterns within a
cluster are more similar to each other than patterns belonging to different clusters.
1. HIERARCHICAL CLUSTERING:
The end result is a tree of clusters representing the nested group of patterns and
similarity levels at which groupings change.
The resulting clusters are always produced as the internal nodes of the tree, while
the root node is reserved for the entire dataset and leaf nodes are for individual
data samples.
Divisive clustering begins with the entire dataset in the same cluster, followed by
iterative splitting of the dataset until the single-point clusters are attained on leaf
nodes.
The cluster centroids are usually computed based on the optimality criterion such
that the objective function is minimised.
Algorithms of the first type are further categorised into probabilistic clustering, K-
medoids, and K-means.
3. K-MEANS CLUSTERING:
The drawback the K-means algorithm is that the number of clusters is fixed, once K
is chosen and it always returns K cluster centres.
4. Fuzzy Clustering:
Edge detection is one of the central tasks of the lower levels of image processing.
The points where sharp changes in the brightness occur typically form the border
between different objects.
The purpose of edge detection is to identify areas of an image where a large change
in intensity occurs.
These changes are often associated with some physical boundary in the scene from
which the image is derived.
48. How is thresholding used in image segmentation?
Ans:- Thresholding:
There exist a large number of gray-level based segmentation methods using either
global or local image information.
The thresholding technique requires that an object has homogenous intensity and a
background with a different intensity level.
Types of thresholding used in image segmentation are as follows:
1. Global Thresholding:
Global thresholding is the simplest and most widely used of all possible
segmentation methods.
In global thresholding, a threshold value of θ is chosen and the following condition is
imposed:
Global thresholding will suffer when pixels from different segments overlap in their
use of intensities. If the overlap is due to variation in illumination across the image,
variable thresholding could be used.
2. Adaptive Thresholding:
Global thresholding, or fixed thresholding, works well if the objects of interest have
a reasonably uniform interior gray level and rest on a background of unequal but a
relatively uniform gray level.
In many cases, the background gray level is not constant, and object contrast varies
within an image.
In such cases, a threshold that works well in one area might not work well in other
areas of the image.
3. Limitation of Thresholding Technique:
The main limitation of thresholding techniques is that in its simplest form, only two
classes are generated and it cannot be applied to multi-channel images.
A thresholding technique does not take into account the spatial characteristics of an
image
49 explain various edges detected in segmentation process ,
Ans:-
In image processing, edge detection is a fundamental step in segmentation, which aims
to partition an image into meaningful regions or objects. Edge detection algorithms
identify abrupt changes in intensity or color within an image, indicating the presence of
object boundaries or edges. There are several types of edges that can be detected in the
segmentation process:
1. Step Edges: Step edges are the most basic type of edges and occur when there is a
sudden change in intensity or color between adjacent regions in an image. These edges
have a distinct, discontinuous transition from one intensity level to another.
2. Ramp Edges: Ramp edges represent a gradual change in intensity or color. Unlike step
edges, ramp edges have a smooth transition from one region to another. They often
occur in textured areas or surfaces with varying reflectance.
3. Roof Edges: Roof edges are formed by a combination of step and ramp edges. They
typically occur when there is an abrupt change in the intensity or color, followed by a
gradual transition. Roof edges are commonly observed at object boundaries or edges
with a gradient.
4. Ridge Edges: Ridge edges are characterized by a series of parallel lines or contours.
They often occur in textured regions with repeated patterns or structures, such as
fabrics or natural scenes with repetitive elements.
5. Line Edges: Line edges are straight or curved lines detected within an image. They can
represent various objects or structures with linear features, such as roads, edges of
buildings, or outlines of objects.
6. Corner Edges: Corner edges occur at the intersection of two or more edges. They
represent points where intensity or color changes occur in multiple directions, indicating
the presence of corners or junctions in an image.
7. Junction Edges: Junction edges are formed at the convergence or divergence points
of multiple edges. They typically occur when three or more edges intersect,
representing complex geometrical structures or objects with intersecting boundaries.
These are some of the common types of edges detected during the segmentation
process in image processing. Edge detection algorithms aim to locate and highlight
these edges to facilitate subsequent segmentation tasks, such as region growing,
contour tracing, or object recognition.
50. Write short notes on i) segmentation by region splitting and merging ii) opening.
Ans:- 1.Segmentation by region splitting:
Q51. Define segmentation. State different methods based on similarity. Explain any
one method with example.
Ans:-
Segmentation in image processing refers to the process of partitioning an image into
meaningful and semantically coherent regions or objects. The goal is to separate the
image into distinct regions based on certain criteria such as color, texture, intensity, or
other visual properties.
There are several methods for image segmentation based on similarity:
1. Thresholding: This method involves selecting a threshold value and classifying pixels
as either foreground or background based on their intensity values. It is a simple and
commonly used method for segmenting grayscale or binary images.
2. Region Growing: Region growing methods start with seed pixels or regions and
iteratively expand them based on similarity criteria. Pixels or regions are added to
the growing region if they meet certain similarity conditions, such as intensity or
color similarity, texture consistency, or spatial proximity.
3. Clustering: Clustering methods group pixels into clusters based on their similarity in
feature space. Popular clustering algorithms such as k-means, mean-shift, or
Gaussian mixture models can be used for segmentation. Pixels within the same
cluster are considered to belong to the same region.
One example of an image segmentation method is the k-means clustering algorithm.
The k-means algorithm is an unsupervised learning technique that partitions data points
into k clusters based on their feature similarity. In the context of image segmentation,
each pixel in the image is considered as a data point with its feature vector, which can
include color values or other image attributes.
Here's a step-by-step explanation of how k-means segmentation works:
1. Choose the number of clusters, k, that you want to segment the image into.
2. Initialize k cluster centroids randomly in the feature space
3. Assign each pixel to the nearest centroid based on its feature similarity
4. Recalculate the centroids by computing the mean feature vector of all pixels assigned
to each centroid.
5. Repeat steps 3 and 4 until convergence or a specified number of iterations.
6. Once convergence is reached, assign each pixel to the cluster represented by its
nearest centroid.
The resulting segmentation map will have k distinct regions corresponding to the k
clusters found by the algorithm. Each pixel will be assigned a label representing its
cluster or region membership.
For example, in an image of a fruit bowl, k-means segmentation can be used to separate
the fruits into different clusters based on their color or other features. The algorithm
will group similar-colored pixels together, resulting in distinct regions corresponding to
each type of fruit in the image.
52. Describe Image Segmentation using Snakes.
ANS:-
The curve formed by the connected edge points delineates the active contour.
Local properties of the image such as gray level, gradient, etc., contribute to the
energy of the snake.
The snake reacts to the image, but moves in a smooth continuous manner towards
the desired object boundary.
The choice of the energy function to be minimised determines the behaviour of the
algorithm.
(ii) Image forces such as gray level and gradient magnitude that pull the snake
towards the optimal boundary position
(iii) External constraints such as user forces applied to the contour The internal
energy of the snake can be modeled using two terms:
The main advantages of the greedy-snake algorithm are computational efficiency and
relative simplicity.
2. Keypoint Localization: Once keypoints are detected, SIFT applies a process called
keypoint localization to accurately localize the keypoints. This involves fitting a 3D
quadratic function to the nearby samples in the scale space to refine the keypoint
positions and reject low-contrast keypoints and keypoints located on edges.
3. Orientation Assignment: SIFT assigns an orientation to each keypoint to achieve
rotation invariance. It computes a gradient orientation histogram in the
neighborhood of the keypoint and selects the dominant orientation as the keypoint's
orientation. This allows SIFT to handle images with arbitrary rotations.
4. Descriptor Extraction: After the keypoints are localized and assigned orientations,
SIFT constructs a descriptor for each keypoint that captures its local appearance and
is invariant to changes in scale, rotation, and illumination. The descriptor is
computed by taking the gradient magnitudes and orientations in the keypoint's local
region and forming a histogram of oriented gradients (HoG). This histogram is then
normalized to ensure invariance to changes in illumination.