Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
N.SREEKANTH., K.S.R.M.C.E 1
3. Color Images
A color image records both the brightness and color of each pixel i.e. for
each pixel in an image it records the contents of Red, contents of Green and
contents of Blue.
The way of storing the data is dependent on the data structure that we
define. For example, in JPEG images it is different and in BMP it might be some
other way. But here our main point is that it records three colors bright nesses (i.e.
Red, Green, Blue).
The data structure can be in any of the following:
5 5 5 5 5 3 3 3 3 3 7 7 7 7 7
6 7 7 7 7 3 3 6 6 6 7 7 2 2 2
7 8 8 8 8 6 6 6 7 7 2 2 2 2 1
9 9 9 9 9 7 7 7 9 9 1 1 1 1 6
9 9 9 9 9 9 9 9 9 9 6 6 6 6 6
OR
R G B R G B …………..
5 5 5 5 5 3 3 3 3 3 7 7 7 7 7
6 7 7 7 7 3 3 6 6 6 7 7 2 2 2
7 8 8 8 8 6 6 6 7 7 2 2 2 2 1
9 9 9 9 9 7 7 7 9 9 1 1 1 1 6
9 9 9 9 9 9 9 9 9 9 6 6 6 6 6
So, we can say that, if we scan an image and save that as a monochrome
image, which takes 100KB of memory, will occupy 300KB if we save that as a
color image, each 100KB for each of R, G, B.
N.SREEKANTH., K.S.R.M.C.E 2
IV. Image Processing Applications:
Space applications are like getting the image of moon and other stars and
applying some algorithm on it. The first image of the moon was taken by “Ranger
7” on July 31,1964.
The computerized axial tomography(CAT) also called computerized
tomography(CT) is one of the important events in the application of image
processing in medical diagnosis, which was invented in early 1970’s.
Computer procedures are used to enhance the contrast, and can code the
intensity levels into color. Geography uses the same or similar techniques to study
pollution patterns from aerial and satellite imagery.
In Archeology, image-processing methods have successfully restored
blurred pictures that were the only available records of rare artifacts lost or
damaged after being photographed. (‘Ayodhya’ Digging).
V. Some definitions:
Pixel / Picture Element / Pel: The smallest individual part of an image, which
can be assigned a single brightness or color, is known as “Pixel”.
Resolution: This may refer to the screen size, i.e. the number of horizontal and
vertical pixels, or to the number of bits that are used to represent each pixel, giving
the number of gray levels or color levels.
(OR)
N.SREEKANTH., K.S.R.M.C.E 3
A measure of how accurately a sampled image represents the actual scene.
Resolution can be used as a spatial measure or as an indicator of how faithfully
brightness or color is represented.
This organization is summarized in Fig.3 Note that the diagram does not imply
that every process is applied to an image. Here, the intention is to convey an idea
of all the methodologies that can be applied to images for different purpose and
possible with different objectives.
ii) Image enhancement is the simplest and most appealing areas of digital image
processing. Basically, the idea behind enhancement technique is to bring out detail
that is obscured, or simply to highlight certain features of interest in an image.
Ex:- to increase the contrast of an image, “so that it looks better “
iii) Image restoration is also deals with improving the appearance of an image.
However, unlike enhancement, which is subjective, image restoration in objectives
in the sense, that restoration technique tends to be based on mathematical or
probabilistic models of image degradation. Enhancement, on the other hand, is
based on human subjective preferences regarding what constitutes a good
enhancement result.
iv) Color Image Processing It is an area that has been gaining in importance
because of the significant increase in the use of digital images over internet. There
are number of other standards such as RGB, CMY, HSI, and HLS and so on.
N.SREEKANTH., K.S.R.M.C.E 4
v) Wavelets: is the foundation for representing images in various degrees of
resolution. Although the Fourier transform has been the mainstay of transform
based image processing since the late 1950’s, a more recent transformation, called
the “Wavelet Transform” is now making it even easier to compress, transmit and
analyze many images. Unlike the Fourier transform, whose basic functions are
sinusoids, wavelet transform are based on small waves called “wavelets” of
varying frequency and limited duration.
x). Recognition is the process that assign a label (ex: a car, a scooter) to an object
based on its description.
N.SREEKANTH., K.S.R.M.C.E 5
bmp image jpeg image
Fig. 6
N.SREEKANTH., K.S.R.M.C.E 6
The elements of a general purpose system capable of performing the image
processing operations is shown in Fig.6.This type of system generally performs
image acquisition, image storage, image processing, communication and
image display.
Image Acquisition:
Two elements are required to acquire digital images. The first is a physical
device that is sensitive to a band in the electromagnetic energy spectrum (such as
x-ray, ultraviolet, visible or infrared bands) and that produces an electrical signal
output proportional to the level of energy scanned. The second, called a digitizer,
is a device for converting the electrical output of the physical sensing device into
digital form.
The different image acquisition equipments are video, scanners etc as
shown in Fig.2 . Although the various devices used for image acquisition vary
greatly in precision, speed and cost, many of the principles on which they operate
are common to them all. Fig.7 illustrates the general arrangement of a digitization
system, which is shown below.
Storage:
An 8-bit image of size 1024X1024 pixels requires one million bytes of
storage. Thus, providing adequate storage is usually a challenge in the design of
image processing system. Digital storage for image processing applications falls
N.SREEKANTH., K.S.R.M.C.E 7
into three categories: i. Short-term storage for use during processing. ii. Online
storage for relatively fast recall, and iii. Archival storage, characterized by
infrequent access. Storage is measured in bytes (8-bits), Kbytes, MB,GB and
TB(Tera bytes).
One method of providing short term storage is computer memory. Another
is by specialized boards, called frame buffers, that store one or more images and
can accessed rapidly, usually at video rates (30 complete images per second).On-
line storage generally takes the form of magnetic disks. Finally, archival storage is
characterized by massive storage requirements, but infrequent need for access.
Magnetic tapes and optical disks are the usual media for archival applications.
Processing:
Processing of digital images involves procedures that are usually expressed
in algorithmic form. Thus, with the exception of image acquisition and display,
most image processing functions can be implemented in software. The only reason
for specialized image processing hardware is the need for speed in some
applications or to over come some fundamental computer limitations.
Although large-scale image processing systems are still being sold for
massive imaging applications, such as processing of satellite images, the trend
continues toward miniaturizing and merging general purpose small computers
equipped with image processing hardware.
Communication:
Communication in digital image processing primarily involves local
communication between image processing systems and remote communication
from one point to another, typically in connection with the transmission of image
data. Hardware and software for local communication are readily available for
most computers. Most books on computer networks clearly explain standard
communication protocols.
Communication across vast distances presents a more serious challenge if
the intent is to communicate image data rather than abstracted results. As should
be evident by now, digital images contain a significant amount of data. A voice-
grade telephone line can transmit at a maximum rate of 9,600-bit/sec. Thus to
transmit a 512 X 512, 8-bit image at this rate would require nearly five minutes.
Wireless links using intermediate stations, such as satellites, are much faster, but
they also cost considerably more. The point is that transmission of entire images
over long distances is far from trivial.
Display:
Monochrome and color TV monitors are the principal display devices used
in modern image processing systems. Printing image display devices are useful
primarily for low-resolution image processing work. One simple approach for
generating gray-tone images directly on paper is to use the overstrike capability of
a standard line printer. The gray level of any point in the printout can be controlled
by the number and density of the characters overprinted at that point.
N.SREEKANTH., K.S.R.M.C.E 8
VIII). Different types of sensors to acquire an image:
N.SREEKANTH., K.S.R.M.C.E 9
In order to generate a 2-D image using a single sensor, there has to be
relative displacements in both the x- and y- directions between the sensor and the
area to be imaged. Figure9 shows an arrangement used in high-precision scanning,
where a film negative is mounted onto a drum whose mechanical rotation provides
displacement in one dimension. The single sensor is mounted on a lead screw that
provides motion in the perpendicular direction. Since mechanical motion can be
controlled with high precision, this method is an inexpensive (but slow) way to
obtain high-resolution images. Other similar mechanical arrangements use a flat
bed, with the sensor moving in two linear directions. These types of mechanical
digitizers sometimes are referred to as microdensitometers.
N.SREEKANTH., K.S.R.M.C.E 10
indicated in earlier Sections 1.2 and 1.3.2. It is important to note that the output of
the sensors must be processed by reconstruction algorithms whose objective is to
transform the sensed data into meaningful cross-sectional images. In other words,
images are not obtained directly from the sensors by motion alone; they require
extensive processing. A 3-D digital volume consisting of stacked images is
generated as the object is moved in a direction perpendicular to the sensor ring.
Other modalities of imaging based on the CAT principle include magnetic
resonance imaging (MRI) and positron emission tomography (PET). The
illumination sources, sensors, and types of images are different, but conceptually
they are very similar to the basic imaging approach shown in Fig.10(b).
N.SREEKANTH., K.S.R.M.C.E 11
The principal manner in which array sensors are used is shown in Fig.11.
This figure shows the energy from an illumination source being reflected from a
scene element, but, as mentioned at the beginning of this section, the energy also
could be transmitted through the scene elements. The first function performed by
the imaging system shown in Fig.11(c) is to collect the incoming energy and focus
it onto an image plane. If the illumination is light, the front end of the imaging
system is a lens, which projects the viewed scene onto the lens focal plane, as
Fig.11(d) shows. The sensor array, which is coincident with the focal plane,
produces outputs proportional to the integral o0f the light received at each sensor.
Digital and analog circuitry sweep these outputs and convert 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 Fig.11 (e).
IX). Scanners: -
Scanners are used to capture the image. Scanners may be hand-held or
fixed, with either the paper being fed through the scanner or the scanner moving
across the paper. Resolution varies from 100 dpi(dots per inch) to 1000 dpi.
The main problem associated with the scanner includes the following
N.SREEKANTH., K.S.R.M.C.E 12
X). Image Model:
where
In theory, the only requirement on Lmin is that it be positive, and on Lmax that
it be finite. In practice, Lmin = imin rmin and Lmax = imax rmax. Using the preceding
values of illumination and reflectance as a guideline, the values Lmin ≈ 0.005 and
Lmax ≈ 100 for indoor image processing applications may be expected.
N.SREEKANTH., K.S.R.M.C.E 13
The internal [Lmin,, Lmax] is called the gray scale. Common practice is to
shift this internal numerically to the internal [0, L], where l = 0 is considered black
and l = L is considered white in the scale. All intermediate values are shades of
gray varying continuously from black to white.
The right-hand side of Eq.(1) represents what is commonly called a digital image.
Each element of the array is referred to as an image element, picture element,
pixel, or pel. The terms image and pixels will be used throughout the following
discussions to denote a digital image and its elements.
This digitization process requires decisions about values for N, M and the
number of discrete gray levels allowed for each pixel. Common practice in digital
image processing is to let these quantities be integer powers of two; that is,
N = 2n, M = 2k --------------2
and
G=2n -----------------3
Where G denotes the number of gray levels. The assumption in this section is that
the discrete levels are equally spaced between 0 and L in the gray scale. Using Eq
(2) and (3) yields the number, b, of bits required to store a digitized image:
b = N x M x m. ---------------4
If M = N,
b= N2m. --------------------5
For example, a 128 x 128 image with 64 gray levels requires 98,304 bits of
storage.
N.SREEKANTH., K.S.R.M.C.E 14
XI). Intensity Images:
Light intensity can be translated into an electrical signal most simply by
using photosensitive cells or photosensitive resistive devices. One of these devices
can be used to make a primitive camera that generates a series of signals
representing levels of light intensity for each ‘spot’ on the picture. A system of
directing the light onto the sensitive cell is required so that the cell is looking at
each spot on the picture in turn until the whole picture has been ‘scanned’.
N.SREEKANTH., K.S.R.M.C.E 15
i). 4-neighbors:
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, called the 4-neighbors of p, is denoted by N4(p). Each pixel is a
unit distance from (x, y).
ii). 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)
and are denoted by ND(p).
iii). 8-neighbors:
The above 4-neighbors and diagonal-neighbors together are called the 8-
neighbors of ‘p’ and is denoted by N8(p).
Adjacency:
Let V be the set of 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 the same, but set V typically contains more elements. For
example, in the adjacency of pixels with a range of possible gray- level values 0 to
255, set V could be any subset of these 256 values.
N.SREEKANTH., K.S.R.M.C.E 16
b). q is in ND(p) and the set N4(p)∩ N4(q) =φ
If p and q are two pixels with co-ordinates (x1, y1) and (x2, y2) then we can
define three types of differences between p & q.
where,
De (p, q) = ( x 2 − x1 )2 + ( y 2 − y1 )2
D4 (p, q) = x2 – x1+ y2 – y1
D8 (p, q) = max (x2 – x1+ y2 – y1 )
Note1:- In the case of pixels having a ‘D4’ distance from (x, y) less than or equal to
some value ‘r’, form a diamond, centered at (x, y).
2
2 1 2
2 1 0 1 2
2 1 2
2
Note2:- In the case of pixels with ‘D8’ distance from (x, y) less than or equal to
some value ‘r’ forms a square, centered at (x, y).
2 2 2 2 2
2 1 1 1 2
N.SREEKANTH., K.S.R.M.C.E 17
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
3. Arithmetic/Logic Operations:-
Arithmetic and logic operations between pixels are used extensively in most
branches of image processing. The arithmetic operations between two pixels ‘p’
and ‘q’ are denoted as follows:
Addition: p+q
Subtraction: p–q
Multiplication: p*q
Division p%q
• The main use of image addition is for images averaging to reduce noise.
Logical operations: -
The Principal (main) logical operations used in image processing are AND,
OR and COMPLEMENT. These three operations are “functionally complete” in
the sense that they can be combined to form any other logical operation.
Note that, the logical operations apply only to binary images, where as arithmetic
operations apply to multivalued pixels.
Logical operations are basic tools in binary image processing, where they
are used for tasks such as masking, feature detection, and shape analysis. Logical
operations on entire images are performed pixels by pixel. The different types of
logical operations is shown in the Fig 5. below.
N.SREEKANTH., K.S.R.M.C.E 18
4. Window operations:
In addition to pixel-by-pixel processing on entire image, arithmetic and
logical operations are used in neighborhood-oriented operations. Neighborhood
processing typically is formulated in the context of so called ‘mask operation’ (or
template, window, filter operation).
The idea behind the mask operation is to let the value assigned to a pixel be
a function of its gray level and the gray level of its neighbors. For instance
consider the subimage area shown in Fig.13, and suppose that we want to replace
the value of z5 with the average value of the pixels in a 3x3 region centered at the
pixel with value z5. To do so entails performing an arithmetic operation of the
form
1 1 9
z= ( z1 + z 2 + ........ + z 9 ) = ∑ z i
9 9 i =1
N.SREEKANTH., K.S.R.M.C.E 19
With reference to the mask shown in Fig.6(b), the same operation can be
obtained in more general terms by centering the mask at z5 multiplying each pixel
under the mask by the corresponding coefficient, and adding the result: i.e.,
9
z = w1 z1 + w2 z 2 + LL + w9 z 9 = ∑ wi z i ------2.4-5
i =1
5. Coordinate operations:
Finally, Operations like moving co-ordinates along an axis, usually known
as translation, rotating them about an axis and scaling dimensions along an axis,
are very common in 3D computers graphics. The operations are usually
represented as matrices. The following matrices are used for translation, scaling
and rotation.
s x 0 0 0
0 sy 0 0
0 0 sz 0
0 0 0 1
Then the Rotation about x-,y- and z- axis by θ are shown below respectively.
1 0 0 0 cosθ 0 − sin θ 0
0 cosθ sin θ 0 0 1 0 0
0 − sin θ cosθ 0 sin θ 0 cos θ 0
0 0 0 1 0 0 0 1
N.SREEKANTH., K.S.R.M.C.E 20
cosθ sin θ 0 0
− sin θ cosθ 0 0
0 0 1 0
0 0 0 1
6. Image Zooming:
Image zooming means increasing the displaying size of the given image.
Zooming can be
i). Horizontal zooming
ii). Vertical zooming
iii). Uniform zooming.
4 6 2 5
2 2 4 6
3 4 6 7
5 4 4 5
the logic to zoom this image twice in horizontally is to place the gray value twice
in horizontally , as shown below.
4 4 6 6 2 2 5 5
2 2 2 2 4 4 6 6
3 3 4 4 6 6 7 7
5 5 4 4 4 4 5 5
so that the size of the resulting array is 4x8 i.e. if mxn is the size of the given
image then the zoomed twice in horizontal means, the resulting image size
becomes mx2n.
N.SREEKANTH., K.S.R.M.C.E 21
4 6 2 5
4 6 2 5
2 2 4 6
2 2 4 6
3 4 6 7
3 4 6 7
5 4 4 5
5 4 4 5
4 4 6 6 2 2 5 5
4 4 6 6 2 2 5 5
2 2 2 2 4 4 6 6
2 2 2 2 4 4 6 6
3 3 4 4 6 6 7 7
3 3 4 4 6 6 7 7
5 5 4 4 4 4 5 5
5 5 4 4 4 4 5 5
N.SREEKANTH., K.S.R.M.C.E 22
7. Different ways of converting the Gray image to Binary image:
for(i=0;i<64;I+++)
for(j=0;j<64;j++)
if(img[i][j] > th)
img[i][j]=1
else
img[i][j]=0
In other words, the result of applying a linear operator to the sum of two
images (that have been multiplied by the constant shown) is identical to applying
the operator to the images individually, multiplying the results by the appropriate
constants, and then adding those results. For example, an operator whose function
is to compute the sum of K images is a linear operator. An operator that computes
the absolute value of the difference of two images is not. An operator that fails the
test of the above equation is by definition nonlinear.
In the first category, the images are acquired 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 intensities.
N.SREEKANTH., K.S.R.M.C.E 23
Color fundamentals:
In 1666, Sir Issac Newton discovered that when a beam of sunlight passes
through a glass prism, the emerging beam of light is not white but consists instead
of ca continuous spectrum of colors ranging from violet at one end to red at the
other. This is shown in Fig.6.1.
As we know that the cones are the sensors in the eye responsible for color
vision. Approximately 65% of all cones are sensitive to red light, 33% are
sensitive to green light, and only 2% are sensitive to blue. Due to these absorption
characteristics of the human eye, these three colors (i.e. Red, Green and Blue) are
known as Primary colors. These colors are generally known according to their
wavelengths. The wavelength of red color is 700nm, of green color is 546.1nm and
of Blue is 435.8nm.
The primary colors can be added to produce secondary colors of light. The
secondary colors are Yellow (red plus green), Cyan (green plus blue) and Magenta
(blue plus red).
But in printing technology, Yellow, cyan and Magenta are know as primary
colors and Red, Green and Blue are know are Secondary colors. If you see the
cartridge used in your color printer we can find the cartridge consisting of Cyan,
Magenta and Yellow.
You see the diagrams in next page
It is observed from the Fig.6.4(b) the mixture of Yellow, Cyan and Magenta
, we will get Muddy Black which is not pure Black. So generally in color printers
we use two cartridges, one consists of Cyan, Magenta, Yellow colors and other
N.SREEKANTH., K.S.R.M.C.E 24
cartridge of black color.
N.SREEKANTH., K.S.R.M.C.E 25
red, green and blue. This model is based on Cartesian co-ordinate system. The
RGB color model is shown below, in which RGB values are at three corners;
Cyan, Magenta and Yellow are at three other corners; Black is at the origin and
White is at corner furthest from the origin. In this model, the gray scale 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. The amount of each color is specified by a number from 0 to 255;
0,0,0 is black, while 255,255,255 is white. But for convenience, all color values
have been normalized as show in the cube i.e. all values are assumed to be in the
range [0,1].
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 pixel is said to have a
depth of 24bits (3 image planes times the number of bits per plane). The term full-
color is used to denote a 24-bit RGB color image. He total number of colors in a
24-bit color cube is (28)3=1,67,77,216. Fig.6.8 shows RGB color cube
corresponding to the above diagram.
We know that Cyan, Magenta and Yellow are the secondary colors of light,
or alternatively, the primary colors of pigments. For example when a surface
N.SREEKANTH., K.S.R.M.C.E 26
coated with cyan pigment is illuminated with white light, no red light is reflected
from the surface i.e. cyan subtracts red light from the reflected white light, which
itself is composed of equal amounts of red, green and blue light.
Most devices that deposit colored pigments on paper, such as color
printers and copiers require CMY data input or perform an RGB to CMY
conversion internally. This conversion is performed using the simple operation as
shown below,
C 1 R
M = 1 - G ------------------1
Y 1 B
From equation.1, we can get RGB values from a set of CMY values by subtracting
the individual CMY values from 1.
As we know, if equal amounts of color pigment primaries, i.e. Yellow, Cyan
and Magenta 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
CMYK model. Thus, whenever we say four color printing, we are referring to
three colors of the CMY color model plus black gives CMYK.
N.SREEKANTH., K.S.R.M.C.E 27
Image acquired by the satellite’s sensors are transmitted via a radio
frequency signal, which is picked up at a ground station and relayed to the control
station for the satellite. Signals sent from the control station via the ground station
to the satellite can be used to alter its position or the position of its sensors to allow
the desired images to be acquired.
One interesting aspect of remote sensing is that satellites often carry several
sensors. Each of these detects radiation in a different part of the spectrum, for
example infrared, visible or ultraviolet. Each detector is said to record a specific
band of the electromagnetic spectrum. The reason for recording data from multiple
bands is to increase the amount of data available for each point on the earth’s
surface. This aids the task of discriminating between the various kinds of ground
cover which can occur, making it possible to distinguish between, for example
forests, urban areas, deserts and arable farm land. Once distinguished, various
areas can be monitored to see how they are changing with time.
N.SREEKANTH., K.S.R.M.C.E 28
XVII). Range Images:
An example of a range image is one captured by radar. On this type of
image light intensity is not captured, but object distance from the sensor is
modeled instead. These range images are particularly useful for navigation much
more so than light intensity images. A moving vehicle needs to know the distances
of objects away from it or the distance to the lack of continuous floor, otherwise it
will bump into or fall off something. Light intensity images cannot give that
information unless distance can be estimated from prior knowledge about size, or
from a stereoscopic vision system.
Ranging Devices
The different ranging devices are
i). Ultra Sound radar
ii). Laser radar.
Ultra sound radar:
Ultra sound is widely used for short range (up to 40 m) image
collection. It is not practical for long-range image collection for a number of
reasons:
a). Insufficient transmitted energy would be detected by the receiver.
b). There is a tendency for sound to bounce more than once( double echo) if the
terrain is not conductive to ultrasound radar.
c). There may be a significant amount of ambient ultrasound present, which
makes collection of the returning signal ‘noisy’.
For more distant objects the electromagnetic spectrum has to be used. This may
mean classical radar technology or laser range finding.
N.SREEKANTH., K.S.R.M.C.E 29