A key question in digital image processing is whether two digital images and represent the same object. If, after magnification or shrinking and translation, copies and of the respective images have been scaled to approximately the same size and are located in approximately the same position, a Hausdorff metric may be employed: if is small, then perhaps and represent the same object; if is large, then and probably do not represent the same object. However, the Hausdorff metric is very crude as a measure of similarity. In this paper, we consider other comparisons of digital images.
Much of this section is quoted or paraphrased from .
We use to indicate the set of natural numbers, for the set of integers, and for the set of real numbers.
A digital image is a graph , where is a subset of for some positive integer , and is an adjacency relation for the points of . The -adjacencies are commonly used. Let , , where we consider these points as -tuples of integers:
Let , . We say and are -adjacent if
There are at most indices for which .
For all indices such that we have .
Often, a -adjacency is denoted by the number of points adjacent to a given point in using this adjacency. E.g.,
In , -adjacency is 2-adjacency.
In , -adjacency is 4-adjacency and -adjacency is 8-adjacency.
In , -adjacency is 6-adjacency, -adjacency is 18-adjacency, and -adjacency is 26-adjacency.
We write , or when is understood, to indicate that and are -adjacent. Similarly, we write , or when is understood, to indicate that and are -adjacent or equal.
A subset of a digital image is -connected , or connected when is understood, if for every pair of points there exists a sequence such that , , and for .
2.2 Digitally continuous functions
The following generalizes a definition of .
 Let and be digital images. A single-valued function is -continuous if for every -connected we have that is a -connected subset of .
When the adjacency relations are understood, we will simply say that is continuous. Continuity can be expressed in terms of adjacency of points:
2.3 Pseudometrics and metrics
 Let be a nonempty set. Let be a function such that for all ,
Then is a pseudometric for . If, further, implies then is a metric for .
Pseudometrics that can be applied to pairs of nonempty subsets of a digital image include the absolute values of the differences in their
deviations from convexity. Several such deviations are discussed in [18, 4], for each of which it was shown that two objects can be “close” in the Hausdorff metric yet quite different with respect to the deviation from convexity. These can be adapted to digital images with respect to digital convexity as defined in .
Lusternik-Schnirelman category . I.e., the function
where is the Lusternik-Schnirelman category of , is a pseudometric for digital images in .
diameters. This is discussed below.
The following is easily verified and extends an assertion of .
Let be a pseudometric, . Then is a pseudometric. Further, if at least one of the is a metric, then is a metric.
Here we mention metrics we use in this paper for or . Let , .
Let . The metric for is given by
The special case gives the Manhattan or city block metric , given by
The special case gives the Euclidean metric , given by
The shortest path metric : Let be a connected digital image. For , let
The Hausdorff metric based on a metric : Let be a metric where . The Hausdorff metric for nonempty bounded and closed subsets and of (hence, in the case , finite subsets of ) based on is
We make the following modification of the Hausdorff metric based on as presented in .
Let , , . Let be an adjacency on . Then
In the version of the Hausdorff metric based on in , . We show below that we can get very different results for the more general situation .
We use the notations for the Hausdorff metric based on the metric , for the Hausdorff metric based on the metric (i.e., ), and for the Hausdorff metric based on for subsets of (i.e., ).
Another metric from classical topology that is easily adapted to digital topology is Borsuk’s metric of continuity [2, 3] based on a metric which is typically, but not necessarily, the Euclidean metric. For digital images and in , define the metric of continuity as the greatest lower bound of numbers such that there are -continuous and with
Given finite digital images and in and a metric for , .
This is largely the argument of the analogous assertion in . Let . Since and are finite, without loss of generality, there exists such that . Then for all -continuous , . Therefore, . ∎
An example for which the inequality of Proposition 2.6 is strict is given in the following.
Let . Let . Then, using the Manhattan metric for and , we have and .
It is clear that .
Notice there is an isomorphism to a subset of . Let be -continuous. By , there is a pair of antipodal points such that . Since is an isomorphism, we must have . We will show that either or , as follows.
If then . Then:
If then , so .
Note so cannot equal .
If for then , so .
The cases , , and are similar. Thus . ∎
We say the diameter of a nonempty bounded set with respect to a metric is
We will use the notations for , and for .
We define a function for pairs of nonempty bounded sets in by
We use notations for , and for .
The following is easily verified.
The function is a pseudometric.
3 Comparing (pseudo)metrics on digital images
In this section, we compare the use of some of the (pseudo)metrics discussed above.
Let and be nonempty, bounded subsets of . Let be the Hausdorff metric based on the metric and suppose . Then .
There exist such that . There exist such that and . So
Similarly, . The assertion follows. ∎
By contrast, we have the following.
Let such that is even. Let . Let
(See Figure 1.) Then , but while , we have . Thus .
It is easy to see that both and have diagonally opposed points that are maximally distant in the metric. Therefore, , so .
Diagonally opposed points of are maximally separated with respect to , so . Maximally separated points of with respect to are
In either case, the unique shortest -path between maximally separated points requires horizontal steps. The number of vertical steps is computed as follows. There are vertical line segments that must be traversed, each of length , so the number of vertical steps is . Thus the number of steps between maximally separated members of is .
Hence for we have . ∎
We do not get an analog of Theorem 3.1 by using the Hausdorff metric based on an adjacency instead of . This is shown in the following example.
Let . Let . (See Figure 2.) Then . However, we have the following.
For , and , so .
For , and , so .
Let and be finite, nonempty -connected subsets of a -connected subset of , where . Suppose we have for some . Then .
By hypothesis, given and , there exist , , and -paths from to and from to in such that each of and has length of at most . Since each -adjacency corresponds to a Euclidean distance of at most , it follows that and . It follows that . ∎
We do not get a converse for Theorem 3.4, as the following shows.
It is easy to see that .
Since , finding a Hausdorff distance between and comes down to considering a furthest point of from . With respect to and also with respect to , the furthest point of from in the shortest path metric is and its closest point of is . Since and , the assertion follows. ∎
Roughly, it appears that the great differences found in Examples 3.3 and 3.5, between measures based in metrics and measures based on the shortest path metric, are due to significant deviations from convexity. If we consider for a set such as a digital cube, we may find and are more alike, as we see below.
Let , . Then .
Let . Let . Then there exists such that . By definition of , it follows that there is a -path in of length at most from to . Similarly, given in , there is a -path in of length at most from to a point . Therefore, .
Now let . Then given , there is a -path in of length at most from to some . Similarly, given , there is a -path in of length at most from to some . Since every adjacency represents a distance of 1, it follows that and . Thus . The assertion follows. ∎
Using the observation that a -adjacency in , , represents a distance between the adjacent points that is between and , we can generalize the argument used to prove Proposition 3.6, getting the following.
Let , . Then for , .
4 Further remarks
The Hausdorff metric is often used to compare objects and . It is easy to compute efficiently [19, 9] and gives a good indication of how well each of its arguments approximates the other with respect to location.
However, two objects may be close in the Hausdorff metric and yet have very different geometric or topological properties. Lemma 2.4 tells us that by adding other pseudometrics or metrics, such as those we have discussed, to the Hausdorff metric, we can get another metric in which closeness is more likely to validate the parameters as digital images representing the same physical object.
The suggestions and corrections of an anonymous reviewer are gratefully acknowledged.
A. Borat and T. Vergili,
Digital Lusternik-Schnirelmann category,
Turkish Journal of Mathematics 42 (2018), 1845-1852
On some metrizations of the hyperspace of compact sets,
Fundamenta Mathematicae 41 (1954), 168-202
-  K. Borsuk, Theory of Retracts, Polish Scientific Publishers, Warsaw, 1967.
L. Boxer, Computing Deviations from Convexity in Polygons,
Pattern Recognition Letters 14 (1993), 163-167
A classical construction for the digital fundamental group,
Journal of Mathematical Imaging and Vision 10 (1999), 51-62
L. Boxer, Continuous maps on digital simple closed curves,
Applied Mathematics 1 (2010), 377-386.
Convexity and freezing sets in digital topology,
Applied General Topology 22 (1) (2021), 121 - 137
L. Boxer, I. Karaca, and A. Oztel, Topological Invariants in Digital Images,
Journal of Mathematical Sciences: Advances and Applications 11(2), 2011, 109-140.
L. Boxer and R. Miller,
Coarse grained gather and scatter operations
Journal of Parallel and Distributed Computing 64 (2004), 1297-1320
L. Boxer and P.C. Staecker,
Fundamental groups and Euler characteristics of sphere-like digital images,
Applied General Topology 17(2), 2016, 139-158.
L. Chen, Gradually varied surfaces and its optimal uniform approximation,
SPIE Proceedings 2182 (1994), 300-307.
-  L. Chen, Discrete Surfaces and Manifolds, Scientific Practical Computing, Rockville, MD, 2004
-  J. Dugundji, Topology, Allyn and Bacon, Boston, 1966
Non-product property of the digital fundamental group,
Information Sciences 171 (2005), 73-91
S.-E. Han, Digital fundamental group and Euler characteristic of a connected sum of
digital closed surfaces,
Information Sciences 177 (2007), 3314-3326
-  S.B. Nadler, Jr., Hyperspaces of Sets, Marcel Dekker, New York, 1978
‘Continuous’ functions on digital images,
Pattern Recognition Letters 4 (1987), 177-184
Polygonal entropy: a convexity measure,
Pattern Recognition Letters 10 (4) (1989), 229-235
An image algorithm for computing the Hausdorff
distance efficiently in linear time,
Information Processing Letters 30 (2) (1989), 87-89
Digital Hausdorff distance on a connected digital image,
Communications Faculty of Sciences University of Ankara Series A1 Mathematics and Statistics 69 (2)