A common problem in computational topology is to try to recover an object embedded in when only some distorted version of it is known. Inspired by digital imaging we consider specifically the problem of a pixelated subset of the plane, which is to say that it has been replaced by a set of square pixels on a grid. Since it is common to represent images by a grid of small pixels, it seems intuitive that any object could be recovered from its pixelations. Indeed, when the resolution of an image is fine it is difficult to detect any difference from the original using only the human eye, and we may expect to be able to recover even deep geometric invariants.lated subset of the plane, which is to say that it has been replaced by a set of square pixels on a grid. Since it is common to represent images by a grid of small pixels, it seems intuitive that any object could be recovered from its pixelations. Indeed, when the resolution of an image is fine it is difficult to detect any difference from the original using only the human eye, and we may expect to be able to recover even deep geometric invariants.
A pixelation associated to a subset of a plane is simply the set of all pixels in a grid of a certain size which touch that subset (see Figure 1). By changing the size of the grid, we can view pixelations of the object with finer and courser resolutions. We call the pixelation associated to a set created from a grid of side-length , or the -pixelation of (see Definition 1.1). The variable is called the resolution of the pixelation.
For small resolutions these pixelations seem to resemble the original shape. However, we need a precise notion of what it means to resemble the original object. At the very least it seems that the important topological and geometric invariants of the pixelation will be close to the corresponding variants of the original set. Even when viewing simple examples, we can quickly see that not all invariants will converge for small resolutions. Most obviously, the total curvature of will tend to increase to infinity, since the pixelation contains many corners. Similarly length of the boundary may not converge. To see this consider the line segment from to . The length of the line is , but each of its pixelations will have a boundary whose length is close to .
We see that pixelations do destroy various geometric invariants. However, it may be that convergence of these invariants is too much to ask for. A much simpler request is for the pixelation to eventually converge in Euler characteristic. Unfortunately not even this is guaranteed. Some pixelations will contain fake cycles which do not correspond to any cycle of the original set (indeed arbitrarily many may appear even if the original set was contractible). Worse yet, these fake cycles may not disappear for small resolutions. Section A has further information on this phenomenon, but for now it is sufficient to consider the example of a line of slope and a line of slope (which is shown in Figure 2). The -pixelations have certain scale invariance properties which guarantee that a fake cycle will always appear, even for very small .
We see that the process of pixelation can destroy a great deal of mathematical information of the set. However, to the eye, the pixelation can look very close to the original set. Therefore it seems that it should be possible to use only the pixelation to reconstruct the original set. In this paper we will create an explicit algorithm which can reconstruct a PL set from only its pixelations. However, to motivate this algorithm and to generate the theorems needed to show that this algorithm works, we will need to examine simpler examples of pixelations.
In Section 2 we deal with pixelations of the graphs of functions. Theorem 2.2, an analogue of the intermediate value theorem, tells us that these pixelations must be contractible. Therefore we do not have to worry at this stage about fake cycles. To approximate the graph of a function we attempt to use a secant line approximation. This is done by connecting points within the pixelation of the function to create a PL approximation. However, additionally error will be generated from the fact that our sample points are being selected not from the graph of function, but merely near to the graph.
Theorem 2.6 gives us bounds on the error between a secant line of our function and the approximate secant line from the pixelation. Note that these bounds depend both on the resolution and the width of the secant line. We want to choose our PL approximation in a strict algorithmic way such that these errors vanish. To do this we use the notion of a spread function.
A spread function is simply a function such that the following conditions hold:
The spread function tells how wide the secant lines in our approximations should be in terms of the resolution of the pixelation. That is, since a pixel is defined to be wide, the secant lines should be arranged to be about wide. Theorem 2.11 shows that the two conditions of the spread guarantee Sobolev convergence of the secant line approximation.
In Section 3 we generalize the approximation technique to handle elementary regions, which are defined to be regions which line in between the graphs of two functions (note that the graph of a function is just a special case of an elementary region). In this case we also cannot have fake cycles. We can easily generalize the secant line approximation of functions to elementary regions by approximating the top and bottom regions of the elementary region. It is then simple to show that we maintain the previous Sobolev convergence on the boundary of the approximation.
Here the notion of a spread becomes very useful. By restricting the spread function , we can dramatically improve the convergence of the approximation. Indeed if require that
so that increases very quickly, but still does not increase faster than decreases, we can recover the total curvature of the boundary of the elementary region. This is shown in Propositions 3.4, 3.6 and Corollary 3.7 for sets of increasing generality. However each of these sets is defined as the region between the graphs of two functions.
At this point although we have created an algorithm which strongly approximates an elementary regions, but we have completely ignored simple sets such as the union of two intersecting lines. Such a set is potentially difficult to approximate, since its pixelation may have more cycles than the original set. In Section 4 we tackle the problem of homotopy type as it relates to the pixelations of sets.
Corollary 4.2 of Theorem 4.1 shows that eventually there is a bijective correspondence between the connected components of the pixelation and the connected components of the original set . A cycle in a (reasonably behaved) planar set corresponds to a hole, i.e., a bounded connected component of the complement of the set. We can again use Theorem 4.1 to show that every hole of the original set will eventually correspond to a hole of the pixelation. Therefore any defect in homotopy type is caused by the addition of holes in the process of pixelation. This means that to ensure convergence in homotopy type, we need only to delete the extra holes using only information from the pixelation.
An intuitive way to distinguish fake holes from real holes is to note that any real hole must take up an actual area in the plane. However, fake holes tend to be composed of a relatively small number of really small pixels. Therefore for small resolutions the fake cycles will have small areas. Appealing as it may sound, this idea is difficult to implement rigorously because we do not have an accurate way of defining what “small area” means. We rely instead on a more robust approach inspired from Morse theory.
We consider the linear function on the Cartesian plane that associates to each point its -coordinate. For simplicity we assume that its restriction to our PL set is a stratified Morse function in the sense of Goresky-MacPherson, . In our case this simply means that no two vertices of our set lie on the same vertical line.
The topology of the level sets of is determined by the counting function
A pixelated version of is the function , where is the number of connected components of the column of located at . Note that for a cycle to appear in , the function must vary and likewise with the pixelation and . Therefore determining whether a cycle in is a fake or really corresponds to a cycle in is a matter of determining how closely the function agrees with .
The Separation Theorem (Theorem 4.4) states that if is not a critical value of then for all sufficiently small. The critical values of correspond to points jumping points of , i.e., points of of discontinuity of . Using the Separation Theorem we prove several results indicating that the jumping points of and the jumping points of are not far apart. This culminates in Proposition 4.10 which states that in the PL case jumping points of must appear close to jumping points of and vice versa. Here “close” means within where is an integer determined by and called the noise range.
We ultimately want to classify an interval around every jumping point of
as “noise.” To do this we must estimate the noise range, but this is determined by the original set and thus unknown given only the pixelation. However if we estimate the noise range using a spread note that for small we can guarantee that while is small. Therefore if we classify an interval of width about around each jumping point of as noise, we can ensure that eventually outside of the noise while the noise region remains small.
The noise intervals are important since they are chosen to eventually contain all fake cycles of while taking up a vanishingly small portion of the real line. Therefore to approximate homotopy type within noise intervals we need only cover every cycle (since any cycle appearing will be a fake cycle). Since noise does not take up much of the plane, we do not need to be careful as to how we approximate within noise intervals, so we will do this by covering each connected component of the noise with the smallest rectangle which covers it.
Call the components of the complement of the noise intervals regular intervals. By the definition of noise, the regular intervals contain no jumping points of . Therefore is continuous on the regular intervals, which implies that the parts of which lie over regular intervals look like strips that span the entire regular interval. Each strip can be interpreted as the pixelation of an elementary set and we have explained how to deal with such objects.
Putting together all these facts we obtain Algorithm 4.12 which associates to each -pixelation a set. This algorithm works by using the function and the spread to divide the pixelation into noise and regular intervals, and then approximates within each interval using the appropriate results. That is to say within noise intervals it covers each connected component with a rectangle and within regular intervals it connects the tops and bottoms of every -th column. An example of the result of this algorithm can be seen in Figure 3 and the Algorithm is restated in terms of a computer program in Appendix D.
We wish to state that Algorithm 4.12 captures all the important geometric and topological invariants. To do this we use the language of normal cycles. These are
-currents with supports contained in the bundle of unit tangent vectors. AppendicesB and C are included for readers unfamiliar with these objects. For purposes of this general discussion it suffices to mention that the normal cycle of a subanalytic subset of the plane is a piecewise closed curve in the unit tangent sphere bundle object which encodes geometric and topological information about of the set through integration of certain canonical 1-forms.
In general the normal cycle can be thought to be approximated by the collection of all unit outer normal vectors of the set. For example, the normal cycle of a bounded domain with -boundary is the graph of the Gauss map of the boundary. The normal cycle of the square resembles Figure 4. Of course the normal cycle is actually a subset of the sphere bundle of the plane, not the plane itself. The fiber of the normal cycle over a point in the interior of an edge each point will consist of only a single outer normal vector. The fiber over a corner consists of an entire quarter-circle (all possible outer normal vectors for the corner). Therefore the length of the normal cycle will be the perimeter of the square plus , or the perimeter of the square plus its total curvature.
If we prove that the normal cycles of our approximations converge weakly to the normal cycle of the original set, we will have shown that our approximation recovers the important geometric information of the set. To prove this we use the powerful General Convergence Theorem proved by Joseph Fu in . This result is restated in this paper as Theorem 5.5. This theorem tells us that to have convergence in normal cycles we must prove three things about our approximations. First, they must all fit within some compact subset of the plane. This is clear from the Algorithm 4.12. Secondly, the mass of the normal cycles of the approximations cannot explode. Since the mass of the normal cycle is highly dependent on the total curvature and the perimeter of the set, this follows from Corollary 3.7. Finally we must have the Euler characteristic of the approximation converge to the Euler characteristic of the original set when restricted to an arbitrary half plane. This requirement of the approximation theorem is the most challenging, but it turns to be true as well. Therefore Fu’s General Convergence Theorem implies convergence of our approximations in normal cycle (Theorem 5.1).
Theorem 5.1 is a powerful result with many corollaries, since the normal cycle encodes many important invariants. Most particularly it implies that the approximation generated by Algorithm 4.12 will recover both the Euler Characteristic as well as the total curvature on the boundary of any generic PL set.
1. Definition of Pixelations
In this section we give the definition of a pixelation and detail the most basic of properties of a pixelation. Questions about recovery of the original set are not tackled until future sections.
(a) Let . Then we define an -pixel to be the square in of the form
The grid of pixels is the collection of all such -pixels.
(b) A union of finitely many -pixels is called an -pixelation. The variable is called the resolution of the pixelation.
(c) For any bounded subset we define the -pixelation of to be the union of all the -pixels that intersect . We denote the -pixelation of by . The pixelation of a function is defined to be the piexelation of its graph . We will denote this pixelation by .
The variable is called the resolution, because we think of a pixelation as a representation of a computerized image. A smaller choice of will cause a shape to be approximated by a greater number of pixels, which is like saving an image as a higher resolution file.
Observe that if is the norm
then the the pixel can be identified with the -closed ball of radius and center
Therefore a pixelation can be thought of as set of points chosen near the original shape. However, rather than being chosen randomly these points are chosen to be the closest points on a regular lattice. This by no means makes the problem of a recovering a set from its pixelation trivial. As we will see, even the homotopy type can be lost during the process of pixelation. Still, the added structure of a pixelation will allow us to make stronger approximations than can be done with regular pixelations. For example it is reasonable to expect geometric information like total curvature of the boundary to be preserved in an approximation.
The -pixelation associated to a bounded set is the collection of pixels in this grid that contain a part of . A pixelation is a sort of “fattening” of the set, since we include a pixel if any part of the set lies within the pixel (see Figure 5.) In this way it is somewhat similar to a tube around the set. However a pixelation differs from a tube in that the boundary of any pixelation will have corners, and that the distance from the boundary to the set may vary significantly (since pixelations are formed by taking a collection of squares in a grid.) As we will see in the following sections, the fact that pixelations approximate via a grid means that the geometric properties of pixelations may not converge to the geometric properties of the original set as (for example, the normal cycle of the pixelation will not converge to the normal cycle of the original set.) The good news is that geometric information about the original set can be obtained from its pixelations in indirect ways.
It is easy to see that the pixelation of an set can be fundamentally different from a set. For example, every pixelation of a line segment will have many corners (as long as the line is not parallel to the or -axis.) This implies that as becomes small, the total curvature of the boundaries of pixelations of a line segment will increase in an unbounded fashion. This contradicts the fact that the line itself has no curvature and shows that essential geometric features of the set are not preserved in the pixelation.
In fact, though it is more difficult to see, pixelations do not preserve the topological properties of the set. Consider the set consisting of a line of slope and a line of slope which both start at the origin. Then it can be shown that for every , contains a hole which prevents from being contractible (see Figure 6.) The position of the hole depends on , but it will always exist for any . This example is far from unique. In fact, by altering the slope of the two lines we can create a set whose pixelations contain any desired number of holes. This shows that pixelations do not preserve the topological properties of the underlying set.
is very small, it is easy for the human eye to detect the kind of shape that probably generated a pixelation. Mathematically this corresponds to the fact that it is possible to create an approximation from the information in the pixelation which will respect topological and geometric features. The approximation can be algorithmically generated, but we delay defining it until much later in the paper (since the motivation for it rests on many properties of pixelations.)
The remainder of the paper will examine specifically what pixelations preserve and what they destroy. Furthermore it will explain how to recover the information “lost” in the process of creating a pixelation.
We end this section with a few basic properties of pixelations which will be useful.
For any two sets and we have
This follows immediately from the definition of a pixelation as the union all pixels which intersect a set.
For each define to be
i.e. the tube of radius of in the norm. Then
Suppose . Then such that and lie within the same pixel. But by the definition of pixels, this implies that . Therefore .
2. Pixelations of Functions and First-Order Approximation
In order to reach our overall goal of recovering sufficiently nice sets from their pixelations, we must start by examining simple sets. The graphs of functions on compact domains provide a good starting point. We will find that in this case many analogues of basic theorems from calculus appear in a pixelated version, and these facts will allow us to approximate the graphs of these functions.
Before we proceed in our investigation we need to introduce a basic vocabulary that will be used throughout the paper.
Fix and a bounded set .
A point will be called -generic if . For such a point we denote by the interval of the form , that contains .
For an interval we define the vertical strip
For every we denote by the vertical strip
For any -generic point we denote by the strip
A column of is the intersection of with a vertical strip , . The connected components of a column are called stacks.
For every -generic , we define the column of a pixelation over to be the set
In other words, is the union of the pixels in which intersect the vertical line . When is the graph of a function , we will use the notation to denote the column over of the pixelation .
We define the top, bottom and respectively height of a column to be the quantities
Since stacks are constrained to be within the same column, a stack can usually be thought of as two pixels together with all the pixels that fall vertically in between them.
This language allows us to state an analogue of the Intermediate Value Theorem.
Theorem 2.2 (Pixelated Intermediate Value Theorem).
If is a continuous function, then for every , the column consists of exactly one stack.
We argue by contradiction. Suppose that the column has at least two stacks. This means that within the column over there are two stacks with a gap of empty pixels in between them. This implies that there exist an interval , not contained in the range of , and real numbers such that
Since is continuous, this contradicts the Intermediate Value Theorem. Therefore the column over has only one stack.
Note that the Pixelated Intermediate Value Theorem immediately implies that a cycle cannot appear in the pixelation of a continuous function. Therefore the pathological behavior witnessed in Appendix A will not occur in the pixelations of functions, which is our first hint that pixelations of functions are the nicest type of pixelation to work with.
This analogue of the Intermediate Value Theorem tells us that we can think of the pixelation of a function that assign a stack of pixels to each value in the domain of the function. The stacks themselves are worth investigating. To generate a stack in the pixelation, the function must attain values near the top and bottom of the stack within that column. This means that the average change of a function over a column must be related to the height of the column. This relation will be shown in the following two theorems. The first tells us that the height of a stack is bounded by the derivative of the function.
Let be a Lipschitz continuous function. We denote by the best Lipschitz constant, i.e.,
Then for any and any we have
We argue by contradiction. This means that there exist and such that
Set so that . The inequality (2.1) is equivalent to the condition
This implies that
because the pixelation can be one pixel higher or lower than the graph of ; see Figure 7. We have thus found and such that
But this contradicts the definition of .
(a) Observe that if then
(b) The above theorem can be used to bound the height of a stack by the derivative of over that stack by considering the restriction of to that column.
The next theorem suggests that the height of a stack is close, in a crude way, to the absolute value of the derivative in the column for sufficiently small . The intuition is that if is , then any sufficiently small section of its graph will be very close to the graph of a line, and the height of a stack in the pixelation of the graph of a line must be very close to the slope of that line.
Let be a function on . Then, for any and any we have
Recall that indicates the interval of the form , , that contains . Let be the linearization of at , i.e., the function
From Taylor’s Theorem we deduce that
This implies that
On the other hand, changes by over the width of a pixel, which implies
We would now like to approximate through its pixelations. An intuitive way to do this is by creating a function whose graph lies within , since this approximation would generate a similar pixelation. However, in practice this method requires making many choices, and it can be cumbersome to check that the graph of the function lies within the pixelation of . A better approach is to form a function by connecting points within by straight line segments. In order to preserve higher order properties of the function, we must be careful when choosing these points.
For example, suppose that the vertices of the approximation are centers of the top pixels in each column. Then the slopes of each line making up the function would have integer slopes, and could never approximate the derivative of arbitrarily well. We could increase the accuracy of the approximation by connecting the maxima of every other column, or every third column. However, doing this decreases the speed in which the approximation converges pointwise to . This is the central tension involved in approximating a function from its pixelation.
Before we further describe how to approximate a function from its pixelation, we show how to at least find the average change of the function, i.e., the slope of the secant line connecting the first and last points of .
Let be a function on the interval . Fix . Let such that and .
for all .
Note that it suffices to prove the above inequalities in the special case when . For ease of notation let
and note that is the slope of the secant line to over the interval . Define
and note that this is the slope of . Note that and differ from and by at most the height of a stack.
With and defined as above,
This immediately implies
The Mean Value Theorem implies that such that . Let be the linearization of at ,i.e.,
Thus we have
First we will bound the first term on the right hand side of (2.5).
To proceed further we need to use the following facts.
Since , we have
Now we bound the other term from (2.5), . We have
Note that , since stacks are at most pixels tall. Taylor’s Theorem implies that
Finally , since has slope at most , and . We conclude that
Combining all of these bounds in (2.5) we deduce
which is the bound (2.2).
The bound (2.3) is obtained as follows.
This Theorem tells us that the slope of a secant line to can be accurately approximated up to its derivative (by restricting to various intervals we can approximate any secant line.) We would like approximate through the use of multiple secant lines. However to accurately approximate a small secant line, we will need to be very small. On the other hand, to accurately approximate we will need to use many (and therefore small) secant lines. Thus we will need to know the size of a secant line that can be accurately approximated for a given . Before we can describe how to go about this process, however, we will need additional terms.
Fix and a bounded set .
An -profile of is a set of points in the plane with the following properties.
Each point in is the center of an -pixel that intersects .
Every column of contains precisely one point of .
A top/bottom -profile is a profile consisting of the centers of the highest/lowest pixels in each column of .
An -sample of is a subset of an -profile.
Suppose is a finite sequence of points in . (The points need not be distinct). We denote by
the curve defined as the union of the straight line segments .
Observe that each -profile of a set is equipped with a linear order . More precisely if are points in , then
where denotes the projection . In particular, this shows that any -sample of carries a natural total order.
If is an -sample of , then the
-interpolation determined by sampleis the continuous, piecewise linear function obtained as follows.
Arrange the points in in increasing order, with respect to the above total order,
The graph of is the -curve .
In applications, the sample sets will be chosen to satisfy certain regularity.
If is a positive integer and is an -profile, then an -sample with spread is a subset
such that the following hold.
The points and are the left and rightmost points in the profile. (That is for each , .)
For any , there exists such that .
A spread is an increasing function from the positive real numbers to the positive integers with the following properties:
The next theorem tells how to approximate using profiles and spreads while maintaining first order properties.
Let be a -function and be a spread function. Fix and let be an -sample of the graph of with spread ,
Denote by the -interpolation determined by . Then
for all . In particular, if
then as , converges to in the Sobolev norm for all .
Let and such that . On this subinterval, the function is defined by
Thus is a function of the type described in Theorem 2.6, where
we obtain the desired error bounds.
Now suppose that and . Then note that every term in both the error bounds of and is a constant multiplied by , , or all of which converge to as . This implies that
Therefore converges to in the Sobolev norm.
This theorem allows us to approximate functions using only their pixelations. Note that any profile can be chosen for the approximation. We can see this in the pixelation by noting that the top profile and bottom profile both converge to the graph of the function, so any profile chosen in between will be squeezed onto the graph.
To ensure the correct convergence on the derivative, we only need the two basic features of a spread: that as , and . In general we would like the spread to increase quickly, so as to get an accurate approximation on the derivative. The two conditions on the spread mean that the quickest increasing spread will look like where .
3. Approximations of Elementary Regions and Curvature Approximation
In this section we use the properties of pixelations of functions to study the pixelations of simple two dimensional sets. We deal with the simplest case: that of a region between the graphs of two functions.
A subset is said to be elementary (with respect to the -axis) if its can be defined as
where are functions such that , . The function is called the bottom of while is called the top of . Note that this includes the situation where , in which case .
In the remainder of this section will indicate an elementary set. We first note that like the pixelation of a function, each column of contains only one stack:
If is an elementary set, then for every , the column consists of exactly one stack.
Fix an -generic . By Theorem 2.2 the columns and consist of single stacks. If these two columns intersect, then the conclusion is obvious. If they do not intersect, then any pixel in the strip situated below the stack and above the stack is a pixel of . This again proves that the column consists of a single stack.
Fix and an elementary set .
An -upper/lower profile of is a profile of the -pixelation of the top/bottom function. An -upper/lower sample is a sample of an upper/lower profile.
An -upper profile is said to be compatible with an -lower profile if and lie in the same column of we have and lie in the same column of we have
An -upper sample is said to be compatible with an -lower sample , if the following hold.
There exist compatible -upper/lower profiles such that .
A strip contains a point in if and only if it also contains a point in .
Suppose that are compatible upper/lower samples of
The -approximation of determined by these two samples is the -set bounded by the simple closed -curve
We denote this approximation by .
These definitions are extensions of the ideas of profiles, samples and PL approximations found in section 2. Note that the upper and lower profiles are defined from the pixelations of the top and bottom function, which might not be known. However, from the definition of an elementary set, every pixel on the top of a column must intersect the pixelation of the upper function and similarly every pixel at the bottom of a column must intersect the lower function. Therefore, an upper profile can be thought of as a profile chosen from the top pixels of and a lower profile can be thought of as a profile chosen from the lower pixels of .
In section 2 we noted that the PL approximation preserves first order properties for a good choice of spread. For elementary sets, we would like to prove something stronger. Namely, we would like to show that the total curvature of the set is preserved for good choice of spread.
The total curvature of a immersion is defined as follows. Define a -function such that
where a dot denotes the -derivative. We set
The scalar is called the curvature of at the point . We define the total curvature of to be
Suppose now that continuous and piecewise -immersion, i.e., there exist a finite subset , , for
such that the restriction is a -immersion for any . The curvature of at a jump point is the quantity
We define the total curvature of to be