0% found this document useful (0 votes)
66 views

Digital Image Processing

Digital images are composed of pixels arranged in a grid, with each pixel assigned a numeric value corresponding to characteristics like brightness or color. There are several key steps in digital image processing: image acquisition, enhancement, restoration, analysis (including segmentation, description and recognition), compression, and representation. Processing allows analyzing images to extract useful information and perform tasks like object detection. Key applications include medical imaging, remote sensing, robot vision, and video processing.

Uploaded by

Yatish Chutani
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Digital Image Processing

Digital images are composed of pixels arranged in a grid, with each pixel assigned a numeric value corresponding to characteristics like brightness or color. There are several key steps in digital image processing: image acquisition, enhancement, restoration, analysis (including segmentation, description and recognition), compression, and representation. Processing allows analyzing images to extract useful information and perform tasks like object detection. Key applications include medical imaging, remote sensing, robot vision, and video processing.

Uploaded by

Yatish Chutani
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

DIGITAL IMAGE PROCESSING

Ekta Soni
Origin of Digital image processing
• The first application of digital image was in the
newspaper industry when the pictures were
first sent by submarine cable between London
and New York.
• The cable picture transmission in 1921
reduced the time required to transport a
picture across the Atlantic for more than a
week to less than 3 hours.
• Digital image is composed of a finite number
of elements, each of which has a particular
location and value. These elements are called
picture elements, image elements, pels and
pixels.
• The pixel values may represent the amount of
visible light, infra-red light, absorption of x-
rays, electrons, or any other measurable value
such as ultrasound wave impulses.
• The images may be obtained by a digital
camera, scanner, electron microscope,
ultrasound stethoscope, or any other optical or
non-optical sensor.
• Examples of digital image are Digital
photographs, Satellite images, Radiological
images (x-rays, mammograms), Binary images,
Fax images, Engineering drawings, Computer
graphics,
Types of Images

• Binary Image – The binary image contains only two pixel elements
0 & 1. 
• Here, 0 refers to black and 1 refers to white. This is also known as
Monochrome.
• Black and White Image– The image contains black and white
color.
• 8 Bit Color Format – It has 256 different shades of colors and
known as Grayscale Image. In this format, 0 stands for Black, and
255 stands for white, and 127 stands for Gray.
• 16 Bit Color Format – It has different colors and is known as a High
Color Format. The distribution of Color is not the same as a
Grayscale image.
• Examples of digital image
areDigitalphotographs, Satelliteimages,
• Radiological images (x-rays, mammograms),
Binary images, Fax images, Engineering
drawings, Computer graphics.
FUNDAMENTAL STEPS IN DIGITAL IMAGE PROCESSING:
Phases/Fundamental steps Of Image Processing

• Image Acquisition – Image acquisition involves preprocessing


such as scaling etc. It could be as simple as being given an
image that is already in digital form.
• Image Enhancement – Basically, enhancement techniques
bring out detail that is obscured and highlight certain features
of interest in an image, such as changing brightness &
contrast etc.
• Image Restoration – Image restoration is an area that also deals with
improving the appearance of an image. Image restoration is objective, in
the sense that restoration techniques tend to be based on mathematical
or probabilistic models of image degradation.
• The common applications of Image sharpening and restoration are
zooming, blurring, sharpening, grayscale conversion, edges detecting,
Image recognition, and Image retrieval, etc.
• Color image processing– it deals with pseudocolor and full color
image processing color models are applicable to digital image
processing. 
• Wavelets and multiresolution processing – the foundation for
representing images in various degrees of resolution is enabled by
wavelets. Images are subdivided into smaller regions for data
compression and for pyramidal representation.
• Compression – compression techniques reduce the storage required to
save an image or the bandwidth to transmit it. Particularly for use over
the internet, it is very much necessary to compress data.
• Morphological processing – morphological processing extracts
image components that are useful in the representation and description
of shape.
• Segmentation – segmentation procedures partition an image into its
constituent parts or objects. In general, autonomous segmentation is
one of the most difficult tasks in digital image processing. A rugged
segmentation procedure brings the process a long way toward a
successful solution of imaging problems that require objects to be
identified individually.
• Representation and Description – Representation and
description almost always follow the output of a
segmentation stage, which usually is raw pixel data that
constitutes either the boundary of a region or all the
points in the region itself.
• Description deals with extracting attributes that result
in some quantitative information of interest or are basic
for differentiating one class of objects from another.
• Object recognition – Recognition is the process that
assigns a label, such as, “apple” to an object based on
its descriptors.
Applications of DIP

• Medical Field The common applications of Image


sharpening and restoration are zooming, blurring,
sharpening, grayscale conversion, edges detecting, Image
recognition, and Image retrieval, etc.
• Remote Sensing:It is the process of scanning the earth by
the use of satellite and acknowledges all activities of space.
• Machine/Robot vision:It works on the vision of robots so
that they can see things, identify them, etc.
• Video processing
• Pattern Recognition
COMPONENTS OF IMAGE PROCESSING SYSTEM:
SAMPLING AND QUANTIZATION:

• An image may be continuous with respect to


the x and y coordinates and also in amplitude.
To convert it into digital form we have to
sample the function in both coordinates and
in amplitudes.
• Digitalizing the coordinate values is called
Sampling. Digitalizing the amplitude values is
called Quantization.
RELATIONSHIP BETWEEN PIXELS
• We consider several important relationships between
pixels in a digital image.
• Neighbors of a Pixel:
• A pixel p at coordinates (x,y) has four horizontal and
verticalneighbors whose coordinates are givenby:
• (x+1,y), (x-1, y), (x, y+1), (x,y-1)
• This set of pixels, called the 4-neighbors or p, is
denoted by N4(p). Each
• pixel is one unit distance from (x,y) and some of the
neighbors of p lie outside the digital image if (x,y) is
on the border of the image. The four diagonal
neighbors of p have coordinates and are denoted by
ND(p).
• (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1).
• These points, together with the 4-neighbors,
are called the 8-neighbors of p, denoted by
N8(p).

As before, some of the points in ND(p) and


N8(p) fall outside the image if (x,y) is on the
border of the image.
• Adjacency and Connectivity:
• Let v be the set of gray –level values used to define
adjacency, in a binary image, V={1}. In a gray-scale image,
the idea is the same, but Vtypically contains more
elements, for example, V= {180, 181, 182, …,200}.
• If the possible intensity values 0 – 255, Vset can be any
subset of these 256 values. if we are reference to
adjacency of pixel with value.
•  Three types of Adjacency:
• 4- Adjacency – two pixel P and Q with value from V are 4 –
adjacency if A is in the setN4(P)
• 8- Adjacency – two pixel P and Q with value from V are 8 –
adjacency if A is in the set N8(P)
• M-adjacency –two pixel P and Q with value from V are m – adjacency if (i)
• Q is in N4(p) or
• Q is in ND(q) and the
• Set N4(p) ∩ N4(q) has no pixel whose values are fromV.
• Mixed adjacency is a modification of 8-adjacency. It is introduced to eliminate the
ambiguities that often arise when 8-adjacency isused.
• Forexample:

• Fig: (a) Arrangement of pixels


– pixels that are 8-adjacent (shown dashed) to the center pixel
– m-adjacency
• Types of Adjacency:
• In this example, we can note that to connect between
two pixels (finding a path between twopixels):
• In 8-adjacency way, you can find multiple paths
between twopixels While, in m-adjacency, you can
find only one path between twopixels
• So, m-adjacency has eliminated the multiple path
connection that has been generated by the8-
adjacency.
• Two subsets S1 and S2 are adjacent, if some pixel in
S1 is adjacent to some pixel in S2. Adjacent means,
either 4-, 8- orm-adjacency.
• Digital Path:
• A digital path (or curve) from pixel p with coordinate (x,y) to pixel q with
coordinate (s,t) is a sequence of distinct pixels with coordinates (x0,y0),
(x1,y1), …, (xn, yn) where (x0,y0) = (x,y) and (xn, yn) = (s,t) and pixels (xi, yi)
and (xi-1, yi-1) are adjacent for 1 ≤ i ≤n, n is the length of thepath.
• If (x0,y0) = (xn, yn), the path isclosed.
• We can specify 4, 8or m-paths depending on the type of adjacency
specified.

• In figure (b) the paths between the top right and bottom right pixels are
8- paths. And the path between the same 2 pixels in figure (c) is m-path
•  

 
• Connectivity:
• Let S represent a subset of pixels in an image, two
pixels p and q are said to be connected in S if there
exists a path between them consisting entirely of
pixels in S.
• For any pixel p in S, the set of pixels that are
connected to it in S is called a connected component
of S. If it only has one connected component, then set
S is called a connected set.
•  
• Region and Boundary:
• Region: Let R be a subset of pixels in an image, we call R a region of the
image ifRis a connected set.
• Boundary: The boundary (also called border or contour) of a region R is the
set of pixels in the region that have one or more neighbors that are not
inR.
• If R happens to be an entire image, then its boundary is defined as the set of
pixels in the first and last rows and columns in the image. This extra definition
is required because an image has no neighbors beyond its borders. Normally,
when we refer to a region, we are referring to subset of an image, and any
pixels in the boundary of the region that happen to coincide with the border
of the image are included implicitly as part of the regionboundary.
•  
• Distance Measures:
For pixel p,q and z with coordinate (x.y) ,(s,t) and (v,w) respectively
D is a distance function or metric if
• D [p.q] ≥ 0 {D[p.q] = 0iff p=q}
• D [p.q] = D [p.q] and
• D [p.q] ≥ 0 {D[p.q]+D(q,z) The Euclidean Distance between p and
q is definedas:
• De(p,q) = [(x – s)2 + (y - t)2]1/2
• Pixels having a distance less than or equal to some value r from
(x,y) are the points contained in a disk of radius „ r „centered at
(x,y)
• The D4distance (also called city-block
distance) between p and q is definedas:
• D4(p,q) = | x – s | + | y – t |
• Pixels having a D4 distance from (x,y), less
than or equal to some value r form a Diamond
centered at (x,y)
. • Example:
• The pixels with distance D4≤ 2 from (x,y) form the following
contours of
• constant distance.
• The pixels with D4= 1 are the 4-neighbors of (x,y)
• The D8distance (also called chessboard distance) between p and q is
definedas:

• D8(p,q) = max(| x – s |,| y – t |)



Pixels having a D8 distance from (x,y), less than or equal to some
value r form a square Centered at (x,y).
Example:
D8distance ≤ 2 from (x,y) form the following contours of constant distance.

DmDistance:
It is defined as the shortest m-path between the points.In this case, the distance between two
pixels will depend on the values of the pixels along the path, as well as the values of their
neighbors.
• Example:
• Consider the following arrangement of pixels
and assume that p, p2, and p4 have value 1
and that p1 and p3 can have can have a value
of 0 or 1 Suppose that we consider the
adjacency of pixels values 1 (i.e. V ={1})
• Now, to compute the Dmbetween points p and
p4
• Here we have 4 cases:
• Case1: If p1 =0 and p3 = 0
• The length of the shortest m-path (the Dm
distance) is 2 (p, p2, p4)
Case2: If p1 =1 and p3 = 0

1 and p will no longer be adjacent (see m-adjacency definition) then, the length of the shortest path will be 3 (p, p1, p
3: If p1 =0 and p3 = 1
• Case4: If p1 =1 and p3 = 1
• The length of the shortest m-path will be 4 (p,
p1, p2, p3, p4)
UNIT -2
IMAGE ENHANCEMENT

• Image enhancement techniques are designed


to improve the quality of an image as
perceived by a human being. Image
enhancement can be performed both in the
spatial as well as in the frequency domain.
• Image enhancement approaches fall into two
broad categories: spatial domain methods and
frequency domain methods.
• The term spatial domain refers to the image plane
itself, and approaches in this category are based on
direct manipulation of pixels in an image.
• Frequency domain processing techniques are
based on modifying the Fourier transform of an
image. Enhancing an image provides better
contrast and a more detailed image as compare to
non-enhanced image.
• Spatial domain processes will be denoted by the
expression.
g(x,y) = T[f(x,y)]
• where f(x, y) is the input image, g(x, y) is the
processed image, and T is an operator on f, defined
over some neighborhood of (x, y).
• Enhancement techniques based on this type of
approach often are referred to as mask processing or
filtering.
• The simplest form of T is when the
neighborhood is of size 1*1 (that is, a single
pixel). In this case, g depends only on the
value of f at (x, y), and T becomes a gray-level
(also called an intensity or mapping)
transformation function of the form
• s=T(r)
• where r is the pixels of the input image and s
is the pixels of the output image.
Fig: Gray level transformation functions for
contrast enhancement
BASIC GRAY LEVEL TRANSFORMATIONS:

• Image negative
• Log transformations
• Power law transformations
• Piecewise-Linear transformation functions
 
LINEAR TRANSFORMATION:

• Linear transformation includes simple identity


and negative transformation.
• Identity transition is shown by a straight line.
• In this transition, each value of the input
image is directly mapped to each other value
of output image.
NEGATIVE TRANSFORMATION:

• In negative transformation, each value of the input image is


subtracted from the L-1 and mapped onto the output image
•  The image negative with gray level value in the range of [0, L-1] is
obtained by negative transformation given by S = T(r) or
• S = L -1 – r
• Where r= gray level value at pixel (x,y)
• L is the largest gray level consists in the image
• It results in getting photograph negative. It is useful when for
enhancing white details embedded in dark regions of the image.
• The overall graph of these transitions has been shown below.
• LOGARITHMIC TRANSFORMATIONS:
• Logarithmic transformation further contains two type of transformation. Log
transformation and inverse log transformation.
•  
• LOG TRANSFORMATIONS:
• The log transformations can be defined by this formula
• S = c log(r + 1).
• Where S and r are the pixel values of the output and the input image and c is a
constant. The value 1 is added to each of the pixel value of the input image
because if there is a pixel intensity of 0 in the image, then log (0) is equal to
infinity. So, 1 is added, to make the minimum value at least 1.
• During log transformation, the dark pixels in an image are expanded as compare
to the higher pixel values. The higher pixel values are kind of compressed in log
transformation. This result in following image enhancement.
POWER – LAW TRANSFORMATIONS:

• There are further two transformation is power law transformations, that


include nth power and nth root transformation. These transformations can
be given by the expression:
• S=Crγ
• This symbol γ is called gamma, due to which this transformation is also
known as gamma transformation.
 
• Variation in the value of γ varies the enhancement of the images. Different
display devices / monitors have their own gamma correction, that’s why
they display their image at different intensity, where c and g are positive
constants. Sometimes Eq. is written as
S = C (r +ε) γ
to account for an offset (that is, a measurable output when the input is zero).
• This type of transformation is used for enhancing images for different type of display
devices. The gamma of different display devices is different. For example, Gamma of
CRT lies in between of 1.8 to 2.5, that means theimage displayed on CRT is dark.
• Varying gamma (γ) obtains family of possible transformation curves
• S = C* r γ
• Here C and γ are positive constants. Plot of S versus r for various values of γ is γ > 1
compresses dark values and expands bright values γ < 1 (similar to Log
transformation) but expands dark values Compresses bright values When C = γ = 1, it
reduces to identity transformation.
•  
• CORRECTING GAMMA:
• S=Cr γ
• S=Cr (1/2.5)
• The same image but with different gamma values has been shown here.
PIECEWISE-LINEAR TRANSFORMATION
FUNCTIONS:
Contrast Stretching:
• Low-contrast images can result from poor
illumination, lack of dynamicrange in the
imaging sensor, or even wrong setting of a
lens aperture during image acquisition.
• S= T(r )
• Gray-level Slicing:Highlighting a specific range
of gray levels in an image often is desired.
Applications include enhancing features such
as masses of water in satellite imagery and
enhancing flaws in X-ray images.
BIT-PLANE SLICING:

• Instead of highlighting gray-level ranges, highlighting


the contribution made to total image appearance by
specific bits might be desired. Suppose that each pixel
in an image is represented by 8 bits. Imagine that
the image is composed of eight 1-bit planes, ranging
from bit-plane 0 for the least significant bit to bit
plane 7 for the most significant bit. In terms of 8- bit
bytes, plane 0 contains all the lowest order bits in the
bytes comprising the pixels in the image and plane 7
contains all the high-order bits.
HISTOGRAM PROCESSING:

• The histogram of a digital image with gray levels in the range [0, L-1] is a discrete function of the form
• H(rk)=nk
• where rk is the kth gray level and nk is the number of pixels in the image having the level rk. A
normalized histogram is given by the equation
• P(rk)=nk/n for k=0,1,2,…..,L-1
• P(rk) gives the estimate of the probability of occurrence of gray level rk. The sum of all components of
a normalized histogram is equal to 1.
• The histogram plots are simple plots of H(rk)=nk versus rk.
•  
• In the dark image the components of the histogram are concentrated on the low (dark) side of the
gray scale. In case of bright image, the histogram components are biased towards the high side of the
gray scale. The histogram of a low contrast image will be narrow and will be centered towards the
middle of the gray scale.
•  
• The components of the histogram in the high contrast image cover a broad range of the gray scale.
The net effect of this will be an image that shows a great deal of gray levels details and has high
dynamic range.
HISTOGRAM EQUALIZATION:

• Histogram equalization is a common


technique for enhancing the appearance of
images. Suppose we have an image which is
predominantly dark.
Spatial Filtering

You might also like