0% found this document useful (0 votes)
33 views37 pages

IV I Ip Lecture Notes 13 49

Uploaded by

loveilu0479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views37 pages

IV I Ip Lecture Notes 13 49

Uploaded by

loveilu0479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

UNIT-1

INTRODUCTION:
ORIGIN OF DIGITAL IMAGE PROCESSING:
One of the first applications of digital images was in the newspaper industry, when
pictures were first sent by submarine cable between London and New York. Introduction of
the Bartlane cable picture transmission system in the early 1920s reduced the time required to
transport a picture across the Atlantic from more than a week to less than 3 hours. Specialized
printing equipment coded pictures for cable transmission and then reconstructed them at the
receiving end.

Fig 1: A digital picture produced in 1921 from a coded tape by a telegraph printer with
special type faces.

Fig 1 was transmitted in this way and reproduced on a telegraph printer fitted with typefaces
simulating a halftone pattern.
Some of the initial problems in improving the visual quality of these early digital pictures
were related to the selection of printing procedures and the distribution of intensity levels.

The printing method used for Fig 1 was abandoned toward the end of 1921 in favor of a
technique based on photographic reproduction made from tapes perforated at the telegraph
receiving terminal. Fig 2 shows an image obtained using this method. The improvements
over Fig 1 are evident, both in tonal quality and in resolution.

The early Bartlane systems were capable of coding images in five district levels of gray.
This capability was increased to 15 levels in1929. Fig 3 is typical of the types of images that
could be obtained using the 15-tone equipment. During this period, introduction of a system
for developing a film plate via light beams that were modulated by the coded picture tape
improved the reproduction process considerably.
Although the examples just cited involved digital images, they are not considered digital
image processing results in the context of our definition because computers were not
involved in their creation. Thus, the history of digital image processing is intimately tied to
the development of the digital computer. In fact, 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 idea of a computer goes back to the invention of the abacus in Asia Minor, more than
5000 years ago. More recently, there were developments in the past two centuries that are the
foundation of what we call a computer today. However, the basis for what we call a modern
digital dates back to only the 1940s with the introduction by John Von Neumann of two key
concepts:(1) a memory to hold a stored program and data, and (2) conditional branching.
These two ideas are the foundation of a central processing unit(CPU), which is at the heart of
the computers today. Starting with von Neumann, there were a series of key advances that led
to computers powerful enough to be used for digital image processing.

Fig 3: Unretouched cable picture of Generals Pershing and Foch , transmitted in 1929 from
London to New York by 15-tone equipment.
Briefly these advances are summarized as follows: (1) the invention of the transistor at
Bell Laboratories in 1948; (2) the development in the 1950s and 1960s of the high-level
programming languages COBOL (common business-oriented language) and FORTRAN
(formula translator); (3) the invention of the integrated circuit (IC) at Texas Instruments in
1958; (4) the development of operating systems in the early 1960s; (5) the
development of the microprocessor by Intel in the 1970s; (6) introduction by IBM of
the personal computer in 1981; and (7) progressive miniaturization of components,
starting with large scale integration (LI) in the late 1970s, then very large scale
integration (VLSI) in the 1980s to the present age of ultra large scale industries (ULSI).
Concurrent with these advances were developments in the areas of mass storage and
display systems, both are which fundamental requirements for digital image processing
are.
The first computers powerful enough to carry out meaningful image processing tasks
appeared in the early 1960s. The birth of what we call digital processing today can be traced
to the availability of those machines and to the onset of the space program during that period.
It looks the combination of those two developments to bring into focus the potential of digital
image processing concepts. Work on using computer techniques for improving images from a
space probe began at the Jet Propulsion Laboratory in 1964 when pictures of the moon
transmitted by Ranger 7 were processed by a computer to correct various types of image
distortion inherent in the on-board television camera. Fig 4 shows the first image of the moon
taken by Ranger 7 on July 31,1964 at 9.09 A.M. Eastern daylight time (EDT), about 17
minutes before impacting the lunar surface. This is also first image of the moon taken by a
U.S. spacecraft. The imaging lessons learned with Ranger 7 served as the basis for improved
methods used to enhance and restore images from the surveyor missions to the moon, the
Mariner series of flyby missions to Mars, the Apollo manned flights to the moon, and others.

Fig 4: The first picture of the moon by a U.S. spacecraft. Ranger 7 took this image on July31,
1964 at 9.09 A.M. EDT, about 17 minutes before impacting the lunar surface.
FIELDS THAT USES DIGITAL IMAGE PROCESSING:
Since digital image processing has very wide applications and almost all of the technical fields
are impacted by DIP, we will just discuss some of the major applications of DIP.
Digital Image processing is not just limited to adjust the spatial resolution of the everyday
images captured by the camera. It is not just limited to increase the brightness of the photo,
Etc., rather it is far more than that.
Electromagnetic waves can be thought of as stream of particles, where each particle is moving
with the speed of light. Each particle contains a bundle of energy. This bundle of energy is
called a photon.
The electromagnetic spectrum according to the energy of photon is shown below.

In this electromagnetic spectrum, we are only able to see the visible spectrum. Visible
spectrum mainly includes seven different colours that are commonly term as (VIBGOYR).
VIBGOYR stands for violet, indigo, blue, green, orange, yellow and Red.
But that does not nullify the existence of other stuff in the spectrum. Our human eye can only
see the visible portion, in which we saw all the objects. But a camera can see the other things
that a naked eye is unable to see. For example: x rays, gamma rays, etc. Hence the analysis of
all that stuff too is done in digital image processing.

1 Define a) Image b) Resolution c) Pixel d) Digital Image


Image : An image is a visual representation of something. An image can be a two-dimensional
representation, such as a drawing, painting, or photograph, or a three-dimensional object, such
as a carving or sculpture.
Resolution:
Image resolution refers to the density of pixels in an image, expressed as PPI. This shouldn't be
confused with image dimension, which is expressed as a measurement of the number of rows
and columns of pixels an image contains, such as 640x480.
Pixel:
A pixel is the smallest unit of a digital image or graphic that can be displayed and represented on a
digital display device. A pixel is the basic logical unit in digital graphics. Pixels are combined
to form a complete image, video, text, or any visible thing on a computer display.
Digital image:
A digital image is an image composed of picture elements also known as pixels, each
with finite, discrete quantities of numeric representation for its intensity or gray level that is an
output from its two-dimensional functions fed as input by its spatial coordinates denoted
with x, y on the x-axis and y-axis, respectively. Depending on whether the image resolution is
fixed, it may be of vector or raster type. By itself, the term "digital image" usually refers
to raster images or bitmapped images
2. List out Classification of images?
There are many type of images, and we will look in detail about different types of images, and the color
distribution in them. The binary image The binary image as it name states, contain only two pixel
values. 0 and 1. In our previous tutorial of bits per pixel, we have explained this in detail about the
representation of pixel values to their respective colors. Here 0 refers to black color and 1 refers to
white color. It is also known as Monochrome.
Black and white image:
The resulting image that is formed hence consists of only black and white color and thus can also be
called as Black and White image. No gray level
One of the interesting this about this binary image that there is no gray level in it. Only two colors that
are black and white are found in it.
Format Binary images have a format of PBM ( Portable bit map )
2, 3, 4,5, 6 bit color format
The images with a color format of 2, 3, 4, 5 and 6 bit are not widely used today. They were used in old
times for old TV displays, or monitor displays.
But each of these colors have more then two gray levels, and hence has gray color unlike the binary
image.
In a 2 bit 4, in a 3 bit 8, in a 4 bit 16, in a 5 bit 32, in a 6 bit 64 different colors are present.
8 bit color format 8 bit color format is one of the most famous image format. It has 256 different shades
of colors in it. It is commonly known as Grayscale image.
The range of the colors in 8 bit vary from 0-255. Where 0 stands for black, and 255 stands for white,
and 127 stands for gray color.
This format was used initially by early models of the operating systems UNIX and the early color
Macintoshes.
A grayscale image of Einstein is shown below:

Format The format of these images are PGM ( Portable Gray Map ).
This format is not supported by default from windows. In order to see gray scale image, you need to
have an image viewer or image processing toolbox such as Matlab.
Behind gray scale image:
As we have explained it several times in the previous tutorials, that an image is nothing but a two
dimensional function, and can be represented by a two dimensional array or matrix. So in the case of the
image of Einstein shown above, there would be two dimensional matrix in behind with values ranging
between 0 and 255.
But thats not the case with the color images.
16 bit color format
It is a color image format. It has 65,536 different colors in it. It is also known as High color format. It
has been used by Microsoft in their systems that support more then 8 bit color format. Now in this 16
bit format and the next format we are going to discuss which is a 24 bit format are both color format.
The distribution of color in a color image is not as simple as it was in grayscale image.
A 16 bit format is actually divided into three further formats which are Red , Green and Blue. The
famous (RGB) format.
It is pictorially represented in the image below.
Now the question arises, that how would you distribute 16 into three. If you do it like this,
5 bits for R, 5 bits for G, 5 bits for B
Then there is one bit remains in the end.
So the distribution of 16 bit has been done like this.
5 bits for R, 6 bits for G, 5 bits for B.
The additional bit that was left behind is added into the green bit. Because green is the color which is
most soothing to eyes in all of these three colors.
Note this is distribution is not followed by all the systems. Some have introduced an alpha channel in
the 16 bit.
Another distribution of 16 bit format is like this:
4 bits for R, 4 bits for G, 4 bits for B, 4 bits for alpha channel.
Or some distribute it like this
5 bits for R, 5 bits for G, 5 bits for B, 1 bits for alpha channel.
24 bit color format
24 bit color format also known as true color format. Like 16 bit color format, in a 24 bit color format,
the 24 bits are again distributed in three different formats of Red, Green and Blue.

Since 24 is equally divided on 8, so it has been distributed equally between three different color
channels.
Their distribution is like this.
8 bits for R, 8 bits for G, 8 bits for B.
Behind a 24 bit image.
Unlike a 8 bit gray scale image, which has one matrix behind it, a 24 bit image has three different
matrices of R, G, B.

Format
It is the most common used format. Its format is PPM ( Portable pixMap) which is supported by Linux
operating system. The famous windows has its own format for it which is BMP
( Bitmap ).
3. List out Various types of image file formats?
These file formats ensures you use the right one for your particular purposes. Here are 10 types of
image file formats:

JPEG or JPG

A JPEG, or JPG, is a compressed image file wherein the quality of the image decreases when the file
size decreases. In other words, it has a smaller file size than the image's original, pre-exported file.
Since they lose quality when they're scaled, they're considered raster images. When you scale a JPEG,
they lose quality and may appear blurry or pixilated if you scale it past the size than they you saved the
file to.

You can use JPEGs for a variety of projects, particularly for photos on websites or in print media. In
order to produce a high-quality project, it's important to pay attention to a JPEG's file size and
resolution. Keep in mind that the .jpg and .jpeg filename extensions refer to the same thing. You can
find either of these denotations on image software programs.

PNG

PNGs are image file types often found in web projects and web design. Using this file type for a web
project lets you preserve transparencies, which allows for a sharper image for the web.

Unlike JPEGs, you can't use PNGs for print purposes. Even though you can't edit them without losing
quality, they still have a low resolution. Use PNGs for images that contain both photos and text or logos
and exported vector images used on both websites and applications.

GIF

A GIF is a bitmap image format that you often find in their animated form. GIFs typically live on
banner ads or social media sites, often alluding to a pop culture reference on the latter. At their most
basic form, GIFs make up to 256 colors in the RGB colorspace.
Like PNGs, GIFs typically work best on web projects where images need to load faster rather than
retain a higher quality level. Use a GIF for low-quality images and animations you use on a website or
an app.

TIFF

TIFFS are raster files that contain a large amount of data. Not only do they not lose quality, but they
also maintain the original image data no matter the amount of times you copy, save or compress the
original file. While TIFFs can recover their quality after you manipulate them, it's best to avoid using
this file type for the web because the amount of time they take to load may negatively impact a
website's performance. Use TIFFs for print media, high-quality website images and for online or print
photos.

PSD

PSDs refer to image file formats native to the graphics editing software, Adobe Photoshop. PSDs
contain layers that make it easier to modify an image. It's important to note that Photoshop works with
raster images instead of vector images. It's best to use PSDs when containing high-quality graphics data.

PDF

Created by Adobe, this universal file type aims to capture rich information from different applications
and gives. A portable document format essentially gives you the ability to present information to a wide
variety of audiences more easily. If you have a vector logo saved as a PDF, you can see it without
needing a design editing software to open it. You just need the Acrobat Reader software.

EPS

An EPS is a standard graphics file format that's designed to create high-resolution graphics for print.
You can create this time of image file format with nearly any type of design software.

Like a PDF, an EPS file extension works universally. You can use an EPS to open vector-based artwork
in a design editing software, rather than common Adobe products. This helps safeguard any file
transfers to designers who aren't using Adobe products. Use an EPS for a more flexible "raw" file
format and for sharing editable vector files with others or in different vector programs.

AI

Known as an Adobe Illustrator document, an AI file extension is an image format that's often preferred
by designers. It's also reliable for images in various types of projects, whether web or print. Many
creatives use Adobe Illustrator to create artwork from scratch. Therefore, it's often the program where
your logo was originally rendered.

FUNDAMENTAL STEPS IN DIGITAL IMAGE PROCESSING:


1.Image Acquisition:
This is the first step or process of the fundamental steps of digital image processing. Image
acquisition could be as simple as being given an image that is already in digital form.
Generally, the image acquisition stage involves pre-processing, such as scaling etc.
2.Image Enhancement:
Image enhancement is among the simplest and most appealing areas of digital image
processing. Basically, the idea behind enhancement techniques is to bring out detail that is
obscured, or simply to highlight certain features of interest in an image. Such as, changing
brightness & contrast etc.
3.Image Restoration:
Image restoration is an area that also deals with improving the appearance of an image.
However, unlike enhancement, which is subjective, image restoration is objective, in the
sense that restoration techniques tend to be based on mathematical or probabilistic models of
image degradation.

4. Colour Image Processing


Colour image processing is an area that has been gaining its importance because of the
significant increase in the use of digital images over the Internet. This may include colour
modelling and processing in a digital domain etc.
5. Wavelets and Multiresolution Processing
Wavelets are the foundation for representing images in various degrees of resolution. Images
subdivision successively into smaller regions for data compression and for pyramidal
representation.
6. Compression
Compression deals with techniques for reducing the storage required to save an image or the
bandwidth to transmit it. Particularly in the uses of internet it is very much necessary to
compress data.
7. Morphological Processing
Morphological processing deals with tools for extracting image components that are useful in
the representation and description of shape.
8. Segmentation
Segmentation procedures partition an image into its constituent parts or objects. In general,
autonomous segmentation is one of the most difficult tasks in digital image processing. A
rugged segmentation procedure brings the process a long way toward successful solution of
imaging problems that require objects to be identified individually.
9. Representation and Description
Representation and description almost always follow the output of a segmentation stage,
which usually is raw pixel data, constituting either the boundary of a region or all the points
in the region itself. Choosing a representation is only part of the solution for transforming raw
data into a form suitable for subsequent computer processing. Description deals with
extracting attributes that result in some quantitative information of interest or are basic for
differentiating one class of objects from another.
10. Object recognition
Recognition is the process that assigns a label, such as, “vehicle” to an object based on its
descriptors.
11. Knowledge Base:
Knowledge may be as simple as detailing regions of an image where the information of
interest is known to be located, thus limiting the search that has to be conducted in seeking
that information. The knowledge base also can be quite complex, such as an interrelated list
of all major possible defects in a materials inspection problem or an image database
containing high-resolution satellite images of a region in connection with change-detection
applications.
APPLICATIONS OF DIGITAL IMAGE PROCESSING:
Some of the major fields in which digital image processing is widely used are mentioned
below
 Image sharpening and restoration
 Medical field
 Remote sensing
 Transmission and encoding
 Machine/Robot vision
 Color processing
 Pattern recognition
 Video processing
 Microscopic Imaging
 Others
COMPONENTS OF AN IMAGE PROCESSING SYSTEM:
Image processing system is the combination of the different elements involved in the digital
image processing. Digital image processing is the processing of an image by means of a
digital computer. Digital image processing uses different computer algorithms to perform
image processing on the digital images.
 Image Sensors:
Image sensors senses the intensity, amplitude, co-ordinates and other features of the
images and passes the result to the image processing hardware. It includes the problem
domain.
 Image Processing Hardware:
Image processing hardware is the dedicated hardware that is used to process the
instructions obtained from the image sensors. It passes the result to general purpose
computer.
 Computer:
Computer used in the image processing system is the general purpose computer that is
used by us in our daily life.

 Image Processing Software:


Image processing software is the software that includes all the mechanisms and
algorithms that are used in image processing system.
 Mass Storage:
Mass storage stores the pixels of the images during the processing.
 Hard Copy Device:
Once the image is processed then it is stored in the hard copy device. It can be a pen
drive or any external ROM device.
 Image Display:
It includes the monitor or display screen that displays the processed images.
 Network:
Network is the connection of all the above elements of the image processing system.
DIGITAL IMAGE FUNDAMENTALS:

ELEMENTS OF VISUAL PERCEPTION:

The field of digital image processing is built on the foundation of mathematical and
probabilistic formulation, but human intuition and analysis play the main role to make the
selection between various techniques, and the choice or selection is basically made on
subjective, visual judgments.
In human visual perception, the eyes act as the sensor or camera, neurons act as the
connecting cable and the brain acts as the processor.
The basic elements of visual perceptions are:
1. Structure of Eye
2. Image Formation in the Eye
3. Brightness Adaptation and Discrimination

Structure of Eye:

The human eye is a slightly asymmetrical sphere with an average diameter of the length of
20mm to 25mm. It has a volume of about 6.5cc. The eye is just like a camera. The external
object is seen as the camera take the picture of any object. Light enters the eye through a
small hole called the pupil, a black looking aperture having the quality of contraction of eye
when exposed to bright light and is focused on the retina which is like a camera film.
The lens, iris, and cornea are nourished by clear fluid, know as anterior chamber. The fluid
flows from ciliary body to the pupil and is absorbed through the channels in the angle of the
anterior chamber. The delicate balance of aqueous production and absorption controls
pressure within the eye.
Cones in eye number between 6 to 7 million which are highly sensitive to colours. Human
visualizes the coloured image in daylight due to these cones. The cone vision is also called as
photopic or bright-light vision.
Rods in the eye are much larger between 75 to 150 million and are distributed over the retinal
surface. Rods are not involved in the colour vision and are sensitive to low levels of
illumination.
Image Formation in the Eye:
When the lens of the eye focus an image of the outside world onto a light-sensitive membrane
in the back of the eye, called retina the image is formed. The lens of the eye focuses light on
the photoreceptive cells of the retina which detects the photons of light and responds by
producing neural impulses.

The distance between the lens and the retina is about 17mm and the focal length is
approximately 14mm to 17mm.
Brightness Adaptation and Discrimination:
Digital images are displayed as a discrete set of intensities. The eyes ability to discriminate
black and white at different intensity levels is an important consideration in presenting image
processing result.

The range of light intensity levels to which the human visual system can adapt is of
the order of 1010 from the scotopic threshold to the glare limit. In a photopic vision,
the range is about 106.
Image sampling and Quantization:
To create a digital image, we need to convert the continuous sensed data into digital form.
This involves two processes: sampling and quantization. A continuous image, f(x, y), that we
want to convert to digital 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.
Digital Image representation:
Digital image is a finite collection of discrete samples (pixels) of any observable object. The
pixels represent a two- or higher dimensional “view” of the object, each pixel having its own
discrete value in a finite range. The pixel values may represent the amount of visible light,
infra red light, absortation of x-rays, electrons, or any other measurable value such as
ultrasound wave impulses. The image does not need to have any visual sense; it is sufficient
that the samples form a two-dimensional spatial structure that may be illustrated as an image.
The images may be obtained by a digital camera, scanner, electron microscope, ultrasound
stethoscope, or any other optical or non-optical sensor. Examples of digital image are:
 digital photographs
 satellite images
 radiological images (x-rays, mammograms)
 binary images, fax images, engineering drawings
Computer graphics, CAD drawings, and vector graphics in general are not considered in this
course even though their reproduction is a possible source of an image. In fact, one goal of
intermediate level image processing may be to reconstruct a model (e.g. vector
representation) for a given digital image.
RELATIONSHIP BETWEEN PIXELS:
We consider several important relationships between pixels in a digital image.
NEIGHBORS OF A PIXEL
• A pixel p at coordinates (x,y) has four horizontal and 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 or p, is denoted by N4(p). Each pixel is one
unit distance from (x,y) and some of the neighbors of p lie outside the digital image if (x,y) is
on the border of the image. The four diagonal neighbors of p have coordinates and are
denoted by ND (p).
(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
These points, together with the 4-neighbors, are called the 8-neighbors of p, denoted
by N8 (p).

As before, some of the points in ND (p) and N8 (p) fall outside the image if (x,y) is on
the border of the image.
ADJACENCY AND CONNECTIVITY
Let v be the set of gray –level values used to define adjacency, in a binary image, v={1}.
In a gray-scale image, the idea is the same, but V typically contains more elements, for
example, V = {180, 181, 182, …, 200}.
If the possible intensity values 0 – 255, V set can be any subset of these 256 values.
if we are reference to adjacency of pixel with value.
Three types of adjacency
 4- Adjacency – two pixel P and Q with value from V are 4 –adjacency if A is in the
set N4(P)
 8- Adjacency – two pixel P and Q with value from V are 8 –adjacency if A is in the
set N8(P)
 M-adjacency –two pixel P and Q with value from V are m – adjacency if (i) Q is in
N4(p) or (ii) Q is in ND(q) and the set N4(p) ∩ N4(q) has no pixel whose values are
from V.
• Mixed adjacency is a modification of 8-adjacency. It is introduced to eliminate the
ambiguities that often arise when 8-adjacency is used.
• For example:
Fig:1.8(a) Arrangement of pixels; (b) pixels that are 8-adjacent (shown dashed) to the
center pixel; (c) m-adjacency.
Types of Adjacency:
• In this example, we can note that to connect between two pixels (finding a path
between two pixels):
– In 8-adjacency way, you can find multiple paths between two pixels
– While, in m-adjacency, you can find only one path between two pixels
• So, m-adjacency has eliminated the multiple path connection that has been generated
by the 8-adjacency.
• Two subsets S1 and S2 are adjacent, if some pixel in S1 is adjacent to some pixel in S2.
Adjacent means, either 4-, 8- or m-adjacency.
A Digital Path:
• A digital path (or curve) from pixel p with coordinate (x,y) to pixel q with coordinate (s,t)
is a sequence of distinct pixels with coordinates (x0,y0), (x1,y1), …, (xn, yn) where (x0,y0) =
(x,y) and (xn, yn) = (s,t) and pixels (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n
• n is the length of the path
• If (x0,y0) = (xn, yn), the path is closed.
We can specify 4-, 8- or m-paths depending on the type of adjacency specified.
• Return to the previous example:

Fig:1.8 (a) Arrangement of pixels; (b) pixels that are 8-adjacent(shown dashed) to the
center pixel; (c) m-adjacency.
In figure (b) the paths between the top right and bottom right pixels are 8-paths. And
the path between the same 2 pixels in figure (c) is m-path
Connectivity:
• Let S represent a subset of pixels in an image, two pixels p and q are said to be
connected in S if there exists a path between them consisting entirely of pixels in S.
• For any pixel p in S, the set of pixels that are connected to it in S is called a connected
component of S. If it only has one connected component, then set S is called a
connected set.
Region and Boundary:
• REGION: Let R be a subset of pixels in an image, we call R a region of the image if R
is a connected set.
• BOUNDARY: The boundary (also called border or contour) of a region R is
the set of pixels in the region that have one or more neighbors that are not in R.
If R happens to be an entire image, then its boundary is defined as the set of pixels in the first
and last rows and columns in the image. This extra definition is required because an image
has no neighbors beyond its borders. Normally, when we refer to a region, we are referring to
subset of an image, and any pixels in the boundary of the region that happen to coincide with
the border of the image are included implicitly as part of the region boundary.
DISTANCE MEASURES:
For pixel p,q and z with coordinate (x.y) ,(s,t) and (v,w) respectively D is a distance function
or metric if
D [p.q] ≥ O {D[p.q] = O iff p=q}
D [p.q] = D [p.q] and
D [p.q] ≥ O {D[p.q]+D(q,z)
• The Euclidean Distance between p and q is defined as:

De (p,q) = [(x – s)2 + (y - t)2]1/2

Pixels having a distance less than or equal to some value r from (x,y) are the points
contained in a disk of radius „ r „centered at (x,y)

• The D4 distance (also called city-block distance) between p and q is defined as:
D4 (p,q) = | x – s | + | y – t |
Pixels having a D4 distance from (x,y), less than or equal to some value r form a
Diamond centered at (x,y)

Example:
The pixels with distance D4 ≤ 2 from (x,y) form the following contours of
constant distance.
The pixels with D4 = 1 are the 4-neighbors of (x,y)

• The D8 distance (also called chessboard distance) between p and q is defined as:
D8 (p,q) = max(| x – s |,| y – t |)
Pixels having a D8 distance from (x,y), less than or equal to some value r form a
square Centered at (x,y).

Example:
D8 distance ≤ 2 from (x,y) form the following contours of constant distance.

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

Now, to compute the Dm between points p and p4


Here we have 4 cases:
Case1: If p1 =0 and p3 = 0
The length of the shortest m-path
(the Dm distance) is 2 (p, p2, p4)

Case2: If p1 =1 and p3 = 0
now, p1 and p will no longer be adjacent (see m-adjacency definition)
then, the length of the shortest
path will be 3 (p, p1, p2, p4)

Case3: If p1 =0 and p3 = 1
The same applies here, and the shortest –m-path will be 3 (p, p2, p3, p4)
Case4: If p1 =1 and p3 = 1
The length of the shortest m-path will be 4 (p, p1 , p2, p3, p4)

You might also like