Dip Module 1
Dip Module 1
Dip Module 1
Module 1
DIGITAL IMAGE PROCESSING
Prepared By,
Sandesha Karanth P.K & Ragavendra Kattagal
Assistant Professors, Dept. Of CSE,
VCET, Puttur
[email protected], [email protected]
An image is defined as a two dimensional function, f(x,y), where x and y are spatial (plane)
coordinates, and the amplitude of ‘f’ at any pair of coordinates (x,y) is called the intensity or gray
level of the image at that point.
The field of digital image processing refers to processing digital image by means of a
digital computer.
NOTE: A digital image is composed of finite number of elements like picture elements, image
elements, pels, and pixels.
The digital image processing methods stems from 2 principal application areas:
Image acquisition: This is the first step in the digital image processing. An image is captured by
a sensor (such as digital camera) and digitized. The image that is acquired is completely
unprocessed. This step involves preprocessing such as scaling.
Image enhancement: It is the process of manipulating an image in order to make image more
suitable than the original for the specific application. The image enhancement techniques are so
verified, and use so many different image processing approaches. The idea behind enhancement
techniques is to bring out detail that is hidden, or simply to highlight certain features of interest in
an image like changing brightness & contrast etc.
Image restoration: It is an area that also deals with improving the appearance of an image but it
is objective than subjective, in the sense that restoration techniques tend to be based on
mathematical or probabilistic models of image degradation.
Color image processing: It is an area that has been gaining in importance because of the significant
increase in the use of digital images over the internet. Color is used also for extracting features of
interest in an image. This may include color modeling and processing in a digital domain etc.
Wavelets: These are the foundation for representing images in various degrees of resolution. In
particular used for image data compression and for pyramidal representation, in which images are
subdivided successively into smaller regions.
Compression: Deals with techniques for reducing the storage required to saving an image, or the
bandwidth required to transmit it. An example for image compression standard is jpg file extension
used in the JPEG (Joint Photographic Experts Group) image compression standard.
Morphological processing: It deals with tools for extracting image components that are useful in
the representation and description of shape.
Segmentation: Segmentation procedures partition an image into its constituent’s parts or objects.
In general, autonomous segmentation is one of the most difficult tasks in digital processing. A
rugged segmentation procedure brings the process a long way towards successful solution of
imaging problems that require objects to be identified individually. On the other hand, weak or
erratic segmentation algorithms always guarantee eventual failure.
Representation and description: It follow the output of the segmentation stage, which is raw pixel
data it’s needed to convert it to a form suitable for computer processing. The first decision that
must be made is whether the data should be represented as a boundary (i.e., the set of pixels
separating one image region from another) or as a complete region.
Recognition: It is the process that assigns a label (e.g., ‘vehicle’) to an object based on its
descriptors.
Network
Image sensors
Problem domain
Figure 1.2 Components of a general – purpose image processing system.
The above figure shows the basic components comprising a typical general purpose system used
for digital image processing. With reference to sensing, two elements are required to acquire
digital images:
1. The physical device that is sensitive to the energy radiated by the object we wish to image.
2. Digitizer is a device for converting the output of the physical sensing device into digital
form.
For example, in a digital camera, the sensors produce an electrical output proportional to light
intensity.
Specialized image processing hardware usually consists of the digitizer plus hardware that
performs other primitive operations, such as an arithmetic logic unit (ALU), that performs other
primitive operations in parallel on entire images. This type of hardware is called a front-end
subsystem, and its most distinguished characteristic is speed, so this unit performs functions that
require fast data throughputs that the typical main computer cannot handle.
The Computer in an image processing system is a general-purpose computer and can range
from a PC to a supercomputer. In dedicated applications, sometimes custom computers are used
to achieve a required level of performance.
Software for image processing consists of specialized modules that perform specific tasks. A
well-designed package also includes the capacity for the user to write code that, as a minimum,
utilizes the specialized modules.
Mass storage capacity is a must in image processing applications. An image 1024 X 1024
pixels, in which the intensity of each pixel is an 8-bit quantity, requires one megabyte of storage
space if the image is not compressed. When dealing with thousands, or even millions, of images,
providing adequate storage in an image processing application falls into three principal categories:
Storage is measured in bytes, Kbytes, Mbytes, Gbytes, Tbytes. One method of providing short
term storage is computer memory. An-other is by specialized buffers, that store one or more images
and can be accessed rapidly, usually at video buffers, that store one or more images and can be
accessed rapidly, usually at video rates. The latter method allows virtually instantaneous image
zoom, as well as scroll (vertical shifts) and pan (horizontal shifts). Online storage generally takes
the form of magnetic disks or optical image storage. The key factor characterizing the online
storage is frequent access to the stored data. Magnetic tapes and optical disks housed in ‘jukeboxes’
are the usual media for the archival applications.
Image displays in use today are mainly color TV monitors. Monitors are driven by the outputs
of image and graphic display cards that are an integral part of the computer system. In some cases
it is necessary to have stereo displays, and these are implemented in the form of head gear
containing two small displays embedded in goggles worn by the users.
Hardcopy devices for recording images include laser printers, film cameras, heat-sensitive
devices, inject units, such as optical and CD ROM disks. Film provides the highest possible
resolution, but paper is the obvious medium of choice for written material.
Networking is almost a default function in any computer system in use today. Because of the
large amount of data inherent in image processing applications, the key consideration in image
transmission is bandwidth. Optical fiber and other broadband technologies overcoming the
problem of communicating with remote sites via internet.
Figure 1.3 Continues image, A scan line from A to B in the continues image, Sampling and quantization, Digital Scan line
In fig. 1.3(a) shows a continuous image f that we want to convert to digital form. The one
dimensional function in fig. 1.3(b) is a plot of amplitude values of the continuous image along the
line segment AB in fig. 1.3(a). The random variations are due to image noise. To sample this
function, we take equally spaced samples along the line AB, as shown in fig.1.3(c). The spatial
location of each sample is indicated by a vertical tick mark in the bottom part of the figure. The
samples are shown as small white squares superimposed on the function. The set of these discrete
locations gives the sampled function. In order to form a digital function, the intensity values also
must be converted into discrete quantities. The right side of the fig. 1.3(c) shows the intensity scale
divided into eight discrete intervals, ranging from black to white. The vertical tic marks indicate
the specific value assigned to each of the eight intensity intervals. The continuous intensity levels
are quantized by assigning one of the eight values to each sample. The digital samples resulting
from both sampling and quantization are shown in fig 1.3(d).
Both the sides of this equation are equivalent ways of expressing a digital image
quantitatively. The right side is a matrix of real numbers. Each element of this matrix is called an
image element, pictures element, pixels, or pel. This digitization process requires that decisions be
made regarding the values for M, N, and for the number L of discrete intensity levels. Here M and
N are positive integers. The number of intensity levels typically is an integer power of 2:
L= 2k
The number, b of bits required to store a digitized image is b = ‘M’ x ‘N’ x ‘k’ When M = N, this
equation becomes b = N2k
This set of pixels is called the 4-neighbors of P, and is denoted by N 4(P). Each of them are at a
unit distance from P. 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 N D(P). Each of them are at Euclidean distance of 1.414 from P. 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.
➢ N 4 - 4-neighbors
➢ N D - diagonal neighbors
➢ N 8 - 8-neighbors (N 4 U N D )
Neighbors of a pixel
[email protected]| [email protected] | VCET, Puttur
9 Digital Image Processing Module 1
a. 4-neighbors of a pixel p are its vertical and horizontal neighbors denoted by N4(p)
b. 8-neighbors of a pixel p are its vertical horizontal and 4 diagonal neighbors denoted by
N8(p) is shown above.
Adjacency: Two pixels are connected if they are neighbors and their gray levels satisfy some
specified criterion of similarity. For example, in a binary image two pixels are connected if they
are 4-neighbors and have same value (0/1) then it is said to be satisfy adjacency.
Let V be set of gray levels values used to define adjacency.
4-adjacency: Two pixels p and q with values from V are 4- adjacent if q is in the set N 4 (p).
8-adjacency: Two pixels p and q with values from V are 8- adjacent if q is in the set N 8 (p).
m-adjacency: Two pixels p and q with values from V are madjacent if,
A. q is in N 4(P).
B. q is in N D(p) and the set N4(p) ∩ N4(q) is empty (has no pixels whose values are
from V.
Connectivity: To determine whether the pixels are adjacent in some sense. Let V be the set of
gray-level values used to define connectivity; then Two pixels p, q that have values from the set
V(1,2) are:
a. 4-connected, if q is in the set N4(p)
Connected Components:
If p and q are pixels of an image subset S then p is connected to q in S if there is a path
from p to q consisting entirely of pixels in S. For every pixel p in S, the set of pixels in S that are
connected to p is called a connected component of S, If S has only one connected component then
S is called Connected Set .
pixels in the boundary of the region that happen to coincide with the border of the image are
included implicitly as part of the region boundary.
Distance Measure
Given pixels p, q and z with coordinates (x, y), (s, t), (u, v) respectively, the distance
function D has following properties:
2
2 1 2
2 1 0 1 2
2 1 2
2
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
In this case, the pixels with D8 distance from (x, y) less than or equal to some value r form a square
centered at (x,y). For example, the pixels with D8 distance ≤ 2 from (x, y) form the following
contains of constant distance: The pxels with D8 = 1 are the 8- neighbors of (x, y).
Electron Microscope
Transmission Electron Microscope (TEM)
• A fraction of electron beam transmitted through the specimen is projected onto a phosphor
screen.
• The interaction of electrons with phosphor produces light an therefore viewable image.
• This is used for very thin samples.
Electron Miccroscope
Scanning Electron Microscope (SEM)
• Scans the electron beam and records the interaction of beam and sample at each location.
This produces one dot at the phosphor screen.
• Complete image is formed by raster scan of beam through sample.
• This is used for bulky samples.
Most of the robots today work by following the line and thus are called line follower
robots. This helps a robot to move on its path and perform some tasks. This has also been
achieved through image processing.
Character Recognition:
Remote Sensing:
In the field of remote sensing, the area of the earth is scanned by a satellite or from a very
high ground and then it is analysed to obtain information about it. One particular application of
digital image processing in the field of remote sensing is to detect infrastructure damages caused
by an earthquake. Since the area effected by the earthquake is sometimes so wide, that it not
possible to examine it with human eye in order to estimate damages. Even if it is, then it is very
hectic and time-consuming procedure. So, a solution to this is found in digital image processing
using remote sensing. An image of the affected area is captured from the above ground and then it
is analysed to detect the various types of damage done by the earthquake. The key steps include in
the analysis are