You are on page 1of 74

Chapter 1

Digital Image Fundamentals

Introduction
Digital Image Processing is an exciting field that evolves rapidly with growing
applications in all fields of science and engineering. The growth of this field is
intimately tied to the development of digital computers and is fuelled by tech-
nological advances in digital imaging and mass storage devices. Digital image
processing has a broad spectrum of applications ranging from remote sensing via
satellites to automated inspection of industrial parts, medical image processing
etcetera.

Digital Image Processing


The term digital image processing refers to processing of digital images by means
of a digital computer. Images are produced by a variety of physical devices such
as still and video cameras, X-ray devices, electron microscopes, RADAR and ul-
trasound devices. The main goal of a digital image processing system is to extract
useful information from the images for human interpretation or for machine per-
ception. The processing may be as simple as enhancing the quality of an image
or complicated as handwritten character recognition. Thus the image processing
algorithms are broadly classified into three types:
• Low Level Processing
• Mid Level Processing
• High Level Processing
1.2 Digital Image Processing

• Low Level Processing


For a low level process, both inputs and outputs are images. It involves
primitive operations such as contrast enhancement, removal of blur and im-
age sharpening.
• Mid-Level Processing
For a mid-level process, the inputs are images whereas the outputs are the
attributes (ex: edges, contours) extracted from those images. It involves
operations such as segmentation, object recognition and description.
• High Level Processing
High-level processing involves in extracting knowledge out of objects rec-
ognized using mid-level processing. High-level processing involves with
image analysis wherein the inputs are images and outputs are the domain
specific knowledge extracted from the image.
Irrespective of the level of processing any digital image processing system
requires digital images as input. Thus a brief understanding about digital
images is presented in the first hand before dealing with digital image pro-
cessing concepts.

Digital Image: A few concepts


Vision is the most advanced of our senses. Hence images play most important
role in human perception. Human vision is limited to the visual band of Elec-
tromagnetic (EM ) spectrum whereas imaging machines cover almost entire EM
spectrum ranging from gamma to radio waves.

Image

Image can be defined as the visual rep-


resentation of a scene. The term image
refers to still pictures that do not change
with time whereas video deals with mo-
tion picture that evolves with time. The
scope of this book is limited to images
and their processing techniques. Hu-
Fig 1.1 Example of an Image
man eyes observe objects around them in
three dimensions. Images represent those objects in two dimensions. Images with
higher dimensions are also possible. Thus in simple words, images are defined as
the projection of a 3-D scene into a 2-D projection plane.
Digital Image Fundamentals 1.3

Definition 1.1 An image is defined as a two dimensional function f (x, y) where


x and y are spatial coordinates, and the amplitude of ‘f ’ at any point is called
the intensity or gray level or brightness level of the image at that point. Figure
1.1 shows an image of a baby acquired using a camera.

Digital Image
An image is said to be a digital image if it is in computer readable format so that
it can be stored in a computer (or any other processor) for further processing. The
images acquired using a digital camera or by scanning a picture are examples of
digital images. Thus the images that appear on paper are the printed version of a
digital image.
Definition 1.2 An image f(x,y)is said to be digital image, if its spatial coordi-
nates (x,y) and the amplitude values are all finite and discrete quantities. A dig-
ital image is comprised of a finite number of elements called picture elements or
pixels. Each pixel has a specific location and value.

Pixel or Picture Element or Pel


Pixel is the smallest sample of an image and its value represents the brightness
(intensity level or gray level) of a particular location. Figure 1.2(a) shows an
image of a deer. Figure 1.2 (b) shows a small part of the image (shown in a square)
zoomed. Closely observing the Figure 1.2 (b) shows that the image is comprised
of number of small elements. Each smallest element represents a pixel.

(a) (b)

Fig 1.2 Image Pixel

Types of Digital Images


Digital images are broadly classified into three types based on the number of bits
used to represent each pixel value.
1.4 Digital Image Processing

1. Binary Images (or) Bi-level Images In a binary image as the name indi-
cates each pixel is comprised of 1 bit. Since the pixel size is one it can take
only two values: either 0 or 1. Pixels with value 0 appear as black and pix-
els with value 1 appear as white in the image. The intermediate shades are
not represented. Figure 1.3 (a) shows a typical example for a binary image.
2. Gray scale Images (or) Gray level Images In a gray scale image each
pixel is comprised of k bits, where k is a positive integer. Pixels can take
a range of value from 0 to 2k −1 and hence can represent shades of gray
starting from black to white. Figure 1.3 (b) shows a typical example for
gray scale image.
3. Color Images Color image is an image in which each pixel is specified
by three values - one each for the red, blue, and green components of the
pixel’s color. Each value is comprised of k bits. Figure 1.3 (c) shows a
typical example for color image.

(a) Binary Image (b) Gray Scale Image (c) Color Image

Fig 1.3 Types of Digital Images

Advantages of Digital Images


• Digital images can be effectively stored and efficiently transmitted from one
place to another.
• The processing of digital images is faster and cost effective.
• Reproduction of digital images is faster and cheaper.
• Digital images offer plenty of scope for image manipulation.

Disadvantage of Digital Images


• Memory required to store and process good quality digital images is very
high.
• Misuse of copyright has become easier
• The processors used for real time implementation should be of very high
speed.
Digital Image Fundamentals 1.5

1.1 Origin of Digital Image Processing


One of the first applications of digital images was in the newspaper industry, when
picture was first sent by submarine cable between London and New York. In
the year 1920, Bartlane cable picture transmission system was introduced which
reduced the time required to transport a picture across Atlantic from more than a
week to less than three hours. The early Bartlane systems were capable of coding
images in five distinct levels and Figure 1.4 shows the early digital images used.
The examples cited above involve digital images but they are not considered as
digital image processing since computers were not involved in their creation.

(a) 5 Tone Digital Image (b) 15 Tone Digital Image Figure

Fig 1.4 Early Digital Images

Digital images require so much storage and computational power that progress
in the field of digital image processing has been dependent on the development of
digital computers and of supporting technologies that include data storage, display
and transmission.
The first computer capable of carrying out meaningful image processing task
appeared in the year 1960. Initially digital image processing techniques were used
for space applications for enhancing images taken by spacecrafts. In the year
1964, computers were used for enhancing images at Jet Propulsion Laboratory
(Pasadena, California).

Fig 1.5 Picture of moon taken by U.S.Spacecraft Ranger 7


1.6 Digital Image Processing

Figure 1.5 shows the first image of the moon taken by the U.S spacecraft
Ranger 7 on July 31, 1964 at 9:09 a.m. The first digital image processing was per-
formed on this image by the on-board television camera to correct the distortions.
In parallel with space applications, digital image processing techniques began
in the late 1960’s and early 1970s to be used in medical imaging, remote sensing
and astronomy. The invention of Computerized Axial Tomography (CAT) in the
year 1970 is one of the most important event in the application of digital image
processing in medical diagnosis. From the year 1960, the field of image process-
ing has grown vigorously. In addition to applications in medicine and space, ge-
ographers use image processing techniques to study pollution patterns from aerial
and satellite imagery.
In archaeology, image processing techniques are used to restore blurred im-
age that record rare artifacts. In physics and related fields, computer techniques
are used to enhance experimental images obtained using high energy plasmas and
electron microscopy. Apart from these applications, other major fields that used
image processing techniques are biology, nuclear medicine, law enforcement, de-
fense and industry. Typical applications in machine perception that use image pro-
cessing techniques are automatic character recognition, industrial inspection, bio-
metric processing, machine processing of aerial and satellite imagery for weather
prediction and environmental assessment.
The decline in the price of computers and the expansion of networking and
communication bandwidth via the world wide web and the Internet have created
unprecedented opportunities for continued growth of this field.

1.2 Steps in Digital Image Processing


In this section, the various processing techniques that can be applied to images
for different purposes and applications are discussed. Figure 1.6 summarizes the
techniques broadly used for low level and mid level processing. As discussed
earlier, for a low level process both the inputs and outputs are images and for a
mid level process the inputs are images and the outputs are the attributes extracted
from those images.

Knowledge base

Knowledge base refers to the knowledge about the problem domain. The knowl-
edge base is used to guide the operation of each processing module and also to
control the interaction between the modules. As the complexity of the image pro-
cessing task increases the complexity of the knowledge base also increases. For
example, image enhancement for human visual interpretation requires a simple
Digital Image Fundamentals 1.7

knowledge base whereas the knowledge base required for pattern recognition can
be quite complex.
Outputs of these steps are generally images

Outputs of these steps are generally image


Wavelets & Morphological
Color Image
Multiresolution Compression Processing
Processing
Processing

Image
Restoration Segmentation

attributes
Problem Domain

Image Representation
Enhancement Knowledge Base & Description

Image Object
Acquisition Recognition

Fig 1.6 Steps in Digital Image Processing

Image acquisition

The first step in any image processing system is to acquire the images required
for processing. Image acquisition can be as simple as getting an image that is
already in digital form or digitizing an analog image. Digital cameras which cap-
ture images directly in digital form use either Charge Coupled Devices(CCD) or
Complementary Metal Oxide Semiconductor (CMOS)image sensors. An image
sensor is a 2D array of light sensitive elements that convert photons to electrons.

Image enhancement

Image enhancement refers to the process of manipulating an image so that the


resulting image is more suitable than the original image for a specific application.
Basically, the idea behind enhancement techniques is to bring out details that are
obscured or simply to highlight certain features of interest in an image. Examples
include enhancing the contrast of medical images, removing noise in images and
enhancing images for better human interpretation.

Image restoration

Image restoration deals with recovering the original image from the degraded im-
age. Image restoration is subjective in the sense that, restoration techniques tend
1.8 Digital Image Processing

to be based on mathematical or probabilistic models of image degradation. A


Priori knowledge of the degradation function is a must to perform restoration.

Color image processing


Color image processing refers to processing of color images and is an active area
of research which is gaining importance due to the significant increase in the use
of digital images over the internet. Since color images require more storage space,
it poses a great challenge to researchers who work on color image processing.
Wavelets
Wavelets provide the scope to represent an image effectively using multiple reso-
lutions. Wavelets are extensively used for image analysis, image compression and
for pyramidal representations.
Compression
Compression deals with techniques for reducing the size of an image in order to
reduce the storage space required or bandwidth required to transmit it. With the
evolution of internet technology, teleconferencing, multimedia and high definition
television technologies, the amount of information that is handled by computers
has grown exponentially over the past decades which have increased the need for
effective image compression techniques.
Morphological processing
Morphological processing deals with extracting image components that are useful
in the representation and description of shape. It is a mid-level process that is used
to extract the attributes from an image.
Segmentation
Segmentation procedures are used to partition an image into its constituent parts
or objects. Segmentation represents the first stage in image analysis and object
recognition. Autonomous segmentation is the most difficult task and accuracy of
any pattern classification algorithm largely depends on the accuracy of segmenta-
tion. A weak or erratic segmentation eventually leads to recognition failure.
Representation and description
Representation and description always follow the output of a segmentation stage.
Representation techniques are used to convert raw pixel data to a form suitable
for computer processing. The raw data can be represented as a boundary or a
complete region. Boundary representation is used when the focus is on external
Digital Image Fundamentals 1.9

shape characteristics. Regional representation is used when the focus is on internal


properties such as texture. After representation, a method must be specified for
describing the data so that features of interest are highlighted. Description or
feature selection deals with extracting attributes that are used for differentiating
one class of objects from another.

Recognition
Recognition is the process of assigning labels to an object based on its descriptors.
For example, consider the problem at hand is to sort nuts and bolts. Based on the
attributes obtained the objects can be classified as nuts if they have a hole and are
of square shape and objects that of elongated shapes are classified as bolts.
Thus the various processes that can be performed on an image are discussed.
As the complexity of the image processing tasks increases, the number of pro-
cesses required to solve the problem also increases.

1.3 Components of an Image Processing System


(or) Elements of an Image Processing System
The basic components of a typical digital image processing system are shown in
Figure 1.7. The elements of a general purpose image processing system are,

Fig 1.7 Components of a Digital Image Processing System


1.10 Digital Image Processing

1. Image Sensors
2. Specialized Image Processing hardware
3. Computer
4. Image Processing software
5. Mass Storage
6. Image displays.
7. Hard copy devices
8. Networks
Image sensors
Image sensors are physical devices used to acquire digital images. Two elements
are required to acquire digital images. First is a physical device that is sensitive to
the energy radiated by the object to be imaged. The second element is the digitizer,
which is used to convert the output of the physical sensing device into digital form.
For example, in digital video camera, the sensors act as the physical device that
produces an electrical output proportional to light intensity. The digitizer converts
these electrical outputs to digital data.
Specialized image processing hardware
Specialized image processing hardware is called the front-end subsystem and its
most important characteristic is its speed. This unit performs functions that re-
quire fast data through puts that the main computer cannot handle. Specialized
image processing hardware usually consists of the digitizer and Arithmetic Logic
Unit (ALU) that performs primitive operations. For example, Specialized Image
Processing hardware is used to average images as they are digitized for the pur-
pose of noise reduction.
Computer
Computer in an image processing system is a general purpose computer which can
range from a PC to a super computer. In certain dedicated applications, Computers
are customized to achieve a required level of performance.

Image processing software


Software for image processing consists of a specialized module that performs
specific tasks. A well designed software package provides specialized modules,
which can be used to perform specific image processing operations. Sophisti-
cated software packages allow the integration of specialized modules and general
purpose software commands from any one computer language.
Digital Image Fundamentals 1.11

Mass storage
When dealing with thousands of images, providing adequate storage in an im-
age processing system is a big challenge. Digital storage for image processing
applications falls into three principal categories:
1. Short term storage
2. Online storage
3. Archival storage.

1. Short term storage : Short term storage devices are used to access images
at the time of processing. One method of providing short term storage is
computer memory and the second method is using frame buffers. Frame
buffers are specialized boards that can store one or more images that can
be accessed rapidly at video rates (e.g.30 images/sec). Frame buffers allow
virtual instantaneous image zoom, image scroll (Vertical shifts) and image
pan (horizontal shifts). Frame buffers usually are placed in the specialized
image processing hardware unit.
2. Online storage : Online storage devices are used to store images that re-
quire frequent and fast recall. Magnetic disks or optical-media storage de-
vices are used as online storage devices.
3. Archival storage : Archival storage devices are used for massive storage
requirements which are accessed rarely Magnetic tapes and optical disks
housed in ‘jukeboxes’ are the usual media for archival applications.

Image displays
Image displays are the physical devices used to display the final output of the
image processing system. Computer and color television monitors are the most
commonly used display devices. Monitors are driven by the outputs of image
and graphics display cards that are integral part of the computer system. Stereo
displays are special display devices that are implemented in the form of headgear
containing two small displays embedded in goggles worn by the user.

Hard copy
Hard copy devices are used for recording images. Most commonly used devices
for recording are laser printer, film cameras, heat sensitive devices, inkjet de-
vices and digital units such as optical and CD-ROM disks. Film provides the
highest possible resolution but paper is the most commonly used medium. For
presentations, images are displayed on transparent films or projected using a LCD
projector.
1.12 Digital Image Processing

Networking
Networking is used to share the large amount of data involved in image process-
ing applications. In dedicated networks transmission bandwidth is not a problem
but for remote communications via internet, transmission bandwidth is the key
consideration. Evolution of optical fibers and other broad band technologies have
greatly influenced the transmission process and nowadays transmission of mass
data via internet is as efficient as via dedicated networks.

1.3.1 Image file formats


A digital image is often encoded in the form of binary files for the purpose of
storage and transmission. A file format is a method used to store digital data
and various image file formats are widely used for the purpose of digital image
storage and retrieval. Each of these file formats possess certain characteristics
which make them suitable for various applications. Whatever may be the format,
the image file consists of two parts, i) File Header. ii) Image data.
The common image file formats are
1. GIF (Graphics Interchange Format)
2. JPEG (Joint Photographic Experts Group)
3. PNG (Portable Network Graphics)
4. TIFF (Tagged Image File Format)
5. PSD (Photo Shops Default)
6. EPS (Encapsulated Post Script)
7. SVG (Scalable Vector Graphics)
8. BMP (Bit Map)

1.4 Elements of Visual Perception


Human intuition and analysis play a central role in the choice of digital image
processing techniques for a specific application. The choice of image processing
algorithms is made based on subjective visual judgments. Hence understanding
Human Visual System (HVS) and human visual perception is important for the
better knowledge of image processing concepts.
The following factors play a crucial role in understanding the image processing
concepts
1. Image formation in the eye and human perception,
2. Difference between human and electronic imaging in terms of resolution,
3. Ability of the imaging system to adapt to changes in illumination
Digital Image Fundamentals 1.13

1.4.1 Structure of the Human Eye

Conjunctiva
Vitreous humor
Zonule fibers
Iris
Fovea
Cornea
Visual axis Macula
lutea

Aqueous Lens Optic axis Disk


humor
Optic nerve

Retina

Ciliary body Choroid


Sclera
Fig 1.8 Simplified Diagram of a Cross Section of Human Eye

Figure 1.8 shows a simplified horizontal cross section of the human eye. The
eye is nearly a sphere, with an average diameter of approximately 20mm.
Three membranes enclose the eye:
1. The cornea and sclera outer cover;
2. The choroid; and
3. The retina
Cornea and Sclera
The cornea is a tough, transparent tissue that covers the anterior surface of the
eye. Continuous with the cornea, the sclera is an opaque membrane that encloses
the remainder of the optic globe. Sclera forms the white part of the eye.
Choroid
The choroid lies directly below the sclera. This membrane contains a network of
blood vessels that serve as the major source of nutrition to the eye. Even superfi-
cial injury to the choroid can lead to severe eye damage as a result of inflammation
that restricts blood flow. The choroid coat is heavily pigmented and hence helps to
reduce the amount of extraneous light entering the eye and the backscatter within
the optical globe.
At its anterior extreme, the choroid is divided into the ciliary body and the
iris diaphragm. The iris diaphragm contracts or expands to control the amount of
light that enters the eye.
1.14 Digital Image Processing

The Iris, Pupil and Lens


Iris is a colored circular muscle which is beautifully pigmented and gives the eye
its color. The front of the iris contains the visible pigment of the eye, whereas the
back contains a black pigment. The central opening of the iris is called the pupil
and it varies in diameter from approximately 2 to 8 mm.
The lens is the most important optical element of human eye and it lies right
behind the iris. Lens is made up of concentric layers of fibrous cells and is sus-
pended by fibers that attach to the ciliary body. It contains 60 to 70% water, about
6% fat, and more protein than any other tissue in the eye. The lens is colored by a
slightly yellow pigmentation that increases with age.
Excessive clouding of the lens is referred to as cataracts which lead to poor
color discrimination and loss of clear vision. The lens absorbs approximately 8%
of the visible light spectrum, with relatively higher absorption at shorter wave-
lengths. Both infrared and ultraviolet light are absorbed appreciably by proteins
within the lens structure and, in excessive amounts, can damage the eye.
Retina
The innermost membrane of the eye is the retina, which lines the entire pos-
terior portion of the inner wall. When the eye is properly focused, light from an
object outside the eye is imaged on the retina. Central portion of the retina is
called as Fovea. Muscles controlling the eye rotate the eyeball until the image of
an object of interest falls on the fovea.
Pattern vision in human eye is enabled by the distribution of photoreceptors
over the surface of the retina. There are two classes of photoreceptors present in
the retina: cones and rods.
Cones
Cone vision is called photopic or bright-light vision. There are about 6 to 7
million cones present in each eye that are located primarily in the fovea. Cones
are highly sensitive to color and are responsible for color vision. Each cone is
connected to its own nerve which helps us to resolve fine details.
Rods
Rods are responsible for scotopic or dim light vision. About 75 to 150 million
rods are distributed over the retinal surface. Several rods are connected to a single
nerve end which reduces the amount of detail discernible by these receptors. Rods
are not involved in color vision and are sensitive to low levels of illumination. That
is the reason brightly colored objects in daylight appears as colorless objects when
seen by moonlight.
Blind Spot
The photoreceptors are absent at the spot from which the optic nerve emerges
and it is known as blind spot.
Digital Image Fundamentals 1.15

1.4.2 Distribution of rods and cones

180,000
Blind spot Cones
Rods
2
No. of rods or cones per mm

135,000

90,000

45,000

80° 60° 40° 20° 0° 20° 40° 60° 80°


Degrees from visual axis (center of fovea)

Fig 1.9 Distribution of rods and cones in the retina

Figure 1.9 shows the distribution of rods and cones for a cross section of
the right eye. Except for the blind spot, the distribution of receptors is radially
symmetric about the fovea. Receptor density is measured in degrees from visual
axis.
Cones are most dense in the center area of the fovea which is the reason for
photopic vision. Rods increase in density from the center out to approximately 20 ◦
off axis and then decrease in density out to the extreme periphery of the retina.
Note No.of cones in the region of highest acuity in the eye is about 3,37,000
elements.
1.4.3 Image Formation in the eye

Fig 1.10 Image Formation in Human Eye

The principal difference between the lens of the eye and an ordinary optical
lens is that the former is flexible. The shape of the lens is controlled by tension in
the fibers of the ciliary body. To focus on distant objects, the controlling muscles
cause the lens to be relatively flattened. Similarly, these muscles allow the lens to
become thicker in order to focus on objects near the eye.
1.16 Digital Image Processing

The distance between the center of the lens and the retina is called the focal
length. Focal length varies from approximately 17mm to about 14mm, as the
refractive power of the lens increases from its minimum to its maximum. When
the eye focuses on far away objects the lens exhibits its lowest refractive power.
When the eye focuses on a nearby object, the lens is most strongly refractive.
Example
In the Figure 1.10, the observer is looking at a tree 15m high at a distance of
100m. If the height of the retinal image is h (in mm), then

15 h
=
100 17
15 × 17
⇒ h= = 2.5mm
100
The retinal image is reflected primarily in the area of the fovea. Perception then
takes place by the relative excitation of light receptors, which transform radiant
energy into electrical impulses that are ultimately decoded by the brain.

1.4.4 Brightness
If the light is achromatic (void of color), then its only attribute is its intensity.
Brightness is a subjective description that is practically impossible to measure. It
embodies the achromatic notion of intensity.
Subjective Brightness
It is the intensity as perceived by Human Visual System (HVS). It is a loga-
rithmic function of the light intensity incident on the eye.

1.4.5 Brightness Adaptation Glare limit

Figure 1.11 shows a plot between subjective bright-


Subjective brightness

ness and logarithmic intensity. The long solid


Adaptation range

curve shows the entire range of intensities from Ba


scotopic threshold to glare limit to which the HVS Bb
can adapt. Human Visual System cannot oper-
ate at such a large range of brightness simultane-
ously. Rather the transition from scotopic to pho- Scotopic
topic takes place gradually. HVS accomplishes this
Scotopic Photopic
by changes in its overall sensitivity, a phenomenon threshold
known as Brightness Adaptation. For any given -6 -4 -2 0 2 4
Log of intensity (mL)
set of conditions, the current sensitivity level of
the visual system is called the brightness adapta- Fig 1.11 Brightness Adapta-

tion level. tion


Digital Image Fundamentals 1.17

1.4.6 Weber Ratio


Weber ratio is a measure of the ability of eye to discriminate changes in light
intensity at any specific adaptation level. It is given by,
∆Ic
Weber Ratio =
I
Where ∆Ic is the increment of illumination discriminable 50% of the time with
the background illumination I.
If the Weber ratio is small it means good brightness adaptation, that is a small
percentage change in intensity is discriminable. A large value of the ratio repre-
sents poor brightness discrimination, that is a large change in intensity is required
for discrimination.
1.4.7 Perceived Brightness
Perceived brightness (intensity) is not a simple function of actual brightness (in-
tensity).
Two phenomena clearly demonstrate this
1. Mach Band Effect 2. Simultaneous Contrast
Mach Band Effect
Mach band effect describes an effect where
the human mind subconsciously increases
the contrast between two surfaces with dif-
ferent luminance. It is based on the fact Actual intensity

that Human Visual System tends to over-


shoot or undershoot around the boundary of
regions of different intensities. Although
the intensity of the stripes shown in Figure Perceived intensity
1.12 is constant, (HVS) perceives a bright-
ness pattern that is strongly scalloped, espe-
cially near the boundaries. These seemingly
scalloped bands are called Mach Band after Fig 1.12 Mach band effect
Ernst Mach (1865).

Simultaneous Contrast
This phenomenon is related to the fact that a region’s perceived brightness does
not depend simply on its intensity. All the inner squares in the Figure 1.13 have
exactly the same intensity; however, they appear to become darker as the back-
ground gets lighter.
1.18 Digital Image Processing

Fig 1.13 Illustration of Simultaneous Contrast

A more familiar example is a piece of paper that seems white while lying on
a desk, but can appear totally black when used to shield the eyes while looking
directly at a bright sky.
Optical illusions
Optical illusion refers to a human perception phenomena, in which the eye fills in
non existing information (or) wrongly perceives geometrical properties of objects.
Optical illusions are a characteristic of the human visual system that is not fully
understood. Figure 1.14 shows examples of optical illusions.
In Figure 1.14 (a) a floating white triangle which doesn’t exist is seen. In
Figure (b), the centre circle on the left appears smaller than that on the right, but
they are in fact of the same size. In Figure (c), horizontal lines that are actually
parallel appear to be sloped due to the presence of the black blocks.

Fig 1.14 Examples of Optical Illusions

1.5 Image Sensing and Acquisition


Digital images are generated by the combination of an “illumination” source and
the reflection or absorption of energy from that source by the elements of the
“scene” being imaged. Illumination may originate from a source of electromag-
netic energy such as radar, infrared, X-ray energy or from other sources such
as ultrasound, computer generated illumination pattern. Similarly, the scene el-
ements could be familiar objects that we see or can be molecules or buried rock
formations.
Digital Image Fundamentals 1.19

Energy

Filter

Sensing material
Power in

Voltage waveform out


Housing

Fig 1.15 Single Element Sensor

Depending on the nature of the source, illumination energy is reflected from


the objects. The purpose of an image acquisition device is to convert the illumi-
nation energy into digital image.
1.5.1 Image Acquisition Methods
Image acquisition can be performed using three different techniques,
1. Image acquisition using single sensor
2. Image acquisition using line sensor (sensor strips)
3. Image acquisition using sensor array
Image acquisition using single sensor
Figure 1.15 shows the components of a single sensor element. The sensing ma-
terial transforms the illumination energy into an electrical voltage proportional
to the input power and the illumination energy. Filters are used to increase the
selectivity of the sensor element.
Example:Photodiodes are single element sensors that convert light energy into
electrical energy.
Figure 1.16 shows an arrangement used to generate a 2-D image using a sin-
gle sensor. A film negative is mounted onto a drum whose mechanical rotation
provides displacement in one dimension. The single sensor is mounted on a lead

Film

Sensor Rotation

Linear motion
Fig 1.16 Generation of 2-D image using a single sensor
1.20 Digital Image Processing

screw that provides motion in the perpendicular direction. Since mechanical mo-
tion can be controlled with high precision, this method is an inexpensive way to
obtain high-resolution images.
Microdensitometers
Microdensitometer is mechanical digitizer used for acquiring 2-D image. Mi-
crodensitometers use a flat bed, with the sensor moving in two linear directions.
These types of mechanical digitizers sometimes are referred to as microdensito-
meters.
Image Acquisition Using Sensor Strips (Line Sensor)

Sensor strips consists of an in-line arrangement of sensors as shown in Figure


1.17. Both 2-D and 3-D images can be acquired using sensor strips.
......

Fig 1.17 Line Sensor


Acquisition of 2-D images
Figure 1.18 shows the arrangement used to acquire a 2-D image using a sensor
strip. The strip provides imaging elements in one direction. Motion perpendicular
to the strip provides imaging in the other direction resulting in 2-D image. This is
the type of arrangement used in most flat bed scanners.
One image line out per
increment of linear motion

Imaged area

Linear motion
Sensor strip

Fig 1.18 2-D Image Acquisition using Line Sensor

Application : In-line sensors are used in airborne imaging applications, in which


the imaging system is mounted on an aircraft that flies at a constant altitude and
speed over the geographical area to be imaged. One-dimensional imaging sensor
strips are mounted perpendicular to the direction of flight. The imaging strip
gives one line of an image at a time, and the motion of the strip completes the
other dimension of a two-dimensional image. Lenses or other focusing schemes
are used to project the area to be scanned onto the sensors.
Acquisition of 3-D images
Figure 1.19 shows sensor strips mounted in a ring configuration, used in medi-
cal and industrial imaging to obtain cross-sectional (“slice”) images of 3-Dobjects.
Digital Image Fundamentals 1.21

A rotating X-ray source provides illumination and the portion of the sensors op-
posite to the source collect the X-ray energy that pass through the object (the
sensors obviously have to be sensitive to X-ray energy). The output of the sensors
is processed by reconstruction algorithms to transform the sensed data into mean-
ingful cross-sectional images. A 3-D digital volume consisting of stacked images
is generated as the object is moved in a direction perpendicular to the sensor ring.

Image
reconstruction
Cross-sectional images
of 3-Dobject

3D Object

X-ray source

n
otio
rm
Lin ea

Sensor ring

Fig 1.19 3-D Image Acquisition using circular sensor strip

Applications
1. Medical and industrial Computerized Axial Tomography (CAT)
2. Magnetic Resonance Imaging (MRI) and
3. Positron Emission Tomography (PET) imaging.

Image Acquisition Using Sensor Arrays


Figure 1.20 shows individual sensors arranged in the
form of a 2-D array. Image sensor arrays are used
in electromagnetic, ultrasonic sensing devices and in
digital cameras. CCD and CMOS sensors are used to
form the sensor array. The response of each sensor
is proportional to the integral of the light energy pro-
jected onto the surface of the sensor. Since the sensor
Fig 1.20 Sensor Array
array is two dimensional, the complete image can be
obtained by focusing the energy pattern onto the surface of the array.
1.22 Digital Image Processing

1.5.2 Image Acquisition Devices


1.5.2.1 Vidicon Camera Tube

Vidicon is the most popular camera tube used in the television industry. The
Vidicon came into general use in the early 50’s and gained immediate popularity
because of its small size and ease of operation. Vidicon is a storage type camera
tube in which a charge density pattern is formed by the image scene radiation
on a photoconductive surface which is then scanned by a beam of low velocity
electrons.

• Principle: Vidicon camera tube functions on the principle of photo conduc-


tivity, where the resistance of the target material decreases when exposed to
light.
• Construction: Vidicon is a short tube with a length of 12 to 20 cm and diam-
eter between 1.5 and 4 cm. Its life is estimated to be between 5000 and 20,000
hours. The tube is made up of a cylindrical glass envelope with electron gun at
one end and a face plate at other end. The glass tube is surrounded by a yoke
which contains the following coils,

1. Focusing Coil
2. Horizontal and Vertical Deflection Coils
3. Alignment Coils

Target connection Grid no.2 (accelerator)


30 to 60V Alignment coil 300V

Grid no.1
Target 0 to 100V

Light
image

Glass Cathode, 0V
face plate
Grid no.3(beam focus)
275 to 300 V
Grid no.4 Focusing
(decelerator) coil Horizontal and vertical
275 V deflecting coils

Fig 1.21 Vidicon Camera Tube Cross Section

Figure 1.21 illustrates the structural configuration of a typical vidicon camera


tube. As shown in the figure the inner side of the faceplate is coated with a trans-
parent conducting film on which a thin layer of target is coated. The target is a
Digital Image Fundamentals 1.23

thin photo conductive layer of either selenium or antimony compounds. Antimony


trisulphide is the most commonly used target material.
This conductive coating is known as signal electrode or plate. The signal
electrode is connected to the DC supply through a load resistance. Grid no.1 is
maintained at 0 to 100 V . Grid no.2 maintained at 300 V is used to accelerate
the electron beam towards the signal electrode. Grid no. 3 maintained at 275 to
300 V acts as a beam focus. The electron beam that emerges from the electron
gun is focused by the combined action of uniform magnetic field provided by the
external focusing coil and electrostatic field provided by grid no.3.
Grid no.4 maintained at 275 V provides a decelerating field between itself and
the photoconductive layer so that the electron beam approaches the layer with low
velocity to prevent any secondary emission. The horizontal and vertical deflection
coils placed around the tube are used for deflecting the electron beam in horizontal
and vertical direction in order to scan the target.

Operation
In darkness, the photo-layer has a thickness of about 0.0001cm and behaves as an
insulator and thus the electrons are unable to reach the positively charged metal
film. Therefore a layer of electrons is deposited on the photoconductive layer
to balance the positive charge on the metal coating. Thus after a complete scan
of the target by electron beam, the photoconductor appears as a capacitor with a
positively charged plate on one side and a layer of electrons on the other side.
When light strikes a small area of the photoconductor electrons in that area
start to penetrate and the charge in that area is neutralized. Thus with an optical
image on the target, each point on the gun side of the photo-layer assumes a
potential with respect to the dc supply and its resistance. A pattern of positive
potentials appears on the gun side of the photo-layer, producing a charge image
corresponding to the incident optical image.

Storage action
Though light from the scene falls continuously from the target, each element of
the photo coating is scanned at intervals equal to the frame time. This results
in storage action and net change in resistance depends on the time between two
successive scanning and intensity of incident light.

Signal current
As the electron beam scans the target plate it replaces the lost electrons and re-
stores uniform surface charge. This causes a current flow in the signal electrode
circuit producing a varying voltage across the load resistance R L . The amplitude
1.24 Digital Image Processing

of current and the consequent output voltage across R L are directly proportional
to the light intensity variations on the scene. Note that, since, a large current
would cause a higher voltage drop across RL , the output voltage is most negative
for white areas. The video output voltage developed across the load resistance (50
K − ohms) is adequate and does not need any image or signal multiplication.The
output signal is further amplified by conventional amplifiers before it leaves the
camera unit. This makes the vidicon a much simpler picture tube.
Applications

1. Earlier types of vidicons were used only where there was no fast movement,
because of inherent lag. These applications included slides, pictures, closed
circuit TV etc.
2. The present day improved vidicon finds wide applications in education,
medicine, industry, aerospace and oceanography.

1.5.2.2 Analog Camera


Two types of cameras are available,
[1.] SLR (Single Lens Reflex) Cameras. [2.] Point and shoot cameras.
In a point and shoot camera, the view finder is a simple window (hole) through
the body of the camera. In an SLR camera, the actual image to be filmed can be
seen. The Camera has a slanted mirror positioned between the shutter and lens,
with a piece of translucent glass and a prism arrangement. The prism flips the
image on the screen, so that it appears right side up again, and then redirects it
to the view finder window. The advantage of this design is that it is possible to
adjust the focus and compare the scene to get the exact picture.
Upon pressing the shutter button, the camera takes the mirror out of the way,
so the image is directed to the exposed film. The mirror is connected to the shutter
timer system and thus, it stays in the home position until the shutter is pressed.
1.5.2.3 Digital Camera
The key difference between digital and film based cameras is that digital cameras
use image sensors instead of film. The image sensor employed by most digital
cameras is either CCD or CMOS. Figure 1.22 shows the components of a typical
digital camera.
The lens assembly usually includes an infrared (IR) blocking filter and an op-
tical anti-aliasing filter. The camera usually has an adjustable focal length lens,
controlled by zoom and focus motors. The zoom motor also controls an opti-
cal viewfinder. When the user presses the shutter button halfway, the camera
performs automatic exposure and automatic focus processing. The camera lens
Digital Image Fundamentals 1.25

Kodak Compact
Memory
Aperture Flash Card
Zoom IR blocking and 16GB Colour LCD
Lens and Shutter anti - aliasing
filter

A/D Camera
ASIC
PC interface
Imager
Focus
Zoom
DRAM
Buffer
Micro
Flash Processor
Optical
View finder Firmware
Memory

User 999 Power


Controls supply Battery
Status LCD
AC Adapter

Fig 1.22 Components of a digital camera

focuses light from the scene onto the CCD or CMOS sensor. The analog sig-
nal from the sensor is amplified and converted to digital form, normally using
a 10 or 12-bit analog to digital (A/D) converter. When the user fully depresses
the shutter button, an image is captured and stored in DRAM. In order to create
the final high-resolution digital image, the digital data is processed by a camera
ASIC (Application Specific IC) digital image processor, or by a high-performance
microprocessor, sometimes supported by a digital signal processor (DSP).

De-mosaicing
Since most digital cameras use a single color image sensor that provides only one
color value for each light sensitive cell, interpolation is used to “fill in” the “miss-
ing” color values for each pixel. This is called “de-mosaicing.” De-mosaicing
provides a full-color, but not yet perfect, image.
White balancing
To get a good color image, the camera must also provide white balancing to com-
pensate for spectral variations in the illumination. While both daylight and indoor
lighting provide “white” light, daylight actually has more energy in the blue por-
tion of the light spectrum and indoor lighting provides more energy in the red por-
tion of the spectrum. An image processing algorithm is used to analyze the scene
and adjust the red and blue signal strengths to match the green signal strength in
white and neutral areas of the picture. Even after white balancing, the color image
is not yet perfect.
1.26 Digital Image Processing

Color correction
The RGB spectral sensitivities of the image sensor do not perfectly match the
way (HVS) see colors. As a result, the color image typically appears desaturated,
muting bright colors like red and blue. Color correction digitally compensates for
this, improving the color reproduction, and also transforming the digital image
into the output color space. The output color space used for most digital cameras
today is RGB, which is a color space that is designed to be ready for display on a
typical computer monitor.
Sharpening
The next image processing step is sharpening. The anti-aliasing filter and other
lens components slightly soften the image captured by the color image sensor. The
picture may also be slightly blurred by the display monitor or printer. Therefore,
digital cameras usually include digital image processing to sharpen the image ap-
plying adaptive spatial filters, which locate and emphasize fine edge details in the
image. In some cases, a photographer may prefer different sharpness levels, for
example, depending on whether the photo is a portrait or a nature shot. To provide
this creative control, some digital cameras offer a variety of different sharpness
settings such as “soft,” “standard” and “sharp.”
Finally the compressed image data is stored in a JPEG image file usually ac-
cording to the Exit format (Exit stands for Exchangeable Image File).
In addition to the compressed JPEG image the file contains meta-data such as:
1. Camera manufacturer and model number
2. Exact date and time the picture was taken
3. Focal length, subject distance, lens fnr, and shutter speed used to take the
picture
4. Ambient light level, flash setting
5. User-selected camera settings (sharpness level, quality level, etc.) and
6. a “thumbnail image”.
Certain cameras even allow short “sound bites”

Recording Color
There are several ways for recording the three colors in a digital camera. The
highest quality cameras use three separate sensors, each with a different filter
over it. Light is directed to the different sensors by placing a beam splitter in the
camera. The advantage of this method is that the camera records each of the three
colours at each pixel location. Unfortunately, cameras using this method tend to
be bulky and expensive.
Digital Image Fundamentals 1.27

The second method is to rotate a series of red, blue and green filters in front
of a single sensor. The sensor records the three separate images in rapid succes-
sion. Since the three images are not taken precisely at the same moment, it is not
practical in the case of candid photography or hand held cameras.
A more economical and practical way to record the three primary colours from
a single image is to permanently place a filter over each individual photo site. By
breaking up the sensor into a variety of red, blue and green pixels, it is possible
to get enough information about the general vicinity of each sensor in order to
enable us to make accurate guesses about the true colour at that location. This
process of looking at the other pixels in the neighborhood of a sensor and making
a guess is called interpolation.

1.5.2.4 Digital image sensors Fig 1.23 Image Sensors

When an image is being captured by a


camera, light passes through the lens
and falls on the image sensor. The
image sensor consists of picture ele-
ments, also called pixels that register
the amount of light that falls on them.
They convert the received amount of
light into a corresponding number of electrons. The stronger the light, the more
electrons are generated. The electrons are converted into voltage and then trans-
formed into numbers by means of an A/D-converter. The signal constituted by
the numbers is processed by electronic circuits inside the camera. Presently, there
are two main technologies that can be used for the image sensor in a camera, i.e.
CCD (Charge-coupled Device) and CMOS (Complementary Metal-oxide Semi-
conductor). Figure 1.23 shows the image sensors in use.

Table 1.1 Comparison of CCD vs. CMOS sensors

Features CCD CMOS


Cost Expensive to produce because Inexpensive because CMOS
of special manufacturing meth- wafers are used for many dif-
ods employed ferent types of semiconductors
Power Consumes up to 100 x more Low power consumption
power than CMOS
Noise High quality, low noise images Susceptible to structured noise
Maturity Produced for longer period; Less mature but equal to CCD
higher quality images, more in low and middle range resolu-
pixels tions.
1.28 Digital Image Processing

Features CCD CMOS


Extended Function- Technically feasible; other Other circuitry easily incorpo-
ality chips are used rated on same chip
Fill Factor High Low
Charge to voltage Per sensor Per pixel
conversion
Windowing Not possible Possible
Multiview streaming Not possible Possible

1.6 Image Sampling and Quantization


The output of most image sensors is continuous voltage waveforms whose ampli-
tude and spatial behavior are related to the physical phenomenon being sensed. To
create a digital image, we need to convert the continuous sensed data into digital
form. In practice, the method of sampling is determined by the sensor arrange-
ment used to generate the image. When an image is generated by a single sensing
element combined with mechanical motion the output of the sensor is digitized in
the manner described below. This involves two processes: sampling and quanti-
zation.
Basic concepts

Analog Image Digital


Image Sampling Quantization Image

Fig 1.24 Conversion of Analog Image to Digital Image

Figure 1.24 shows the block diagram to convert an analog image to digital im-
age. The basic idea behind sampling and quantization is illustrated in Figure. 1.25.
Figure 1.25 (a) shows a continuous image, f (x, y), that is to be converted to dig-
ital form. An image may be continuous with respect to the x- and y-coordinates,
and also in amplitude. To convert it to digital form, we have to sample the function
in both coordinates and in amplitude.
• Digitizing the coordinate values is called sampling.
• Digitizing the amplitude values is called quantization.
Sampling
The amplitude along the line segment AB is plotted to obtain the one-dimensional
function shown in Figure 1.25(b). The random variations are due to image noise.
To sample this function, we take equally spaced samples along line AB, as shown
in Figure 1.25(c).The location of each sample is given by a vertical tick mark in
the bottom part of the figure. The samples are shown as small white squares su-
perimposed on the function. The set of these discrete locations gives the sampled
function of the line segment AB.
Digital Image Fundamentals 1.29

A B

A B

(a) (b)
A B A B

Sampling Quantization

(c) (d)
Generating a digital image. (a) Continuous Image. (b) A scan line from A to B is the
continuous image used to illustrate the concepts of sampling and quantization.
(c) Sampling and quantization.(d) Digital scan line.l

Fig 1.25 Generating a Digital Image

Quantisation

Fig 1.26 Result of Image Sampling and Quantization

In order to form a digital function, the gray-level values also must be converted
(quantized) into discrete quantities. The amplitude (intensity) value of every sam-
ple is to be quantized. The gray level scale is divided into finite number of discrete
levels. In this example the gray-level scale divided into eight discrete levels, rang-
ing from black to white as shown in Figure 1.25(c). One of the eight discrete gray
level value is assigned to each sampled value based on the vertical proximity of
the sample amplitude value to the discrete gray level value in the scale.
1.30 Digital Image Processing

The digital samples resulting from both sampling and quantization are shown
in Figure 1.25(d).
End of this procedure results in digitization of a line segment AB in the image.
In order to obtain the complete 2-D digital image the procedure is to be carried out
line by line starting at the top of the image until the last line segment is digitized.
When a sensing array is used for image acquisition, there is no motion and the
number of sensors in the array determines the limitations of sampling. Figure
1.26 illustrates this concept. Figure 1.26(a) shows a continuous image projected
onto the plane of an array sensor. Figure 1.26(b) shows the image after sampling
and quantization. Clearly, the quality of a digital image is determined to a large
degree by the number of samples and discrete gray levels used in sampling and
quantization.

Digital Image Representation

The digital images obtained as a result of sampling and quantization is a matrix


of real numbers. These digital images can be represented in two basic ways.
Let f (x, y) be the image. After sampling the values of the coordinates (x, y)
become discrete quantities. Let M be the number of rows and N be the number
of columns. Now the digital image f (x, y) having M rows and N columns, can
be represented in a compact form as shown below,
 
f (0, 0) f (0, 1) ··· f (0, N − 1)
 f (1, 0) f (1, 1) ... f (1, N − 1) 
f (x, y) =  .. .. ..
 
. . .

 
f (M − 1, 0) f (M − 1, 1) · · · f (M − 1, N − 1)

The right side of this equation is by definition a digital image. Each element of
this matrix array is called an image element, picture element, pixel, or pel.
The second method is to use a more traditional matrix notation as shown below
to denote a digital image and its elements
 
a0,0 a0,1 · · · a0,N −1
 a1,0 a1,1 . . . a1,N −1 
A= . .. ..
 
 .. . .


aM −1,0 aM −1.1 · · · aM −1,N −1

The values M and N should be positive integers. The number of gray levels in
the images is represented using L and it should be typically a integer power of 2
as shown in equation, L = 2k .
Digital Image Fundamentals 1.31

Thus the gray level values are equally spaced integers that lie in the interval
[0, L − 1]

Simple Image Acquisition Model


Figure 1.27 shows the principal manner in which array sensors are used for Image
Acquisition.

Illumination Source

(Internal) image plane

Output (digitized) image

(Internal) image plane

Fig 1.27 Example of Digital Image Acquisition Process


The illumination source can be any source of light energy. The energy re-
flected from the scene element is focused on the image plane using a focusing
lens. The sensor array, which is coincident with the focal plane, produces outputs
proportional to the integral of the light received at each sensor. Digital and analog
circuitry sweeps these outputs and converts them to a video signal, which is then
digitized by another section of the imaging system. The output is a digital image,
as shown diagrammatically in Figure 1.27.

1.6.1 Image Sampling(2-D Sampling)


The digitization process for images can be understood by modeling them as band
limited signals.

Band limited Function


A function f (x, y) is called band limited if its fourier transform F (U, V ) is zero
outside a bounded region in the frequency plane as shown in the figure 1.28 .
That is F (U, V ) = 0, for |U | > U0 , |V | > V0 . The quantities U0 and V0 are
called the x and y bandwidths of the image.
2-D Sampling Theorem
A band limited image f (x, y) sampled uniformly on a rectangular grid with spac-
ing ∆x, ∆y can be recovered without error from sample values f (m∆x, n∆y)
1.32 Digital Image Processing

F(x1,x2)

x2

xy0

x1
-xy0 xx0

xx0 x1
-xy0
-xy0
x2
(a) Fourier transform of a (b) Its region of support
band limited function
Fig 1.28 Band Limited Function

provided the sampling rate is greater than the Nyquist rate, that is

1 1
= Us > 2U0 , = Vs > 2V0
∆x ∆y

Where Us , Vs are the sampling frequencies and Uo , Vo are the bandwidth.

Reconstruction of the image from its samples

If the sampling frequencies Us , Vs are greater than twice the bandwidths, that is
Us > 2U0 , Vs > 2V0 then F (U, V ) can be recovered by a Low Pass Filter with
frequency response,
(
1
(Us ,Vs ) (U, V ) ∈ R,
H (U, V ) = (1.1)
0, otherwise

Where R is any region.

1.6.2 Image Quantization


The step subsequent to sampling in image digitization is quantization. A quantizer
maps a continuous variable u into a discrete variable u∗ , which takes values from a
finite set r1 , r2 , · · · , rL of numbers. The mapping is generally represented using a
staircase function as shown in Figure 1.29 and the quantization rule is as follows:
if u lies in the interval [tk , t(k+1) ], then it is mapped to rk , the k th reconstruction
level.
Digital Image Fundamentals 1.33

U*
Quantizer
rL output

U Quantizer U*
rk

U
t1 t2 tk tL+1

r2 Quantizer
error
r1

Fig 1.29 Quantization (Staircase Approximation)

1.6.2.1 Lloyd - Max Quantizer


This quantizer is obtained by minimizing the mean square error for a given num-
ber of quantisation levels L. Let u be scalar random variable with a continuous
probability density function p(u). It is desired to find the decision levels t k and
the reconstruction levels rk in order to minimize the mean square error:
h i Z tL+1
∗ 2
∆ = E (u − u ) = (u − u∗ )2 p (u) du, (1.2)
t1

which can be rewritten as


L Z tL+1
(u − ri )2 p (u) du
X
∆= (1.3)
i=1 t1

" #ti+1
(u − ri )3
∆= pu (u) f or1 ≤ i ≤ L (1.4)
3
ti

1 1
∆= (ti+1 − ri )3 P u (ti+1 ) − (ti − ri )3 P u (ti ) (1.5)
3 3
To minimize the mean square error, differentiating ∆ with respect to t k and equat-
ing it to zero yields
rk + rk−1
tk = (1.6)
2
1.34 Digital Image Processing

Similarly, differentiating ∆ with respect to rk and equating it to zero yields,


R t(k+1)
(t ) uPu (u)du
rk = R tk(k+1) (1.7)
(tk ) Pu (u)du

These results state that,


1. Optimum transition levels lie halfway between the optimum reconstruction
levels
2. Optimum reconstruction levels in turn lie at the centre of mass of the prob-
ability density in between the transition levels.

1.6.2.2 Uniform Optimal Quantizer (Linear Quantizer)


For uniform distribution, the Lloyd Max quantizer equation become linear,
giving equal intervals between the transition levels and reconstruction levels. For
uniform distribution,
1
−t1 t1 ≤ u ≤ tL+1

Pu (u) = t L+1 (1.8)
0, Otherwise

From Eq w.k.t,
R tk+1
t uP u (u) du
rk = Rktk+1 (1.9)
tk P u (u) du

Substituting Eq.(1.8) in above equation leads to ,


R tk+1  1 
tk u tL+1 −t1 du
rk = R tk+1 1
(1.10)
tk tL+1 −t1 du
R tk+1
t udu
rk = Rktk+1 (1.11)
tk du
h 2 itk+1
u t2k+1 −t2k
2 tk 2
rk = t = (1.12)
[u]tk+1 tk+1 − tk
k
tk+1 + tk
rk = (1.13)
2
rk + rk−1
From Eq(1.6) w.k.t, tk =
2
Digital Image Fundamentals 1.35

Sub Eq(1.13) in Eq(1.6) leads to


rk + rk−1
tk =
 2   
tk+1 +tk tk +tk−1
2 + 2
= (1.14)
2
tk+1 + 2tk + tk−1
tk = (1.15)
4
4tk − 2tk = tk+1 + tk−1 (1.16)
tk+1 + tk−1
tk = (1.17)
2

Thus,tk+1 − tk = tk − tk−1 = constant , q


The quantization error ∆ , u − u∗ is uniformly distributed over the interval
q q
(− , ). Hence the means square error is given by
2 2
Zq/2
1 q2
∆= u2 du = (1.18)
q 12
−q/2

Properties
The optimal uniform quantizer has the following properties
1. The quantizer output is an unbiased estimate of the input,
i.e., E[u∗] = E[u]
2. The quantization error is orthogonal to the quantizer output,
i.e., E[(u − u∗)u] = 0

1.6.3 Storage Space


The number of bits required to store a digitized image is given by, b = M × N × k
When M = N then the above equation becomes, b = N 2 k
In general, the image with 2k intensity levels is referred to as ‘k-bit image’.
For example if an image has 256 gray levels then, L = 256 = 2 k , then the image
is called as 8-bit image. In other terms when an image is termed as ‘k-bit image’,
k denotes the number of bits used to represent each gray level value.

Example 1.1 Calculate the storage space required to store an 8-bit image of size
256 × 256 pixels.
Solution:
Given M = N = 256 k = 8 bits
1.36 Digital Image Processing

The number of bits required to store a digitized image,


b = M × N × kb = 256 × 256 × 8 = 524, 288 bits.

1.6.4 Image Resolution


Resolution of a digital image depends on two factors:
1. The number of picture elements in the image (M × N ), which in turn de-
pends on the sampling rate
2. The number of Quantization levels (L) or in other words the number of bits
used to represent a pixel (k).
As M, N and k increases, the resolution of an image increases along with storage
space required. Thus two types of resolutions are defined for an image,
i) Spatial Resolution ii) Intensity Resolution

1.6.4.1 Spatial Resolution


Spatial resolution is the smallest discernible detail in an image. Sampling is the
principal factor determining the spatial resolution of an image. The unit for spatial
resolution is line pairs/unit distance (or) dots per unit distance (or) dpi(dots per
inch). Spatial resolution increases with increase in sampling rate. As the sampling
rate increases the values of M and N increases and the size of the image also
increases.

Aliasing and Moire Patterns


If the function is under sampled then a phenomenon called
aliasing corrupts the sampled images. The corruption is in
the form of additional frequency components being intro-
duced into the sampling function. These are called aliasing
Fig 1.30 Illustration
frequencies. The effect of aliased frequencies can be seen
of Moire Pattern
in the form of ‘Moire Patterns’ as shown in Figure 1.30.

Effects of Reducing Spatial Resolution[Checkerboard Effect]


The effects of reducing spatial resolution keeping the number of gray levels con-
stant are illustrated with the help of an example. As the rate of sampling is re-
duced, the number of rows and columns reduce therefore reducing the size of the
image. Figure 1.31 shows an image of apples of size 512 × 512 pixels. The sub-
sequent images are obtained by sub sampling the original image while keeping
number of gray levels constant. From the given example it is clear that as the
spatial resolution is decreased, the size of the image also decreases.
Digital Image Fundamentals 1.37

32 × 32
64 × 64
128 × 128

256 × 256

512 × 512

Fig 1.31 Effect of Reducing Spatial Resolution

Checkerboard Pattern

Fig 1.32 Checkerboard Effect

Checkerboard pattern is a degradation that results due to the reduction in spa-


tial resolution. In order to visualize the amount of details lost due to the reduction
in spatial resolution, the sub-sampled images are replicated to the size of 512×512
using nearest neighbor interpolation. Figure 1.32(a) is obtained by replicating the
256 × 256 image to the size of 512 × 512, Figure 1.32(b) is obtained by repli-
cating the 128 × 128 image to the size of 512 × 512, Figure 1.32(c) is obtained
by replicating 64 × 64 image to the size of 512 × 512 and 1.32(d) is obtained by
replicating 32 × 32 image to the size of 512 × 512.
1.38 Digital Image Processing

In Figure 1.32(d) the checkerboard effect is more pronounced to the extent of


totally obscuring the objects present in the image.

1.6.4.2 Intensity Resolution or Gray Level Resolution

It refers to the smallest discernible change in gray level and it depends on the
number of gray levels. Quantization determines the number of gray levels in an
image. Quantization is the principal factor determining the intensity resolution of
an image. The most commonly used resolution is 28 that is 256 gray level.

Effects of Reducing Intensity Resolution [False Contouring]

Fig 1.33 Original Scenery Image

The effects of reducing intensity resolution keeping the number of samples


constant are illustrated in this example. Figure 1.33 shows the original 8-bit
scenery image with 256 gray levels, that is k = 8, L = 2k = 28 = 256. When k
is reduced to 7 the number of gray levels reduces to 128 and so on. As the k value
is reduced to 4 as shown in Figure 1.34(a), it leads to false contours. This effect is
more pronounced as the k value is further reduced to 3 and 2 as shown in Figures
1.34(b) and Figure 1.34(c). Figure 1.34(d) is the image obtained for k = 1, that is
the number of gray levels is 2 and the image becomes a binary image.

False Contouring

Use of insufficient number of gray levels in smooth areas of a digital image causes
False Contouring. When groups of neighboring pixels are quantized to the same
value, regions of constant gray levels are formed, whose boundaries are called
contours as shown in Figure 1.34.
Digital Image Fundamentals 1.39

Fig 1.34 (a) Image with k = 4, 16 gray levels (b) Image with k = 3, 8 gray levels (c) Image with
k = 2, 4 gray levels (d) Image with k = 1, 2 gray levels

Uniform quantization of images requires about 256 gray levels (i.e., 8-bits).
Contouring effects start becoming visible at or below 6-bits/pixel. This effect of
false contouring can be held below the level of visibility by using two methods,
(i) Contrast Quantization (ii) Pseudorandom Quantization

Contrast Quantization

-1
Luminance f() C f ()
MMSE
Luminance to Contrast to
Quantizer
contrast Luminance

Fig 1.35 Contrast Quantizer

It is a method of suppressing false contouring in images. Figure 1.35 shows


the block diagram of a contrast quantizer. In this method using non linear trans-
formation, luminance of the image is converted to contrast C and the contrast C is
quantized using MMSE [Minimum Mean Square Error] quantizer. The quantized
contrast is transformed back to the luminance value by the inverse transformation.
Experimental studies indicate that if uniformly quantized, the contrast scale
needs about 6-bits. However with the optimum mean square quantizer 4 to 5-
bits/pixel will be sufficient.
Pseudorandom Quantization [Dither]
Another method of suppressing contouring effects is to add a small amount of
uniformly distributed pseudorandom noise to the luminance samples before quan-
1.40 Digital Image Processing

1 1
f(x,y) g(x,y) Quantizer g (x,y) f (x,y)
å å to display
K bits +
+
+ -
h(x,y)

Uniform
Pseudorandom
Noise

Fig 1.36 Pseudorandom Noise Quantizer

tization. This pseudorandom noise is also called dither. To display the image, the
same pseudorandom sequence is subtracted from the quantizer output. The effect
is that in the regions of low luminance gradients (i.e., contours), the input noise
causes pixels to go above or below the original decision level, thereby breaking
contours. Figure 1.36 shows the block diagram of a Pseudorandom Quantizer.
1.7 Basic Relationship between pixels
Pixels are the basic elements which form the image and their proper manipulation
gives rise to different appearances. The relationships between pixels are used for
image manipulations. In this section we consider several important relationships
between pixels in digital image. As mentioned before an image is denoted by
f (x, y), when referring to a particular pixel, we use lowercase letters p & q.

1.7.1 Neighbors of a Pixel


Three types of neighbors are defined for a pixel. They are
• 4 - Neighbors
• D - Neighbors
• 8 - Neighbors
4-Neighbors of pixel
A pixel p at coordinates (x, y) has four horizontal and vertical neighbors
whose coordinates are given by (x + 1, y), (x − 1, y), (x, y + 1), (x, y − 1) as

Fig 1.37 4 Neighbors; the set of Horizontal and Vertical Neighbors


Digital Image Fundamentals 1.41

shown in Figure 1.37. This set of pixels are called 4-neighbors of p denoted by
N4 (p). In N4 (p), each pixel has a unit distance from (x, y) and some of the neigh-
bors of p lie outside the digital image if (x, y) is on the border of the image.
Diagonal Neighbors
The four diagonal neighbors of p have coordinates (x+1, y+1), (x+1, y−1),
(x − 1, y + 1), (x − 1, y − 1) as shown in Figure 1.38 and are denoted by N D (p).

Fig 1.38 Diagonal Neighbors; the set of 4 Diagonal Neighbors

8-Neighbors
Diagonal neighbors together with the 4-neighbors are called 8-neighbors of
p, denoted by N8 (p). Some of the points in ND (p) and N8 (p) fall outside the
image if f (x, y) is on the border of the image. Eight neighbors are at non-uniform
distance from P . Effectively we have N8 (p) = N4 (p) + ND (p). Figure 1.39
shows the eight neighbors of p.

Fig 1.39 Eight neighbors

1.7.2 Adjacency
Definition 1.3 Two pixels that are neighbors and have the same gray level (or)
some other specified similarity criterion are called adjacent pixels. Let V be the
set of gray level values used to define adjacency. In a binary image V = 1, if we
are referring to adjacency of pixels with value 1. In a gray scale image the idea
is same but set V typically contains more elements.

Types of Adjacency
There are three different types of adjacency they are
1.42 Digital Image Processing

0 1 1 0 1 1 0 1 1

0 1 0 0 1 0 0 1 0

0 0 1 0 0 1 0 0 1

(a) (b) (b)

Fig 1.40 (a) Arrangement of Pixels, (b) Pixels that are 8-adjacent to centre pixel, (c) m-adjacent

• 4 - Adjacency
• 8 - Adjacency
• m - Adjacency (mixed adjacency)

An example of adjacency

• 4 - Adjacency
Two pixels p and q with values from ‘V ’ are adjacent if ‘q’ is in the set
N4 (p).
• 8 - Adjacency
Two pixels p and q with values from ‘V ’ are 8 - adjacent if ‘q 0 is in the set
of N8 (p).
• m - Adjacency
Mixed adjacency is the modification of 8 adjacency and it is introduced to
eliminate the multi-path connection that often arise when 8 - adjacency is
used. Two pixels ‘p’ and ‘q’ with values from ‘V ’ are m - adjacent,

– if ‘p’ and ‘q’ are 4-adjacent that is qN4 (p) (or)


– if ‘p’ and ‘q’ are diagonally adjacent and do not have any common 4 -
adjacent neighbors that is ‘q 0 ∈ ND (p) and the set N4 (p) ∩ N4 (q) has
no pixels whose values are from V .

1.7.3 Connectivity
Connectivity between pixel is a fundamental concept that simplifies the definition
of digital image concepts such as regions and boundaries. To establish if two
pixels are connected it must be determined if they are neighbors and if their gray
level satisfy the specified criterion of similarity. Connectivity between pixels is
used for establishing boundary of an object and components of region in an image.
If the pixels are adjacent in some sense and if their gray level are equal, then we
can connect the pixels.
Digital Image Fundamentals 1.43

Types of Connectivity
There are three types of connectivity they are
1. 4 - Connectivity
2. 8 - Connectivity
3. m - Connectivity
• 4 - Connectivity
Two pixels p and q with values from ‘V ’ are 4 connected if ‘q’ is in the set
N4 (p).
• 8 - Connectivity
Two pixels p and q with valued from ‘V ’ are 8 - connected if q is in the set
of N8 (p).
• m - Connectivity
Two pixels p and q with valued from ‘V ’ are 8 - connected if
(i) q is in the set of N4 (p) or
(ii) q is in ND (p) and the set N4 (p) ∩ N4 (q) is empty
1.7.4 Path or Curve
A digital path or curve from pixel ‘p’ to pixel ‘q’ is a sequence of distinct pixels.
If ‘p’ = ‘q’ then the path is closed path. A path between two pixels ‘p’ and ‘q’
with co-ordinates (x0 , y0 ) and (xn , yn ) respectively is a sequence of pixels with
co-ordinates (x0 , y0 ), (x1 , y1 ), (x2 , y2 ) · · · (xn , yn ). where (xi , yi ) is adjacent to
(xi + 1, yi + 1) for 1 ≤ i ≤ n.
Eg:

15 20 32
V = {20,32,40,50,}
40 50 70
C = {20.32.40}
100 45 60

Fig 1.41 Illustration of a digital path

If ‘p’ and ‘q’ are the pixels of an image of subset ‘S’ then ‘p’ is connected to
‘q’ in ‘s’, if there exists a path from ‘p’ to ‘q’ consisting entirely of pixels in S.
For any pixels ‘p’ in ‘S’, the set of pixels that are connected to it in ‘s’ is called a
connected component of S.
In the above Figure 1.41, consider the pixel arrangement with the set
V = {20, 32, 40, 50}. The center pixel 50, has the connected component C =
{20, 32, 40}.
1.44 Digital Image Processing

1.7.5 Regions and Boundaries


Let ‘R’ be a subset of pixels in an image we call ‘R’ a region of the image if ‘R’
is a connected set. The boundary (or) Contour (or) border of a region ‘R’ is the
set of pixels in the region that have one (or) more neighbors that are not in R.
If R (region) happens to be an entire image, then its boundary is defined as
the set of pixels in the first and last rows and columns of the image. This extra
definition is required because an image has no neighbors beyond its border. The
set of pixels within the region on the boundary are called inner border and the
corresponding pixels in the background are called outer border.

1.7.6 Edge
An edge is a local concept that is based on a measure of gray level discontinuity
of a point. Edges are formed by the pixels with derivative value that is higher than
a present threshold. Edge points can be linked to form edge segments and edge
segments are linked to form boundaries.

1.7.7 Distance Measures


Various distance measures are used to determine the distance between different
pixels some of the important distance measures are
• Euclidean distance
• D4 Distance (or) City block distance and
• D8 Distance (or) Chessboard distance

Conditions
Consider three pixels p, q and z with co-ordinates (x, y)(s, t) and (v, w) respec-
tively. Let D be the distance function which satisfies the following conditions,
• D(p, q) ≥ 0, [D(p, q) = 0; if p = q]
• D(p, q) = D(q, p) and
• D(p, z) ≤ D(p, q) + D(q, z)

Euclidean distance
The Euclidean distance between p & q is defined as,
1/2
De (p, q) = (x − s)2 + (y − t)2 (1.19)

p
(Or) De (p, q) = (x − s)2 + (y − t)2 (1.20)
Digital Image Fundamentals 1.45

D4 Distance (or) City Block distance

The city block distance between two pixels p & q is defined as.

D4 (p, q) = |x − s| + |y − t| (1.21)

In this case, the pixels having a D4 distance from (x, y) form a diamond centered
at (x, y).

Example
The pixels with D4 distance ≤ 2 from (x, y) ie, the center point form the
following contours of constant distance.

2
2 1 2
2 1 0 1 2
2 1 2
2

Fig 1.42 The pixels with D4 = 1 are the 4 neighbors of (x, y)

D8 distance (or) Chessboard distance

The D8 distance between p & q is defined as,

D8 (p, q) = max {|x − s| , |y − t|} (1.22)

In this case, the pixels with D8 distance from (x, y) form a square centered at
(x, y).
Eg: The pixels with D8 distance ≤ 2 from (x, y) i.e., the center point form
the following contours of constant distance

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

Fig 1.43 The pixels with D8 = 1 are the 8 - neighbors of (x, y )


1.46 Digital Image Processing

1.8 Applications of Digital Image Processing


As discussed earlier, Digital Image Processing refers to processing of digital im-
ages by means of a digital computer. Today, there is almost no area of technical
endeavor that is not impacted in some way by digital image processing. The ar-
eas of applications of digital image processing are so varied that this book is not
sufficient to capture the breadth of this field.
The amazing diversity of applications that make use of image processing or
analysis techniques has made image processing a interesting field of study. Al-
most every branch of science use recording devices or sensors to collect image
data from the universe around us and image processing techniques for further
manipulation. Although it is very difficult to include all the applications, the
few fields of application which utilize image processing techniques routinely are
shown in Figure 1.44.
SONAR
Surveillance Astronomy
Remote Sensing Artistic Images

Traffic Monitoring Robotics


Imaging and
Photography Image Electron Microscopy
Processing
Angiography Industrial Inspection

Nuclear Medicine Computerized Axial Tomography


Geological Exploration 3-D Modeling (CAT)
RADAR

Fig 1.44 Applications of Digital Image Processing

As observed from the figure the fields of application of digital image pro-
cessing is so varied that some form of organization is required to understand
the breadth of the field. Thus the applications are categorized according to their
source of energy.

1.9 Sources of Energy


The electromagnetic (EM) energy spectrum is the principal energy source for the
various images in use. Other commonly used energy sources for images are ultra-
sonic, acoustic, electronic and computers (for generating synthetic images).
Various energy sources for images in use are
1. EM Energy spectrum
Digital Image Fundamentals 1.47

2. Acoustic
3. Ultrasonic
4. Electronic and
5. Computers

1.9.1 EM energy spectrum

Fig 1.45 Electromagnetic Spectrum

Photographs, X-ray images, RADAR images and other most familiar images
are generated based on the radiation from the EM spectrum. EM waves can be
conceptualized as a stream of charged particles that travel at the speed of light.
Each charged particle contains a quantum of energy called photon. Figure 1.45
shows the Electromagnetic spectrum obtained when arranged according to the
energy per photon. The EM spectrum ranges from gamma rays (highest energy)
at one end to radio waves (lowest energy) at the other end.

Computer Imaging

Fig 1.46 Examples of Synthetic Images

Synthetic images are created using computer for artistic effects in films and
other multimedia applications. 3-D modeling is a more structured approach to
1.48 Digital Image Processing

image generation by computer and is used more dominantly in medical field. This
is an area that provides an important intersection between image processing and
computer graphics and is the basis for many 3-D visualization systems (e.g., flight
simulators). Figure 1.46 shows examples of computer - generated images. Since
the original object is created in 3-D, images can be generated in any perspective
from plane projections of the 3-D volume. Images of this type can be used for
medical training and for a host of other applications, such as criminal forensics
and special effects.
Table 1.2 summarizes the various applications of digital image processing
based on the source of energy used.
Table-1.2 Applications of Digital Image Processing
S.No. Source of Field of Application
Energy
1 Gamma Nuclear medicine, Astronomical observations,
Rays Positron Emission Tomography(PET).
2 X- rays Medical Diagnostics, Angiography, Computerized
Axial Tomography(CAT), Industrial Inspection, As-
tronomy
3 Ultraviolet Lithography, industrial inspection, microscopy,
Band LASERs, biological imaging, astronomical observa-
tions and Fluorescence microscopy
4 Visible and Remote sensing, photography, videography,
IR band light microscopy, multi spectral imaging (satel-
lites),automated visual inspection of manufactured
goods, traffic monitoring and surveillance
5 Microwave RADAR
band
6 Radio band Medicine (MRI) and Astronomy
7 Acoustics Geological exploration, industry and medicine
8 Ultrasound Medical diagnostics (Obstetrics)
9 Electronics Electron Microscope, Transmission Electron Micro-
scope(TEM), Scanning Electron Microscope(SEM)
10 Computer Synthetic images, artistic images,3-D modeling and
visualization

1.10 Introduction to Color Models


In this section a brief introduction to color fundamentals is presented following
which the colour models are discussed.
Digital Image Fundamentals 1.49

1.10.1 Color Fundamentals

The use of color in image processing is motivated by two principal factors. First,
color is a powerful descriptor that often simplifies object identification and ex-
traction from a scene. Second, humans can discern thousands of color shades and
intensities, compared to about only two dozen shades of gray. This second factor
is particularly important in manual image analysis.
Color image processing is divided into two major areas: full color and pseudo
color processing. In the first category, the images in question typically are ac-
quired with a full-color sensor, such as a color T.V. camera or color scanner.
In the second category the problem is one of assigning a color to a particular
monochrome intensity or range of intensities until recently, most digital color im-
age processing was done at the pseudo color level. However, in the past decade,
color sensors and hardware for processing color images have become available at
reasonable prices. The result is that full - color image processing techniques are
now used in a broad range of applications, including publishing, visualization and
the internet.
d
Infra re
Red
Orange
Yellow
Green
White light Blue
Violet
Optical Prism
Ultra violet
Fig 1.47 Color Spectrum

In 1666, Sir Isaac Newton discovered that when a beam of sunlight passes
through a glass prism, the emerging beam of light is not white but consists of a
continuous spectrum of colors ranging from violet at one end to red at the other as
shown in Figure 1.47. When viewed in full color, no color in the spectrum ends
abruptly, but rather each color blends smoothly into the next.
Basically the colors that humans and some other animals perceive in an object
are determined by the nature of the light reflected from the object. As illustrated in
Figure 1.48, visible light is composed of a relatively narrow band of frequencies
in the electromagnetic spectrum. A body that reflects light that is balanced in all
visible wavelengths appears white to the observer. However, a body that favors,
reflectance in a limited range of the visible spectrum exhibits some shades of
color. For example, green objects reflect light with wavelengths primarily in the
500 to 570nm range while absorbing most of the energy at other wavelengths.
1.50 Digital Image Processing

Gamma Infra Micro


X-Rays U-V TV Radio
Rays Red Waves
.001mm 1mm 10mm .0001ft .01ft 1ft 100ft
Ultra Violet Visible Spectrum Infra Red

300 400 500 600 700 1000 1500


Wavelength (NM)

Fig 1.48 Wave Length Comprising the Visible Range of Electromagnetic Spectrum

Characterization of light is central to the science of color. If the light is achro-


matic, its only attribute is its intensity, or amount. Achromatic light is what view-
ers see on a black and white television set, and it has been an implicit component
of image processing thus far the term gray level refers to a scalar measure of
intensity that ranges from black, to grays and finally to white.
Chromatic light spans the electromagnetic spectrum from approximately 400
to 700nm. Three basic quantities are used to describe the quality of a chromatic
light source: radiance, luminance, and brightness. Radiance is the total amount
of energy an observer perceives from a light source. For example light emitted
from a source operating in the far infrared region of the spectrum could have
significant energy but an observer would hardly perceive it; its luminance would
be almost zero. Brightness is a subjective descriptor that is practically impossible
to measure. It embodies the achromatic notion of intensity and is one of the key
factors in describing color sensation.
Detailed experimental evidence has established that the 6 to 7 million cones
in the human eye can be divided into three principal sensing categories, corre-
sponding roughly to red, green and blue. Approximately 65% of all cones are
sensitive to red light, 33% are sensitive to green light and only about 2% are
sensitive to blue. Figure 1.49 shows average experimental curves detailing the
absorption of light by the red, green, and blue cones in the eye. Due to these ab-
sorption characteristics of the human eye, colors are seen as variable combinations
of the so-called primary colors red (R), green(G) and blue (B). For the purpose of
standardization, the CIE, designated in 1931 the following specific wavelength
values to the three primary colors: blue = 435.8nm, green = 546.1nm, and
red = 700nm. This standard was set before the detailed experimental curves
shown in Figure 1.49 became available in 1965. Thus the CIE standards corre-
spond only approximately with experimental data.
The primary colors can be added to produce the secondary colors of light ma-
genta (red plus blue) cyan (green plus blue) and yellow (red plus green). Mixing
the three primaries or a secondary with its opposite primary color, in the right
Digital Image Fundamentals 1.51

445nm 535nm 575nm

Absorption (arbitrary units)


Blue Green Red

400 450 500 550 600 650 700 nm

Yellowish Green
Green

Red
Blue Green
Blue

Orange

Orange
Raddish
Yellow
Bluish purple

Purplish blue

Fig 1.49

intensities produces white light. This result is shown in Figure 1.50 which also il-
lustrates the three primary colors and their combinations to produce the secondary
colors.

Mixture of light Mixture of Pigments


(Additive primaries) (Subtractive primaries)

Green
Yellow

yellow Cyan Red Green

White Black
Blue
Cyan
Magenta Magenta Blue
Red

Primary and secondary colors of light and pigment

Fig 1.50 Primary and Secondary colors of light and pigments

Differentiating between the primary colors of light and the primary colors of
pigments or colorants is important. A primary color is defined as one that absorbs
a primary color of light and reflects the other two colors. Therefore, the primary
colors of pigments are magenta, cyan, and yellow, and the secondary colors are
red, green and blue. These colors are shown in Figure 1.50. A proper combination
of the three pigment primaries, or a secondary with its opposite primary, produces
black.
1.52 Digital Image Processing

Color television reception is an example of the additive nature of light colors.


The interior of CRT (cathode ray tube) color TV screens is composed of a large
array of triangular dot patterns of electron sensitive phosphor. When excited, each
dot in a triad produces light in one of the primary colors.

1.10.2 Color Models


The purpose of a color model (also called color space on color system) is to fa-
cilitate the specification of colors in some standard, generally accepted way. In
essence, a color model is a specification of a coordinate system and a subspace
within that system where each color is represented by a single point.
Most color models in use today are oriented either toward hardware (such as
for color monitors and printers) or toward application where color manipulation
is a goal (such as in the creation of color graphics for animation).
The most commonly used color models are

• RGB color model


• CMY/CMYK color model
• HSI color model

In terms of digital image processing, the hardware -oriented models most com-
monly used in practice are the RGB (red green blue) model for color monitors
and a broad class of color video cameras, the CMY (cyan, magenta, yellow) and
CMYK (cyan, magenta, yellow, black) models for color printing, and the HSI
(hue, saturation, intensity) model, which corresponds closely with the way hu-
mans describe and interpret color. The HSI model also has the advantage that it
decouples the color and gray-scale information in an image, making it suitable for
many of the gray-scale techniques.

1.10.2.1 RGB Color Model


In the RGB model, each color appears in its primary spectral components of red,
green and blue. This model is based on a cartesian coordinate system. The color
subspace of interest is the cube shown in Figure 1.51 in which RGB primary
values are at three corners; the secondary colors cyan, magenta, and yellow are
three other corners, black is at the origin; and white is at the corner farthest from
the origin. In this model, the gray scale (points of equal RGB values) extends from
black to white along the line joining these two points. The different colors in this
model are points on or inside the cube, and are defined by vectors extending from
the origin. For convenience, the assumption is that all color values have been
Digital Image Fundamentals 1.53

normalized so that the cube shown in Figure 1.51 is the unit cube. That is, all
values of R,G, and B are assumed to be in the range [0,1].

(0,01)
Blue
Cyan

Magenta White

Gray Scale (0,1,0)


Black G
Green
(1,0,0)
Red Yellow

Fig 1.51 RGB Colour Cube

Points along the main diagonal have gray values, from black at the origin to
white at point (1,1,1).
Images represented in the RGB color model consist of three component im-
ages, one for each primary color. When fed into an RGB monitor, these three
images combine on the screen to produce a composite color image, as explained.
The number of bits used to represent each pixel in RGB space is called the pixel
depth. Consider an RGB image in which each of the red, green, and blue images
is an 8-bit image. Under these conditions each RGB color pixels [that is,a triplet
of values (R,G,B)] is said to have a depth of 24-bits. (3 image planes times the
number of bits per plane). The term full color image is used often to denote a
24-bit RGB color image. The total number of colors in a 24-bit RGB image is
(28 )3 = 16, 777, 216 colors.

Red

Color RGB Color


Green
Monitor Image

Blue

Fig 1.52 Generating the RGB color image


1.54 Digital Image Processing

The RGB color cube is a solid cube composed of the (28 )3 = 16, 777, 216
colors mentioned in the preceding paragraph. Figure 1.52 shows that an image
of the cross - sectional plane is viewed simply by feeding the three individual
component images into a color monitor. In the component images, 0 represents
black and 255 represents white (note that these are gray scale images).
It is of interest to note that acquiring a color image is basically the process
shown in Figure 1.52 in reverse. A color image can be acquired by using three
filters, sensitive to red, green and blue, respectively. When we view a color scene
with a monochrome camera equipped with one of these filters, the result is a
monochrome image whose intensity is proportional to the response of that filter.
Repeating this process with each filter produces three monochrome images that
are the RGB component images of the color scene. (In practice, RGB color image
sensors usually integrate this process into a single devices). Clearly, displaying
these three RGB component images in the form shown in Figure 1.52 would yield
an RGB color rendition of the original color scene.
While high end display cards and monitors provide a reasonable rendition of
the colors in a 24-bit RGB image, many systems in use today are limited to 256
colors. Also, there are numerous applications in which it simply makes no sense
to use more than a few hundred, and sometimes fewer, colors. A good example of
this is provided by the pseudocolor image processing techniques discussed. Given
the variety of systems in current use, it is of considerable interest to have a subset
of colors that are likely to be reproduced faithfully, reasonably independently of
viewer hardware capabilities. This subset of colors is called the set of safe RGB
colors, or the set of all - systems - safe colors. In internet applications, they are
called safe Web colors or safe browser colors.
On the assumption that 256 colors is the minimum number of colors that can
be reproduced faithfully by any system in which a desired result is likely to be
displayed, it is useful to have an accepted standard notation to refer to these color.
Forty of these 256 colors are known to be processed differently by various oper-
ating systems, leaving only 216 colors that are common to most systems. These
216 colors have become the defact standard for safe colors, especially in Internet
applications.
Number System Color Equivalents
Hex 00 33 66 99 CC FF
Decimal 0 51 102 153 204 255
Table 1.3 Valid values of each RGB component in a safe color
Each of the 216 safe colors is formed from three RGB values as before, but
each value can only be 0, 51,102,153,204 or 255. Thus RGB triplets of these
values give us (6)3 = 216 possible value (note that all values are divisible by 3).
Digital Image Fundamentals 1.55

It is customary to express these values in the hexagonal number system, as shown


in Table (1.3).
Since it takes three numbers to form an RGB color, each safe color is formed
from three of the two digit hex numbers in Table(1.3). For example, the purest
red is FF0000. The values 000000 and FFFFFF represent black and white respec-
tively. For instance, the brightest red in decimal notation has R = 255 (FF) and G
= B = 0.

Fig 1.53 The RGB Safe Colour Cube

Figure 1.53 shows the 216 safe colors, organised in a cube. The square in the
top left array has value FFFFFF (white), the second square to its right has value
FFFFCC, the third square has value FFFF99, and so on for the first row. The
second row of that same array has values FFCCFF, FFCCCC, FFCC99, and so
on. The final square of that array has value FF0000(the brightest possible red).
The second array to the right of the one just examined starts with value. CCFFFF
and proceeds in the same manner, as do the other remaining four arrays. The final
(bottom right) square of the last array has value 000000 (black). It is important to
note that not all possible 8 bit gray colors are included in the 216 safe colors.
Figure 1.53 shows the RGB safe - color cube. Unlike the full - color cube
which is solid, the cube in Figure 1.53 has valid colors only on the surface planes.
As shown in Figure 1.53, each plane has a total of 36 colors, so the entire surface
of the safe - color cube is covered by 216 different colors, as expected.

1.10.2.2 The CMY and CMYK color Models


Cyan, magenta and yellow are the secondary colors of light or, alternatively, the
primary colors of pigments, For example, when a surface coated with cyan pig-
ment is illuminated with white light, no red light is reflected from the surface.
That is cyan subtracts red light from reflected white light.
Most devices that deposit colored pigments on paper, such as color printers
and copiers, required CMY data input or perform an RGB to CMY conversion
internally. This conversion is performed using the simple operation.
1.56 Digital Image Processing
     
C 1 R
 M = 1 − G  (1.23)
Y 1 B

where again, the assumption is that all color values have been normalized to the
range[0,1]. Eq(1.23) demonstrates that light reflected from a surface coated with
pure cyan does not contain red (that is, C = 1−R in the equation). Similarly, pure
magenta does not reflect green, and pure yellow does not reflect blue. Equation
(1.23) also reveals that RGB values can be obtained easily from a set of CMY
values by subtracting the individual CMY values from 1. As indicated earlier, in
image processing this color model is used in connection with generating hard copy
output, so the inverse operation from CMY to RGB generally is of little practical
interest.
According to Figure 1.50, equal amounts of the pigments, cyan, magenta, and
yellow should produce black. In practice, combining these colors for printing
produces a muddy looking black. So, in order to produce true black (which is the
predominant color in printing) a fourth color, black, is added, giving rise to the
CMYK color model. Thus when publishers talk about “four - color printing,” they
are referring to the three colors of the CMY color model plus black.

1.10.2.3 The HSI Color Model

As we have seen, creating colors in the RGB and CMY models and changing from
one model to the other is a straight forward process. As noted earlier, these color
systems are ideally suited for hardware implementations. In addition, the RGB
system matches nicely with the fact that the human eye is strongly perceptive to
red, green and blue primaries. Unfortunately, the RGB, CMY and other similar
color models are not well suited for describing colors in terms that are practical
for human interpretation. For example, one does not refer to the color of an au-
tomobile by giving the percentage of each of the primaries composing its color.
Further more, we do not think of color images as being composed of three primary
images that combine to form that single image.
When humans view a color object, we describe it by its hue, saturation, and
brightness. Recall from the discussion that hue is color attribute that describes
a pure color (pure yellow, orange, or red). Whereas saturation gives a measure
of the degree to which a pure color is diluted by white light. Brightness is a
subjective descriptor that is practically impossible to measure. It embodies the
achromatic notation of intensity and is one of the key factors in describing color
sensation. Thus HSI (Hue, Saturation, Intensity) color model an ideal tool for de-
veloping image processing algorithms based on color descriptions that are natural
and intuitive to humans.
Digital Image Fundamentals 1.57

White
I=0.75

Green
n Yel
Cya lo w
I=0.5 Blue I
Red
Blue Magenta

Black

Fig 1.54 HSI color model

Intensity

Intensity value can be easily extracted from the RGB image. This is done by
making the RGB cube stand on the black (0,0,0) vertex with the white (1,1,1)
vertex diversity above it, as shown in Figure 1.55. In this figure the line joining
the black and white vertices is called the intensity axis.
Thus, to determine the intensity component of any color, simply pass a plane
perpendicular to the intensity axis containing the color. The point at which the
plane intersects the intensity axis will give the intensity value in the range [0,1].

Saturation

From the Figure 1.55, it is clear that, as the planes move up and down the intensity
axis, the boundaries defined by the intersection of each plane with the faces of the
cube will have either a triangular or hexagonal shape, as shown in Figure 1.55. In
the hexagon, the primary colors are separated by 120 ◦ . The secondary colors are
60◦ from the primaries.
Consider an arbitrary color point inside the triangle shown as a dot. For this
color point, the saturation is the length of the vector from the origin to the color
point.

Hue

The Hue of a color point is determined as follows. The red axis is selected as the
reference axis. The angle ‘H’ made by the color point with the red axis represents
the Hue value.
1.58 Digital Image Processing

Thus the three important components of HSI color space are


(i) The intensity value ‘I’.
(ii) The length of the vector ‘S’ from the origin to the color point.
(iii) The angle ‘H’ between the vector and red axis representing the Hue.

Fig 1.55 Hue and Saturation in HSI color model

Converting colors from RGB to HSI


Given an image in RGB color format, the H component of each RGB pixel is
obtained using the equation.
if B 6 G

θ
H= (1.24)
360 − θ if B > G

with
 
 1 
 [(R − G) + (R − B)]
2

θ = cos−1 h i1/2  (1.25)
 (R − G)2 + (R − B) (G − B)
 

The saturation component is given by


3
S =1− [min (R, G, B)] (1.26)
(R + G + B)
Finally, intensity component is given by
Digital Image Fundamentals 1.59

1
I= (R + G + B) (1.27)
3
It is assumed that the RGB values have been normalized to the range [0,1] and
that angle θ is measured with respect to the red axis of the HSI space, as indicated
in Figure 1.54. Hue can be normalized to the range [0,1] by dividing the values
resulting from Eq(1.24) by 360◦ . The other two HSI components already are in
this range if the given RGB values are in the interval [0,1].

Converting colors from HSI to RGB


Given values of HSI in the interval [0,1], we now want to find the corresponding
RGB values in the same range. The applicable equations depend on the values of
H. There are three sectors of interest, corresponding to the 120 ◦ intervals in the
seperation of primaries. We begin by multiplying H by 360 ◦ , which returns the
hue to its original range of [0◦ , 360◦ ].
RG sector (0◦ ≤ H ≤ 120◦ ): When H is this sector, the RGB components
are given by the equations.
B = I(1 − S) (1.28)
 
S cos H
R=I 1+ (1.29)
cos(60◦ − H)
and
G = 3I − (R + B) (1.30)

GB sector (120◦ ≤ H ≤ 240◦ ): If the given value of H is in this sector, we first


subtract 120◦ from it:
H = H − 120◦ (1.31)

Then the RGB components are


R = I(1 − S) (1.32)
 
S cos H
G=I 1+ (1.33)
cos(60◦ − H)
and
B = 3I − (R + G) (1.34)

BR sector (240◦ ≤ H ≤ 360◦ ): Finally, if H is in this range, we subtract 240◦


from it.
H = H − 240◦ (1.35)
1.60 Digital Image Processing

Then the RGB components are


G = I(1 − S) (1.36)
 
S cos H
B =I 1+ (1.37)
cos(60◦ − H)
and
R = 3I − (G + B) (1.38)

Problems
Problem 1.1
Let V = {0, 1} compute D4 , D8 and De distance between p & q.
y
1(q) 1 2 3

0 2 2 1

1 1 0 2

2 1 2 1(p)
x

Fig 1.56

Solution
The Euclidean distance ‘De ’ is calculated from the coordinates of p & q. the
coordinates of ‘p’ are (3,3) & the coordinates of ‘q’ are (0,0)
1. Euclidian distance ‘De ’ = (x − s)2 + (y − t)2
p
p
= (0 − 3)2 + (0 − 3)2
p
= (3)2 + (3)2

= 9+9

= 18

=3 2
2. D4 Distance
D4 = |(x − s)| + |(y − t)|
D4 = |(0 − 3)| + |(0 − 3)|
D4 = 6
3. D8 Distance
D8 = max [|x − s| , |y − t|]
D8 = max [|0 − 3| , |0 − 3|]
Digital Image Fundamentals 1.61

D8 = max(3, 3)
D8 = 3

Problem 1.2
Consider two image subsets S1 and S2
S1 S2
0 0 0 0 0 0 0 0 2 2

2 0 0 2 0 0 2 0 0 2

2 0 2 0 2 2 0 0 0
q
0 0 2 2 p 2 0 0 0 0 0

0 0 2 2 2 0 0 2 2 2

Fig 1.57

For V = {2}, determine whether S1 and S2 are a) 4 - Connected


b) 8 - Connected c) m - connected
Solution
V = {2}, To check two image subsets are connected or not consider the
boundary pixel. A long the boundary only two pixels marked p and q are having
values 2.
Consider p and q,
• S1 and S2 are not 4 - Connected because q is not in the set of N4 (p).
• S1 and S2 are eight connected because q is in the set of N8 (p)
• S1 and S2 are m-connected because
(i) q is in the set ND (p) and (ii) The set N4 (p) ∩ N4 (q) is empty

Problem 1.3
Find out D4 and D8 of 5 × 5 image given in Figure 1.58.

3 2 4 3 1q

0 4 4 3 2

2 2 2 0 2

2 2 1 1 1

p 1 0 1 0 3

Fig 1.58
1.62 Digital Image Processing

Solution
p(x1 , y1 ) = p(4, 0)
q(x2 , y2 ) = q(0, 4)

1. D4 (p, q) = |x1 − x2 | + |y1 − y2 |


= |x1 − x2 | + |y1 − y2 |
= |4 − 0| + |0 − 4|
=4+4=8

2. D8 (p, q) = max {|x1 − x2 | , |y1 − y2 |}


= max {|4 − 0| , |0 − 4|}
= max(4, 4) = 4

Problem 1.4
Consider the image segment shown below for V = 0, 1, compute the length of the
shortest m path between p and q.

3 1 2 1(q)
2 2 0 2
1 2 1 1
1(p) 0 1 2
Solution
The path taken from the image segment is equal to 5.

3 1 2 1

2 2 0 2

1 2 1 1

1 0 1 2

Fig 1.59
Digital Image Fundamentals 1.63

Problem 1.5
Consider an observer looking at a lamp post which is at a distance of 50m. If the
height of the lamp post is 10m find the size of the image in the retina, if the focal
length is 17mm.

10m

50m 17mm
Fig 1.60

Solution
10 r
=
50 17
10
r= × 17
50
r = 3.4mm

Therefore the height of the retinal image is 3.4mm.

Problem 1.6
Consider the image subsets S1 and S2 given below for V = 4, determine whether
S1 and S2 are
a. 4 - Connected b. 8 - Connected c. m - Connected
S1 S2
2 2 2 2 2 2 2 4 4 2

4 2 2 4 2 2 4 2 2

4 2 2 4 2 4 4 2 2 2

2 2 4 4 4 2 2 2 2 2

2 2 4 4 4 2 2 4 4 4

Fig 1.61

Solution

1. S1 and S2 are not 4 - connected because q is not in the set of N4 (p).


1.64 Digital Image Processing

2. S1 and S2 are 8 - connected because q is in the set of N8 (p).


3. S1 and S2 are m - connected because
i. q is in the set of ND (p) and ii. The set N4 (p) ∩ N4 (q) is empty.

Problem 1.7
A 4 × 4 sub image is shown in below Figure (1.62). Let V = 2, 4 and compute
the D4 , D8 and Dm distance between p and q.

y
4 2 2(p) 3

4 3 2 1

1 2 2 0

2(q) 3 1 0
x

Fig 1.62

The coordinates of p are (0,2)


The coordinates of q are (3,0)
D4 = |x1 − x2 | + |y1 − y2 |
D4 = |0 − 3| + |2 − 0|
D4 = 3 + 2 = 5
D8 = max |x1 − x2 | + |y1 − y2 |
D8 = max{3, 2}
D8 = 3
De = (x1 − x2)2 + (y1 − y2)2
De = (−3)2 + (2)2
De = 13

Short Questions and Answers


1. Define image.
An image may be defined as two dimensional light intensity function f (x, y)
where x and y denote spatial co-ordinate and the amplitude or value of ’f ’
at any point (x, y) is called intensity or gray scale or brightness of the image
at that point.
Digital Image Fundamentals 1.65

2. What is a digital image?


An image may be defined as two dimensional light intensity function f (x, y)
where x and y denote spatial co-ordinate and the amplitude or value of ‘f ’
at any point (x, y) is called intensity or grayscale or brightness of the im-
age at that point. When x, y and the amplitude values of ‘f ’ are all finite
discrete quantities it is called a digital image.
3. What is a pixel?
A digital image is composed of a finite number of elements, each of which
has a particular location and value. These elements are referred to as picture
elements, image elements, pels or pixels.
4. What are the applications of digital image processing?
Digital image processing is applied in the following fields

• Remote sensing via satellite and spacecrafts


• RADAR and SONAR
• Biomedical applications-ECG,EEG,EMG etc.,
• Robotics
• Military applications
• Astronomy etc.,
5. What are the steps involved in DIP?

• Image Acquisition
• Image enhancement and restoration
• Segmentation
• Color image processing
• Morphological processing
• Representation and Description
• Recognition and Interpretation
• Image compression.
6. What is morphological processing?
Morphological processing deals with tools for extracting image components
that are useful in the representation and description of shape.
7. Specify the elements of DIP system.

• Image Sensors
• Specialized image processing hardware
• Image processing software
• Computer
1.66 Digital Image Processing

• Mass storage
• Image displays
8. Explain the types of digital storage.

• Short term storage for use during processing , ex: computer memory,
frame buffers etc.,
• Online storage for relatively fast recall, ex: Magnetic disks or optical
media storage
• Archival storage for rare access, ex : Magnetic tapes, juke boxes.
9. What are the membranes that enclose the eye?

• The cornea and sclera


• The choroid and
• The retina
10. What are the types of light receptors present in human eye?

• Cones and
• Rods
11. Define brightness (or) subjective brightness.
Brightness is a subjective descriptor that is practically impossible to mea-
sure. Subjective brightness of an object is the luminance or intensity as
perceived by the Human Visual System(HVS).
12. What is brightness adaptation?
HVS (Human Visual System) cannot operate over a large range of bright-
ness simultaneously. Rather to accomplishes this large variation by changes
in its overall sensitivity, this phenomenon is known as brightness adapta-
tion.
13. Differentiate photopic and scotopic vision. (or) Differentiate cones and
rods.

Photopic Vision (Cones) Scotopic Vision (Rods)


Cones are responsible for pho- Rods are responsible for scotopic
topic or bright light vision or dim light vision
6 to 7 million cones are present in 75 to 150 million rods are present
each eye. in each eye.
Each cone is connected to its own Several rods are connected to a
nerve end which helps to resolve single nerve hence the amount of
fine details details discernible is less.
Digital Image Fundamentals 1.67

14. Define weber ratio.


∆Ic
Weber Ratio =
I
Where ∆Ic is the increment of illumination discriminable 50% of the time
with the background illumination I.
If the ratio is small it means good brightness adaptation, and large value of
the ratio represents poor brightness discrimination
15. What is mach band effect?

Actual intensity

Perceived intensity

Fig 1.63

It is based on the fact that Human Visual System tends to overshoot or


undershoot around the boundary of regions of different intensities.
As shown above, although, the intensity of the stripes is constant, HVS
perceive a brightness pattern that is strongly scalloped, especially near the
boundaries. These seemingly scalloped bands are called Mach Band after
Ernst Mach(1865).
16. What is simultaneous contrast?
This phenomenon is related to the fact that a region’s perceived brightness
does not depend simply on its intensity. However, they appear to become
darker as the background gets lighter.
17. Define radiance and luminance.
Radiance is the total amount of energy that flows from the light source and
is usually measured in Watts (W ).
Luminance gives a measure of the amount of energy an observer perceives
from a light source, unit is lumens (lm).
1.68 Digital Image Processing

Fig 1.64

18. Define hue, saturation and contrast.


Hue represents dominant color as perceived by an observer.
Saturation refers to relative purity or the amount of white light mixed with
a hue.
Contrast is defined as the difference in intensity between the highest and
lowest intensity levels in an image.
19. What is pseudo-color image processing?
It is the method in which to a particular monochrome intensity or range of
intensities a color is assigned and processed. Thus in pseudo color image
processing, full colors are not used.
20. What are the primary colors and secondary colors?
Primary colors - Red,Green,Blue
Secondary Colors - Cyan,Magenta, Yellow
21. Define chromaticity.
Hue and saturation together is known as chromaticity.
22. What are tristimulus values?
The amounts of Red,Green and Blue required to form any particular color
are called the tristimulus values and are denoted by X, Y and Z.
23. What do you mean by color model?
A color model is a specification of 3D-coordinates system and a subspace
with in that system where each color is represented by a single point.
24. List the hardware oriented color models and their applications.

• RGB model— used for color monitor and color video camera
• CMY/CMYK model—used for color printing
• HSI model—-used for color image processing
• YIQ model—used for color picture transmission
Digital Image Fundamentals 1.69

25. What is dynamic range?


It is the ratio of maximum measurable intensity to the minimum detectable
intensity i.e., the range of values spanned by the gray scale. Image will have
high contrast, if the dynamic range is high and image will have dull washed
out gray look if the dynamic range is low.
26. Define resolutions.
Resolution is defined as the smallest number of discernible detail in an
image.
Spatial resolution is the smallest discernible detail in an image, unit is line
pairs /unit distance, dots per unit distance or dpi(dots per inch)
Gray level resolution or Intensity resolution refers to the smallest dis-
cernible change is gray level.
27. What is meant by illumination and reflectance?
Illumination is the amount of source light incident on the scene. It is rep-
resented as i(x, y).
Reflectance is the amount of light reflected by the object in the scene. It is
represented by r(x, y).
28. Define sampling and quantization.
Sampling means digitizing the co-ordinate value (x, y) of the image. Sam-
pling is the primary factor that determines the spatial resolution of the im-
age.
Quantization means digitizing the amplitude value of the image. Quanti-
zation is the primary factor that determines the gray level resolution of the
image.
29. What do you mean by gray level?
Gray level refers to a scalar measure of intensity that ranges from black to
gray and finally to white.
30. Write the expression to find the number of bits to store a digital image?
The number of bits required to store a digital image is
b=M ×N ×k
Where M × N , refers to the size of the image and k refers to the number of
bits per pixel.
When M = N , this equation becomes
b = N 2k
1.70 Digital Image Processing

31. Find the number of bits required to store a 256 × 256 image with 32
gray levels.
Given : 32 gray levels (i.e., L = 32)
L = 2k = 32, therefore k = 5 bits
256 ∗ 256 ∗ 5 = 3, 27, 680 bits.
32. What do you meant by Zooming and shrinking of digital images?
Zooming may be viewed as over sampling. It involves the creation of new
pixel locations and the assignment of gray levels to those new locations.
Shrinking may be viewed as under sampling. To shrink an image by one
half, we delete every alternate row and column.
33. Define N4 (p).
A pixel p at coordinates (x, y) has four horizontal and vertical neighbors
whose coordinates are given by (x + 1, y), (x − 1, y), (x, y + 1), (x, y − 1).
This set of pixels are called 4-neighbors of p denoted by N 4 (p).

Fig 1.65 4 Neighbors; the set of Horizontal and Vertical Neighbors

34. Define ND (P ).
The four diagonal neighbors of p have coordinates (x + 1, y + 1),
(x + 1, y − 1), (x − 1, y + 1), (x − 1, y − 1) and are denoted by N D (p).

Fig 1.66 Diagonal Neighbors; the set of 4 Diagonal Neighbors

35. Define N8 (p).


Diagonal neighbors together with the 4-neighbors are called 8-neighbors of
p, denoted by N8 (p). Some of the points in ND (p) and N8 (p) fall outside
the image if f (x, y) is on the border of the image if f (x, y) is on the border
Digital Image Fundamentals 1.71

of the image. Eight neighbors is non-uniform distance from P . Effectively


we have N8 (p) = N4 (p) + ND (p).

Fig 1.67 Eight neighbors


36. What are the types of adjacency and define them.
Three types of adjacency:

• 4 -adjacency
• 8-adjacency
• m-adjacency

4-adjacency :Two pixels p and q are 4- adjacent if q is in the set N 4 (p).


8-adjacency: Two pixels p and q are 8- adjacent if q is in the set N 8 (p).
m-adjacency: Let V be the set of gray level values used to define adja-
cency.
Two pixels p and q with values from V are said to m-adjacent if

(a) q is in N4 (p) (or)


(b) q is in ND (P ) and the set N4 (p) ∩ N4 (q) has no pixels whose values
are from V .
37. Define connectivity and explain their types.
Two pixels are said to be connected if

(a) They are neighbors and


(b) Their gray levels satisfy a specified criterion of similarity

Types of connectivity.

(a) 4 connectivity
(b) 8 connectivity
(c) m-connectivity (mixed connectivity)
38. What is meant by path or curve ?
A digital path or curve from pixel p to pixel q is a sequence of distinct
pixels.If p = q then the path is closed path.
1.72 Digital Image Processing

39. Give the formula for calculating euclidean distance, D4 (city block dis-
tance), D8 (chess board distance).
Consider two pixels p, q with co-ordinates (x, y) and (s, t) respectively,
three types of distances are defined as
Euclidean distance, De (p, q) = (x − s) + (y − t)
p

City block distance, D4 (p, q) = |x − s| + |y − t|


Chess board distance, D8 (p, q) = max(|x − s|, |y − t|).
40. What is moire pattern (or) How is aliasing defined with respect to im-
ages?

Fig 1.68

If the two dimensional function (i.e., the image) is under sampled then a
phenomenon called aliasing corrupts the sampled images. The corruption
is in the form of additional frequency components being introduced into
the sampling function. These are called aliasing frequencies. The effect of
aliased frequencies can be seen in the form of ‘Moire Patterns’ as shown in
Figure 1.65.
41. What is false contouring?
If the number of quantization levels is not sufficient a phenomenon called
false contouring becomes visible. When groups of neighboring pixels are
quantized to the same value, regions of constant gray levels are formed,
whose boundaries are called contours.
42. How to overcome the effect of false contouring?
False contouring can be held below the level of visibility by using the fol-
lowing two methods.
1. Contrast quantisation 2. Pseudorandom quantisation (Dither).
43. What is dither (pseudorandom quantisation)?
Dither is a method used to reduce the effect of false contouring. A small
amount of uniformly distributed pseudorandom noise is added to the lu-
Digital Image Fundamentals 1.73

minance samples before quantization. This pseudorandom noise is called


dither.
44. Define checkerboard effect.
Checkerboard pattern or effect is a degradation that results due to the re-
duction is spatial resolution. When lower resolution images are replicated
to larger size, the pixel values are replicated to fill the display area leading
to checkerboard effect.
45. What is a Micro densitometers?
Micro densitometer is mechanical digitizer used for acquiring 2-D image.
Micro densitometers use a flat bed, with the sensor moving in two linear
directions.

Review Questions
1. Explain the steps involved in digital image processing. (OR) Explain vari-
ous functional blocks of digital image processing.
2. Describe the elements of visual perception and image formation in the eye.
3. With necessary diagrams explain sampling and quantization. (OR) with
necessary diagrams explain how an analog image is converted into digital
image.
4. Describe the components of digital image processing system with neat dia-
gram.
5. What are the elements of an image processing system and describe its work-
ing? How this is used for weather forecasting applications?
6. Explain the basic relationships between pixels?
7. What is a color model? What are its types? Explain RGB and HSI color
models with necessary diagrams.
8. Explain digital camera working principle.
9. With necessary diagram explain the construction and principle of operation
of a vidicon camera tube.
10. What is a frame buffer ? Discuss the categories of digital storage for image
processing applications.
11. What is meant by the image sensing? Explain in detail the construction and
operation of various image sensing and acquisition devices.

You might also like