SlideShare a Scribd company logo
1 of 73
Download to read offline
A project report on
"An Introduction To Digital Topology"
Project submitted to university of Kerala in the partial fulfill-
ment of the requirements for the awards of the degree of Master
of Science in Mathematics 2014 - 16.
i
AN INTRODUCTION TO DIGITAL TOPOLOGY
PROJECT REPORT
Submitted to
University Of Kerala
Thiruvananthapuram
By
Vishnu V
Candidate code : 14 125 020 Exam Code : 620
Project Code : MM245
Department Of Mathematics and Statistics
Sanatana Dharma College
Alappuzha.
August 17, 2016
AN INTRODUCTION TO DIGITAL TOPOLOGY
PROJECT
Submitted to University of Kerala in partial fulfillment of the
requirements of for the award of the Degree of Master of Science
in
Mathematics
By
VISHNU V
Candidate Code: 14 125 020
Exam Code: 620 Project Code: MM254
Under the Guidance of
SRI RAKESH N NAMPOOTHIRI
Assistant Professor,
DEPARTMENT OF MATHEMATICS AND STATISTICS
SANATANA DHARMA COLLEGE, ALAPPUZHA
2016
i
SANATANA DHARMA COLLGE, ALAPPUZHA
DEPARTMENT OF MATHEMATICS AND
STATISTICS
CertificatE
This is to certify that the project work entitled “AN INTRODUCTION TO
DIGITAL TOPOLOGY”is a bona fide work done by VISHNU V (620 14 125
020) in partial fulfilment of the requirement for the award of Master of Sci-
ence in Mathematics by the University of Kerala and this report has not
been submitted by any other university for the award of any degree to the
best of my knowledge and belief.
Alappuzha, DR. R SREEKUMAR,
August 17, 2016 Head of Department
Department of Mathematics and Statistics,
Sanatana Dharma College, Alappuzha .
ii
DECLARATION
I hereby declare that this is a bonafide record of the work done by me in
partial fulfilment of the requirements for the award of the degree of Master
of Science in Mathematics by the University of Kerala and this report has
not been submitted to any other university for the award of any degree to
the best of my knowledge and belief.
VISHNU V
620 14 125 020
iii
AcknowledgementS
I truly wouldn’t be where I am today if not for the thousands of people
who have been there to love, guide, teach, support, motivate and inspire
me during this incredible journey I have been on.
It is my pleasure to express my sincere thanks to god almighty showing
his blessing on me for the successful completion of the project. I would like
to thank all of them in particular.
Dr.R Sreekumar - Head of the department, Guru and like a friend, who
taught me the basics of telling a subject and stayed with me right till the
end. if he hadn’t encouraged and harassed me all the way, I would have
given this up a long time ago.
Rakesh N Nampoothiri - mentor and my guide, for the valuable guid-
ance, observation and timely advice during the preparation of the project
and project report.
Arun Kishore B L, Dr. S Vijayakrishnan, Dr. V G Rajaleshmi, P Amal-
raj, Dr. Bibin K Jose, Ananthalakshmy, and Jisha - amazing teachers who
read the manuscript and gave honest comments. All of them also stayed
with me in the process, and handled me and my sometimes out-of-control
emotions so well.
My friends Rajesh, Minnu, Gopu, Leshmi, Athria, Nithyasree, Seersha,
Emily and all others. I love them all so much that I could literally write
on them.
And lastly, it is only one writes a Mathematics book that realizes the
true power of LATEX, to typeset mathematics , from grammar checks to
replace-alls. It is simple - without this software, this project report would
not be written. Thank you Donald Knuth, and TEXCorp! . If Adobe can’t
released illustrator then I can’t draw or edit the pictures so, I express my
truthful thanks to Illustrator and Adobe Corp! for creating such a nice
software.
VISHNU V
iv
Contents
Table of Contents iv
List of Figures vii
1 Introduction ix
2 Preliminaries 1
2.1 Sets and Functions . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1.1 Set Operations . . . . . . . . . . . . . . . . . . . . . . 1
2.2 Metric Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Topological Spaces and Examples . . . . . . . . . . . . . . . . 7
2.4 Grid and examples . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Adjacency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5.1 Adjacency in 2D and 3D Grids . . . . . . . . . . . . . 11
3 Digitization Models 15
3.0.2 Gauss digitization . . . . . . . . . . . . . . . . . . . . 15
3.0.3 Jordan digitization . . . . . . . . . . . . . . . . . . . . 16
3.0.4 Grid-intersection digitization . . . . . . . . . . . . . . 19
3.1 Type digital sets . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Domain digitizations . . . . . . . . . . . . . . . . . . . . . . . 25
4 Digital Topology 27
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 Digital Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2.1 Picture resolution and picture size . . . . . . . . . . . 30
4.2.2 Connectedness . . . . . . . . . . . . . . . . . . . . . . 31
4.2.3 Arcs and curves . . . . . . . . . . . . . . . . . . . . . . 32
4.2.4 Thinning . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.5 Thinning algorithm . . . . . . . . . . . . . . . . . . . . 35
4.2.6 Border following . . . . . . . . . . . . . . . . . . . . . 36
v
4.2.7 The adjacency tree . . . . . . . . . . . . . . . . . . . . 39
5 Binary digital picture spaces 41
5.0.8 Binary Pictures . . . . . . . . . . . . . . . . . . . . . . 43
5.0.9 Properties of DPS . . . . . . . . . . . . . . . . . . . . . 44
5.1 Regular digital picture spaces . . . . . . . . . . . . . . . . . . 46
5.1.1 The digital fundamental groups . . . . . . . . . . . . 47
5.2 Strong normal digital pictures spaces . . . . . . . . . . . . . . 49
5.2.1 Examples of Strong normal DPS . . . . . . . . . . . . 51
5.2.2 The discrete digital fundamental group . . . . . . . . 52
5.3 Continuous analogs of digital pictures . . . . . . . . . . . . . 53
5.3.1 The augmented black and white point sets . . . . . . 54
5.3.2 C(P) and C (P) . . . . . . . . . . . . . . . . . . . . . 56
6 Concluding remarks 60
Bibliography 61
vi
List of Figures
2.1 A rectangular orthogonal grid . . . . . . . . . . . . . . . . 9
2.2 Grid points in plane and cells . . . . . . . . . . . . . . . . 10
2.3 α-adjacent 3 cells . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Lattice points in plane and 3-space . . . . . . . . . . . . 13
2.5 8, 4-adjacent neighbour in plane . . . . . . . . . . . . . . . 13
2.6 26, 18, 6-adjacent neighbour in 3-space . . . . . . . . . . . 14
3.1 Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Four disks (dashed) and their Gauss digitizations (shaded) 16
3.3 Gauss digitization of a simple polygon using grids of
sizes from 8×8 (upper left) to 128×128 (lower middle).
The original polygon was drawn on a grid of size 512×
512 (lower right) . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 Relative deviations of area and perimeter for the dig-
itized polygon in Figure 1.9 . . . . . . . . . . . . . . . . . 17
3.5 Inner and outer Jordan digitizations of a centered disk 18
3.6 Grid-intersection digitization of an arc. . . . . . . . . . . 19
3.7 Directional encoding of an arc. Starting at grid point
p, the arc can be represented by the sequence of codes
677767000001 . . . 65 . . . . . . . . . . . . . . . . . . . . . . . . 20
3.8 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.9 Dierences in h1 and h2 from the correct y value . . . . 21
3.10 Gauss digitizations of the same disk at dierent loca-
tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.11 Inner and outer diamond and ball digitizations in the
plane. The inner digitization is the union of the grid
squares centered at black grid points, and the outer
digitization (frontier shown as a bold black line) also
contains the grid squares centered at shaded grid points.
Left: diamond digitization. Right: ball digitization. . . 24
vii
4.1 Grid point and grid square notation in a plane . . . . . 30
4.2 A 380◦
panoramic picture of Auckland copied from Na-
tional geographic channel . . . . . . . . . . . . . . . . . . 31
viii
1 Introduction
Objects in three dimensions, and their two-dimensional images, are ap-
proximated digitally by sets of voxels (volume elements) or pixels (pic-
ture elements), respectively. Digital geometry is the study of geometric
properties of digitized objects (or digitized images of objects); it deals both
with the definitions of such properties and with algorithms for their com-
putation. In particular, digital topology deals with properties of a topo-
logical nature (particularly, properties that involve the concepts of con-
nectedness or adjacency, but do not depend on size or shape), and with
algorithms that compute or preserve such properties. Topological prop-
erties and algorithms play a fundamental role in the analysis of two- and
three-dimensional digital images.
Digital geometry deals with the geometric properties of subsets of dig-
ital pictures and with the approximation of geometric properties of objects
by making use of the properties of the digital picture subsets that repre-
sent the objects. It emerged in the second half of the 20th century with
the initiation of research in the fields of computer graphics and digital im-
age analysis. It has its mathematical roots in graph theory and discrete
topology; it deals with sets of grid points which are also studied in num-
ber theory (since C.F. Gauss) and the geometry of numbers, or with cell
complexes (which have been studied in topology since the middle of the
19th century). Studies of gridding techniques, such as those by Gauss,
Dirichlet, or Jordan (for measuring the content of a set), also provide his-
toric context for digital geometry. Digitizations on regular grids are also
frequently used in numeric computation in science and engineering
The main purpose of digital topology is study the topological proper-
ties of digital images. Digital images are discrete objects in nature, but they
are usually representing continuous object. There are 2 types of approach
are a multilevel architecture and an axiomatic definition of the notion of
digital space. In image processing and computer graphics, an object in
the plane or 3-space is often approximated digitally by a set of pixels or
voxels. Digital topology studies properties of this set of pixels or voxels
ix
that correspond to topological properties of the original object. It provides
theoretical foundations for important operations such as digitization, con-
nected component labelling and counting, boundary extraction, contour
filling, and thinning.
We will first introduce the concept of finite topology that makes use
of classical topological method such as cell complexes in a discrete space
especially for digital images in digital space. Then we will present a uni-
fied method for topological analysis in 2D and 3D digital space by using
the Euler theorem for planar graphs. Then we move up to digitization
models, their we define the concepts of gauss, jordan and grid intersection
digitization, and we go through digital pictures and introduces some new
ideology. then we move up to the important section digital picture space
and strongly normal digital spaces,
x
2 Preliminaries
In this initial chapter, we will present the background needed for the the
study of Digital topology. It consists of a brief survey of set operations
and functions, two vital tools for all of mathematics. In it we establish the
notation and state the basic definitions and properties that will be used
throughout the report. We will regard the word set as synonymous with
the words class, collections and family and we will not define these
terms or give a list of axioms for set theory. this approach, often referred
to as  native  set theory is quite adequate for working with sets in the
context of digital topology.
2.1 Sets and Functions
In this section we give a brief review of terminology and notation that will
be used in this report.
if an element x is in a set A, we write
x ∈ A
and say that x is a Member of A, or that x belongs to A. If x is not on A,
we write
x /∈ A.
Definition 2.1.1. Two sets A and B are said to be equal and we write
A = B, if they contain the same elements.
Thus ,to prove that the sets A and B are equal, we must show that
A ⊆ B  B ⊆ A.
2.1.1 Set Operations
Note that the set operations are based on the meaning of the words “or”,
“and” and “not”.
1
Definition 2.1.2. The following are some set operations:
1. The union of set A and B is the set
A ∪ B = {x : x ∈ A or x ∈ B}.
2. The intersection of the sets A and B is the set
A ∩ B = {x : x ∈ A and x ∈ B}.
3. The complement of B relative to A is the set
A − B = {x : x ∈ A and x /∈ B}.
The set that has no element is called empty set and it is denoted by
φ. Two sets A and B are said to be disjoint if they have no elements in
common and it is expressed by A ∩ B = φ.
Functions:
Definition 2.1.3. A function f from set X to set Y , denoted f : X → Y
is a rule which assigns to each member x of X a unique member y = f(x) of
Y . If y = f(x) then y is called the image of x and x is called a pre-image
of y. The set X is the domain of f and Y is the co-domain or range of
f.
Note that for a function f : X → Y each element x in X has a unique
image f(x) in Y . However, the number of pre-image may be zero, one, or
more than one.
Definition 2.1.4. A function f : X → Y is one-to-one or injective
means that for distinct elements x1, x2 ∈ X, f(x1) = f(x2). In other words,
f is one-to-one provided that no two distinct points in the domain have the
same image. In contrapositive form this can be stated as : f(x1) = f(x2) =⇒
x1 = x2.
A function f for which f(X) = Y i.e, for which the image f(X) equals
the co-domain , is said to be map X onto Y or to be surjective.
A one-to-one function from X onto Y is called a one-to-one corre-
spondence or a bijection. Thus f : X → Y is a one-to-one correspondence
provided that each member of Y is the image under f of exactly one member
of X. In the case there is an inverse function f−1
: Y → X which assigns
to each y in Y its unique pre-image x = f−1
(y) in X.
2
Example 2.1.1. Let X = {a, b, c, d, e}, Y = {1, 2, 3, 4, 5} and the function
f : X → Y dened by
f(a) = 1, f(b) = 2, f(c) = 3, f(d) = 4, f(e) = 5
is a bijection with inverse function f−1
: Y → X dened by
f−1
(1) = a, f−1
(2) = b, f−1
(3) = c, f−1
(4) = d, f−1
(5) = e
.
Definition 2.1.5. If f : X → Y and g : Y → Z are functions on the sets,
then the composite function g ◦ f : X → Z is dened by
g ◦ f(x) = g(f(x)), x ∈ X
The composite function g ◦ f is some times denoted simply gf.
Example 2.1.2. Consider the function f : R → R and g : R → R dened
by f(x) = x2
, g(x) = x + 1. Then the composite function g ◦ f and f ◦ g
are both dened
g◦f(x) = g(f(x)) = g(x2
) = x2
+1, f◦g(x) = f(g(x)) = f(x+1) = (x+1)2
2.2 Metric Space
In this section, we will introduce the idea of metric space and discuss the
concepts of neighbourhood of a point, open and closed closed sets, con-
vergence of sequences, and continuity of functions.
Definition 2.2.1. A metric space is a set X where we have a notation
of distance. That is, if x, y ∈ X, then d(x, y) is the  distance between x
and y.The particular distance functions must satisfy the following conditions.
1. d(x, y) ≥ 0 for all x, y ∈ X
2. d(x, y) = 0 i x = y
3. d(x, y) = d(y, x)
4. d(x, z) ≤ d(x, y) + d(y, z)
3
Definition 2.2.2 (Open Ball). Let x0 ∈ X and r be a positive real number
.Then the open ball with centre x0 and radius r is dened to be the set
{x ∈ X : d(x, x0)  r}.
It is denoted either by Br(x0) or by B(x0; r). It is also called the open r-ball
around x0 .
Definition 2.2.3 (Open Set). A subset A ⊂ X is said to be open if for
every x0 ∈ A, ∃ some open ball around x0 ∈ A. If their exist some r  0 such
that B(x0; r) ∈ A.
Remark2.2.1. Before doing anything with open balls and open sets it would
be nice to know that open balls are indeed open sets.This follows trivially from
the denitions and the triangle inequality.
Note 2.2.1. Let {xn} be a sequence in metric space. Then {xn} converges
to y in X i for every open set y ∈ U ∃ N ∈ Z.
Theorem 2.2.1. Let (X; d) be a metric space. Then
1. φ and X are open.
2. The union of collection of open set is open.
3. The intersection of nite number of open set is open.
4. x, y ∈ X ∃ open sets U, V such that x ∈ U, y ∈ V and U ∩ V = φ.
Proof. (i) Since there are no points e ∈ φ the statement x ∈ φ whenever
d(x, e)  1, holds for all e ∈ φ. Since every point x ∈ X, the statement
x ∈ X whenever d(x, e)  1 , holds ∀ e ∈ X
(ii) If e ∈
α∈A
Uα, then we can nd a particular α1 ∈ A with e ∈ Uα1. Since
Uα1 is open, we can nd a δ  0 such that
x ∈ Uα1, d(x, e)  δ
. Since Uα1 ⊆
α∈A
Uα,
x ∈
α∈A
Uα, d(x, e)  δ
4
Thus
α∈A
Uα is open.
(iii) If e ∈
n
j=1
Uj, then e ∈ Uj for each 1 ≤ j ≤ n. Since Uj is open, we can
nd a δj  0 such that
x ∈ Uj, d(x, e)  δj
. Setting δ = min{δj}1≤j≤n we have δ  0 and
x ∈ Uj, d(x, e)  δ
forall 1 ≤ j ≤ n . Thus
x ∈
n
j=1
Uj, d(x, e)  δ
and we have shown that
n
j=1
Uj is open.
Example 2.2.1. The n− dimensional Euclidean space Rn
is a metric space
with the respected to the function d : Rn
× Rn
→ R, dened by
d(x, y) =
n
i=1
(xi − yi)2
1/2
where x = (x1, x2, . . . , xn) and y = (y1, y2, . . . , yn) ∈ Rn
where xi, yi ∈ R.
Clearly, d(x, y) ≥ 0 ∀ x, y ∈ R,
d(x, y) = 0 iff
n
i=1
(xi − yi)2
1/2
= 0
i.e, iff xi = yi ∀ i = 1, 2, . . . , n
Hence x = y iff d(x, y) = 0
Now let
x = (x1, x2, . . . , xn)
y = (y1, y2, . . . , yn)
z = (z1, z2, . . . , zn)
be three arbitrary elements of Rn
.
5
Since xi, yi, zi ∈ R ∀ i = 1, 2, . . . , n and
Pi = xi − yi and
Qi = yi − zi ∈ R
Clearly, Pi + Qi = xi − zi where i = 1, 2, . . . , n
By the corollary we just proved
n
i=1
(Pi + Qi)2
1/2
≤
n
i=1
(Pi)2
1/2
+
n
i=1
(Qi)2
1/2
i.e,
n
i=1
(xi + zi)2
1/2
≤
n
i=1
(xi − yi)2
1/2
+
n
i=1
(yi − zi)2
1/2
i.e, d(x, y) ≤ d(x, y) + d(y, z) (Triangle inequality)
Finally, d(x, y) =
n
i=1
(xi − yi)2
1/2
=
n
i=1
(yi − xi)2
1/2
= d(x, y)
All these prove that d is a metric known as Euclidean metric or Usual
metric.
Example 2.2.2. Let R be a set of real numbers, show that the function
d : R → R dened by d : (a, b) = |a − b|, ∀ a, b ∈ R, is a metric on R.
Here,
1. |a − b| ≥ 0 =⇒ d(a, b) ≥ 0, ∀ a, b ∈ R
2. |a − b| = 0, iff a − b = 0, iff a = b so that d(a, b) = 0 ⇔ a = b
3. |a − b| = |b − a| =⇒ d(a, b) = d(b, a), ∀ a, b ∈ R
4. |a − b| = |(a − c) + (c − b)| ≤ |a − c| + |c − b|
=⇒ d(a, b) ≤ d(a, b) ≤ d(a, c) + d(c, b), a, b, c ∈ R
From this d is a metric on R.
6
2.3 Topological Spaces and Examples
In this section, we give the much-delayed definition of a topological spaces.
We develop it from properties of a metrices space. In the second section
we give a few examples like finite spaces, discrete spaces, indiscrete spaces
of topological spaces.
Definition 2.3.1. A topological space is a pair (X, T ) where X is a set
and T is a collection of subsets of X satisfying:
1. φ, X ∈ T .
2. T is clodsed under arbitrary unions.
3. T is closed under nite intersections.
The collection T is said to be a topology on the set X. Members of T
are called open sets of X. The elements of X are called its points.
Example 2.3.1. Let X be a non-empty set, and let the topology be the class
of all subsets of X. This is called the discrete topology on X , and any
topological space whose topology is the discrete topology is called a discrete
space.
Suppose that X = φ, T = ℘(X) , cleraly X and φ ∈ T . Let
A = {uα/α ∈ λ} then uα ⊂ X ∀ α
∞
i=0
uα ⊂ X ∈ ℘(x) = T
so T is closed under arbitrary union.
Now we are going to show T is closed under finite intersection. Take
u1, u2, . . . , un be a finite elements of T then,
n
i=1
uα ⊂ X ∈ ℘(x) = T
i.e; T is closed under arbitrary intersection. So (X, T ) is a topological
space.
Example 2.3.2. Let X be a non-empty set, and let the topology consist
only the empty set φ and full set X. This is called the in-discrete topology
on X and any topological space whose topology is the in-discrete topology is
called a in-discrete space.
7
Here T = {φ, X} ∴ T is closed under arbitrary union,
because T consist only φ and X, so the union is either X or φ. Similarly
T is closed under finite intersections.
Example 2.3.3. Every metric space is a topological space.
Consider a metric space (X, d). Let T be the collection of
all open subsets of X.
φ and X are open in X, (φ, X) ∈ T .
Now the union of a number of open sets in X is open. i.e; T is closed
under arbitrary union. Similary, T is closed under finite intersection.
∴ T is a topology.
Thus every metric space is a topological space.
Remark 2.3.1. On R d(x, y) = |x − y| is a metric. Hence (R , d) is a
metric space and so R is a topological space. This topology is said be Usual
topology on R
Example 2.3.4. Let X = {a, b} and let T = {φ, X, a}. Cleraly T is a
topology on X called Sierpinski topology. Suppose that d : X × X → R
is a metric or pseudometric on X then d(a, a) = 0 = d(b, b) and d(a, b) =
d(b, a) = k(say). If d is metric then k  0.
Sr(a) = {a} similarly Sr(b) = {b}
∴ T = {φ, X, {a}, {b}} is a Discrete topology
If k = 0 then d will be a pseudometric. Then Sk(x) = {a, b} = X . Then
the only open sphere in X is X ∴ T = {φ, X} is In-discrete topology. From
this we can say that not every topological space is metrizable space.
2.4 Grid and examples
In these section, we are going to defining the 2D and 3D grid points and
grid cell adjacency models, then we will move to the digitization models,
including the classic Gauss, Jordan and grid intersection models and de-
fines a domain model that will generalizes all of them.The grid point set
of 2D is Z2
and 3D is Z3
.
Definition 2.4.1 (Grid -edges, -square, -cube). A pair of adjacent grid
vertices is a grid edge. A grid square is dened by four grid edges that form
a square, and a grid cube in 3-D is dened by six grid squares that form a
cube
8
The figure shows the grid vertices, edges, and square in a rectangular
plane with grid constant θ = 0.
Example 2.4.1. In 2D, Suppose that the set of position of the grid vertices
is
(0 · 5, 0 · 5) + Z2
= {(i + 0 · 5, j + 0 · 5) : i, j ∈ Z2
}
and grid edge connects a pair of adjacent grid vertices
(i + 0 · 5, j + 0 · 5)(i + 0 · 5, j + 1 · 5)or(i + 0 · 5, j + 0 · 5)(i + 1 · 5, j + 0 · 5)
A grid square is dened by as four times of grid edges in which successive
edges (modulo 4) share a vertex.
(i + 0 · 5, j + 0 · 5)(i + 0 · 5, j + 1 · 5)(i + 1 · 5, j + 1 · 5)(i + 1 · 5, j + 0 · 5)
It is similar in 3D case.
Definition 2.4.2 (3,2,1 and 0 -cells). A grid cube is called a 3-cell, a grid
square is a 2-cell, a grid edge is a 1-cell, and a grid vertex is a 0-cell.
A 2D grid point is the center point of a 2-cell and a 3D grid point is the
center point of a 3-cell. Let C
(i)
2 be the set of all i -cells in the plane (i =
0, 1, 2), and C
(i)
3 will denote the set of all i -cells in the plane (i = 0, 1, 2, 3).
We also define the following
C2 = C
(2)
2 ∪ C
(1)
2 ∪ C
(0)
2 and C3 = C
(3)
3 ∪ C
(2)
3 ∪ C
(1)
3 ∪ C
(3)
3
A pixel is either a 2-cell(grid square) or a grid point(the center of a
2-cell). Similarly a voxel is either a 3-cell (grid cube) or a grid point(the
center of a 3-cell)
Figure 2.1: A rectangular orthogonal grid
9
The figure shows the grid points in plane with grid constant θ = 0 and
second one from left: graphic sketch of 0,1 and 2-cells. right: the centers of
these cells.
Lets define grid models,
Note 2.4.1. In the grid point model, a 2-D grid G is either the innite grid
Z2
or an mn rectangular sub-array of Z2
; Similarly, a 3-D grid is either Z3
or an lmn cuboid-al sub-array of Z3
.
In the grid cell model, a 2D grid G is either C2 or an mn block of 2-cells whose
union G is a rectangular region of the Euclidean plane E2
. Similarly, a 3D
grid is either C3 or anlmn set of 3-cells whose union is a cuboid in Euclidean
space E3
.
Definition 2.4.3 (Grid line). A grid line in 2D is incident with two dif-
ferent grid points whose x or y coordinates are the same. The 2D grid Z2
can be regarded as a subset of the 3D grid Z3
by adding a third coordinate z
= 0 to every 2D grid point. In 3D, a grid plane is incident with two orthog-
onal grid lines. All of the grid points of a grid plane have the same x, y, or
zcoordinate. A grid line in 3D is a set of points, two with coordinates that
are constant in Z, whereas the third is a variable in R. Grid lines intersect
at grid points in either 2D or 3D
2.5 Adjacency
We are going to define adjacency relations between grid point, grid points
are isolated poits in the plane. we defining neighbourhoods as mathemat-
Figure 2.2: Grid points in plane and cells
10
ical as
For p = (x, y) ∈ Z2
N4(p) = {(x, y), (x + 1, y), (x − 1, y), (x, y + 1), (x, y − 1)}
and
N8(p) = N4(p) ∪ {(x + 1, y + 1), (x + 1, y − 1), (x − 1, y + 1), (x − 1, y − 1)}
Result 2.5.1. If p, q ∈ Z2
are 4-adjacent or proper 4- neighbors i p = q
and p ∈ N4(q)
The same results holds for 8-adjacent or 8-neighbors.
Definition 2.5.1 (Connected). Let M be set that contains the adjacency
relation, if M is said to be connected then ∀p, q ∈ M, ∃ a sequence p0, . . . , pn
where pi ∈ M, such that p0 = p, pn = q and pi is adjacent to pi−1, 1 ≤ i ≤ n.
Such a sequence is called path and said to join p and m in M. Maximal
connected subsets of M are called components of M
2.5.1 Adjacency in 2D and 3D Grids
Definition 2.5.2 (1 -adjacent). Two 2-cells, c1 and c2, are called 1-
adjacent i c1 = c2 and c1 ∩ c2is a 1-cell. Two grid points p1 = (x1, y1)
and p2 = (x2,y 2) are called 4-adjacent i |x1x2| + |y1y2| = 1
Two 2-cells c1 and c2 are 1- adjacent iff they are not identical but they
share a grid edge. Let pi be the centre of ci where i = 1, 2then c1 and c2 are
1 -adacent iff p1 and p2 are 4 -adjacent.
Definition 2.5.3 (0 -adjacent). Two 2 -cells c1 and c2 are called 0 -
adjacent i c1 = c2 and c1 ∩ c2 contains a 0 -cells. Two grid p1 = (x1, y1)
and p2 = (x2, y2) are called 8-adjacent i max{|x1 − x2|, |y1 − y2|} = 1
In 3-D case generally we define α- adjacent and let de be the Euclidean
metric
11
Definition 2.5.4 (α - adjacent). Two 3-cells c1 and c2 are called α -
adjacent i c1 = c2 and the intersection c1 ∩ c2 contains an α -cell (α ∈
{0, 1, 2}). Two 3-D grid points p1 = (x1, y1, z1) and p2 = (x2, y2, z2) are
called 6-adjacent i 0  de(p1, p2) ≤ 1, 18- adjacent i 0  de(p1, p2) ≤
√
2,
and 26-adjacent i 0  de(p1, p2) ≤
√
3.
Figure 2.3: α-adjacent 3 cells
Left : two α-adjacent 3-cells(α = 0, 1, 2). Middle :two α-adjacent 3-
cells(α = 0, 1). Right : two α-adjacent 3-cells.
We can now define the 2-D and 3-D grid point and grid cell adjacency
models:
Note 2.5.1. A 2-D(3-D) grid point adjacency model combines the grid point
model with an adjacency relation dened between 2-D(3-D) grid points.
A 2-D(3-D) grid cell adjacency model combines the grid cell model with an
adjacency relation dened between grid squares (grid cubes).
Both 2-D and 3-D grid point and grid cell adjacency models are called
α-adjacency grids; the value of α determines whether we use a grid point
model (α ≥ 4) or a grid cell model (α ≤ 3). A dual use of adjacencies for
2-D binary pictures P : α1-adjacency for P and α2-adjacency for ¯P ; in
this case we deals about [α1, α2] -adjacency grids
Let Z2
be the set of lattice points(i.e, a point with integer coordinates)
in the plane and Z3
for the set of lattice points in 3-space. Figure shows
the lattice points in plane and 3-space.
Now we moving to the connectivity to plane and 3-space, we are defin-
ing adjacency(something that lies next to something) between the lattice
points,
In Z2
we are going to define 8, 4-adjacent
Definition 2.5.5. Two lattice points of Z2
are said to be
1. (8- adjacent) If they are distinct and each coordinate of one diers from
corresponding coordinate of the other by at most 1.
12
Figure 2.4: Lattice points in plane and 3-space
2. (4-adjacent) If they are 8-adjacent and dier in just one of their coor-
dinates.
for n−4, 8an n- neighbour of a lattice point p is a point that is n-adjacent
to p.
Figure 2.5: 8, 4-adjacent neighbour in plane
In the case of Z3
, we are moving to 26, 18, 6-adjacency, lets recall the
definition and defining how they are in 3-space
Definition 2.5.6. Two lattice points of Z3
are said to be
1. (26- adjacent) If they are distinct and each coordinate of one diers
from corresponding coordinate of the other by at most 1.
13
2. (18-adjacent) If they are 26-adjacent and dier in at most two of their
coordinates.
3. (6-adjacent) If they are 26-adjacent and dier in just one coordinate.
Figure 2.6: 26, 18, 6-adjacent neighbour in 3-space
If p is a lattice point in Z2
then N(p) denotes the set consisting of p
and its 8-neighbours. Similarly in Z3
,If p is a lattice point in Z3
then N(p)
denotes the set consisting of p and its 26-neighbours.
Definition 2.5.7 (Black, White point). A lattice point associated with a
pixel or voxel that has value 1 in an image is called a black point ; a lattice
point associated with a pixel or voxel that has a value 0 is called a white point.
14
3 Digitization Models
In this chapter, We are using mathematics to define method of digitiza-
tion to create digital pictures and to compare results by analysing these
pictures with corresponding results in Euclidean or similarity geometry.
Gauss digitization and grid-intersection digitization, which were origi-
nally proposed for 2-D, and Jordan digitization, which was defined more
than a century ago for 3-D. We generalize these methods to allow variable
grid resolution, and we extend the Gauss and grid-intersection models to
3-D and the Jordan model to 2-D.
Here we are going to famous conjecture: There are 2 pictures in which
of these pictures are black pixel connected?
Figure 3.1: Pictures
3.0.2 Gauss digitization
C.F. Gauss (1777 - 1855) studied the measurement of the area of a planar
set S ⊂ R2
by counting the grid points (i, j) ∈ Z2
contained in S.
Definition3.0.8. Let S be a subset of the plane. The Gauss digitizationG(S)
is the union of the grid squares with center points in S.
Figure 3.2 shows the Gauss digitizations G(D) of four disksD of dif-
ferent diameters (measured in grid units). (The results would be the same
if the disks all had unit diameter and were digitized on grids of different
15
resolutions. The Gauss digitization of S on a grid of resolution h will be
denoted by Gh(S)). G(D) is an isothetic polygon that has 12 vertices for
diameter 5, 20 vertices for diameter 10, and 36 vertices for diameter 17.
Note that the number of vertices is always a multiple of 4, because a disk
that is centered at a grid point has a symmetric Gauss digitization.
Figure 3.2: Four disks (dashed) and their Gauss digitizations
(shaded)
Theorem 3.0.1. The Gauss digitization G(S) of any non-empty bounded
set S ⊂ R2
is the union of a nite number of simple isothetic polygons.
Proof. A Gauss digitization G(S) is a union of grid squares, all of equal
size. This union contains only a nite number of grid squares, because S is
bounded. Any grid square is a simple isothetic polygon.
Obviously, different sets can have identical Gauss digitizations. Figure
3.3 shows the Gauss digitization of a simple polygon with area 102, 742·5
and perimeter 4, 040 · 796, 631 . . . drawn on a 512 × 512 grid. On the upper
left, each grid square contains 64×64 squares of the original 512×512 grid;
in the upper middle, 32 × 32; and so on.
Figure 3.4 shows the relative deviations of the area and perimeter of
Gh( ) from those of when is digitized on a 2n
× 2n
grid (i.e., h =
2n
). The relative deviation is the absolute difference between the property
values forGh( ) and divided by the property value for .
Gauss digitization is defined analogously in 3D. If S ⊂ R3
, the Gauss
digitization Gh(S) is the union of all of the 3-cells (in a grid of resolution
h  0) with center points in S
3.0.3 Jordan digitization
Let S ⊂ R3
and h  0. The magnification of S by factor h is denoted by h·S.
In terms of multiplication of vectors by a scalar , we have the following:
h · S = {(h · x, h · y, h · z) : (x, y, z) ∈ S}
16
Figure 3.3: Gauss digitization of a simple polygon using grids of sizes
from 8 × 8 (upper left) to 128 × 128 (lower middle). The original
polygon was drawn on a grid of size 512 × 512 (lower right)
Figure 3.4: Relative deviations of area and perimeter for the digi-
tized polygon in Figure 1.9
17
This magnification leaves the origin (0, 0, 0) fixed; other points of R3
could
also be chosen as fixed points.
C. Jordan (1838 - 1922) used grids to estimate the volumes of subsets of
R3
. Let S ⊂ R3
be contained in the union of finitely many 3-cells. Magnify
S by factor h with respect to an arbitrary fixed point p ∈ R3
; this trans-
forms S into Sp
h. Let lp
h(S) be the number of 3 -cells completely contained
in Sp
h and up
h(S) the number of 3 -cells that have non-empty intersections
with Sp
h. Then h−3
· lp
h(S) and h−3
· up
h converge to limits L(S) and U(S),
respectively, as h → ∞, these limits are the same for any p. Jordan called
L(S) the inner volume and U(S) the outer volume of S or the volume V (S)
of S if L(S) = U(S)
Definition 3.0.9. Let S be a nonempty subset of R2
. Let J−
h (S) be the
union of all 2-cells (for grid resolution h  0) that are completely contained
in S, and let J+
h (S) be the union of all such 2-cells that have nonempty
intersections with S. Jh(S) is called the inner Jordan digitization of S and
J+
h (S) the outer Jordan digitization of S. For S ⊆ R3
, we use 3-cells instead
of 2-cells. For brevity, we denote J−
1 and J+
1 with J and J+
, respectively.
Outer Jordan digitization is also called super-cover digitization.
Figure 3.5: Inner and outer Jordan digitizations of a centered disk
Figure 3.5 shows a 2-D example in which S is a circle of radius n (in grid
units) for n = 4 (left), n = 8 (middle), and n = 16 (right). If the frontier
of a non-empty set S ⊂ R2
does not contain any grid edge segment of
nonzero length, then the frontier of Jh(S) never intersects the frontier of
J+
h (S). For example, this is the case if S has a smooth frontier that has
continuous partial derivatives with respect to both coordinates and has
positive curvature everywhere. A straight line γ has an empty J(γ) and a
connectedJ+
(γ).
18
3.0.4 Grid-intersection digitization
Gauss digitization and inner Jordan digitization are obviously not appro-
priate for curves or arcs. Outer Jordan digitization is appropriate, but, in
this section, we will define grid-intersection digitization, which is com-
monly used for arcs and curves in the plane
Definition 3.0.10. The grid-intersection digitization R(γ) of a planar
curve or arc γ is the set of all grid points (i, j) that are closest (in Euclidean
distance) to the intersection points of γ with the grid lines.
Figure 3.6: Grid-intersection digitization of an arc.
Figure 3.6 is an example of grid-intersection digitization of an arc. Note
that an intersection point may have the same minimum distance to two
different grid points; such an intersection point contributes two grid points
to R(γ). (Alternatively, we could always choose, for example, the right
point or the upper point.) A traversal of γ defines an ordered sequence
(list) of grid points in R(γ). We assume the following :
1. if an intersection point is at the same minimum distance from two
grid points, we list only the grid point that has the larger x-coordinate,
or ,if their x-coordinates are equal, the one with the larger y-coordinate;
2. if consecutive intersection points have the same closest grid point,
we list that grid point only once.
The resulting ordered sequence of grid points is called the digitized
grid intersection sequence ρ(γ) of γ . It defines a polygonal arc (or poly-
gon) with vertices at grid points. The sequence represents R(γ) uniquely
if an intersection point is never at the same minimum distance from two
grid points.
A similar method can be used to digitize a 3-D arc or curve γ for each
intersection point of γ with a grid plane, we add the grid point(s) closest
to the intersection point to the digitization
19
Successive pairs of grid points in ρ(γ) define steps of length 1 along
grid lines and diagonal steps of length
√
2. The directions of the steps can
be represented with codes 0, 1, . . . , 7 as shown at the lower left of Figure
3.7; code i represents a step that makes angle (45 · i)◦
with the positive
x-axis. Figure 3.7 shows an example of the directional encoding of an arc.
The directional codes are usually called chain codes. A chain is an ordered
finite sequence of code numbers. The length of a chain is the number of
code numbers in it; note that this length is not related to the geometric
length of the arc or curve represented by the chain.
for any γ, we have the following:
J−
h (γ) = φ ⊆ Rh(γ) ⊆ J+
h (γ)
Let γ be rectifiable; thus γ has a well-defined length L(γ). The length of
ρ(γ) is not a good estimate of L(γ); it does not necessarily converge to L(γ)
as the grid constant goes to zero.
Example3.0.1 (Particular). consider the straight line segment pq in Figure
3.8 that has a slope of 22 · 5◦
and a length of
5
√
5
2
. The length of (pq) is
3 + 2
√
2 for grid constant 1 and
(5+5
√
2)
2
for all grid constants
1
2n (n ≥ 1).
then the length of (pq) does not converge to
5
√
5
4
as the grid constant goes to
zero.
Figure 3.7: Directional encoding of an arc. Starting at grid
point p, the arc can be represented by the sequence of codes
677767000001 . . . 65
Figure 3.8: Example
20
Example 3.0.2 (General). consider a line segment γ with slope
1
(m+1)
. Its
chain code representation is (0m
1)k
, where k depends on the grid resolu-
tion. No matter what k is, the length of ρ(γ) is k(m +
√
2) where L(γ) is
k 1 + (m + 1)2. The ratio L(ρ(γ))/L(γ) is not unless m = 0 or m → ∞
We conclude this chapter by discussing the grid-intersection digitiza-
tion of a straight line segment. Bresenham ’s algorithm is a standard rou-
tine in computer graphics . We discuss the use of this algorithm to digitize
a segment of a line y = ax + b in the first octant (i.e., with slope a ∈ [0, 1]).
To draw the resulting digital straight line segment, we increase the x-
coordinate stepwise by +1; the y -coordinate is occasionally increased by
+1 and remains constant otherwise.
By interchanging the start points and endpoints of the segment, we
can handle octants to the left of the y-axis. In the eighth octant, we use a
y-increment of 1, and in the second and seventh octants, we interchange
the roles of the x- and y-coordinates.
The digital straight line segment is a sequence of grid points (xi, yi), i ≥
1.The point (x1, y1) is the grid point closest to the end point of the real
segment. If we already have point (xi, yi), the next point has x-coordinate
xi+1, and, for its y-coordinate, we must decide between yi and yi + 1. Let
y = a(xi + 1) + b, and define the differences h1 and h2 by figure 3.9
Figure 3.9: Dierences in h1 and h2 from the correct y value
21
h1 = y − yi = a(xi + 1) + b − yi
h2 = (yi + 1) − y = yi + 1 − a(xi + 1) − b
h1 − h2 = 2a(xi + 1) − 2yi + 2b − 1
We choose (xi +1, yi) if h1  h2 and(xi +1, yi +1) otherwise. For reasons
of efficiency we use integer arithmetic only, so we do not use h1−h2 for this
decision. Rather, let p = (x1, y1) and q = (xq, yq) be the grid points closest
to the end points of the segment, and let dx = xq − x1 and dy = yq − y1. Let
ei = dx · (h1h2) thus ei = 2(dy · xi − dx · yi) + b where b = 2dy + 2dx · b −
dx is independent of i. Thus ei can be updated iteratively for successive
decision at xi + 1 and xi + 2 :
ei = 2dy · xi − 2dx · · · yi + b
ei+1 = 2dy · −2dx · yi+1 + b
Thus
ei+1 − ei = 2dy(xi+1 − xi) − 2dx(yi+1 − yi)
= 2dy − 2dx(yi+1 − yi)
because xi+1 = xi+1; this is sufficient for deciding about the y-increment.
Let x1 = xp = 0, and y1 = yp = 0 give the starting value
ei = 2dy · x1 − 2dx · y1) + 2dy + dx(2b − 1)
= 2dy − dx
Bresenham ’s algorithm for first octant
1. Let
dx = xq − xp,
dy = yq − yp
y = yq
b1 = 2 · dy
error = b1 − dx
b2 = error − dx
22
2. Repeat Steps 3 through 6 until x  xq. Stop when x  xq.
3. Change the value of (x, y) to the value of a line pixel.
4. Increment x by 1.
5. If error  0 let error = error + b1, or else increment y by 1 and let
error = error + b2
6. Go to step 2.
At Step 1, we have error = e1 = 2dydx. The values b1 = 2 · dy and
b2 = 2 · dy2 · dx are used to efficiently update the variable error. The
algorithm runs in O(xq − xp) time because, for each i, it involves only a
constant number of operations: setting one pixel value, two simple logical
tests, one addition, and one or two increments.
3.1 Type digital sets
If γ is, for example, a straight line, straight line segment, circle, or parabola,
we call Rh(γ) a digital straight line, digital straight segment, digital circle,
or digital parabola, respectively.
If S is, for example, a disk, square, or convex set (and similarly in 3-D),
we call J−
h (S), Gh(S), orJ+
h (S) a digital disk, digital square, or digital con-
vex set, respectively, provided it is connected. We call a connected set of
grid points a digital disk and so forth (with respect to a given digitization
model), if there exists a disk and so forth that has that connected set as its
digitization.
If Gauss or inner Jordan digitization is used, a connected set can have
a digitization that consists of several connected isothetic polygons (poly-
hedra). On the other hand, the outer Jordan digitization of a connected set
S is always a single connected isothetic polygon or polyhedron. However,
J+
does not preserve simple connectedness; it can create holes.
Figure 3.10 (In the example on the right, the disk is not shown: this is
done to illustrate the difficulty of recognizing digital disks.) shows how a
disk in different positions can create different digital disks by Gauss dig-
itization. The left and center digital disks both consist of 24 grid points,
23
but the disk on the right consists of only 22 grid points. It can be shown
that the number of different digital disks (up to translation), with respect
to Gauss digitization, that consist of exactly n âL’ˇe 1 grid points is at most
the following:
O(n2
)
Gauss and Jordan digitization allow us to study methods or algorithms of
digital geometry unders lightly different assumptions about there relation-
ships between sets S in the Euclidean plane and their digitizations. Evi-
dently, J−
h (φ) = Gh(φ) = J+
h (φ) = φ And J−
h (R2
) = Gh(R2
) = J+
h (R2
) = R2
(and similarly for R3
). If S is a non-empty proper subset of R2
or of R3
with
a smooth frontier, we have J−
h (S) ⊂ J+
h (S). Furthermore, the following
J−
h (S) ⊆ Gh(S) ⊆ J+
h (S), ∀S ⊆ R2
(S ⊆ R3
)
One or both relations ⊆ in the left part of above equation can be re-
placed by =, but both cannot be if S has a smooth frontier. Let S be a finite
union of grid squares; then we have J−
(S) = G(S) = J+
(S).
Figure 3.10: Gauss digitizations of the same disk at dierent loca-
tions
Figure 3.11: Inner and outer diamond and ball digitizations in the
plane. The inner digitization is the union of the grid squares
centered at black grid points, and the outer digitization (frontier
shown as a bold black line) also contains the grid squares centered
at shaded grid points. Left: diamond digitization. Right: ball
digitization.
24
3.2 Domain digitizations
In this section, we define a framework for a general class of digitization
models. To simplify the discussion, we formulate this framework in n
dimensions (n ≥ 1), but our main interest is of course in n = 2 and n = 3.
Let the following be the n-cell centered at the origin O = (0, . . . , 0):
cube
= {(x1, . . . xn) : max
1in
|xi| ≤
1
2
Let φ = σ ⊆ cube and consider translates σ(q) = {q + p : p ∈ σ}
of σ centered at grid points q ∈ Zn
. In particular cube(q) is the n-cell cq
centered at q.
We will use the translates σ(q) of σ as the domains of influence for
digitizations that is dig+
σ and dig−
σ .For any set S ⊆ Rn
dig+
σ (q) is the union
of all cq such that σ(q) intersects S and dig−
σ (S) is the union of all cq such
that σ(q) is contained in S. Thus
cq ⊆ dig+
σ (S) iff
σ
(q) ∩ S = φ
cq ⊆ dig−
σ (S) iff
σ
(q) ⊆ S
So dig+
σ (S) is called the outer σ− digitization of S and dig−
σ (S) the inner
σ -digitization of S. For any S ⊆ Rn
, we have dig−
σ (S) ⊆ dig+
σ (S) ⊆ C
(n)
n .
We now show that Jordan and Gauss digitizations are all σ-digitizations
and that grid-intersection digitization can also be regarded as a σ-digitization.
1. If σ = c be for n = 2, 3 we obtain the inner and outer Jordan
digitizations such that for S ⊆ R2
or S ⊆ R3
we have
J+
(S) = dig+
cube(S)
J−
(S) = dig−
cube(S)
2. σ = {0}, we have σ(q) = {q} so that dig+
σ (S) = dig−
σ (S) ∀S ⊆
Rn
. For n = 2 or 3, this set is just the Gauss digitization G(S).
25
3. If σ = {(x1 . . . xn) : ∃i, (1 ≤ i ≤ n∧xi = 0)∧ max
1≤i≤n
|xi| ≤
1
2
}, dig+
σ ,is
essentially grid- intersection digitization.If γ is a planar arc or curve
and n = 2, it is not hard to see that R(γ) = dig+
σ (γ), provided γ does
not intersect any grid line midway between two grid points.
Thus the Jordan digitizations are σ- digitizations in which σ is a cube;
Gauss digitization is a σ- digitizations in which σ is a point; and grid-
intersection digitization is essentially a σ-digitization in which σ is a
cross. Other digitization models can be defined by using other simple
sets σ . These digitization are illustrated in figure 3.11 The figure also
illustrates a general property that follows directly from the definitions of
dig+
σ and dig−
σ
σ1
⊆
σ2
⇒ dig+
σ1
(S) ⊆ dig+
σ2
(S)  dig−
σ2
(S) ⊆ dig−
σ1
(S)
26
4 Digital Topology
Digital pictures are rectangular arrays of non-negative numbers. The anal-
ysis of a digital picture usually involves segmenting it into parts and
measuring various properties of and relationships among the parts. In
particular, one often wants to separate out the connected components of
a picture subset to determine the adjacency relationships among those
components, to track and encode their borders, or to thin them down
to skeletons that have no interiors, without changing their connected-
ness properties. There are standard algorithms for doing all of these tasks;
but to prove that they work, one needs to establish some basic topological
properties of digital picture subsets.
4.1 Introduction
Digital image processing or picture processing is a rapidly growing dis-
cipline with broad applications in business (document reading), industry
(automated assembly and inspection), medicine (radiology, hematology,
e.t.c. . .), and the environmental sciences (meteorology, geology, land-use
management, e.t.c. . .), among many other fields. Most of this work in-
volves picture analysis: given a picture, to construct a description of it in
terms of the objects it contains or the regions of which it is composed and
their properties and relationships. For example, a printed page is made up
of characters on a background; a blood smear on a microscope slide con-
tains blood cells on a background; a chest x-ray shows the heart, lungs,
ribs, e.t.c. . ..; a satellite TV image of terrain is composed of terrain types;
and so on. The process of decomposing a picture into regions, or into ob-
jects and background, is called segmentation.
A picture is input to the computer by sampling its brightness values
at a discrete grid of points, and digitizing or quantizing these values to a
finite number of binary places. The result of this process is called a digital
picture; it is a rectangular array of discrete values. The elements of this
array are called pixels (short for picture elements), or sometimes simply
27
points, and the value of a pixel is called its gray level. Segmentation is
basically a process of assigning the pixels to classes; one simple way of
doing this, called thresholding, classifies the pixels according to whether
or not their gray levels exceed a given threshold value t.
Once a picture has been segmented into subsets, it can be described in
terms of properties of these subsets and relationships among them. Some
of these properties depend on the gray levels of the points that belong to
a subset, but others are geometrical properties which depend only on
the positions of these points. Especially basic are topological properties
of the subsets, involving such concepts as adjacency and connectedness,
but not size or shape. Topological properties of digital picture subsets are
useful for a number of reasons. After a subset has been singled out, e.g.,
by thresholding, one usually wants to further segment it into connected
regions, since these often correspond to distinct objects (characters, blood
cells, e.t.c. . .). One may also want to track the borders of these regions,
since the sequences of moves around the borders provide a compact en-
coding of region shape. Alternatively, one may want to thin the regions
into skeletons, without changing their connectedness properties, since
this too yields a compact representation (e.g., an elongated region is rep-
resented by a set of arcs or curves). The adjacency or surroundedness rela-
tions among the regions can be compactly represented by a graph whose
nodes are the regions, and in which two nodes are joined by an arc iff those
two regions are adjacent.
Many algorithms exist for segmenting a picture subset into its con-
nected components, border following, thinning, and constructing the ad-
jacency graph of a partition of a picture; To prove that these algorithms
work correctly, or even (in some cases) to state them precisely, it is neces-
sary to establish some of the basic topological properties of digital picture
subsets. This gives an introduction to the study of such properties, which
we call digital topology. Of course, this is nothing more than the study of
some simple properties of finite sets of lattice points;
The image normally considered in digital topology are binary arrays
all of whose elements have value 0 or 1, in some part of digital topology
can be generalized to fuzzy digital topology, which discuss with gray-scale
image arrays, that is elements are in range 0 ≤ x ≤ 1
The array elements of a two dimensional image are called pixel , those
of a three dimensional image are called voxel .There is a problem for con-
sidering the border of the image array, so we assume that the array is
ubounded in all directions this allows image in which an infinite number
of pixels or voxels have value 1.
28
4.2 Digital Pictures
A 2D digital picture captured or constructed on a surface is typically de-
fined using a finite data structure that models regularly spaced planar or-
thogonal grid.
Definition 4.2.1 (Pixel). A picture P is a function dened on a nite
rectangular subset of G of a regular planar orthogonal array,where G is called
a grid, and an elements of G is called a pixel. P assigns a value P(p) to each
pixel p ∈ G
The values of a integer can be integers, floating point(Real numbers),
or even a finite sets.
For example, values of pixels in a colour picture are denoted by triples of
scalar values, i.e, red green and blue or hue, saturation and intensity.
Definition 4.2.2 (Voxel). A (3D)picture P is a function dened on a
nite rectangular rectangular cuboid in a regular spatial(Space) orthogonal
array, where G is called a(3D) grid, and an elements of G is called a voxel.
P assigns a value P(p) to each pixel p ∈ G
Pixels have grid- based coordinates, the regular planar orthogonal ar-
ray is Z2
= Z × Z = {(i, j) : i, j ∈ Z}. Every grid points in Z2
is the center
point of a grid square with sides of length 1. The corners of grid squares
are called grid vertices.
A 2D grid of size m × n is a rectangular array of grid points
Gm,n = {(i, j) ∈ Z2
: 1 ≤ i ≤ m ∧ 1 ≤ j ≤ n} (4.1)
or a rectangular set of grid squares,
Gm,n = { grid square c : (i, j) = center of c ∧ 1 ≤ i ≤ m ∧ 1 ≤ j ≤ n}
where m, n 1
Pictures are quantized as well as sampled, a pixel or voxel can have
only a finite number of possible values. The range of values in a picture P
of the form {0, . . . , Gmax},where Gmax is maximal picture value or maximal
gray level, when 0 ≤ P(p) ≤ Gmax where Gmax ≥ 0. If Gmax = 0 then its
a constant picture( blank picture).From an example we already said, the
values in a colour picture are triples [u1, u2, u3], such as red, green and
blue colour components. These triples are mapped onto {0, . . . , Gmax}.
The range of values of the pixels or voxels in a binary picture is {0, 1}, i.e.,
Gmax = 1
29
4.2.1 Picture resolution and picture size
Picture resolution is a display parameter. It is defined in dots per inch i.e.,
dpi or spatial pixel density, and its has a standard value for recent screen
technologies is 72 dpi. Some recent printers use resolutions such as 300
dpi or 600 dpi and such values can also be used for picture presentation
on a screen.
In human eye itself makes use of sampled pictures. The retina of the
eye is an array of about 125 million photoreceptor cells called rods and
cones. A rod is about 0.002 mm in diameter and a cone is about 0.006 mm
in diameter
Pictures whose acquisition satisfies the traditional pinhole camera model
are captured on planar surfaces. The light-sensitive array of a typical dig-
ital camera, which is a charge-coupled device (CCD) matrix, can be re-
garded as a rectangular set of square cells in a plane. The elements of the
matrix capture a discrete set of pixel values. Other types of cameras may
capture pictures on non-planar surfaces.
Example 4.2.1. Figure 4.2 shows a super-high-resolution panoramic pic-
ture captured with a rotating line camera. A geometric model of the panoramic
picture acquisition process assumes that the picture is captured on a cylindric
surface.
Discrete methods of picture generation are frequently used in both art
and technology. The dots in a pointillistic(the use of small area of colour to
construct an image) painting can be as small as 1/16 of an inch in diameter.
Figure 4.1: Grid point and grid square notation in a plane
30
Picture size is another important picture property. Pictures cannot be
arbitrarily large; picture capturing, display, and printing technologies will
always impose finite limits. The number of pixels in a typical picture has
increased greatly since the early days of picture analysis and computer
graphics. In those days,a picture might contain only a few thousand pix-
els; today, a color picture may require gigabytes of memory, Figure 1.5 also
shows that how many pixels,
Figure 4.2: A 380◦
panoramic picture of Auckland copied from Na-
tional geographic channel
The full-resolution picture consists of about 104
×5·104
pixels captured
on a cylindric surface with a rotating line camera(report of MATLAB).
Algorithms in picture analysis are often applied to the pixels of a pic-
ture in sequence, where the sequence is obtained by scanning the grid.
Definition 4.2.3 (Scan). A scan of a grid Gm,n is a one-to-one mapping
φ of the m × n pixels of the grid into a linear sequence φ(1), . . . , φ(mn). A
scan can also be viewed as an enumeration of the pixels; φ(k) is the k-th pixel
where 1 ≤ k ≤ mn.
4.2.2 Connectedness
We begin by formulating the concept of connectedness for subsets of a
digital picture . For concreteness, we assume that is an array of lattice
points having positive integer coordinates (x, y), where 1  x  M, 1 
y  N
Definition 4.2.4 (4-neighbors). The 4-neighbors of (x, y) are its four hor-
izontal and vertical neighbors (x ± l, , y) and (x, y ± l).
31
Definition 4.2.5 (8-neighbors). The 8-neighbors of (x, y) consist of its
four neighbors together with its four diagonal neighbors (x + 1, y ± 1) and
(x − 1, y ± 1)
Note 4.2.1. If (x, y) is a border point of , i.e., if x = 1 or M, y = 1 or
N, some of these neighbors do not exist. If the points P and Q of are
neighbors, we say that (4- or 8-) adjacent.
Definition 4.2.6. Let P, Q be points of . By a path from P to Q we
mean a sequence of points P = p0, p1 · · · pn = Q such that Pi, is a neighbor
of Pi1, 1  i  n
Let S be a nonempty subset of . To avoid special cases, we assume
that S does not meet the border of
Definition 4.2.7 (Connected). If P and Q are connected in S if there
exists a path from P to Q consisting entirely of points of S.
Result 4.2.1. Connectedness in S is an equivalence relation
Definition4.2.8. The equivalence classes dened by this relation are called
the (connected) components of S. If S has only one component, it is called
connected.
4.2.3 Arcs and curves
A commonly used method of shape analysis in digital picture processing
involves reducing thick digital point sets to idealized thin forms e.g., re-
ducing elongated, simply connected objects to arcs, or objects that have a
single hole to closed curves.
Definition 4.2.9 (Arc). If S ⊆ is called an arc if it is connected, and
all but two of its points (its endpoints) have exactly two neighbors in S, while
those two have exactly one.
An arc can be regarded as a path which neither crosses nor touches
itself ,i.e., its points can be numbered Q1, . . . Qn , so that Qi is a neighbor
of Qj iff i = j ± 1. To rule out degenerate cases, we shall assume that an
arc always has at least two points. S cannot be both a 4-arc and an 8-arc
unless it is a horizontal or vertical straight line segment.
Theorem 4.2.1. An arc is simply connected.
32
Proof. It can be proved by induction on the number of points in the arc,
using the fact that, if we delete an endpoint from an arc, the result is still an
arc (if it has more than one point); the details, which involve an enumeration
of cases,
Remark 4.2.1. This result is not true if we use 4-connectedness for both
the arc and its complement, since the 4-arc
P P P
P P
P P
has a 4-hole.
Definition 4.2.10. If S ⊆ is called a curve if it is connected, and each
of its points has exactly two neighbors in S.
We can number the points of a curve Q1, . . . , Qn so that Qi is a neighbor
of Qj iff i ≡ j ± 1(modulon). To rule out degenerate cases, we will assume
that a 4-curve always has at least eight points; and an 8-curve, four points.
Note that no S can be both a 4-curve and an 8-curve.
Theorem 4.2.2. A curve has at most one hole.
Proof. From theorem 2.21 and the fact that deleting any point from a curve
makes it an arc. Note that it, too, is false if we use 4-connectedness for both
S and S; we proove in the case of 4-curve
P P P
P P P
P P P
P P P
has two 4-holes. Indeed, as we shall next see, if we use opposite types of
connectedness for S and ¯S, then a curve has exactly one hole; but if we use
8-connectedness for both, then the 8-curve has no 8-holes.
P
P P
P
33
Similarly, other cases can prove.
Theorem 4.2.3 (Jordan Curve Theorem for digital curves). A curve has
exactly one hole.
Proof. The proof is similar to a standard proof of the theorem for polygons.
Let S be a curve, and P /∈ S; we say that P ≡ (x, y) is inside S if the half-line
Hp = {(z, y) : x ≤ z ≤ M} crosses S an odd number of times, and outside S
otherwise. Crosses must be properly dened, since HP may meet S in runs
of consecutive points; such a run is a crossing if S enters the run from the
row above H and exits to the row below H, or vice versa. It can then be
shown that neighboring points of ¯S are either both inside or both outside S;
hence points in the same component of ¯S are either all inside or all outside.
The theorem follows from this and the fact that the inside and outside of a
curve are both nonempty.
Result 4.2.2. Every point of a curve S is adjacent (in the sense of ¯S s
connectedness) to both components of ¯S
4.2.4 Thinning
The goal of thinning is to remove points from a set S without changing the
connectedness properties of either S or ¯S. The class of points which can
be safely removed is characterized by the following result, in which N(P)
denotes the set of 8-neighbors of P.
Result 4.2.3. The following properties of P of S are equivalent :
1. S ∩ N(P) has the same number of components as S ∩ [N(P) ∪ {P}]
2. ¯S ∩ N(P) has the same number of components as ¯S ∩ [N(P) ∪ {P}]
3. S ∩ N(P) has just one component adjacent to P
4. ¯S ∩ N(P) has just one component adjacent to P
5. S − {P} has the same number of componets as S and ¯S ∪ {P} has the
same number of components as ¯S
Definition 4.2.11 (Simple). A point having properties of above result is
called simple
34
An isolated point of S (having no neighbors in S) and an interior point
of S (having all eight neighbors in S) cannot be simple; while an end point
of S (having exactly one neighbor in S) is always simple.
Remark 4.2.2. If S is simply connected, and P ∈ S is not an isolated,
interior, or simple point, then S − {P} is not connected, but consists of
components that are simply connected. Using this observation, we can show,
using induction on the number of points in S, that if S is simply connected
and has more than two points it must have at least two simple points. In fact,
we can show that if S has only two simple points, they must both be ends,
and that if S has an interior point it has a simple point that is not an end.
Theorem 4.2.4. If S is an arc i it is simply connected and has exactly
two simple points.
From the above remark and Result 2.2.3 follows that connected S s that
have only one hole; If P ∈ S is not isolated, interior, or simple, then S−{P}
is either simply connected or not connected.
Theorem 4.2.5. If S is a curve i it is connected has exactly one hole,
and has no simple points.
A connected S having just one hole can be thinned to a curve by re-
peatedly deleting its simple points.
4.2.5 Thinning algorithm
Let P = (V, m, n, B) and P = (V, m, n, B − D) be digital pictures where
D ⊆ B we say that P is obtained from P by deleting the points in D. Al-
ternatively, we may say that P is obtained from P by adding the points
in D. A class of topology-preserving point deletion algorithms that are
much used in image processing are known as thinning algorithms.
Thinning originated in an attempt to compactly represent digital im-
ages of alphanumeric characters or line drawings by sets of digital arcs
and curves. A related goal was to develop a digital version of the medial
axis transformation proposed by Blum for shapes in the Euclidean plane.
For this reason the output of a thinning algorithm is sometimes called a
medial line.
Another kind of digital approximation of Blum’s transformation that
does not always preserve topology is the discrete medial axis transforma-
tion, which finds the black points at which the distance from the white
point set attains a local maximum. This normally involves computing the
distance transform of the image, in which each black point is labeled with
35
its distance from the white point set. These processes are used in some
thinning algorithms.
A non-topological requirement on a thinning algorithm is that each
elongated part of the input black point set should be represented by an arc
in the output black point set. An algorithm that reduces the number of
black points without necessarily satisfying this condition, but which pre-
serves the topology of the image, is said to perform shrinking to a topo-
logical equivalent. A related type of process is shrinking to a residue , in
which holes are not preserved but each black component is shrunk to a
single isolated point (called a residue) which may then be deleted.
4.2.6 Border following
A set S ⊆ can be represented by specifying its borders; each border can
be specified by defining a starting point and a sequence of moves from
neighbor to neighbor. This representation, which is often quite compact,
is very commonly used in image processing. In this section we define the
border representation and give an algorithm for constructing it.
Definition 4.2.12 (Border). The border of S ⊆ is the set of points of
S that have 4-neighbors in ¯S.
A thicker border consisting of points that have 8-neighbors in ¯S; The
border of S consists, in general, of many parts, since S may have many
components, each of which has many holes.
Definition 4.2.13 (D-border (CD) ). Let C be a component of S and D
a component of ¯S. The D-border of C is the set of points of C that have
4-neighbors in D. We denote this border by CD.
BF4 algorithm
We now describe an algorithm that successively visits all the points of
the D-border of C. We assume that C is 4-connected and D 8-connected;
that C has more than one point; and that we are given an initial pair of
4-neighboring points P0 ∈ C, Q0 ∈ D, which we assume to be distinctively
marked. The algorithm, which we call BF4, specifies how to find a new
point pair (Pi+1, Qi+1), given the current pair (Pi, Qi)
BF4 operates as follows: Let the 8-neighbors of Pi, in clockwise order
starting with Qi, be Ri1 = Qi, Ri2, . . . Ri8 Let Rij be the first of the R s that
is in C and is a 4-neighbor of Pi (i.e., j is odd); such an Rij must exist, since
C is 4-connected and has more than one point. If Rij−1 is in D, take Rij as
36
Pi+1 and as Qi+1; otherwise, take RiJ−1 as Pi+1 and Rij−2 asQi + 1. If, for
some i  0, Pi is P0 and one ofRi1, . . . Rij is stop.
To illustrate the operation of BF4, we give a simple example. Let C be
the set of P s shown below; the blanks are in ¯S, while P∗
is in S but not
in C. Let P0 be the P on the third row, and let Q0 be the blank on its left.
Then the successive steps of BF4, are as follows:
Input :
P∗
P
P
P P
1. Here R03 = P1, R02 = Q1
P∗
R02 P
Q02 P0
P
2. Here R17 = P2, R16 = Q2 Note that R14 = P∗
is in S, but is ignored
R12 R13 P∗
Q1 P1 R15
P R16
P P
3. Here R22 = P3, R21 = Q3(= Q2) Note that P2 = P0, but algorithm
does not stop since Q0 is not one R21, R22, R23
P∗
P
P2 Q2
P P
37
4. Here R37 = P4, R36 = Q4
P∗
P
P Q2R32
P P3 R33
R36 R35R34
5. Here R45 = P5, R44 = Q5
P∗
P
R44 P
R43 P4 P
R42 Q4
6. Here P5 = P0 and Q5 = Q0, so the algorithm stops
P∗
P
Q5 P5
P P
The successive Pi s chosen by BF4 are 4-connected to each other in S (though
they may not be 4-neighbors); the successive Qis are 8-connected to each
other in ¯S; and Pi is 4adjacent to Qi. Thus the Pi s are all in C, the Qis all in
D, and the Pi s are all on the D-border of C. The Pi s constitute the entire
D-border can be outlined as follows: the operation of BF4 is unaffected if
all points of ¯S except those in D (and in the background component) are
transferred from ¯S to S; hence it suffices to prove the assertion for C s that
have at most one hole. For simply connected C s, we can use induction on
the number of points in C; since , C has simple points, and
if BF4 works when a simple point is deleted, it still works when the point
is present. For C s with one hole, we can first show that BF4 works if C is
a curve.
38
The algorithm (BF8) for the case where C is 8-connected and D 4-
connected is very similar. Here we simply let Rij be the first of the R s
that is in C, and take Pi+1 = Rij, Qi+1 = Rij−1. Thus Pi+1 is an 8-neighbor
of Pi, and Qi+1 is 4-connected in ¯S to Q. Incidentally, our choice of clock-
wise order for the R s implies that borders are followed keeping C on the
right; thus the outer border of C is followed clockwise, and its hole borders
counter clockwise.
Since the successive Pi s chosen by BF4 or BF8 are 8-neighbors of each
other, we can specify the D-border of C by giving the position of the start-
ing point P0 together with a string of 3-bit numbers (0, . . . , 7) representing
the moves from one Pi to the next. For example, we can use the code
3 2 1
4 Pi 0
5 6 7
to represent these moves (mnemonic: code i corresponds to a move in
direction 45i◦
). This representation is called a chain code.
To reconstruct C from its borders, we need to know the pair of points
(P0, Q0) and the chain code for each border CD. It is then straight forward
to mark the points of CD, as well as a band of points in D adjacent to CD,
for each D. When this has been done, it is easy to color in the interior of
C. Note that if we had not marked the points in D that adjoin C, it would
not be easy to decide which side of the D-border of C is interior to C.
4.2.7 The adjacency tree
Given S ⊆ , the components of S and ¯S partition into connected re-
gions. A useful way of (partially) describing a partition of is in terms
of its adjacency graph, which specifies the regions and their adjacencies.
When the partition consists of the components of a set and its complement,
we can show that its adjacency graph is a tree. It can also be shown that
if a component of S and a component of ¯S are adjacent, one of them sur-
rounds the other; thus, under the relationship surrounds, the tree becomes
a directed tree. In this section we define these concepts more precisely.
Definition 4.2.14 (Adjacency graph). Let S = {S1, . . . Sn} be a partition
of prod. The adjacency graph g of this partition is the graph whose node set
is S , and in which two nodes Si, Sj are joined by an arc i the sets Si and
Sj are adjacent (i.e., some point of Si is a neighbor of some point of Sj)
39
When S consists of the connected components of S and ¯S, we shall
denote its adjacency graph by gS,. In this case it does not matter whether
we use 4-neighbors or 8-neighbors to define the adjacency relationship,
since if a component of S and a component of ¯S are 8-adjacent, they must
also be 4-adjacent.
Theorem 4.2.6. gS is a tree
Proof. We must show that gS does not contain a cycle. Let Tbe a component
of S and U, V components of S that are adjacent to T (or vice versa); then
any path from U to V , in the sense of the connectedness of S, must meet
T, since otherwise the regions encountered by the path, together with T,
would constitute a cycle. If we knew that U and V had to be in dierent
components of ¯T, then no path between them could lie entirely in ¯T. Suppose
they were in the same component W of ¯T; since they are both adjacent to
T, they would both have to meet WT , the T-border of W. But since BF
works, we know that WT is connected , and WT ⊆ ¯S, since points of ¯T that
are adjacent to the component T of S cannot be in S. Thus U and V cannot
both meet WT , since they are dierent components of ¯S; hence they cannot
be in the same component of ¯T, so that T separates them, which proves that
gS, has no cycles.
Definition 4.2.15 (Surrounds). Let A, B be any subsets of . We say
that A surrounds B if any 4-path from B to the border of meets A.
Theorem4.2.7. Let C, D be adjacent components of S, ¯S, respectively; then
either C surrounds D or D surrounds C. Moreover, exactly one component
of ¯S surrounds each component of S (and vice versa, for non-background
components of ¯S).
Proof. As by the above Theorem 4.2.6 , two D s cannot be in the same
component of ¯C; hence at most one D can be in the background component,
so that all others are in holes and so are surrounded by C. On the other
hand, there does exist a D0 not surrounded by C On any 4-path from C
to the border of , let Pi be the last point of C; then Pi+1 is in some D,
but is not surrounded by C, hence is in D0, so that D0 surrounds C. hence
proved
40
5 Binary digital picture spaces
T.Y. Kong and A.W. Roscoe, the first two authors presented a general the-
ory of binary digital pictures. In that theory a binary digital picture was
represented by an ordered pair (A, S), where S was the set of black grid
points on the 2-D square grid or 3-D cubic grid, and A was an adjacency
relation, on the set of all grid points, that satisfied certain regularity con-
ditions. It was shown that well-behaved binary digital pictures had con-
tinuous analogs. However, the continuous analogs constructed are not
consistent with any reasonable theory of digital fundamental groups.
The (A, S) representation of binary digital pictures is not a convenient
notation for discussing image processing operations such as thinning or
digital rotation. The reason is that these operations would normally alter
the A part of a binary digital picture (A, S) as well as the black point set S.
Instead of the A part of the (A, S) representation, it is better to have some-
thing that is invariant under conventional image processing operations.
Definition 5.0.16 (Binary digital space or DPS). A binary digital picture
space is a triple (V, β, ω)where V is the set of grid points in a 2-D or 3-D grid
and each of β and ω is a set of closed straight line segments joining pairs of
points in V . V is an innite set of points in E2
(2-D case) or E3
(3-D case),
V has no accumulation points, and there exists a positive constant D such
that every point in E2
or respectively E3
is within distance D of a point in
V . (We write E2
for the Euclidean plane and E3
for Euclidean 3-space.) we
refer to a binary digital picture space simply as a digital picture space; and
we will often abbreviate this to DPS.
The members of V the points of (or in) the DPS (V, β, ω). Most often we
take V = Z2
or Z3
, corresponding to the square or cubic grid. (We write
Z2
for the set of points with integer coordinates in E2
, and Z3
for the set of
points with integer coordinates in E3
.)
An important notion of digital topology is that of adjacency between
points. Typically, different adjacency relations are used for the black and
the white points. On a DPS (V, β, ω) these adjacency relations are defined
41
by the line segments in the sets β and ω. The β set contains all straight
line segments joining points in V that will be considered adjacent to each
other if they are both black. Similarly, the set ω contains all straight line
segments joining points in V that will be considered adjacent to each other
if they are both white. Neither β nor ω need have the same symmetries as
V . (More precisely, neither βnor ω need be invariant under isometries
of E2
or E3
that map V onto itself.)
In the special case V = Z2
it is most usual for one of β and ω to be the
set of all 4-adjacencies of Z2
and the other to be the set of all 8-adjacencies
of Z3
. In the special case V = Z3
it is most usual for one β and ω of and
to be the set of all 6-adjacencies of Z3
and the other to be either the set
of all 18-adjacencies or the set of all 26-adjacencies of Z3
. In general, if β
happens to be the set of all m-adjacencies of V for some integer m, and ω
happens to be the set of all n-adjacencies for some integer n, then we may
denote the DPS (V, β, ω) by (V, m, n), as in (Z2
, 8, 4) or (Z3
, 6, 26).
Definition 5.0.17 ( β, ω -adjacency). A line segment in βis called a β-
adjacency. Similarly, a line segment in ω is called an ω -adjacency. If p and
q are the endpoints of a β-adjacency (ω -adjacency) we say p is β-adjacency
(ω -adjacency) to q.
Definition5.0.18 (Isomorphism). An isomorphism of a DPS P1 = (V1, β1, ω1)
to a DPS P2 = (V2, β2, ω2) is a homeomorphism h of the Euclidean plane
(2-D case) or Euclidean 3-space (3-D case) to itself such that h maps V1
onto V2, each β1-adjacency onto a β2-adjacency and each ω1-adjacency onto
an ω2-adjacency, and h−1
maps each β2-adjacency onto a β1 -adjacency and
each ω2 -adjacency onto an ω1-adjacency.
Thus the DPS (V, 6, 6) where V is the set of grid points in a 2-D isometric
hexagonal grid is isomorphic to the DPS (V, β, ω) in which V = Z2
and
β = ω = the 4-adjacencies and the south-west-north-east diagonals of unit
lattice squares. The latter DPS is an example of a DPS (V, β, ω) in which β
and ω do not have the same symmetries as V .
Definition 5.0.19 (Complement). If S is any set of points in the DPS
P = (V, β, ω) then the complement of S (with respect to P), written ¯S, is
the set V − S. The complement of a DPS P = (V, β, ω), written ¯P, is the
DPS (V, β, ω).
Example 5.0.2. If P = (Z2
, 8, 4), then ¯P = (Z2
, 4, 8)
42
5.0.8 Binary Pictures
Definition 5.0.20 (Binary Picture). A binary digital picture is a quadru-
ple (V, β, ω), B), where (V, β, ω) is a DPS and B is a subset of V . we refer
to a binary digital picture simply as a digital picture; and often we just call
it a picture.
(V, β, ω), B) is a picture on the DPS (V, β, ω), and points of the DPS (i.e.,
points in V ) are also referred to as points of the picture
Definition 5.0.21 (Black,White points). Points in B are called black
points of the picture; each black point represents a pixel or voxel that has
value l. Points in B correspond to pixels or voxels with value 0 and are
called white points of the picture.
The general effect of image processing operations such as shrinking,
thinning, border finding and digital rotation is to transform a digital pic-
ture to another digital picture on the same digital picture space.
Definition 5.0.22 (Isomorphism,P-adjacent,Black, White adjacency, Complement). 1.
An isomorphism of a picture P1 = (V1, β1, ω1, B1) to a picture P2 =
(V2, β2, ω2, B2)is an isomorphism of the DPS (V1, β1, ω1) to the DPS
(V2, β2, ω2) that maps B1 onto B2.
2. Two black points of the picture P = (V, β, ω, B) are said to be P-
adjacent if they are β-adjacent. Two white points or a white point and
a black point are said to be P-adjacent if they are ω-adjacent.
3. A β-adjacency that joins two black points of P = (V, β, ω, B) is called
a black adjacency; an ω-adjacency that joins two white points of P is
called a white adjacency
4. The complement of a picture P = (V, β, ω, B), written ¯P, is the pic-
ture (V, ω, β, B). That is, the picture ¯P is the same as the picture
P but with the black and white points and their associated adjacency
relations interchanged. Thus P-adjacent black points of P are ¯P -
adjacent white points of ¯P. However, a black point and a white point
that are P-adjacent are not necessarily ¯P -adjacent.
A black (white) adjacency that joins two points in a subset S of V is
called a black (white) adjacency of S.
43
5.0.9 Properties of DPS
Let P = (V, β, ω, B) be any picture and let • be P, β, ω, or a positive
integer (e.g., 4 or 8 when V = Z2
).
Definition 5.0.23 ( •-adjacency, -component, -connected, -path, and -curve). 1.
If a point p is •-adjacent to a point q then we say p is a • -neighbor
of q. A point p is said to be • -adjacent to a set of points S if p is •
-adjacent to some point in S. Two sets of points S and T are said to
be •-adjacent to each other if some point in S is • -adjacent to some
point in T.
2. A set of points is •-connected if it is not a union of two disjoint non-
empty sets which are not • -adjacent to each other. A • -component
of a non-empty set of points S is a maximal • -connected subset of S.
Thus a •-component of S is a non-empty • -connected subset of S that
is not • -adjacent to any other point in S.
3. A P-component of B (or, equivalently, a β-component of B) is called a
black component of P. A P-component of ¯B = V B (or, equivalently,
an ω-component of B) is called a white component of P.
4. A • -path of P is a sequence p1, p2, . . . , pn of n ≥ 1 points in which
each point pi is •-adjacent to pi−1 1  i ≤ n. A • -path from p to
q is a • -path whose initial and nal points are respectively p and q.
Two points p and q lie in the same • -component of a set of points S
i there is a •-path in S from p to q.
5. A simple closed • -curve of P is a nite •-connected set of points in
which each point is •-adjacent to exactly two other points in the set.
6. A • -path or simple closed •-curve of P is said to be black (white) if
all its points are black (white). A black P -path of P is a β-path in
B and a white P-path of P is an ω-path in B.
Let ¯S be the complement of S
44
Definition 5.0.24 (Background, holes, simply connected). The unique
component of ¯S that contains the border of is called the background of S;
all other components, if any, are called holes in S. If S has no holes, it is
called simply connected
Let U as a basis for the open sets,
U(P) ≡ U(x, y) = {P}; if x + y is odd.
= {Pandits4negihbors}; if x + y is even.
then a set is connected in the resulting topology iff it is 4- connected.
Definition 5.0.25 (Border). If a black component C in a picture P =
(V, β, ω, B), a point in C that is adjacent to a white point of P is called a
border point of C in P. The set of all border points of Cin P is called the
border of C in P
If Dis a white component of P, then the border of C with respect to
D in P is the set of all points in C that are adjacent to D. If a DPS P =
(V, β, ω) is connected if V is connected in every picture on P.
Note 5.0.2. In a picture (V, β, ω, B) on a connected DPS a nonempty set
X ⊆ V is adjacent to each component of ¯X. For if C is a component of ¯X,
then by the connectedness of V there is a path in V from a point in C to a
point in X. The rst point on such a path that belongs to X must be adjacent
to C
Definition 5.0.26 (Surround). A connected set of points X in a picture
P = (V, β, ω, B) is said to surround a (not necessarily connected) set of
points Y in P if every point in Y is contained in a nite component of ¯X
(i.e., a component of X consisting of just nitely many points).
Note that since V has no accumulation points a subset of V is finite if
and only if it is bounded. In a picture on a connected DPS if X surrounds
Y , then Y does not surround X
Theorem 5.0.8. In a picture on a connected DPS if a connected set of
points X surrounds a connected set of points Y , then Y does not surround
X.
Proof. Let X and Y be connected sets of points in a picture on the connected
DPS (V, β, ω) such that X surrounds Y . Then the component of ¯X that con-
tains Y is nite. Therefore, since V is innite, either some other component
of ¯X is innite, or there are innitely many other components of ¯X, or X
itself is innite. As V is connected each component of ¯X is adjacent to X.
So in each of the three cases X is contained in an innite component of ¯Y .
Therefore Y does not d X.
45
Definition 5.0.27 (Hole, Cavity). A white component of a picture P
which is both adjacent to and surrounded by a black component C of P is
called a hole of (or in) C if P is a 2-D picture, and a cavity of (or in) C if
P is a 3-D picture.
By a hole in P we mean a hole in any black component of P
Definition5.0.28 (Background). A white component of P that surrounds
the set of all black points is called a background component of P. The back-
ground component may be the only white component of P.
On the other hand, P may have no background component. This is so
when P = (Z2
, 8, 4, B) and B is the set of all lattice points whose x and
y coordinates are both positive. But in a picture on a connected DPS the
background component, if it exists, is unique
Theorem 5.0.9. A picture on a connected DPS has no more than one
background component.
Proof. Let D be a background component of a picture P on the connected
DPS (V, β, ω), and let F be any other white component of P. Each com-
ponent of ¯D must contain a black point adjacent to D (at the border of the
component). So each component of ¯D is nite, since D must surround the
black points in that component. As V is innite it follows that either D is
innite, or ¯D has innitely many components in which case D is adjacent to
innitely many black points. Hence the black points adjacent to D belong
to an innite component of ¯F, and so F is not a background component.
Suppose P is a picture on a connected DPS such that each point in P
is adjacent to only finitely many other points. Then the complement of any
finite set of points in P has only finitely many components, one of which
must be infinite. But all components of the complement of the background
component ofP must be finite. Hence the background component of P,
if it exists, is infinite.
5.1 Regular digital picture spaces
To avoid awkward, or pathological, digital picture spaces that are incom-
patible with our definition of digital fundamental groups, we shall have
to impose two restrictions on the sets and ω of a DPS (V, β, ω). We call the
DPS’s that satisfy these conditions regular, we will confine our attention
to regular DPS’s.
46
Definition 5.1.1. A DPS (V, β, ω) is said to be regular if it satises both
of the following conditions:
1. no β -adjacency or ω-adjacency passes through any point in V other
than its endpoints,
2. no β -adjacency meets an ω-adjacency with which it does not share an
endpoint.
The second condition in this definition essentially says that no β-adjacency
ever crosses an ω-adjacency. Notice that if a DPS P is regular, then so is
its complement ¯P
For a DPS P = (V, β, ω) satisfying condition (1), condition (2) is equiv-
alent to the following condition: (2’) If the points a, b, c, d in V are the cor-
ners of a convex quadrilateral, where a is diagonally opposite to c, then in
any picture on P in which a and c are black points and b and d are white
points, the sets {a, c} and {b, d} are not both connected.
The motivation for condition (2 ) is that Euclidean space has an anal-
ogous property: if a closed convex quadrilateral in Euclidean space with
corners a, b, c, d, where a is diagonally opposite to c, is partitioned into two
subsets in such a way that a and c belong to one subset and b and d to the
other, then the two subsets are not both arc wise connected.
Example5.1.1. The DPS's (Z2
, 8, 8), (Z3
, 18, 18), (Z3
, 18, 26) and (Z3
, 26, 26)
are not regular. If V is the set of grid points of the face-centered cubic grid,
then (V, 18, 18)is not a regular DPS.
5.1.1 The digital fundamental groups
Definition 5.1.2 (P-walk). A P-walk is a curve γ : [0, 1] → En
, where
n = 2 or 3 according as P is 2-D or 3-D, such that γ(0) and γ(l) are black
points of P, and there exists a positive integer k such that for all non-negative
integers i  k:
1. γ(i/k) is a black point,
2. γ(i/k) is equal or adjacent to γ((i + k)/k),
3. γ is a linear on the closed interval [i/k, (i + 1)/k].
A P-walk γ is said to be a P-walk from γ(0) to γ(l). A P-walk that is
a constant map will be called trivial; all other P-walks will be called non
trivial. If γ is a non trivial P-walk, then it follows from the first condition
47
in Definition 2.4.1 that there is just one positive integer k such that the
conditions (1), (2) and (3) in the definition of a P-walk are satisfied for
all nonnegative integers i  k. This value of k will be called the length
of -γ. For a trivial P-walk all positive integers k satisfy conditions (1), (2)
and (3), so this definition cannot be used. We define the length of a trivial
P-walk to be 1.
If γ1 is a P-walk of length m from p to q and γ2 is a P-walk of length
n from q to r, then the product of γl and γ2, written γ1 · γ2, is the P-walk
from p to r obtained by catenating the curves γ1 and γ2 in the following
way:
γ1 · γ2(x) =



γ1
(m+n)x
m
, if 0 ≤ x ≤ m
(m+n)
γ1
(m+n)x
n−m
n
, if m
(m+n)
≤ x ≤ 1
The length of γ1 · γ2 is the sum of the lengths of γ1 and γ2, provided at
least one of γ2 and γ2 is non trivial.
Definition 5.1.3 (P -loop). A P -walk from a point p to itself is called
a P-loop, and is said to be based at p; we also call p the base point of the
P-loop. A trivial P-walk is a P -loop, and is called a trivial P-loop; all
other P-loops are called non trivial. The trivial P-loop based at p is denoted
by ep.
Remark 5.1.1. let P be a picture on an n-dimensional DPS, where n = 2
or 3. Two P -loops with the same base point are called equivalent if they
are xed base point homotopic in En
− W, where W is the union of all white
points of P if n = 2, and the union of all white adjacencies of P if n = 3.
This is of course an equivalence relation.
Let [λ]P for the equivalence class consisting of all P-loops which have
the same base point as λ and which are equivalent to λ. If the P -loops λ
and λ have the same base point, then define [λ]P · [λ ]P to be the equiva-
lence class [λ · λ ]P This is a well-defined associative binary operation on
equivalence classes
Definition 5.1.4 (The digital fundamental group ). Let P be a picture
on a regular DPS. The digital fundamental group of P with base point p,
denoted by π(P, p), is the group of all equivalence classes [λ]P where λis a
P-loop based at p, under the · operation.
If p1 and p2 are points in the same black component of a picture P on
a regular DPS, then π(P, p1)and π(P, p2) are isomorphic groups.
48
Note5.1.1. Digital fundamental groups are invariant under isomorphism of
ures. In fact, if f is any isomorphism of a picture P1 to a picture P2, then,
for each black point p in P1 , f induces a group isomorphism of π(P, p1) to
P2
5.2 Strong normal digital pictures spaces
A strongly normal digital picture space is a DPS P = (Zn
, β, ω) ,where
n = 2 or 3, in which there is a certain duality between the β-adjacencies
and the ω-adjacencies. As a result of this duality the digital topology of
P is in many ways analogous to the topology of the Euclidean plane or
Euclidean 3-space.
A strongly normal DPS provides a possible basis for topology-related
image processing operations such as thinning and border following. Dig-
ital picture spaces that are not strongly normal, such as (Zn
, 4, 4), may be
quite unsuitable for this purpose.
Definition 5.2.1 (Strongly normal). If P = (V, β, ω) is strongly normal
if its if it is regular and also satises all of the following conditions:
1. V = Z2
in the 2-D case or V = Z3
in the 3-D case.
2. In the 2-D case every 4-adjacency and in the 3-D case every 6-adjacency
is both a β-adjacency and an ω -adjacency.
3. All β-adjacencies and ω-adjacencies are 8-adjacencies in the 2-D case
and 26-adjacencies in the 3-D case.
4. In any given unit lattice square either both diagonals are β-adjacencies
or both diagonals are ω-adjacencies or one of the diagonals is both a β
-adjacency and an ω -adjacency.
5. Every picture P on P has the property that whenever a black compo-
nent of P is either β -adjacent or ω -adjacent to a white component of
P, the black component is in the 2-D case 4-adjacent and in the 3-D
case 6-adjacent to the white component.
Example 5.2.1. (Z2
, 8, 4) and (Z3
, 26, 6) are strongly normal.
Note 5.2.1. If DPS P is strongly normal, then so is its complement ¯P
49
Conditions (l) and (2) imply that a strongly normal DPS is connected.
Regarding condition (4), note that if both diagonals are β-adjacencies ( ω-
adjacencies), then neither is an ω-adjacency (a β-adjacency) because P is
regular. Conditions (1), (2) and (5) imply that a black component and a
white component of a picture on a strongly normal DPS (V, β, ω) are β-
adjacent if and only if they are ω -adjacent.
Given that P satisfies condition (1), it is easily seen that condition (4) is
equivalent to each of the following conditions:
Note 5.2.2. (4') : In any picture on P, if two diagonally opposite corners
a, c of a unit lattice square are black points and the other two corners b, d are
white points, then one of the sets {a, c} and {b, d} is connected.
(4*) : If either diagonal of a unit lattice square is not a β-adjacency, the
other is an ω-adjacency.
When V = Z2
and P satisfies conditions (2) and (3) we want condition
(4’) (and hence (4) and (4*)) to hold because if it does not, then we can
construct a connectivity paradox. For if (4’) fails, then we may suppose
w.l.o.g. that {a, c} = {(0, 0), (1, 1)}. Then, in the picture on P with black
point set B = {(0, n) : n ∈ Z, n  0} ∪ {(1, n) : n ∈ Z, n  0}, B has
two components and neither component separates Zn
i.e., if we remove
either black component by changing its points into white points, then the
white point set becomes connected). Now if a closed set in the Euclidean
plane E2
has just two components and neither component separates E2
,
then the set itself does not separate E2
. However, B does separate Z2
.
To avoid this connectivity paradox we must require condition (4’) to hold
when V = Z2
We want a 3-D strongly normal DPS to meet each coordinate plane in
a strongly normal 2-dimensional DPS. So we also require condition (4’) to
hold when V = Z3
Condition (5) may seem unsatisfactory for two reasons. First, it may
not be clear why one might expect condition (5) to hold in a well-behaved
DPS. Second, it looks as though one might have to do some work to de-
termine whether a given DPS satisfies condition (5) or not. these apparent
drawbacks of condition (5) by giving two alternate formulations of that
condition. It asserts that if P satisfies conditions (1) - (4), then condition
(5) is equivalent to each of the following conditions:
Note 5.2.3. (5') : In any picture on P, a one-point black component {p}
and a one-point white component {q} cannot be β-adjacent or ω -adjacent to
each other.
50
(5* ) : In the case V = Z2
, if p and q are diametrically opposite corners of
a unit lattice cube in which p is not β -adjacent to any 6-neighbor of q, and
q is not ω -adjacent to any 6-neighbor of p, then p and q are neither β- nor
ω -adjacent.
A one-point white component {q} corresponds to a very small cavity
Q in some object in E3
. A one-point black component {p} corresponds to
a very small object P in E3
. Since (assuming condition (2)) {p} does not
surround {q} and {q} does not surround {p}, the object P should neither
surround nor be surrounded by the cavity Q. Thus removing the object P
should not affect the cavity Q, so changing p to a white point should not
enlarge the white component {q}. Hence {p} should not be ω -adjacent
to {q}. Similarly, filling in the cavity Q should not affect the object P, so
changing q to a black point should not enlarge the black component {p}.
Hence {p} should not be β-adjacent to {q}.
Theorem 5.2.1. Suppose P = (Z3
, β, ω) satises conditions (2)-(4) in the
denition of a strongly normal DPS. Then conditions (5), (5') and (5* ) are
equivalent.
Proof. First we proof that (5 ) ⇒ (5∗), suppose (5') holds. Let p and q be
diametrically opposite corners of the unit lattice cube K. Let a, b, c be the
three 6-neighbors of q in K. If q is not ω-adjacent to any 6-neighbor of p, and
p is not β-adjacent to any 6-neighbor of q, then when B is the set consisting
of p, a, b, c, and the nineteen 26-neighbors of q outside K the sets {p} and
{q} are respectively a black and white component of (Z3
, β, ω, B), and so (5')
implies p is neither β - nor ω -adjacent to q. It is clear from the denition
that (5*) ⇒ (5) and that implies (5 ')
5.2.1 Examples of Strong normal DPS
The DPS’s (Z2
, 8, 4), (Z2
, 4, 8), (Z3
, 6, 26), (Z3
, 26, 6), (Z3
, 6, 18) and (Z3
, 18, 6)
are all strongly normal. Both the 2-D and the 3-D , Khalimsky digital
picture spaces in which β = ω =the Khalimsky adjacencies, are strongly
normal. (However, the DPS’s (Z2
, 4, 4), (Z2
, 8, 8), (Z3
, 6, 6), (Z3
, 18, 18) and
(Z3
, 26, 26) are not strongly normal.) It is not difficult to show that each of
the following five DPS’s is isomorphic to a strongly normal DPS
1. (V, 6, 6) where V = grid points of the 2-D isometric hexagonal grid,
2. (V, 12, 12) where V = grid points of the 3-D face-centered cubic grid,
3. (V, 12, 18) where V = grid points of the 3-D face-centered cubic grid,
51
4. (V, 18, 12) where V = grid points of the 3-D face-centered cubic grid,
5. (V, 14, 14)where V = grid points of the 3-D body-centered cubic grid.
In a DPS that is isomorphic to a strongly normal DPS every point has
at least four β -neighbors and at least four a ω -neighbors (each point has
at least six of each in the 3-D case). Thus neither of the DPS’s (V, 12, 3)
and (V, 3, 12) where V is the set of grid points of the 2-D triangular grid is
isomorphic to a strongly normal DPS.
5.2.2 The discrete digital fundamental group
Given two finite sequences c1, c2, where the final point of c1 is the same as
the initial point of c2, the product of c1 and c2, written c1 ·c2, is the sequence
obtained by removing the initial element of and appending the resulting
sequence onto the end of c1 . Thus
p, p, q, r, a · a, x, y, a = p, p, q, r, a, x, y, a
The reduced form of a finite sequence c is the subsequence of c that is
obtained when we remove from c all but one point from every set of con-
secutive equal points. If all members of a sequence are equal to p, then the
reduced form of the sequence is p . Otherwise, if c = p1, p2, . . . , pm , then
the reduced form of c is the longest sequence of the form p1, pi1 , . . . , pin
, where n ≥ 1, i1 is the smallest value of i such that pi = p1 , and each of
the other ik is the smallest value of i greater than ik−l such that pi = pik−1
.
Thus the reduced form of p, p, p, q, r, r, q, q, q, q, p, p is p, q, r, q, p if p, q
and r are distinct.
Definition 5.2.2 (Black digital walk, black digital loop). For any digital
picture P and black points p, p of P, a black digital walk of P from p to p
is a sequence p1, p2, . . . pn of black points of P where n ≥ 1, p1 = p, pn = p
and each point pi is equal or adjacent to pi−1, (1  i ≤ n). A black digital
walk is said to be trivial if all its points are equal, non trivial otherwise. A
black digital walk of P from p to p is called a black digital loop of P based
at p, and we call p its base point.
Now suppose P is a picture on a strongly normal DPS. If K is any
unit lattice square or unit lattice cube, then we say that one black digi-
tal walk is K-equivalent to another with the same initial and final points
if the two are equal or if the first x = p1, p2, . . . , pm = y , the second is
x = q1, q2, . . . , qn = y and the following three conditions are satisfied:
52
Dt
Dt
Dt
Dt
Dt
Dt
Dt
Dt
Dt

More Related Content

Viewers also liked

Проект постанови (деякі питання НАЗЯВО)
Проект постанови (деякі питання НАЗЯВО)Проект постанови (деякі питання НАЗЯВО)
Проект постанови (деякі питання НАЗЯВО)
vasyl petrov
 
Reserva ecológica el ángel
Reserva ecológica el ángelReserva ecológica el ángel
Reserva ecológica el ángel
will19931994
 

Viewers also liked (20)

Trabajo
TrabajoTrabajo
Trabajo
 
Arsany's Resume
Arsany's ResumeArsany's Resume
Arsany's Resume
 
Aula virtual
Aula virtualAula virtual
Aula virtual
 
Fundamentos de administración
Fundamentos de administraciónFundamentos de administración
Fundamentos de administración
 
Manualcontabilidad empresas sistema financiero
Manualcontabilidad empresas sistema financieroManualcontabilidad empresas sistema financiero
Manualcontabilidad empresas sistema financiero
 
Medicina
MedicinaMedicina
Medicina
 
Проект постанови (деякі питання НАЗЯВО)
Проект постанови (деякі питання НАЗЯВО)Проект постанови (деякі питання НАЗЯВО)
Проект постанови (деякі питання НАЗЯВО)
 
Expo comunicacion.pptx la pobreza
Expo comunicacion.pptx la pobrezaExpo comunicacion.pptx la pobreza
Expo comunicacion.pptx la pobreza
 
Reserva ecológica el ángel
Reserva ecológica el ángelReserva ecológica el ángel
Reserva ecológica el ángel
 
Biodata
BiodataBiodata
Biodata
 
Ensayo 5 semestre de ingeniería comunicación no verval
Ensayo 5 semestre de ingeniería comunicación no vervalEnsayo 5 semestre de ingeniería comunicación no verval
Ensayo 5 semestre de ingeniería comunicación no verval
 
Banco de preguntas
Banco de preguntasBanco de preguntas
Banco de preguntas
 
Trudove navchannja-6-klas-madzigon
Trudove navchannja-6-klas-madzigonTrudove navchannja-6-klas-madzigon
Trudove navchannja-6-klas-madzigon
 
Practica 3
Practica 3Practica 3
Practica 3
 
Рановац
РановацРановац
Рановац
 
Palabras sobre electricidad
Palabras sobre electricidadPalabras sobre electricidad
Palabras sobre electricidad
 
Water treatment plant
Water treatment plantWater treatment plant
Water treatment plant
 
Career Portfolio
Career PortfolioCareer Portfolio
Career Portfolio
 
Colage_cepeda
Colage_cepedaColage_cepeda
Colage_cepeda
 
Marln muertos
Marln muertosMarln muertos
Marln muertos
 

Similar to Dt

Spatial_Data_Analysis_with_open_source_softwares[1]
Spatial_Data_Analysis_with_open_source_softwares[1]Spatial_Data_Analysis_with_open_source_softwares[1]
Spatial_Data_Analysis_with_open_source_softwares[1]
Joachim Nkendeys
 

Similar to Dt (20)

Android Application for American Sign Language Recognition
Android Application for American Sign Language RecognitionAndroid Application for American Sign Language Recognition
Android Application for American Sign Language Recognition
 
Spatial_Data_Analysis_with_open_source_softwares[1]
Spatial_Data_Analysis_with_open_source_softwares[1]Spatial_Data_Analysis_with_open_source_softwares[1]
Spatial_Data_Analysis_with_open_source_softwares[1]
 
thesis
thesisthesis
thesis
 
Evaluation of conditional images synthesis: generating a photorealistic image...
Evaluation of conditional images synthesis: generating a photorealistic image...Evaluation of conditional images synthesis: generating a photorealistic image...
Evaluation of conditional images synthesis: generating a photorealistic image...
 
eur22904en.pdf
eur22904en.pdfeur22904en.pdf
eur22904en.pdf
 
Vivarana fyp report
Vivarana fyp reportVivarana fyp report
Vivarana fyp report
 
Grl book
Grl bookGrl book
Grl book
 
main
mainmain
main
 
Honours_Thesis2015_final
Honours_Thesis2015_finalHonours_Thesis2015_final
Honours_Thesis2015_final
 
A Comparative Study Of Generalized Arc-Consistency Algorithms
A Comparative Study Of Generalized Arc-Consistency AlgorithmsA Comparative Study Of Generalized Arc-Consistency Algorithms
A Comparative Study Of Generalized Arc-Consistency Algorithms
 
btpreport
btpreportbtpreport
btpreport
 
Big Data and the Web: Algorithms for Data Intensive Scalable Computing
Big Data and the Web: Algorithms for Data Intensive Scalable ComputingBig Data and the Web: Algorithms for Data Intensive Scalable Computing
Big Data and the Web: Algorithms for Data Intensive Scalable Computing
 
Big data-and-the-web
Big data-and-the-webBig data-and-the-web
Big data-and-the-web
 
Im-ception - An exploration into facial PAD through the use of fine tuning de...
Im-ception - An exploration into facial PAD through the use of fine tuning de...Im-ception - An exploration into facial PAD through the use of fine tuning de...
Im-ception - An exploration into facial PAD through the use of fine tuning de...
 
Rapport d'analyse Dimensionality Reduction
Rapport d'analyse Dimensionality ReductionRapport d'analyse Dimensionality Reduction
Rapport d'analyse Dimensionality Reduction
 
Master In Information And Communication Technology.doc
Master In Information And Communication Technology.docMaster In Information And Communication Technology.doc
Master In Information And Communication Technology.doc
 
Thesis_Prakash
Thesis_PrakashThesis_Prakash
Thesis_Prakash
 
diplomarbeit
diplomarbeitdiplomarbeit
diplomarbeit
 
Robustness in Deep Learning - Single Image Denoising using Untrained Networks...
Robustness in Deep Learning - Single Image Denoising using Untrained Networks...Robustness in Deep Learning - Single Image Denoising using Untrained Networks...
Robustness in Deep Learning - Single Image Denoising using Untrained Networks...
 
Mining of massive datasets
Mining of massive datasetsMining of massive datasets
Mining of massive datasets
 

Dt

  • 1. A project report on "An Introduction To Digital Topology" Project submitted to university of Kerala in the partial fulfill- ment of the requirements for the awards of the degree of Master of Science in Mathematics 2014 - 16. i
  • 2. AN INTRODUCTION TO DIGITAL TOPOLOGY PROJECT REPORT Submitted to University Of Kerala Thiruvananthapuram By Vishnu V Candidate code : 14 125 020 Exam Code : 620 Project Code : MM245 Department Of Mathematics and Statistics Sanatana Dharma College Alappuzha. August 17, 2016
  • 3. AN INTRODUCTION TO DIGITAL TOPOLOGY PROJECT Submitted to University of Kerala in partial fulfillment of the requirements of for the award of the Degree of Master of Science in Mathematics By VISHNU V Candidate Code: 14 125 020 Exam Code: 620 Project Code: MM254 Under the Guidance of SRI RAKESH N NAMPOOTHIRI Assistant Professor, DEPARTMENT OF MATHEMATICS AND STATISTICS SANATANA DHARMA COLLEGE, ALAPPUZHA 2016 i
  • 4. SANATANA DHARMA COLLGE, ALAPPUZHA DEPARTMENT OF MATHEMATICS AND STATISTICS CertificatE This is to certify that the project work entitled “AN INTRODUCTION TO DIGITAL TOPOLOGY”is a bona fide work done by VISHNU V (620 14 125 020) in partial fulfilment of the requirement for the award of Master of Sci- ence in Mathematics by the University of Kerala and this report has not been submitted by any other university for the award of any degree to the best of my knowledge and belief. Alappuzha, DR. R SREEKUMAR, August 17, 2016 Head of Department Department of Mathematics and Statistics, Sanatana Dharma College, Alappuzha . ii
  • 5. DECLARATION I hereby declare that this is a bonafide record of the work done by me in partial fulfilment of the requirements for the award of the degree of Master of Science in Mathematics by the University of Kerala and this report has not been submitted to any other university for the award of any degree to the best of my knowledge and belief. VISHNU V 620 14 125 020 iii
  • 6. AcknowledgementS I truly wouldn’t be where I am today if not for the thousands of people who have been there to love, guide, teach, support, motivate and inspire me during this incredible journey I have been on. It is my pleasure to express my sincere thanks to god almighty showing his blessing on me for the successful completion of the project. I would like to thank all of them in particular. Dr.R Sreekumar - Head of the department, Guru and like a friend, who taught me the basics of telling a subject and stayed with me right till the end. if he hadn’t encouraged and harassed me all the way, I would have given this up a long time ago. Rakesh N Nampoothiri - mentor and my guide, for the valuable guid- ance, observation and timely advice during the preparation of the project and project report. Arun Kishore B L, Dr. S Vijayakrishnan, Dr. V G Rajaleshmi, P Amal- raj, Dr. Bibin K Jose, Ananthalakshmy, and Jisha - amazing teachers who read the manuscript and gave honest comments. All of them also stayed with me in the process, and handled me and my sometimes out-of-control emotions so well. My friends Rajesh, Minnu, Gopu, Leshmi, Athria, Nithyasree, Seersha, Emily and all others. I love them all so much that I could literally write on them. And lastly, it is only one writes a Mathematics book that realizes the true power of LATEX, to typeset mathematics , from grammar checks to replace-alls. It is simple - without this software, this project report would not be written. Thank you Donald Knuth, and TEXCorp! . If Adobe can’t released illustrator then I can’t draw or edit the pictures so, I express my truthful thanks to Illustrator and Adobe Corp! for creating such a nice software. VISHNU V iv
  • 7. Contents Table of Contents iv List of Figures vii 1 Introduction ix 2 Preliminaries 1 2.1 Sets and Functions . . . . . . . . . . . . . . . . . . . . . . . . 1 2.1.1 Set Operations . . . . . . . . . . . . . . . . . . . . . . 1 2.2 Metric Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Topological Spaces and Examples . . . . . . . . . . . . . . . . 7 2.4 Grid and examples . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5 Adjacency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.5.1 Adjacency in 2D and 3D Grids . . . . . . . . . . . . . 11 3 Digitization Models 15 3.0.2 Gauss digitization . . . . . . . . . . . . . . . . . . . . 15 3.0.3 Jordan digitization . . . . . . . . . . . . . . . . . . . . 16 3.0.4 Grid-intersection digitization . . . . . . . . . . . . . . 19 3.1 Type digital sets . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2 Domain digitizations . . . . . . . . . . . . . . . . . . . . . . . 25 4 Digital Topology 27 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2 Digital Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.2.1 Picture resolution and picture size . . . . . . . . . . . 30 4.2.2 Connectedness . . . . . . . . . . . . . . . . . . . . . . 31 4.2.3 Arcs and curves . . . . . . . . . . . . . . . . . . . . . . 32 4.2.4 Thinning . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.2.5 Thinning algorithm . . . . . . . . . . . . . . . . . . . . 35 4.2.6 Border following . . . . . . . . . . . . . . . . . . . . . 36 v
  • 8. 4.2.7 The adjacency tree . . . . . . . . . . . . . . . . . . . . 39 5 Binary digital picture spaces 41 5.0.8 Binary Pictures . . . . . . . . . . . . . . . . . . . . . . 43 5.0.9 Properties of DPS . . . . . . . . . . . . . . . . . . . . . 44 5.1 Regular digital picture spaces . . . . . . . . . . . . . . . . . . 46 5.1.1 The digital fundamental groups . . . . . . . . . . . . 47 5.2 Strong normal digital pictures spaces . . . . . . . . . . . . . . 49 5.2.1 Examples of Strong normal DPS . . . . . . . . . . . . 51 5.2.2 The discrete digital fundamental group . . . . . . . . 52 5.3 Continuous analogs of digital pictures . . . . . . . . . . . . . 53 5.3.1 The augmented black and white point sets . . . . . . 54 5.3.2 C(P) and C (P) . . . . . . . . . . . . . . . . . . . . . 56 6 Concluding remarks 60 Bibliography 61 vi
  • 9. List of Figures 2.1 A rectangular orthogonal grid . . . . . . . . . . . . . . . . 9 2.2 Grid points in plane and cells . . . . . . . . . . . . . . . . 10 2.3 α-adjacent 3 cells . . . . . . . . . . . . . . . . . . . . . . . . 12 2.4 Lattice points in plane and 3-space . . . . . . . . . . . . 13 2.5 8, 4-adjacent neighbour in plane . . . . . . . . . . . . . . . 13 2.6 26, 18, 6-adjacent neighbour in 3-space . . . . . . . . . . . 14 3.1 Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 Four disks (dashed) and their Gauss digitizations (shaded) 16 3.3 Gauss digitization of a simple polygon using grids of sizes from 8×8 (upper left) to 128×128 (lower middle). The original polygon was drawn on a grid of size 512× 512 (lower right) . . . . . . . . . . . . . . . . . . . . . . . . 17 3.4 Relative deviations of area and perimeter for the dig- itized polygon in Figure 1.9 . . . . . . . . . . . . . . . . . 17 3.5 Inner and outer Jordan digitizations of a centered disk 18 3.6 Grid-intersection digitization of an arc. . . . . . . . . . . 19 3.7 Directional encoding of an arc. Starting at grid point p, the arc can be represented by the sequence of codes 677767000001 . . . 65 . . . . . . . . . . . . . . . . . . . . . . . . 20 3.8 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.9 Dierences in h1 and h2 from the correct y value . . . . 21 3.10 Gauss digitizations of the same disk at dierent loca- tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.11 Inner and outer diamond and ball digitizations in the plane. The inner digitization is the union of the grid squares centered at black grid points, and the outer digitization (frontier shown as a bold black line) also contains the grid squares centered at shaded grid points. Left: diamond digitization. Right: ball digitization. . . 24 vii
  • 10. 4.1 Grid point and grid square notation in a plane . . . . . 30 4.2 A 380◦ panoramic picture of Auckland copied from Na- tional geographic channel . . . . . . . . . . . . . . . . . . 31 viii
  • 11. 1 Introduction Objects in three dimensions, and their two-dimensional images, are ap- proximated digitally by sets of voxels (volume elements) or pixels (pic- ture elements), respectively. Digital geometry is the study of geometric properties of digitized objects (or digitized images of objects); it deals both with the definitions of such properties and with algorithms for their com- putation. In particular, digital topology deals with properties of a topo- logical nature (particularly, properties that involve the concepts of con- nectedness or adjacency, but do not depend on size or shape), and with algorithms that compute or preserve such properties. Topological prop- erties and algorithms play a fundamental role in the analysis of two- and three-dimensional digital images. Digital geometry deals with the geometric properties of subsets of dig- ital pictures and with the approximation of geometric properties of objects by making use of the properties of the digital picture subsets that repre- sent the objects. It emerged in the second half of the 20th century with the initiation of research in the fields of computer graphics and digital im- age analysis. It has its mathematical roots in graph theory and discrete topology; it deals with sets of grid points which are also studied in num- ber theory (since C.F. Gauss) and the geometry of numbers, or with cell complexes (which have been studied in topology since the middle of the 19th century). Studies of gridding techniques, such as those by Gauss, Dirichlet, or Jordan (for measuring the content of a set), also provide his- toric context for digital geometry. Digitizations on regular grids are also frequently used in numeric computation in science and engineering The main purpose of digital topology is study the topological proper- ties of digital images. Digital images are discrete objects in nature, but they are usually representing continuous object. There are 2 types of approach are a multilevel architecture and an axiomatic definition of the notion of digital space. In image processing and computer graphics, an object in the plane or 3-space is often approximated digitally by a set of pixels or voxels. Digital topology studies properties of this set of pixels or voxels ix
  • 12. that correspond to topological properties of the original object. It provides theoretical foundations for important operations such as digitization, con- nected component labelling and counting, boundary extraction, contour filling, and thinning. We will first introduce the concept of finite topology that makes use of classical topological method such as cell complexes in a discrete space especially for digital images in digital space. Then we will present a uni- fied method for topological analysis in 2D and 3D digital space by using the Euler theorem for planar graphs. Then we move up to digitization models, their we define the concepts of gauss, jordan and grid intersection digitization, and we go through digital pictures and introduces some new ideology. then we move up to the important section digital picture space and strongly normal digital spaces, x
  • 13. 2 Preliminaries In this initial chapter, we will present the background needed for the the study of Digital topology. It consists of a brief survey of set operations and functions, two vital tools for all of mathematics. In it we establish the notation and state the basic definitions and properties that will be used throughout the report. We will regard the word set as synonymous with the words class, collections and family and we will not define these terms or give a list of axioms for set theory. this approach, often referred to as native set theory is quite adequate for working with sets in the context of digital topology. 2.1 Sets and Functions In this section we give a brief review of terminology and notation that will be used in this report. if an element x is in a set A, we write x ∈ A and say that x is a Member of A, or that x belongs to A. If x is not on A, we write x /∈ A. Definition 2.1.1. Two sets A and B are said to be equal and we write A = B, if they contain the same elements. Thus ,to prove that the sets A and B are equal, we must show that A ⊆ B B ⊆ A. 2.1.1 Set Operations Note that the set operations are based on the meaning of the words “or”, “and” and “not”. 1
  • 14. Definition 2.1.2. The following are some set operations: 1. The union of set A and B is the set A ∪ B = {x : x ∈ A or x ∈ B}. 2. The intersection of the sets A and B is the set A ∩ B = {x : x ∈ A and x ∈ B}. 3. The complement of B relative to A is the set A − B = {x : x ∈ A and x /∈ B}. The set that has no element is called empty set and it is denoted by φ. Two sets A and B are said to be disjoint if they have no elements in common and it is expressed by A ∩ B = φ. Functions: Definition 2.1.3. A function f from set X to set Y , denoted f : X → Y is a rule which assigns to each member x of X a unique member y = f(x) of Y . If y = f(x) then y is called the image of x and x is called a pre-image of y. The set X is the domain of f and Y is the co-domain or range of f. Note that for a function f : X → Y each element x in X has a unique image f(x) in Y . However, the number of pre-image may be zero, one, or more than one. Definition 2.1.4. A function f : X → Y is one-to-one or injective means that for distinct elements x1, x2 ∈ X, f(x1) = f(x2). In other words, f is one-to-one provided that no two distinct points in the domain have the same image. In contrapositive form this can be stated as : f(x1) = f(x2) =⇒ x1 = x2. A function f for which f(X) = Y i.e, for which the image f(X) equals the co-domain , is said to be map X onto Y or to be surjective. A one-to-one function from X onto Y is called a one-to-one corre- spondence or a bijection. Thus f : X → Y is a one-to-one correspondence provided that each member of Y is the image under f of exactly one member of X. In the case there is an inverse function f−1 : Y → X which assigns to each y in Y its unique pre-image x = f−1 (y) in X. 2
  • 15. Example 2.1.1. Let X = {a, b, c, d, e}, Y = {1, 2, 3, 4, 5} and the function f : X → Y dened by f(a) = 1, f(b) = 2, f(c) = 3, f(d) = 4, f(e) = 5 is a bijection with inverse function f−1 : Y → X dened by f−1 (1) = a, f−1 (2) = b, f−1 (3) = c, f−1 (4) = d, f−1 (5) = e . Definition 2.1.5. If f : X → Y and g : Y → Z are functions on the sets, then the composite function g ◦ f : X → Z is dened by g ◦ f(x) = g(f(x)), x ∈ X The composite function g ◦ f is some times denoted simply gf. Example 2.1.2. Consider the function f : R → R and g : R → R dened by f(x) = x2 , g(x) = x + 1. Then the composite function g ◦ f and f ◦ g are both dened g◦f(x) = g(f(x)) = g(x2 ) = x2 +1, f◦g(x) = f(g(x)) = f(x+1) = (x+1)2 2.2 Metric Space In this section, we will introduce the idea of metric space and discuss the concepts of neighbourhood of a point, open and closed closed sets, con- vergence of sequences, and continuity of functions. Definition 2.2.1. A metric space is a set X where we have a notation of distance. That is, if x, y ∈ X, then d(x, y) is the distance between x and y.The particular distance functions must satisfy the following conditions. 1. d(x, y) ≥ 0 for all x, y ∈ X 2. d(x, y) = 0 i x = y 3. d(x, y) = d(y, x) 4. d(x, z) ≤ d(x, y) + d(y, z) 3
  • 16. Definition 2.2.2 (Open Ball). Let x0 ∈ X and r be a positive real number .Then the open ball with centre x0 and radius r is dened to be the set {x ∈ X : d(x, x0) r}. It is denoted either by Br(x0) or by B(x0; r). It is also called the open r-ball around x0 . Definition 2.2.3 (Open Set). A subset A ⊂ X is said to be open if for every x0 ∈ A, ∃ some open ball around x0 ∈ A. If their exist some r 0 such that B(x0; r) ∈ A. Remark2.2.1. Before doing anything with open balls and open sets it would be nice to know that open balls are indeed open sets.This follows trivially from the denitions and the triangle inequality. Note 2.2.1. Let {xn} be a sequence in metric space. Then {xn} converges to y in X i for every open set y ∈ U ∃ N ∈ Z. Theorem 2.2.1. Let (X; d) be a metric space. Then 1. φ and X are open. 2. The union of collection of open set is open. 3. The intersection of nite number of open set is open. 4. x, y ∈ X ∃ open sets U, V such that x ∈ U, y ∈ V and U ∩ V = φ. Proof. (i) Since there are no points e ∈ φ the statement x ∈ φ whenever d(x, e) 1, holds for all e ∈ φ. Since every point x ∈ X, the statement x ∈ X whenever d(x, e) 1 , holds ∀ e ∈ X (ii) If e ∈ α∈A Uα, then we can nd a particular α1 ∈ A with e ∈ Uα1. Since Uα1 is open, we can nd a δ 0 such that x ∈ Uα1, d(x, e) δ . Since Uα1 ⊆ α∈A Uα, x ∈ α∈A Uα, d(x, e) δ 4
  • 17. Thus α∈A Uα is open. (iii) If e ∈ n j=1 Uj, then e ∈ Uj for each 1 ≤ j ≤ n. Since Uj is open, we can nd a δj 0 such that x ∈ Uj, d(x, e) δj . Setting δ = min{δj}1≤j≤n we have δ 0 and x ∈ Uj, d(x, e) δ forall 1 ≤ j ≤ n . Thus x ∈ n j=1 Uj, d(x, e) δ and we have shown that n j=1 Uj is open. Example 2.2.1. The n− dimensional Euclidean space Rn is a metric space with the respected to the function d : Rn × Rn → R, dened by d(x, y) = n i=1 (xi − yi)2 1/2 where x = (x1, x2, . . . , xn) and y = (y1, y2, . . . , yn) ∈ Rn where xi, yi ∈ R. Clearly, d(x, y) ≥ 0 ∀ x, y ∈ R, d(x, y) = 0 iff n i=1 (xi − yi)2 1/2 = 0 i.e, iff xi = yi ∀ i = 1, 2, . . . , n Hence x = y iff d(x, y) = 0 Now let x = (x1, x2, . . . , xn) y = (y1, y2, . . . , yn) z = (z1, z2, . . . , zn) be three arbitrary elements of Rn . 5
  • 18. Since xi, yi, zi ∈ R ∀ i = 1, 2, . . . , n and Pi = xi − yi and Qi = yi − zi ∈ R Clearly, Pi + Qi = xi − zi where i = 1, 2, . . . , n By the corollary we just proved n i=1 (Pi + Qi)2 1/2 ≤ n i=1 (Pi)2 1/2 + n i=1 (Qi)2 1/2 i.e, n i=1 (xi + zi)2 1/2 ≤ n i=1 (xi − yi)2 1/2 + n i=1 (yi − zi)2 1/2 i.e, d(x, y) ≤ d(x, y) + d(y, z) (Triangle inequality) Finally, d(x, y) = n i=1 (xi − yi)2 1/2 = n i=1 (yi − xi)2 1/2 = d(x, y) All these prove that d is a metric known as Euclidean metric or Usual metric. Example 2.2.2. Let R be a set of real numbers, show that the function d : R → R dened by d : (a, b) = |a − b|, ∀ a, b ∈ R, is a metric on R. Here, 1. |a − b| ≥ 0 =⇒ d(a, b) ≥ 0, ∀ a, b ∈ R 2. |a − b| = 0, iff a − b = 0, iff a = b so that d(a, b) = 0 ⇔ a = b 3. |a − b| = |b − a| =⇒ d(a, b) = d(b, a), ∀ a, b ∈ R 4. |a − b| = |(a − c) + (c − b)| ≤ |a − c| + |c − b| =⇒ d(a, b) ≤ d(a, b) ≤ d(a, c) + d(c, b), a, b, c ∈ R From this d is a metric on R. 6
  • 19. 2.3 Topological Spaces and Examples In this section, we give the much-delayed definition of a topological spaces. We develop it from properties of a metrices space. In the second section we give a few examples like finite spaces, discrete spaces, indiscrete spaces of topological spaces. Definition 2.3.1. A topological space is a pair (X, T ) where X is a set and T is a collection of subsets of X satisfying: 1. φ, X ∈ T . 2. T is clodsed under arbitrary unions. 3. T is closed under nite intersections. The collection T is said to be a topology on the set X. Members of T are called open sets of X. The elements of X are called its points. Example 2.3.1. Let X be a non-empty set, and let the topology be the class of all subsets of X. This is called the discrete topology on X , and any topological space whose topology is the discrete topology is called a discrete space. Suppose that X = φ, T = ℘(X) , cleraly X and φ ∈ T . Let A = {uα/α ∈ λ} then uα ⊂ X ∀ α ∞ i=0 uα ⊂ X ∈ ℘(x) = T so T is closed under arbitrary union. Now we are going to show T is closed under finite intersection. Take u1, u2, . . . , un be a finite elements of T then, n i=1 uα ⊂ X ∈ ℘(x) = T i.e; T is closed under arbitrary intersection. So (X, T ) is a topological space. Example 2.3.2. Let X be a non-empty set, and let the topology consist only the empty set φ and full set X. This is called the in-discrete topology on X and any topological space whose topology is the in-discrete topology is called a in-discrete space. 7
  • 20. Here T = {φ, X} ∴ T is closed under arbitrary union, because T consist only φ and X, so the union is either X or φ. Similarly T is closed under finite intersections. Example 2.3.3. Every metric space is a topological space. Consider a metric space (X, d). Let T be the collection of all open subsets of X. φ and X are open in X, (φ, X) ∈ T . Now the union of a number of open sets in X is open. i.e; T is closed under arbitrary union. Similary, T is closed under finite intersection. ∴ T is a topology. Thus every metric space is a topological space. Remark 2.3.1. On R d(x, y) = |x − y| is a metric. Hence (R , d) is a metric space and so R is a topological space. This topology is said be Usual topology on R Example 2.3.4. Let X = {a, b} and let T = {φ, X, a}. Cleraly T is a topology on X called Sierpinski topology. Suppose that d : X × X → R is a metric or pseudometric on X then d(a, a) = 0 = d(b, b) and d(a, b) = d(b, a) = k(say). If d is metric then k 0. Sr(a) = {a} similarly Sr(b) = {b} ∴ T = {φ, X, {a}, {b}} is a Discrete topology If k = 0 then d will be a pseudometric. Then Sk(x) = {a, b} = X . Then the only open sphere in X is X ∴ T = {φ, X} is In-discrete topology. From this we can say that not every topological space is metrizable space. 2.4 Grid and examples In these section, we are going to defining the 2D and 3D grid points and grid cell adjacency models, then we will move to the digitization models, including the classic Gauss, Jordan and grid intersection models and de- fines a domain model that will generalizes all of them.The grid point set of 2D is Z2 and 3D is Z3 . Definition 2.4.1 (Grid -edges, -square, -cube). A pair of adjacent grid vertices is a grid edge. A grid square is dened by four grid edges that form a square, and a grid cube in 3-D is dened by six grid squares that form a cube 8
  • 21. The figure shows the grid vertices, edges, and square in a rectangular plane with grid constant θ = 0. Example 2.4.1. In 2D, Suppose that the set of position of the grid vertices is (0 · 5, 0 · 5) + Z2 = {(i + 0 · 5, j + 0 · 5) : i, j ∈ Z2 } and grid edge connects a pair of adjacent grid vertices (i + 0 · 5, j + 0 · 5)(i + 0 · 5, j + 1 · 5)or(i + 0 · 5, j + 0 · 5)(i + 1 · 5, j + 0 · 5) A grid square is dened by as four times of grid edges in which successive edges (modulo 4) share a vertex. (i + 0 · 5, j + 0 · 5)(i + 0 · 5, j + 1 · 5)(i + 1 · 5, j + 1 · 5)(i + 1 · 5, j + 0 · 5) It is similar in 3D case. Definition 2.4.2 (3,2,1 and 0 -cells). A grid cube is called a 3-cell, a grid square is a 2-cell, a grid edge is a 1-cell, and a grid vertex is a 0-cell. A 2D grid point is the center point of a 2-cell and a 3D grid point is the center point of a 3-cell. Let C (i) 2 be the set of all i -cells in the plane (i = 0, 1, 2), and C (i) 3 will denote the set of all i -cells in the plane (i = 0, 1, 2, 3). We also define the following C2 = C (2) 2 ∪ C (1) 2 ∪ C (0) 2 and C3 = C (3) 3 ∪ C (2) 3 ∪ C (1) 3 ∪ C (3) 3 A pixel is either a 2-cell(grid square) or a grid point(the center of a 2-cell). Similarly a voxel is either a 3-cell (grid cube) or a grid point(the center of a 3-cell) Figure 2.1: A rectangular orthogonal grid 9
  • 22. The figure shows the grid points in plane with grid constant θ = 0 and second one from left: graphic sketch of 0,1 and 2-cells. right: the centers of these cells. Lets define grid models, Note 2.4.1. In the grid point model, a 2-D grid G is either the innite grid Z2 or an mn rectangular sub-array of Z2 ; Similarly, a 3-D grid is either Z3 or an lmn cuboid-al sub-array of Z3 . In the grid cell model, a 2D grid G is either C2 or an mn block of 2-cells whose union G is a rectangular region of the Euclidean plane E2 . Similarly, a 3D grid is either C3 or anlmn set of 3-cells whose union is a cuboid in Euclidean space E3 . Definition 2.4.3 (Grid line). A grid line in 2D is incident with two dif- ferent grid points whose x or y coordinates are the same. The 2D grid Z2 can be regarded as a subset of the 3D grid Z3 by adding a third coordinate z = 0 to every 2D grid point. In 3D, a grid plane is incident with two orthog- onal grid lines. All of the grid points of a grid plane have the same x, y, or zcoordinate. A grid line in 3D is a set of points, two with coordinates that are constant in Z, whereas the third is a variable in R. Grid lines intersect at grid points in either 2D or 3D 2.5 Adjacency We are going to define adjacency relations between grid point, grid points are isolated poits in the plane. we defining neighbourhoods as mathemat- Figure 2.2: Grid points in plane and cells 10
  • 23. ical as For p = (x, y) ∈ Z2 N4(p) = {(x, y), (x + 1, y), (x − 1, y), (x, y + 1), (x, y − 1)} and N8(p) = N4(p) ∪ {(x + 1, y + 1), (x + 1, y − 1), (x − 1, y + 1), (x − 1, y − 1)} Result 2.5.1. If p, q ∈ Z2 are 4-adjacent or proper 4- neighbors i p = q and p ∈ N4(q) The same results holds for 8-adjacent or 8-neighbors. Definition 2.5.1 (Connected). Let M be set that contains the adjacency relation, if M is said to be connected then ∀p, q ∈ M, ∃ a sequence p0, . . . , pn where pi ∈ M, such that p0 = p, pn = q and pi is adjacent to pi−1, 1 ≤ i ≤ n. Such a sequence is called path and said to join p and m in M. Maximal connected subsets of M are called components of M 2.5.1 Adjacency in 2D and 3D Grids Definition 2.5.2 (1 -adjacent). Two 2-cells, c1 and c2, are called 1- adjacent i c1 = c2 and c1 ∩ c2is a 1-cell. Two grid points p1 = (x1, y1) and p2 = (x2,y 2) are called 4-adjacent i |x1x2| + |y1y2| = 1 Two 2-cells c1 and c2 are 1- adjacent iff they are not identical but they share a grid edge. Let pi be the centre of ci where i = 1, 2then c1 and c2 are 1 -adacent iff p1 and p2 are 4 -adjacent. Definition 2.5.3 (0 -adjacent). Two 2 -cells c1 and c2 are called 0 - adjacent i c1 = c2 and c1 ∩ c2 contains a 0 -cells. Two grid p1 = (x1, y1) and p2 = (x2, y2) are called 8-adjacent i max{|x1 − x2|, |y1 − y2|} = 1 In 3-D case generally we define α- adjacent and let de be the Euclidean metric 11
  • 24. Definition 2.5.4 (α - adjacent). Two 3-cells c1 and c2 are called α - adjacent i c1 = c2 and the intersection c1 ∩ c2 contains an α -cell (α ∈ {0, 1, 2}). Two 3-D grid points p1 = (x1, y1, z1) and p2 = (x2, y2, z2) are called 6-adjacent i 0 de(p1, p2) ≤ 1, 18- adjacent i 0 de(p1, p2) ≤ √ 2, and 26-adjacent i 0 de(p1, p2) ≤ √ 3. Figure 2.3: α-adjacent 3 cells Left : two α-adjacent 3-cells(α = 0, 1, 2). Middle :two α-adjacent 3- cells(α = 0, 1). Right : two α-adjacent 3-cells. We can now define the 2-D and 3-D grid point and grid cell adjacency models: Note 2.5.1. A 2-D(3-D) grid point adjacency model combines the grid point model with an adjacency relation dened between 2-D(3-D) grid points. A 2-D(3-D) grid cell adjacency model combines the grid cell model with an adjacency relation dened between grid squares (grid cubes). Both 2-D and 3-D grid point and grid cell adjacency models are called α-adjacency grids; the value of α determines whether we use a grid point model (α ≥ 4) or a grid cell model (α ≤ 3). A dual use of adjacencies for 2-D binary pictures P : α1-adjacency for P and α2-adjacency for ¯P ; in this case we deals about [α1, α2] -adjacency grids Let Z2 be the set of lattice points(i.e, a point with integer coordinates) in the plane and Z3 for the set of lattice points in 3-space. Figure shows the lattice points in plane and 3-space. Now we moving to the connectivity to plane and 3-space, we are defin- ing adjacency(something that lies next to something) between the lattice points, In Z2 we are going to define 8, 4-adjacent Definition 2.5.5. Two lattice points of Z2 are said to be 1. (8- adjacent) If they are distinct and each coordinate of one diers from corresponding coordinate of the other by at most 1. 12
  • 25. Figure 2.4: Lattice points in plane and 3-space 2. (4-adjacent) If they are 8-adjacent and dier in just one of their coor- dinates. for n−4, 8an n- neighbour of a lattice point p is a point that is n-adjacent to p. Figure 2.5: 8, 4-adjacent neighbour in plane In the case of Z3 , we are moving to 26, 18, 6-adjacency, lets recall the definition and defining how they are in 3-space Definition 2.5.6. Two lattice points of Z3 are said to be 1. (26- adjacent) If they are distinct and each coordinate of one diers from corresponding coordinate of the other by at most 1. 13
  • 26. 2. (18-adjacent) If they are 26-adjacent and dier in at most two of their coordinates. 3. (6-adjacent) If they are 26-adjacent and dier in just one coordinate. Figure 2.6: 26, 18, 6-adjacent neighbour in 3-space If p is a lattice point in Z2 then N(p) denotes the set consisting of p and its 8-neighbours. Similarly in Z3 ,If p is a lattice point in Z3 then N(p) denotes the set consisting of p and its 26-neighbours. Definition 2.5.7 (Black, White point). A lattice point associated with a pixel or voxel that has value 1 in an image is called a black point ; a lattice point associated with a pixel or voxel that has a value 0 is called a white point. 14
  • 27. 3 Digitization Models In this chapter, We are using mathematics to define method of digitiza- tion to create digital pictures and to compare results by analysing these pictures with corresponding results in Euclidean or similarity geometry. Gauss digitization and grid-intersection digitization, which were origi- nally proposed for 2-D, and Jordan digitization, which was defined more than a century ago for 3-D. We generalize these methods to allow variable grid resolution, and we extend the Gauss and grid-intersection models to 3-D and the Jordan model to 2-D. Here we are going to famous conjecture: There are 2 pictures in which of these pictures are black pixel connected? Figure 3.1: Pictures 3.0.2 Gauss digitization C.F. Gauss (1777 - 1855) studied the measurement of the area of a planar set S ⊂ R2 by counting the grid points (i, j) ∈ Z2 contained in S. Definition3.0.8. Let S be a subset of the plane. The Gauss digitizationG(S) is the union of the grid squares with center points in S. Figure 3.2 shows the Gauss digitizations G(D) of four disksD of dif- ferent diameters (measured in grid units). (The results would be the same if the disks all had unit diameter and were digitized on grids of different 15
  • 28. resolutions. The Gauss digitization of S on a grid of resolution h will be denoted by Gh(S)). G(D) is an isothetic polygon that has 12 vertices for diameter 5, 20 vertices for diameter 10, and 36 vertices for diameter 17. Note that the number of vertices is always a multiple of 4, because a disk that is centered at a grid point has a symmetric Gauss digitization. Figure 3.2: Four disks (dashed) and their Gauss digitizations (shaded) Theorem 3.0.1. The Gauss digitization G(S) of any non-empty bounded set S ⊂ R2 is the union of a nite number of simple isothetic polygons. Proof. A Gauss digitization G(S) is a union of grid squares, all of equal size. This union contains only a nite number of grid squares, because S is bounded. Any grid square is a simple isothetic polygon. Obviously, different sets can have identical Gauss digitizations. Figure 3.3 shows the Gauss digitization of a simple polygon with area 102, 742·5 and perimeter 4, 040 · 796, 631 . . . drawn on a 512 × 512 grid. On the upper left, each grid square contains 64×64 squares of the original 512×512 grid; in the upper middle, 32 × 32; and so on. Figure 3.4 shows the relative deviations of the area and perimeter of Gh( ) from those of when is digitized on a 2n × 2n grid (i.e., h = 2n ). The relative deviation is the absolute difference between the property values forGh( ) and divided by the property value for . Gauss digitization is defined analogously in 3D. If S ⊂ R3 , the Gauss digitization Gh(S) is the union of all of the 3-cells (in a grid of resolution h 0) with center points in S 3.0.3 Jordan digitization Let S ⊂ R3 and h 0. The magnification of S by factor h is denoted by h·S. In terms of multiplication of vectors by a scalar , we have the following: h · S = {(h · x, h · y, h · z) : (x, y, z) ∈ S} 16
  • 29. Figure 3.3: Gauss digitization of a simple polygon using grids of sizes from 8 × 8 (upper left) to 128 × 128 (lower middle). The original polygon was drawn on a grid of size 512 × 512 (lower right) Figure 3.4: Relative deviations of area and perimeter for the digi- tized polygon in Figure 1.9 17
  • 30. This magnification leaves the origin (0, 0, 0) fixed; other points of R3 could also be chosen as fixed points. C. Jordan (1838 - 1922) used grids to estimate the volumes of subsets of R3 . Let S ⊂ R3 be contained in the union of finitely many 3-cells. Magnify S by factor h with respect to an arbitrary fixed point p ∈ R3 ; this trans- forms S into Sp h. Let lp h(S) be the number of 3 -cells completely contained in Sp h and up h(S) the number of 3 -cells that have non-empty intersections with Sp h. Then h−3 · lp h(S) and h−3 · up h converge to limits L(S) and U(S), respectively, as h → ∞, these limits are the same for any p. Jordan called L(S) the inner volume and U(S) the outer volume of S or the volume V (S) of S if L(S) = U(S) Definition 3.0.9. Let S be a nonempty subset of R2 . Let J− h (S) be the union of all 2-cells (for grid resolution h 0) that are completely contained in S, and let J+ h (S) be the union of all such 2-cells that have nonempty intersections with S. Jh(S) is called the inner Jordan digitization of S and J+ h (S) the outer Jordan digitization of S. For S ⊆ R3 , we use 3-cells instead of 2-cells. For brevity, we denote J− 1 and J+ 1 with J and J+ , respectively. Outer Jordan digitization is also called super-cover digitization. Figure 3.5: Inner and outer Jordan digitizations of a centered disk Figure 3.5 shows a 2-D example in which S is a circle of radius n (in grid units) for n = 4 (left), n = 8 (middle), and n = 16 (right). If the frontier of a non-empty set S ⊂ R2 does not contain any grid edge segment of nonzero length, then the frontier of Jh(S) never intersects the frontier of J+ h (S). For example, this is the case if S has a smooth frontier that has continuous partial derivatives with respect to both coordinates and has positive curvature everywhere. A straight line γ has an empty J(γ) and a connectedJ+ (γ). 18
  • 31. 3.0.4 Grid-intersection digitization Gauss digitization and inner Jordan digitization are obviously not appro- priate for curves or arcs. Outer Jordan digitization is appropriate, but, in this section, we will define grid-intersection digitization, which is com- monly used for arcs and curves in the plane Definition 3.0.10. The grid-intersection digitization R(γ) of a planar curve or arc γ is the set of all grid points (i, j) that are closest (in Euclidean distance) to the intersection points of γ with the grid lines. Figure 3.6: Grid-intersection digitization of an arc. Figure 3.6 is an example of grid-intersection digitization of an arc. Note that an intersection point may have the same minimum distance to two different grid points; such an intersection point contributes two grid points to R(γ). (Alternatively, we could always choose, for example, the right point or the upper point.) A traversal of γ defines an ordered sequence (list) of grid points in R(γ). We assume the following : 1. if an intersection point is at the same minimum distance from two grid points, we list only the grid point that has the larger x-coordinate, or ,if their x-coordinates are equal, the one with the larger y-coordinate; 2. if consecutive intersection points have the same closest grid point, we list that grid point only once. The resulting ordered sequence of grid points is called the digitized grid intersection sequence ρ(γ) of γ . It defines a polygonal arc (or poly- gon) with vertices at grid points. The sequence represents R(γ) uniquely if an intersection point is never at the same minimum distance from two grid points. A similar method can be used to digitize a 3-D arc or curve γ for each intersection point of γ with a grid plane, we add the grid point(s) closest to the intersection point to the digitization 19
  • 32. Successive pairs of grid points in ρ(γ) define steps of length 1 along grid lines and diagonal steps of length √ 2. The directions of the steps can be represented with codes 0, 1, . . . , 7 as shown at the lower left of Figure 3.7; code i represents a step that makes angle (45 · i)◦ with the positive x-axis. Figure 3.7 shows an example of the directional encoding of an arc. The directional codes are usually called chain codes. A chain is an ordered finite sequence of code numbers. The length of a chain is the number of code numbers in it; note that this length is not related to the geometric length of the arc or curve represented by the chain. for any γ, we have the following: J− h (γ) = φ ⊆ Rh(γ) ⊆ J+ h (γ) Let γ be rectifiable; thus γ has a well-defined length L(γ). The length of ρ(γ) is not a good estimate of L(γ); it does not necessarily converge to L(γ) as the grid constant goes to zero. Example3.0.1 (Particular). consider the straight line segment pq in Figure 3.8 that has a slope of 22 · 5◦ and a length of 5 √ 5 2 . The length of (pq) is 3 + 2 √ 2 for grid constant 1 and (5+5 √ 2) 2 for all grid constants 1 2n (n ≥ 1). then the length of (pq) does not converge to 5 √ 5 4 as the grid constant goes to zero. Figure 3.7: Directional encoding of an arc. Starting at grid point p, the arc can be represented by the sequence of codes 677767000001 . . . 65 Figure 3.8: Example 20
  • 33. Example 3.0.2 (General). consider a line segment γ with slope 1 (m+1) . Its chain code representation is (0m 1)k , where k depends on the grid resolu- tion. No matter what k is, the length of ρ(γ) is k(m + √ 2) where L(γ) is k 1 + (m + 1)2. The ratio L(ρ(γ))/L(γ) is not unless m = 0 or m → ∞ We conclude this chapter by discussing the grid-intersection digitiza- tion of a straight line segment. Bresenham ’s algorithm is a standard rou- tine in computer graphics . We discuss the use of this algorithm to digitize a segment of a line y = ax + b in the first octant (i.e., with slope a ∈ [0, 1]). To draw the resulting digital straight line segment, we increase the x- coordinate stepwise by +1; the y -coordinate is occasionally increased by +1 and remains constant otherwise. By interchanging the start points and endpoints of the segment, we can handle octants to the left of the y-axis. In the eighth octant, we use a y-increment of 1, and in the second and seventh octants, we interchange the roles of the x- and y-coordinates. The digital straight line segment is a sequence of grid points (xi, yi), i ≥ 1.The point (x1, y1) is the grid point closest to the end point of the real segment. If we already have point (xi, yi), the next point has x-coordinate xi+1, and, for its y-coordinate, we must decide between yi and yi + 1. Let y = a(xi + 1) + b, and define the differences h1 and h2 by figure 3.9 Figure 3.9: Dierences in h1 and h2 from the correct y value 21
  • 34. h1 = y − yi = a(xi + 1) + b − yi h2 = (yi + 1) − y = yi + 1 − a(xi + 1) − b h1 − h2 = 2a(xi + 1) − 2yi + 2b − 1 We choose (xi +1, yi) if h1 h2 and(xi +1, yi +1) otherwise. For reasons of efficiency we use integer arithmetic only, so we do not use h1−h2 for this decision. Rather, let p = (x1, y1) and q = (xq, yq) be the grid points closest to the end points of the segment, and let dx = xq − x1 and dy = yq − y1. Let ei = dx · (h1h2) thus ei = 2(dy · xi − dx · yi) + b where b = 2dy + 2dx · b − dx is independent of i. Thus ei can be updated iteratively for successive decision at xi + 1 and xi + 2 : ei = 2dy · xi − 2dx · · · yi + b ei+1 = 2dy · −2dx · yi+1 + b Thus ei+1 − ei = 2dy(xi+1 − xi) − 2dx(yi+1 − yi) = 2dy − 2dx(yi+1 − yi) because xi+1 = xi+1; this is sufficient for deciding about the y-increment. Let x1 = xp = 0, and y1 = yp = 0 give the starting value ei = 2dy · x1 − 2dx · y1) + 2dy + dx(2b − 1) = 2dy − dx Bresenham ’s algorithm for first octant 1. Let dx = xq − xp, dy = yq − yp y = yq b1 = 2 · dy error = b1 − dx b2 = error − dx 22
  • 35. 2. Repeat Steps 3 through 6 until x xq. Stop when x xq. 3. Change the value of (x, y) to the value of a line pixel. 4. Increment x by 1. 5. If error 0 let error = error + b1, or else increment y by 1 and let error = error + b2 6. Go to step 2. At Step 1, we have error = e1 = 2dydx. The values b1 = 2 · dy and b2 = 2 · dy2 · dx are used to efficiently update the variable error. The algorithm runs in O(xq − xp) time because, for each i, it involves only a constant number of operations: setting one pixel value, two simple logical tests, one addition, and one or two increments. 3.1 Type digital sets If γ is, for example, a straight line, straight line segment, circle, or parabola, we call Rh(γ) a digital straight line, digital straight segment, digital circle, or digital parabola, respectively. If S is, for example, a disk, square, or convex set (and similarly in 3-D), we call J− h (S), Gh(S), orJ+ h (S) a digital disk, digital square, or digital con- vex set, respectively, provided it is connected. We call a connected set of grid points a digital disk and so forth (with respect to a given digitization model), if there exists a disk and so forth that has that connected set as its digitization. If Gauss or inner Jordan digitization is used, a connected set can have a digitization that consists of several connected isothetic polygons (poly- hedra). On the other hand, the outer Jordan digitization of a connected set S is always a single connected isothetic polygon or polyhedron. However, J+ does not preserve simple connectedness; it can create holes. Figure 3.10 (In the example on the right, the disk is not shown: this is done to illustrate the difficulty of recognizing digital disks.) shows how a disk in different positions can create different digital disks by Gauss dig- itization. The left and center digital disks both consist of 24 grid points, 23
  • 36. but the disk on the right consists of only 22 grid points. It can be shown that the number of different digital disks (up to translation), with respect to Gauss digitization, that consist of exactly n âL’ˇe 1 grid points is at most the following: O(n2 ) Gauss and Jordan digitization allow us to study methods or algorithms of digital geometry unders lightly different assumptions about there relation- ships between sets S in the Euclidean plane and their digitizations. Evi- dently, J− h (φ) = Gh(φ) = J+ h (φ) = φ And J− h (R2 ) = Gh(R2 ) = J+ h (R2 ) = R2 (and similarly for R3 ). If S is a non-empty proper subset of R2 or of R3 with a smooth frontier, we have J− h (S) ⊂ J+ h (S). Furthermore, the following J− h (S) ⊆ Gh(S) ⊆ J+ h (S), ∀S ⊆ R2 (S ⊆ R3 ) One or both relations ⊆ in the left part of above equation can be re- placed by =, but both cannot be if S has a smooth frontier. Let S be a finite union of grid squares; then we have J− (S) = G(S) = J+ (S). Figure 3.10: Gauss digitizations of the same disk at dierent loca- tions Figure 3.11: Inner and outer diamond and ball digitizations in the plane. The inner digitization is the union of the grid squares centered at black grid points, and the outer digitization (frontier shown as a bold black line) also contains the grid squares centered at shaded grid points. Left: diamond digitization. Right: ball digitization. 24
  • 37. 3.2 Domain digitizations In this section, we define a framework for a general class of digitization models. To simplify the discussion, we formulate this framework in n dimensions (n ≥ 1), but our main interest is of course in n = 2 and n = 3. Let the following be the n-cell centered at the origin O = (0, . . . , 0): cube = {(x1, . . . xn) : max 1in |xi| ≤ 1 2 Let φ = σ ⊆ cube and consider translates σ(q) = {q + p : p ∈ σ} of σ centered at grid points q ∈ Zn . In particular cube(q) is the n-cell cq centered at q. We will use the translates σ(q) of σ as the domains of influence for digitizations that is dig+ σ and dig− σ .For any set S ⊆ Rn dig+ σ (q) is the union of all cq such that σ(q) intersects S and dig− σ (S) is the union of all cq such that σ(q) is contained in S. Thus cq ⊆ dig+ σ (S) iff σ (q) ∩ S = φ cq ⊆ dig− σ (S) iff σ (q) ⊆ S So dig+ σ (S) is called the outer σ− digitization of S and dig− σ (S) the inner σ -digitization of S. For any S ⊆ Rn , we have dig− σ (S) ⊆ dig+ σ (S) ⊆ C (n) n . We now show that Jordan and Gauss digitizations are all σ-digitizations and that grid-intersection digitization can also be regarded as a σ-digitization. 1. If σ = c be for n = 2, 3 we obtain the inner and outer Jordan digitizations such that for S ⊆ R2 or S ⊆ R3 we have J+ (S) = dig+ cube(S) J− (S) = dig− cube(S) 2. σ = {0}, we have σ(q) = {q} so that dig+ σ (S) = dig− σ (S) ∀S ⊆ Rn . For n = 2 or 3, this set is just the Gauss digitization G(S). 25
  • 38. 3. If σ = {(x1 . . . xn) : ∃i, (1 ≤ i ≤ n∧xi = 0)∧ max 1≤i≤n |xi| ≤ 1 2 }, dig+ σ ,is essentially grid- intersection digitization.If γ is a planar arc or curve and n = 2, it is not hard to see that R(γ) = dig+ σ (γ), provided γ does not intersect any grid line midway between two grid points. Thus the Jordan digitizations are σ- digitizations in which σ is a cube; Gauss digitization is a σ- digitizations in which σ is a point; and grid- intersection digitization is essentially a σ-digitization in which σ is a cross. Other digitization models can be defined by using other simple sets σ . These digitization are illustrated in figure 3.11 The figure also illustrates a general property that follows directly from the definitions of dig+ σ and dig− σ σ1 ⊆ σ2 ⇒ dig+ σ1 (S) ⊆ dig+ σ2 (S) dig− σ2 (S) ⊆ dig− σ1 (S) 26
  • 39. 4 Digital Topology Digital pictures are rectangular arrays of non-negative numbers. The anal- ysis of a digital picture usually involves segmenting it into parts and measuring various properties of and relationships among the parts. In particular, one often wants to separate out the connected components of a picture subset to determine the adjacency relationships among those components, to track and encode their borders, or to thin them down to skeletons that have no interiors, without changing their connected- ness properties. There are standard algorithms for doing all of these tasks; but to prove that they work, one needs to establish some basic topological properties of digital picture subsets. 4.1 Introduction Digital image processing or picture processing is a rapidly growing dis- cipline with broad applications in business (document reading), industry (automated assembly and inspection), medicine (radiology, hematology, e.t.c. . .), and the environmental sciences (meteorology, geology, land-use management, e.t.c. . .), among many other fields. Most of this work in- volves picture analysis: given a picture, to construct a description of it in terms of the objects it contains or the regions of which it is composed and their properties and relationships. For example, a printed page is made up of characters on a background; a blood smear on a microscope slide con- tains blood cells on a background; a chest x-ray shows the heart, lungs, ribs, e.t.c. . ..; a satellite TV image of terrain is composed of terrain types; and so on. The process of decomposing a picture into regions, or into ob- jects and background, is called segmentation. A picture is input to the computer by sampling its brightness values at a discrete grid of points, and digitizing or quantizing these values to a finite number of binary places. The result of this process is called a digital picture; it is a rectangular array of discrete values. The elements of this array are called pixels (short for picture elements), or sometimes simply 27
  • 40. points, and the value of a pixel is called its gray level. Segmentation is basically a process of assigning the pixels to classes; one simple way of doing this, called thresholding, classifies the pixels according to whether or not their gray levels exceed a given threshold value t. Once a picture has been segmented into subsets, it can be described in terms of properties of these subsets and relationships among them. Some of these properties depend on the gray levels of the points that belong to a subset, but others are geometrical properties which depend only on the positions of these points. Especially basic are topological properties of the subsets, involving such concepts as adjacency and connectedness, but not size or shape. Topological properties of digital picture subsets are useful for a number of reasons. After a subset has been singled out, e.g., by thresholding, one usually wants to further segment it into connected regions, since these often correspond to distinct objects (characters, blood cells, e.t.c. . .). One may also want to track the borders of these regions, since the sequences of moves around the borders provide a compact en- coding of region shape. Alternatively, one may want to thin the regions into skeletons, without changing their connectedness properties, since this too yields a compact representation (e.g., an elongated region is rep- resented by a set of arcs or curves). The adjacency or surroundedness rela- tions among the regions can be compactly represented by a graph whose nodes are the regions, and in which two nodes are joined by an arc iff those two regions are adjacent. Many algorithms exist for segmenting a picture subset into its con- nected components, border following, thinning, and constructing the ad- jacency graph of a partition of a picture; To prove that these algorithms work correctly, or even (in some cases) to state them precisely, it is neces- sary to establish some of the basic topological properties of digital picture subsets. This gives an introduction to the study of such properties, which we call digital topology. Of course, this is nothing more than the study of some simple properties of finite sets of lattice points; The image normally considered in digital topology are binary arrays all of whose elements have value 0 or 1, in some part of digital topology can be generalized to fuzzy digital topology, which discuss with gray-scale image arrays, that is elements are in range 0 ≤ x ≤ 1 The array elements of a two dimensional image are called pixel , those of a three dimensional image are called voxel .There is a problem for con- sidering the border of the image array, so we assume that the array is ubounded in all directions this allows image in which an infinite number of pixels or voxels have value 1. 28
  • 41. 4.2 Digital Pictures A 2D digital picture captured or constructed on a surface is typically de- fined using a finite data structure that models regularly spaced planar or- thogonal grid. Definition 4.2.1 (Pixel). A picture P is a function dened on a nite rectangular subset of G of a regular planar orthogonal array,where G is called a grid, and an elements of G is called a pixel. P assigns a value P(p) to each pixel p ∈ G The values of a integer can be integers, floating point(Real numbers), or even a finite sets. For example, values of pixels in a colour picture are denoted by triples of scalar values, i.e, red green and blue or hue, saturation and intensity. Definition 4.2.2 (Voxel). A (3D)picture P is a function dened on a nite rectangular rectangular cuboid in a regular spatial(Space) orthogonal array, where G is called a(3D) grid, and an elements of G is called a voxel. P assigns a value P(p) to each pixel p ∈ G Pixels have grid- based coordinates, the regular planar orthogonal ar- ray is Z2 = Z × Z = {(i, j) : i, j ∈ Z}. Every grid points in Z2 is the center point of a grid square with sides of length 1. The corners of grid squares are called grid vertices. A 2D grid of size m × n is a rectangular array of grid points Gm,n = {(i, j) ∈ Z2 : 1 ≤ i ≤ m ∧ 1 ≤ j ≤ n} (4.1) or a rectangular set of grid squares, Gm,n = { grid square c : (i, j) = center of c ∧ 1 ≤ i ≤ m ∧ 1 ≤ j ≤ n} where m, n 1 Pictures are quantized as well as sampled, a pixel or voxel can have only a finite number of possible values. The range of values in a picture P of the form {0, . . . , Gmax},where Gmax is maximal picture value or maximal gray level, when 0 ≤ P(p) ≤ Gmax where Gmax ≥ 0. If Gmax = 0 then its a constant picture( blank picture).From an example we already said, the values in a colour picture are triples [u1, u2, u3], such as red, green and blue colour components. These triples are mapped onto {0, . . . , Gmax}. The range of values of the pixels or voxels in a binary picture is {0, 1}, i.e., Gmax = 1 29
  • 42. 4.2.1 Picture resolution and picture size Picture resolution is a display parameter. It is defined in dots per inch i.e., dpi or spatial pixel density, and its has a standard value for recent screen technologies is 72 dpi. Some recent printers use resolutions such as 300 dpi or 600 dpi and such values can also be used for picture presentation on a screen. In human eye itself makes use of sampled pictures. The retina of the eye is an array of about 125 million photoreceptor cells called rods and cones. A rod is about 0.002 mm in diameter and a cone is about 0.006 mm in diameter Pictures whose acquisition satisfies the traditional pinhole camera model are captured on planar surfaces. The light-sensitive array of a typical dig- ital camera, which is a charge-coupled device (CCD) matrix, can be re- garded as a rectangular set of square cells in a plane. The elements of the matrix capture a discrete set of pixel values. Other types of cameras may capture pictures on non-planar surfaces. Example 4.2.1. Figure 4.2 shows a super-high-resolution panoramic pic- ture captured with a rotating line camera. A geometric model of the panoramic picture acquisition process assumes that the picture is captured on a cylindric surface. Discrete methods of picture generation are frequently used in both art and technology. The dots in a pointillistic(the use of small area of colour to construct an image) painting can be as small as 1/16 of an inch in diameter. Figure 4.1: Grid point and grid square notation in a plane 30
  • 43. Picture size is another important picture property. Pictures cannot be arbitrarily large; picture capturing, display, and printing technologies will always impose finite limits. The number of pixels in a typical picture has increased greatly since the early days of picture analysis and computer graphics. In those days,a picture might contain only a few thousand pix- els; today, a color picture may require gigabytes of memory, Figure 1.5 also shows that how many pixels, Figure 4.2: A 380◦ panoramic picture of Auckland copied from Na- tional geographic channel The full-resolution picture consists of about 104 ×5·104 pixels captured on a cylindric surface with a rotating line camera(report of MATLAB). Algorithms in picture analysis are often applied to the pixels of a pic- ture in sequence, where the sequence is obtained by scanning the grid. Definition 4.2.3 (Scan). A scan of a grid Gm,n is a one-to-one mapping φ of the m × n pixels of the grid into a linear sequence φ(1), . . . , φ(mn). A scan can also be viewed as an enumeration of the pixels; φ(k) is the k-th pixel where 1 ≤ k ≤ mn. 4.2.2 Connectedness We begin by formulating the concept of connectedness for subsets of a digital picture . For concreteness, we assume that is an array of lattice points having positive integer coordinates (x, y), where 1 x M, 1 y N Definition 4.2.4 (4-neighbors). The 4-neighbors of (x, y) are its four hor- izontal and vertical neighbors (x ± l, , y) and (x, y ± l). 31
  • 44. Definition 4.2.5 (8-neighbors). The 8-neighbors of (x, y) consist of its four neighbors together with its four diagonal neighbors (x + 1, y ± 1) and (x − 1, y ± 1) Note 4.2.1. If (x, y) is a border point of , i.e., if x = 1 or M, y = 1 or N, some of these neighbors do not exist. If the points P and Q of are neighbors, we say that (4- or 8-) adjacent. Definition 4.2.6. Let P, Q be points of . By a path from P to Q we mean a sequence of points P = p0, p1 · · · pn = Q such that Pi, is a neighbor of Pi1, 1 i n Let S be a nonempty subset of . To avoid special cases, we assume that S does not meet the border of Definition 4.2.7 (Connected). If P and Q are connected in S if there exists a path from P to Q consisting entirely of points of S. Result 4.2.1. Connectedness in S is an equivalence relation Definition4.2.8. The equivalence classes dened by this relation are called the (connected) components of S. If S has only one component, it is called connected. 4.2.3 Arcs and curves A commonly used method of shape analysis in digital picture processing involves reducing thick digital point sets to idealized thin forms e.g., re- ducing elongated, simply connected objects to arcs, or objects that have a single hole to closed curves. Definition 4.2.9 (Arc). If S ⊆ is called an arc if it is connected, and all but two of its points (its endpoints) have exactly two neighbors in S, while those two have exactly one. An arc can be regarded as a path which neither crosses nor touches itself ,i.e., its points can be numbered Q1, . . . Qn , so that Qi is a neighbor of Qj iff i = j ± 1. To rule out degenerate cases, we shall assume that an arc always has at least two points. S cannot be both a 4-arc and an 8-arc unless it is a horizontal or vertical straight line segment. Theorem 4.2.1. An arc is simply connected. 32
  • 45. Proof. It can be proved by induction on the number of points in the arc, using the fact that, if we delete an endpoint from an arc, the result is still an arc (if it has more than one point); the details, which involve an enumeration of cases, Remark 4.2.1. This result is not true if we use 4-connectedness for both the arc and its complement, since the 4-arc P P P P P P P has a 4-hole. Definition 4.2.10. If S ⊆ is called a curve if it is connected, and each of its points has exactly two neighbors in S. We can number the points of a curve Q1, . . . , Qn so that Qi is a neighbor of Qj iff i ≡ j ± 1(modulon). To rule out degenerate cases, we will assume that a 4-curve always has at least eight points; and an 8-curve, four points. Note that no S can be both a 4-curve and an 8-curve. Theorem 4.2.2. A curve has at most one hole. Proof. From theorem 2.21 and the fact that deleting any point from a curve makes it an arc. Note that it, too, is false if we use 4-connectedness for both S and S; we proove in the case of 4-curve P P P P P P P P P P P P has two 4-holes. Indeed, as we shall next see, if we use opposite types of connectedness for S and ¯S, then a curve has exactly one hole; but if we use 8-connectedness for both, then the 8-curve has no 8-holes. P P P P 33
  • 46. Similarly, other cases can prove. Theorem 4.2.3 (Jordan Curve Theorem for digital curves). A curve has exactly one hole. Proof. The proof is similar to a standard proof of the theorem for polygons. Let S be a curve, and P /∈ S; we say that P ≡ (x, y) is inside S if the half-line Hp = {(z, y) : x ≤ z ≤ M} crosses S an odd number of times, and outside S otherwise. Crosses must be properly dened, since HP may meet S in runs of consecutive points; such a run is a crossing if S enters the run from the row above H and exits to the row below H, or vice versa. It can then be shown that neighboring points of ¯S are either both inside or both outside S; hence points in the same component of ¯S are either all inside or all outside. The theorem follows from this and the fact that the inside and outside of a curve are both nonempty. Result 4.2.2. Every point of a curve S is adjacent (in the sense of ¯S s connectedness) to both components of ¯S 4.2.4 Thinning The goal of thinning is to remove points from a set S without changing the connectedness properties of either S or ¯S. The class of points which can be safely removed is characterized by the following result, in which N(P) denotes the set of 8-neighbors of P. Result 4.2.3. The following properties of P of S are equivalent : 1. S ∩ N(P) has the same number of components as S ∩ [N(P) ∪ {P}] 2. ¯S ∩ N(P) has the same number of components as ¯S ∩ [N(P) ∪ {P}] 3. S ∩ N(P) has just one component adjacent to P 4. ¯S ∩ N(P) has just one component adjacent to P 5. S − {P} has the same number of componets as S and ¯S ∪ {P} has the same number of components as ¯S Definition 4.2.11 (Simple). A point having properties of above result is called simple 34
  • 47. An isolated point of S (having no neighbors in S) and an interior point of S (having all eight neighbors in S) cannot be simple; while an end point of S (having exactly one neighbor in S) is always simple. Remark 4.2.2. If S is simply connected, and P ∈ S is not an isolated, interior, or simple point, then S − {P} is not connected, but consists of components that are simply connected. Using this observation, we can show, using induction on the number of points in S, that if S is simply connected and has more than two points it must have at least two simple points. In fact, we can show that if S has only two simple points, they must both be ends, and that if S has an interior point it has a simple point that is not an end. Theorem 4.2.4. If S is an arc i it is simply connected and has exactly two simple points. From the above remark and Result 2.2.3 follows that connected S s that have only one hole; If P ∈ S is not isolated, interior, or simple, then S−{P} is either simply connected or not connected. Theorem 4.2.5. If S is a curve i it is connected has exactly one hole, and has no simple points. A connected S having just one hole can be thinned to a curve by re- peatedly deleting its simple points. 4.2.5 Thinning algorithm Let P = (V, m, n, B) and P = (V, m, n, B − D) be digital pictures where D ⊆ B we say that P is obtained from P by deleting the points in D. Al- ternatively, we may say that P is obtained from P by adding the points in D. A class of topology-preserving point deletion algorithms that are much used in image processing are known as thinning algorithms. Thinning originated in an attempt to compactly represent digital im- ages of alphanumeric characters or line drawings by sets of digital arcs and curves. A related goal was to develop a digital version of the medial axis transformation proposed by Blum for shapes in the Euclidean plane. For this reason the output of a thinning algorithm is sometimes called a medial line. Another kind of digital approximation of Blum’s transformation that does not always preserve topology is the discrete medial axis transforma- tion, which finds the black points at which the distance from the white point set attains a local maximum. This normally involves computing the distance transform of the image, in which each black point is labeled with 35
  • 48. its distance from the white point set. These processes are used in some thinning algorithms. A non-topological requirement on a thinning algorithm is that each elongated part of the input black point set should be represented by an arc in the output black point set. An algorithm that reduces the number of black points without necessarily satisfying this condition, but which pre- serves the topology of the image, is said to perform shrinking to a topo- logical equivalent. A related type of process is shrinking to a residue , in which holes are not preserved but each black component is shrunk to a single isolated point (called a residue) which may then be deleted. 4.2.6 Border following A set S ⊆ can be represented by specifying its borders; each border can be specified by defining a starting point and a sequence of moves from neighbor to neighbor. This representation, which is often quite compact, is very commonly used in image processing. In this section we define the border representation and give an algorithm for constructing it. Definition 4.2.12 (Border). The border of S ⊆ is the set of points of S that have 4-neighbors in ¯S. A thicker border consisting of points that have 8-neighbors in ¯S; The border of S consists, in general, of many parts, since S may have many components, each of which has many holes. Definition 4.2.13 (D-border (CD) ). Let C be a component of S and D a component of ¯S. The D-border of C is the set of points of C that have 4-neighbors in D. We denote this border by CD. BF4 algorithm We now describe an algorithm that successively visits all the points of the D-border of C. We assume that C is 4-connected and D 8-connected; that C has more than one point; and that we are given an initial pair of 4-neighboring points P0 ∈ C, Q0 ∈ D, which we assume to be distinctively marked. The algorithm, which we call BF4, specifies how to find a new point pair (Pi+1, Qi+1), given the current pair (Pi, Qi) BF4 operates as follows: Let the 8-neighbors of Pi, in clockwise order starting with Qi, be Ri1 = Qi, Ri2, . . . Ri8 Let Rij be the first of the R s that is in C and is a 4-neighbor of Pi (i.e., j is odd); such an Rij must exist, since C is 4-connected and has more than one point. If Rij−1 is in D, take Rij as 36
  • 49. Pi+1 and as Qi+1; otherwise, take RiJ−1 as Pi+1 and Rij−2 asQi + 1. If, for some i 0, Pi is P0 and one ofRi1, . . . Rij is stop. To illustrate the operation of BF4, we give a simple example. Let C be the set of P s shown below; the blanks are in ¯S, while P∗ is in S but not in C. Let P0 be the P on the third row, and let Q0 be the blank on its left. Then the successive steps of BF4, are as follows: Input : P∗ P P P P 1. Here R03 = P1, R02 = Q1 P∗ R02 P Q02 P0 P 2. Here R17 = P2, R16 = Q2 Note that R14 = P∗ is in S, but is ignored R12 R13 P∗ Q1 P1 R15 P R16 P P 3. Here R22 = P3, R21 = Q3(= Q2) Note that P2 = P0, but algorithm does not stop since Q0 is not one R21, R22, R23 P∗ P P2 Q2 P P 37
  • 50. 4. Here R37 = P4, R36 = Q4 P∗ P P Q2R32 P P3 R33 R36 R35R34 5. Here R45 = P5, R44 = Q5 P∗ P R44 P R43 P4 P R42 Q4 6. Here P5 = P0 and Q5 = Q0, so the algorithm stops P∗ P Q5 P5 P P The successive Pi s chosen by BF4 are 4-connected to each other in S (though they may not be 4-neighbors); the successive Qis are 8-connected to each other in ¯S; and Pi is 4adjacent to Qi. Thus the Pi s are all in C, the Qis all in D, and the Pi s are all on the D-border of C. The Pi s constitute the entire D-border can be outlined as follows: the operation of BF4 is unaffected if all points of ¯S except those in D (and in the background component) are transferred from ¯S to S; hence it suffices to prove the assertion for C s that have at most one hole. For simply connected C s, we can use induction on the number of points in C; since , C has simple points, and if BF4 works when a simple point is deleted, it still works when the point is present. For C s with one hole, we can first show that BF4 works if C is a curve. 38
  • 51. The algorithm (BF8) for the case where C is 8-connected and D 4- connected is very similar. Here we simply let Rij be the first of the R s that is in C, and take Pi+1 = Rij, Qi+1 = Rij−1. Thus Pi+1 is an 8-neighbor of Pi, and Qi+1 is 4-connected in ¯S to Q. Incidentally, our choice of clock- wise order for the R s implies that borders are followed keeping C on the right; thus the outer border of C is followed clockwise, and its hole borders counter clockwise. Since the successive Pi s chosen by BF4 or BF8 are 8-neighbors of each other, we can specify the D-border of C by giving the position of the start- ing point P0 together with a string of 3-bit numbers (0, . . . , 7) representing the moves from one Pi to the next. For example, we can use the code 3 2 1 4 Pi 0 5 6 7 to represent these moves (mnemonic: code i corresponds to a move in direction 45i◦ ). This representation is called a chain code. To reconstruct C from its borders, we need to know the pair of points (P0, Q0) and the chain code for each border CD. It is then straight forward to mark the points of CD, as well as a band of points in D adjacent to CD, for each D. When this has been done, it is easy to color in the interior of C. Note that if we had not marked the points in D that adjoin C, it would not be easy to decide which side of the D-border of C is interior to C. 4.2.7 The adjacency tree Given S ⊆ , the components of S and ¯S partition into connected re- gions. A useful way of (partially) describing a partition of is in terms of its adjacency graph, which specifies the regions and their adjacencies. When the partition consists of the components of a set and its complement, we can show that its adjacency graph is a tree. It can also be shown that if a component of S and a component of ¯S are adjacent, one of them sur- rounds the other; thus, under the relationship surrounds, the tree becomes a directed tree. In this section we define these concepts more precisely. Definition 4.2.14 (Adjacency graph). Let S = {S1, . . . Sn} be a partition of prod. The adjacency graph g of this partition is the graph whose node set is S , and in which two nodes Si, Sj are joined by an arc i the sets Si and Sj are adjacent (i.e., some point of Si is a neighbor of some point of Sj) 39
  • 52. When S consists of the connected components of S and ¯S, we shall denote its adjacency graph by gS,. In this case it does not matter whether we use 4-neighbors or 8-neighbors to define the adjacency relationship, since if a component of S and a component of ¯S are 8-adjacent, they must also be 4-adjacent. Theorem 4.2.6. gS is a tree Proof. We must show that gS does not contain a cycle. Let Tbe a component of S and U, V components of S that are adjacent to T (or vice versa); then any path from U to V , in the sense of the connectedness of S, must meet T, since otherwise the regions encountered by the path, together with T, would constitute a cycle. If we knew that U and V had to be in dierent components of ¯T, then no path between them could lie entirely in ¯T. Suppose they were in the same component W of ¯T; since they are both adjacent to T, they would both have to meet WT , the T-border of W. But since BF works, we know that WT is connected , and WT ⊆ ¯S, since points of ¯T that are adjacent to the component T of S cannot be in S. Thus U and V cannot both meet WT , since they are dierent components of ¯S; hence they cannot be in the same component of ¯T, so that T separates them, which proves that gS, has no cycles. Definition 4.2.15 (Surrounds). Let A, B be any subsets of . We say that A surrounds B if any 4-path from B to the border of meets A. Theorem4.2.7. Let C, D be adjacent components of S, ¯S, respectively; then either C surrounds D or D surrounds C. Moreover, exactly one component of ¯S surrounds each component of S (and vice versa, for non-background components of ¯S). Proof. As by the above Theorem 4.2.6 , two D s cannot be in the same component of ¯C; hence at most one D can be in the background component, so that all others are in holes and so are surrounded by C. On the other hand, there does exist a D0 not surrounded by C On any 4-path from C to the border of , let Pi be the last point of C; then Pi+1 is in some D, but is not surrounded by C, hence is in D0, so that D0 surrounds C. hence proved 40
  • 53. 5 Binary digital picture spaces T.Y. Kong and A.W. Roscoe, the first two authors presented a general the- ory of binary digital pictures. In that theory a binary digital picture was represented by an ordered pair (A, S), where S was the set of black grid points on the 2-D square grid or 3-D cubic grid, and A was an adjacency relation, on the set of all grid points, that satisfied certain regularity con- ditions. It was shown that well-behaved binary digital pictures had con- tinuous analogs. However, the continuous analogs constructed are not consistent with any reasonable theory of digital fundamental groups. The (A, S) representation of binary digital pictures is not a convenient notation for discussing image processing operations such as thinning or digital rotation. The reason is that these operations would normally alter the A part of a binary digital picture (A, S) as well as the black point set S. Instead of the A part of the (A, S) representation, it is better to have some- thing that is invariant under conventional image processing operations. Definition 5.0.16 (Binary digital space or DPS). A binary digital picture space is a triple (V, β, ω)where V is the set of grid points in a 2-D or 3-D grid and each of β and ω is a set of closed straight line segments joining pairs of points in V . V is an innite set of points in E2 (2-D case) or E3 (3-D case), V has no accumulation points, and there exists a positive constant D such that every point in E2 or respectively E3 is within distance D of a point in V . (We write E2 for the Euclidean plane and E3 for Euclidean 3-space.) we refer to a binary digital picture space simply as a digital picture space; and we will often abbreviate this to DPS. The members of V the points of (or in) the DPS (V, β, ω). Most often we take V = Z2 or Z3 , corresponding to the square or cubic grid. (We write Z2 for the set of points with integer coordinates in E2 , and Z3 for the set of points with integer coordinates in E3 .) An important notion of digital topology is that of adjacency between points. Typically, different adjacency relations are used for the black and the white points. On a DPS (V, β, ω) these adjacency relations are defined 41
  • 54. by the line segments in the sets β and ω. The β set contains all straight line segments joining points in V that will be considered adjacent to each other if they are both black. Similarly, the set ω contains all straight line segments joining points in V that will be considered adjacent to each other if they are both white. Neither β nor ω need have the same symmetries as V . (More precisely, neither βnor ω need be invariant under isometries of E2 or E3 that map V onto itself.) In the special case V = Z2 it is most usual for one of β and ω to be the set of all 4-adjacencies of Z2 and the other to be the set of all 8-adjacencies of Z3 . In the special case V = Z3 it is most usual for one β and ω of and to be the set of all 6-adjacencies of Z3 and the other to be either the set of all 18-adjacencies or the set of all 26-adjacencies of Z3 . In general, if β happens to be the set of all m-adjacencies of V for some integer m, and ω happens to be the set of all n-adjacencies for some integer n, then we may denote the DPS (V, β, ω) by (V, m, n), as in (Z2 , 8, 4) or (Z3 , 6, 26). Definition 5.0.17 ( β, ω -adjacency). A line segment in βis called a β- adjacency. Similarly, a line segment in ω is called an ω -adjacency. If p and q are the endpoints of a β-adjacency (ω -adjacency) we say p is β-adjacency (ω -adjacency) to q. Definition5.0.18 (Isomorphism). An isomorphism of a DPS P1 = (V1, β1, ω1) to a DPS P2 = (V2, β2, ω2) is a homeomorphism h of the Euclidean plane (2-D case) or Euclidean 3-space (3-D case) to itself such that h maps V1 onto V2, each β1-adjacency onto a β2-adjacency and each ω1-adjacency onto an ω2-adjacency, and h−1 maps each β2-adjacency onto a β1 -adjacency and each ω2 -adjacency onto an ω1-adjacency. Thus the DPS (V, 6, 6) where V is the set of grid points in a 2-D isometric hexagonal grid is isomorphic to the DPS (V, β, ω) in which V = Z2 and β = ω = the 4-adjacencies and the south-west-north-east diagonals of unit lattice squares. The latter DPS is an example of a DPS (V, β, ω) in which β and ω do not have the same symmetries as V . Definition 5.0.19 (Complement). If S is any set of points in the DPS P = (V, β, ω) then the complement of S (with respect to P), written ¯S, is the set V − S. The complement of a DPS P = (V, β, ω), written ¯P, is the DPS (V, β, ω). Example 5.0.2. If P = (Z2 , 8, 4), then ¯P = (Z2 , 4, 8) 42
  • 55. 5.0.8 Binary Pictures Definition 5.0.20 (Binary Picture). A binary digital picture is a quadru- ple (V, β, ω), B), where (V, β, ω) is a DPS and B is a subset of V . we refer to a binary digital picture simply as a digital picture; and often we just call it a picture. (V, β, ω), B) is a picture on the DPS (V, β, ω), and points of the DPS (i.e., points in V ) are also referred to as points of the picture Definition 5.0.21 (Black,White points). Points in B are called black points of the picture; each black point represents a pixel or voxel that has value l. Points in B correspond to pixels or voxels with value 0 and are called white points of the picture. The general effect of image processing operations such as shrinking, thinning, border finding and digital rotation is to transform a digital pic- ture to another digital picture on the same digital picture space. Definition 5.0.22 (Isomorphism,P-adjacent,Black, White adjacency, Complement). 1. An isomorphism of a picture P1 = (V1, β1, ω1, B1) to a picture P2 = (V2, β2, ω2, B2)is an isomorphism of the DPS (V1, β1, ω1) to the DPS (V2, β2, ω2) that maps B1 onto B2. 2. Two black points of the picture P = (V, β, ω, B) are said to be P- adjacent if they are β-adjacent. Two white points or a white point and a black point are said to be P-adjacent if they are ω-adjacent. 3. A β-adjacency that joins two black points of P = (V, β, ω, B) is called a black adjacency; an ω-adjacency that joins two white points of P is called a white adjacency 4. The complement of a picture P = (V, β, ω, B), written ¯P, is the pic- ture (V, ω, β, B). That is, the picture ¯P is the same as the picture P but with the black and white points and their associated adjacency relations interchanged. Thus P-adjacent black points of P are ¯P - adjacent white points of ¯P. However, a black point and a white point that are P-adjacent are not necessarily ¯P -adjacent. A black (white) adjacency that joins two points in a subset S of V is called a black (white) adjacency of S. 43
  • 56. 5.0.9 Properties of DPS Let P = (V, β, ω, B) be any picture and let • be P, β, ω, or a positive integer (e.g., 4 or 8 when V = Z2 ). Definition 5.0.23 ( •-adjacency, -component, -connected, -path, and -curve). 1. If a point p is •-adjacent to a point q then we say p is a • -neighbor of q. A point p is said to be • -adjacent to a set of points S if p is • -adjacent to some point in S. Two sets of points S and T are said to be •-adjacent to each other if some point in S is • -adjacent to some point in T. 2. A set of points is •-connected if it is not a union of two disjoint non- empty sets which are not • -adjacent to each other. A • -component of a non-empty set of points S is a maximal • -connected subset of S. Thus a •-component of S is a non-empty • -connected subset of S that is not • -adjacent to any other point in S. 3. A P-component of B (or, equivalently, a β-component of B) is called a black component of P. A P-component of ¯B = V B (or, equivalently, an ω-component of B) is called a white component of P. 4. A • -path of P is a sequence p1, p2, . . . , pn of n ≥ 1 points in which each point pi is •-adjacent to pi−1 1 i ≤ n. A • -path from p to q is a • -path whose initial and nal points are respectively p and q. Two points p and q lie in the same • -component of a set of points S i there is a •-path in S from p to q. 5. A simple closed • -curve of P is a nite •-connected set of points in which each point is •-adjacent to exactly two other points in the set. 6. A • -path or simple closed •-curve of P is said to be black (white) if all its points are black (white). A black P -path of P is a β-path in B and a white P-path of P is an ω-path in B. Let ¯S be the complement of S 44
  • 57. Definition 5.0.24 (Background, holes, simply connected). The unique component of ¯S that contains the border of is called the background of S; all other components, if any, are called holes in S. If S has no holes, it is called simply connected Let U as a basis for the open sets, U(P) ≡ U(x, y) = {P}; if x + y is odd. = {Pandits4negihbors}; if x + y is even. then a set is connected in the resulting topology iff it is 4- connected. Definition 5.0.25 (Border). If a black component C in a picture P = (V, β, ω, B), a point in C that is adjacent to a white point of P is called a border point of C in P. The set of all border points of Cin P is called the border of C in P If Dis a white component of P, then the border of C with respect to D in P is the set of all points in C that are adjacent to D. If a DPS P = (V, β, ω) is connected if V is connected in every picture on P. Note 5.0.2. In a picture (V, β, ω, B) on a connected DPS a nonempty set X ⊆ V is adjacent to each component of ¯X. For if C is a component of ¯X, then by the connectedness of V there is a path in V from a point in C to a point in X. The rst point on such a path that belongs to X must be adjacent to C Definition 5.0.26 (Surround). A connected set of points X in a picture P = (V, β, ω, B) is said to surround a (not necessarily connected) set of points Y in P if every point in Y is contained in a nite component of ¯X (i.e., a component of X consisting of just nitely many points). Note that since V has no accumulation points a subset of V is finite if and only if it is bounded. In a picture on a connected DPS if X surrounds Y , then Y does not surround X Theorem 5.0.8. In a picture on a connected DPS if a connected set of points X surrounds a connected set of points Y , then Y does not surround X. Proof. Let X and Y be connected sets of points in a picture on the connected DPS (V, β, ω) such that X surrounds Y . Then the component of ¯X that con- tains Y is nite. Therefore, since V is innite, either some other component of ¯X is innite, or there are innitely many other components of ¯X, or X itself is innite. As V is connected each component of ¯X is adjacent to X. So in each of the three cases X is contained in an innite component of ¯Y . Therefore Y does not d X. 45
  • 58. Definition 5.0.27 (Hole, Cavity). A white component of a picture P which is both adjacent to and surrounded by a black component C of P is called a hole of (or in) C if P is a 2-D picture, and a cavity of (or in) C if P is a 3-D picture. By a hole in P we mean a hole in any black component of P Definition5.0.28 (Background). A white component of P that surrounds the set of all black points is called a background component of P. The back- ground component may be the only white component of P. On the other hand, P may have no background component. This is so when P = (Z2 , 8, 4, B) and B is the set of all lattice points whose x and y coordinates are both positive. But in a picture on a connected DPS the background component, if it exists, is unique Theorem 5.0.9. A picture on a connected DPS has no more than one background component. Proof. Let D be a background component of a picture P on the connected DPS (V, β, ω), and let F be any other white component of P. Each com- ponent of ¯D must contain a black point adjacent to D (at the border of the component). So each component of ¯D is nite, since D must surround the black points in that component. As V is innite it follows that either D is innite, or ¯D has innitely many components in which case D is adjacent to innitely many black points. Hence the black points adjacent to D belong to an innite component of ¯F, and so F is not a background component. Suppose P is a picture on a connected DPS such that each point in P is adjacent to only finitely many other points. Then the complement of any finite set of points in P has only finitely many components, one of which must be infinite. But all components of the complement of the background component ofP must be finite. Hence the background component of P, if it exists, is infinite. 5.1 Regular digital picture spaces To avoid awkward, or pathological, digital picture spaces that are incom- patible with our definition of digital fundamental groups, we shall have to impose two restrictions on the sets and ω of a DPS (V, β, ω). We call the DPS’s that satisfy these conditions regular, we will confine our attention to regular DPS’s. 46
  • 59. Definition 5.1.1. A DPS (V, β, ω) is said to be regular if it satises both of the following conditions: 1. no β -adjacency or ω-adjacency passes through any point in V other than its endpoints, 2. no β -adjacency meets an ω-adjacency with which it does not share an endpoint. The second condition in this definition essentially says that no β-adjacency ever crosses an ω-adjacency. Notice that if a DPS P is regular, then so is its complement ¯P For a DPS P = (V, β, ω) satisfying condition (1), condition (2) is equiv- alent to the following condition: (2’) If the points a, b, c, d in V are the cor- ners of a convex quadrilateral, where a is diagonally opposite to c, then in any picture on P in which a and c are black points and b and d are white points, the sets {a, c} and {b, d} are not both connected. The motivation for condition (2 ) is that Euclidean space has an anal- ogous property: if a closed convex quadrilateral in Euclidean space with corners a, b, c, d, where a is diagonally opposite to c, is partitioned into two subsets in such a way that a and c belong to one subset and b and d to the other, then the two subsets are not both arc wise connected. Example5.1.1. The DPS's (Z2 , 8, 8), (Z3 , 18, 18), (Z3 , 18, 26) and (Z3 , 26, 26) are not regular. If V is the set of grid points of the face-centered cubic grid, then (V, 18, 18)is not a regular DPS. 5.1.1 The digital fundamental groups Definition 5.1.2 (P-walk). A P-walk is a curve γ : [0, 1] → En , where n = 2 or 3 according as P is 2-D or 3-D, such that γ(0) and γ(l) are black points of P, and there exists a positive integer k such that for all non-negative integers i k: 1. γ(i/k) is a black point, 2. γ(i/k) is equal or adjacent to γ((i + k)/k), 3. γ is a linear on the closed interval [i/k, (i + 1)/k]. A P-walk γ is said to be a P-walk from γ(0) to γ(l). A P-walk that is a constant map will be called trivial; all other P-walks will be called non trivial. If γ is a non trivial P-walk, then it follows from the first condition 47
  • 60. in Definition 2.4.1 that there is just one positive integer k such that the conditions (1), (2) and (3) in the definition of a P-walk are satisfied for all nonnegative integers i k. This value of k will be called the length of -γ. For a trivial P-walk all positive integers k satisfy conditions (1), (2) and (3), so this definition cannot be used. We define the length of a trivial P-walk to be 1. If γ1 is a P-walk of length m from p to q and γ2 is a P-walk of length n from q to r, then the product of γl and γ2, written γ1 · γ2, is the P-walk from p to r obtained by catenating the curves γ1 and γ2 in the following way: γ1 · γ2(x) =    γ1 (m+n)x m , if 0 ≤ x ≤ m (m+n) γ1 (m+n)x n−m n , if m (m+n) ≤ x ≤ 1 The length of γ1 · γ2 is the sum of the lengths of γ1 and γ2, provided at least one of γ2 and γ2 is non trivial. Definition 5.1.3 (P -loop). A P -walk from a point p to itself is called a P-loop, and is said to be based at p; we also call p the base point of the P-loop. A trivial P-walk is a P -loop, and is called a trivial P-loop; all other P-loops are called non trivial. The trivial P-loop based at p is denoted by ep. Remark 5.1.1. let P be a picture on an n-dimensional DPS, where n = 2 or 3. Two P -loops with the same base point are called equivalent if they are xed base point homotopic in En − W, where W is the union of all white points of P if n = 2, and the union of all white adjacencies of P if n = 3. This is of course an equivalence relation. Let [λ]P for the equivalence class consisting of all P-loops which have the same base point as λ and which are equivalent to λ. If the P -loops λ and λ have the same base point, then define [λ]P · [λ ]P to be the equiva- lence class [λ · λ ]P This is a well-defined associative binary operation on equivalence classes Definition 5.1.4 (The digital fundamental group ). Let P be a picture on a regular DPS. The digital fundamental group of P with base point p, denoted by π(P, p), is the group of all equivalence classes [λ]P where λis a P-loop based at p, under the · operation. If p1 and p2 are points in the same black component of a picture P on a regular DPS, then π(P, p1)and π(P, p2) are isomorphic groups. 48
  • 61. Note5.1.1. Digital fundamental groups are invariant under isomorphism of ures. In fact, if f is any isomorphism of a picture P1 to a picture P2, then, for each black point p in P1 , f induces a group isomorphism of π(P, p1) to P2 5.2 Strong normal digital pictures spaces A strongly normal digital picture space is a DPS P = (Zn , β, ω) ,where n = 2 or 3, in which there is a certain duality between the β-adjacencies and the ω-adjacencies. As a result of this duality the digital topology of P is in many ways analogous to the topology of the Euclidean plane or Euclidean 3-space. A strongly normal DPS provides a possible basis for topology-related image processing operations such as thinning and border following. Dig- ital picture spaces that are not strongly normal, such as (Zn , 4, 4), may be quite unsuitable for this purpose. Definition 5.2.1 (Strongly normal). If P = (V, β, ω) is strongly normal if its if it is regular and also satises all of the following conditions: 1. V = Z2 in the 2-D case or V = Z3 in the 3-D case. 2. In the 2-D case every 4-adjacency and in the 3-D case every 6-adjacency is both a β-adjacency and an ω -adjacency. 3. All β-adjacencies and ω-adjacencies are 8-adjacencies in the 2-D case and 26-adjacencies in the 3-D case. 4. In any given unit lattice square either both diagonals are β-adjacencies or both diagonals are ω-adjacencies or one of the diagonals is both a β -adjacency and an ω -adjacency. 5. Every picture P on P has the property that whenever a black compo- nent of P is either β -adjacent or ω -adjacent to a white component of P, the black component is in the 2-D case 4-adjacent and in the 3-D case 6-adjacent to the white component. Example 5.2.1. (Z2 , 8, 4) and (Z3 , 26, 6) are strongly normal. Note 5.2.1. If DPS P is strongly normal, then so is its complement ¯P 49
  • 62. Conditions (l) and (2) imply that a strongly normal DPS is connected. Regarding condition (4), note that if both diagonals are β-adjacencies ( ω- adjacencies), then neither is an ω-adjacency (a β-adjacency) because P is regular. Conditions (1), (2) and (5) imply that a black component and a white component of a picture on a strongly normal DPS (V, β, ω) are β- adjacent if and only if they are ω -adjacent. Given that P satisfies condition (1), it is easily seen that condition (4) is equivalent to each of the following conditions: Note 5.2.2. (4') : In any picture on P, if two diagonally opposite corners a, c of a unit lattice square are black points and the other two corners b, d are white points, then one of the sets {a, c} and {b, d} is connected. (4*) : If either diagonal of a unit lattice square is not a β-adjacency, the other is an ω-adjacency. When V = Z2 and P satisfies conditions (2) and (3) we want condition (4’) (and hence (4) and (4*)) to hold because if it does not, then we can construct a connectivity paradox. For if (4’) fails, then we may suppose w.l.o.g. that {a, c} = {(0, 0), (1, 1)}. Then, in the picture on P with black point set B = {(0, n) : n ∈ Z, n 0} ∪ {(1, n) : n ∈ Z, n 0}, B has two components and neither component separates Zn i.e., if we remove either black component by changing its points into white points, then the white point set becomes connected). Now if a closed set in the Euclidean plane E2 has just two components and neither component separates E2 , then the set itself does not separate E2 . However, B does separate Z2 . To avoid this connectivity paradox we must require condition (4’) to hold when V = Z2 We want a 3-D strongly normal DPS to meet each coordinate plane in a strongly normal 2-dimensional DPS. So we also require condition (4’) to hold when V = Z3 Condition (5) may seem unsatisfactory for two reasons. First, it may not be clear why one might expect condition (5) to hold in a well-behaved DPS. Second, it looks as though one might have to do some work to de- termine whether a given DPS satisfies condition (5) or not. these apparent drawbacks of condition (5) by giving two alternate formulations of that condition. It asserts that if P satisfies conditions (1) - (4), then condition (5) is equivalent to each of the following conditions: Note 5.2.3. (5') : In any picture on P, a one-point black component {p} and a one-point white component {q} cannot be β-adjacent or ω -adjacent to each other. 50
  • 63. (5* ) : In the case V = Z2 , if p and q are diametrically opposite corners of a unit lattice cube in which p is not β -adjacent to any 6-neighbor of q, and q is not ω -adjacent to any 6-neighbor of p, then p and q are neither β- nor ω -adjacent. A one-point white component {q} corresponds to a very small cavity Q in some object in E3 . A one-point black component {p} corresponds to a very small object P in E3 . Since (assuming condition (2)) {p} does not surround {q} and {q} does not surround {p}, the object P should neither surround nor be surrounded by the cavity Q. Thus removing the object P should not affect the cavity Q, so changing p to a white point should not enlarge the white component {q}. Hence {p} should not be ω -adjacent to {q}. Similarly, filling in the cavity Q should not affect the object P, so changing q to a black point should not enlarge the black component {p}. Hence {p} should not be β-adjacent to {q}. Theorem 5.2.1. Suppose P = (Z3 , β, ω) satises conditions (2)-(4) in the denition of a strongly normal DPS. Then conditions (5), (5') and (5* ) are equivalent. Proof. First we proof that (5 ) ⇒ (5∗), suppose (5') holds. Let p and q be diametrically opposite corners of the unit lattice cube K. Let a, b, c be the three 6-neighbors of q in K. If q is not ω-adjacent to any 6-neighbor of p, and p is not β-adjacent to any 6-neighbor of q, then when B is the set consisting of p, a, b, c, and the nineteen 26-neighbors of q outside K the sets {p} and {q} are respectively a black and white component of (Z3 , β, ω, B), and so (5') implies p is neither β - nor ω -adjacent to q. It is clear from the denition that (5*) ⇒ (5) and that implies (5 ') 5.2.1 Examples of Strong normal DPS The DPS’s (Z2 , 8, 4), (Z2 , 4, 8), (Z3 , 6, 26), (Z3 , 26, 6), (Z3 , 6, 18) and (Z3 , 18, 6) are all strongly normal. Both the 2-D and the 3-D , Khalimsky digital picture spaces in which β = ω =the Khalimsky adjacencies, are strongly normal. (However, the DPS’s (Z2 , 4, 4), (Z2 , 8, 8), (Z3 , 6, 6), (Z3 , 18, 18) and (Z3 , 26, 26) are not strongly normal.) It is not difficult to show that each of the following five DPS’s is isomorphic to a strongly normal DPS 1. (V, 6, 6) where V = grid points of the 2-D isometric hexagonal grid, 2. (V, 12, 12) where V = grid points of the 3-D face-centered cubic grid, 3. (V, 12, 18) where V = grid points of the 3-D face-centered cubic grid, 51
  • 64. 4. (V, 18, 12) where V = grid points of the 3-D face-centered cubic grid, 5. (V, 14, 14)where V = grid points of the 3-D body-centered cubic grid. In a DPS that is isomorphic to a strongly normal DPS every point has at least four β -neighbors and at least four a ω -neighbors (each point has at least six of each in the 3-D case). Thus neither of the DPS’s (V, 12, 3) and (V, 3, 12) where V is the set of grid points of the 2-D triangular grid is isomorphic to a strongly normal DPS. 5.2.2 The discrete digital fundamental group Given two finite sequences c1, c2, where the final point of c1 is the same as the initial point of c2, the product of c1 and c2, written c1 ·c2, is the sequence obtained by removing the initial element of and appending the resulting sequence onto the end of c1 . Thus p, p, q, r, a · a, x, y, a = p, p, q, r, a, x, y, a The reduced form of a finite sequence c is the subsequence of c that is obtained when we remove from c all but one point from every set of con- secutive equal points. If all members of a sequence are equal to p, then the reduced form of the sequence is p . Otherwise, if c = p1, p2, . . . , pm , then the reduced form of c is the longest sequence of the form p1, pi1 , . . . , pin , where n ≥ 1, i1 is the smallest value of i such that pi = p1 , and each of the other ik is the smallest value of i greater than ik−l such that pi = pik−1 . Thus the reduced form of p, p, p, q, r, r, q, q, q, q, p, p is p, q, r, q, p if p, q and r are distinct. Definition 5.2.2 (Black digital walk, black digital loop). For any digital picture P and black points p, p of P, a black digital walk of P from p to p is a sequence p1, p2, . . . pn of black points of P where n ≥ 1, p1 = p, pn = p and each point pi is equal or adjacent to pi−1, (1 i ≤ n). A black digital walk is said to be trivial if all its points are equal, non trivial otherwise. A black digital walk of P from p to p is called a black digital loop of P based at p, and we call p its base point. Now suppose P is a picture on a strongly normal DPS. If K is any unit lattice square or unit lattice cube, then we say that one black digi- tal walk is K-equivalent to another with the same initial and final points if the two are equal or if the first x = p1, p2, . . . , pm = y , the second is x = q1, q2, . . . , qn = y and the following three conditions are satisfied: 52