Abstract

This work is devoted to present a methodology for the computation of Discrete Compactness in -dimensional orthogonal pseudo-polytopes. The proposed procedures take in account compactness' definitions originally presented for the 2D and 3D cases and extend them directly for considering the D case. There are introduced efficient algorithms for computing discrete compactness which are based on an orthogonal polytopes representation scheme known as the Extreme Vertices Model in the -Dimensional Space (D-EVM). It will be shown the potential of the application of Discrete Compactness in higher-dimensional contexts by applying it, through EVM-based algorithms, in the classification of video sequences, associated to the monitoring of a volcano's activity, which are expressed as 4D orthogonal polytopes in the space-color-time geometry.

1. Introduction

In areas such as image processing, pattern recognition, and computer vision, there is required to characterize for a given object its topological and geometrical factors. They have a paramount role in more elaborated tasks such as those related to classification, indexing, or comparison. Some of these factors describe the shape of an object. One of them, and one of the most used, is the shape compactness [1]. The shape compactness of an object refers to a measure between the object and an ideal object [2]. In the 2D euclidean space, shape compactness is usually computed via the well-known ratio where is the perimeter of an object and A its area. Such ratio has its origins in the isoperimetric inequality: It is actually the solution to the isoperimetric problem which states the question related to find the simple closed curve that maximizes the area of its enclosed region [3]. The equality is obtained when the considered curve is a circle. Hence, as pointed out in [1], the ratio for shape compactness is in effect comparing an object with a circle. In the 3D space the isoperimetric inequality is given by where is the area of the boundary of a 3D object while V is its volume. Hence, the ratio denotes shape compactness of a 3D object, and it effectively is comparing such object with a sphere.

As [1, 4] point out, these classical ratios are very sensitive to variations in the shape of an object. Moreover, they point out, when the above definitions are applied to objects defined via pixelizations (in the 2D case) or voxelizations (3D case), that small changes in the final objectโ€™s boundary produce more important variations in the computed values. Consider, for example, the sets of boxes presented in Figure 1. The square described by the union of the boxes shown in Figure 1(a) has a perimeter of 32โ€‰u while its area is 64โ€‰ Figure 1(b) shows a polygon that can be seen as a modified version (because of noise, artifacts, digitalization scheme, etc.) of the previous one. Its perimeter is given by 58โ€‰u. Both polygons have the same area, but their shapes have some slight differences. Shape compactness for the first polygon is given by 1.2732 while for the second is 4.1827. These values are significantly distinct, and by considering shape compactness as a rule for classification, this could imply that they are very different objects.

In order to provide a solution to the above problem, Bribiesca, in [1, 5], defined the Discrete Compactness. It has its foundation on the notion of counting the number of edges (in the 2D case) and faces (in the 3D case) which are shared between pixels or voxels, according to the case, that define an object. Discrete Compactness is given by the following expression [1, 5]:

where(i) is the number of shared edges (faces) within an object consisting of m pixels (voxels) (ii)is the the maximum number of shared edges (faces) achieved with an object consisting of m pixels (voxels)(iii)is the minimum number of shared edges (faces) achieved with an object consisting of m pixels (voxels)(iv)

In [1] there are used, for the 2D case, and , which, respectively, describe the maximum and minimum number of internal contacts (shared edges) between the m pixels forming a squared object. It is clear, in this case, when the object corresponds to a square of sides , and when it corresponds to a rectangle with base of length 1 and height m. For example, considering again the polygons presented in Figure 1, we have for that shown in Figure 1(a), while for the polygon in Figure 1(b). In both cases m = 64, hence, and . Then, discrete compactness for the polygon in Figure 1(a) is given by while the other has . In [4] it is established that . Hence, if then the object corresponds to a chain of pixels such that no edges, and only vertices, are shared. By considering then discrete compactness for the polygons in Figures 1(a) and 1(b) are 1 and 0.8839, respectively. It both cases, it is clear that discrete compactness provides us a more robust criterion for objectsโ€™ comparison/classification/description of shapes under the advantage it is much less sensitive to variations in their shape. For the 3D case, in [1] it is used . If m is a power of 3, then the given provides the number of shared faces in an array of voxels that correspond to a cube of edges of length . By using then it is defined a stack of m voxels [1].

2. Problem Statement

An -dimensional Euclidean polytope is defined as a finite region of -dimensional Euclidean space enclosed by a finite number of (-1)-dimensional hyperplanes [6]. The finiteness of the region implies that the number N-1 of bounding hyperplanes satisfies the inequality The part of the polytope that lies on one of these hyperplanes is called a cell. Each cell of a n is an (-1)-Dimensional polytope, . The cells of a are 's, and so on; thus it is obtained a descending sequence of elements , -4,, 3 (a volume), 2 (a polygon), 1 (an edge), 0 (a vertex).

The representation of a polytope through a scheme of hyperspatial occupancy enumeration is essentially a list of identical hyperspatial cells occupied by the polytope. Specific types of cells, called hypervoxels [7], are hyper-boxes (hypercubes, for example) of a fixed size that lie in a fixed grid in the -dimensional Space. By instantiation, it is well known that a 2D hypervoxel is a pixel while a 3D hypervoxel is a voxel; the term rexel is suggested for referencing a 4D hypervoxel [7]. The collection of hyperboxes can be codified as an -Dimensional array . The array will represent the coloration of each hypervoxel. If , the white hypervoxel represents an unoccupied region from the -Dimensional space. If , then the black hypervoxel represents a used region from the -Dimensional space. Hence, the set of black cells defines a polytope whose vertices coincide with some of the occupied cellsโ€™ vertices.

It is clear that Bribiescaโ€™s definition of Discrete Compactness can be extended for considering -Dimensional polytopes, and in the particular dominion of this work, -Dimensional Orthogonal Pseudo-Polytopes (D-OPPs). We will consider those D-OPPs that can be seen as the result of a hypervoxelization such that hypervoxels are unit D hypercubes with integer coordinates. It is well known that an D hypercube has 2 boundary (-1)D cells [8]: 2 vertices in a segment, 4 edges in a square, 6 faces in a cube, 8 volumes in a 4D hypercube, and so on. Hence, denotes the number of shared (-1)D cells within polytope consisting of m hypervoxels while and correspond, respectively, to the maximum and minimum number of shared (-1)D cells achieved with objects composed by m hypervoxels.

When using hypervoxelizations for representing and manipulating D polytopes some compromises should be taken in account. In particular is the one related to the representationโ€™s spatial complexity. It is well known that spatial complexity of a hypervoxelization is at least where is the length of the grid along Xi-axis. For example, a 4D grid with = = = = 1,000 is required to store 1 trillion (012) hypervoxels. For that reason, in this work we will concentrate on expressing D-OPPs via a polytopesโ€™ concise representation scheme known as the Extreme Vertices Model in the -Dimensional Space (D-EVM). The EVM is a model originally established by Aguilera and Ayala in [9, 10] for representing 1D, 2D, and 3D-OPPs. In [11], EVMโ€™s properties in the -Dimensional Euclidean Space were formally proved, leading to characterize it as a complete representation scheme for D-OPPs. In [10, 11] there are described efficient algorithms for performing some of the most used operations in solid and polytopes modeling such as regularized boolean operations, set membership classification, and measure queries. The conciseness of the EVM lies in the fact it only stores some specific vertices of a polytope: the Extreme Vertices. Via such subset of the polytopeโ€™s vertices, it is possible to obtain much geometrical and topological information about the polytope and to perform operations as the ones previously mentioned. Now, returning to the question related to hypervoxelizationsโ€™ complexity, we commented before that in a hypervoxelization the set of black hypervoxels defines a polytope, actually an D-OPP. The hypervoxels in such set can be seen as a set of quasidisjoint D-OPPs. Based on this observation, we will describe a straight methodology for converting a hypervoxelization to a concise EVM representation. In Section 3 we will describe formally to D-OPPs (Section 3.1), and we will present a summary of the foundations behind the D-EVM (Section 3.2). Section 3.3 presents basic algorithms under the D-EVM while Section 3.4 deals with two algorithms for interrogating and manipulating D-OPPs represented via the D-EVM: the first one computes the D content of an OPP while the second corresponds to computation of regularized boolean operations between OPPs. Finally, Section 3.5 presents the procedure for hypervoxelizations to D-EVM conversion.

The main contribution of this work is the specification of efficient procedures that provide us a way to infer the number of hypervoxels that originally composed an D-OPP. In this sense, we assume that such OPP fits exactly in a hypervoxelization, where hypervoxels are unit D hypercubes whose vertices have integer coordinates. More specifically, given an EVM we will determine the number of internals contacts, that is, the number of shared (-1)D cells, that took place between the hypervoxels that originally defined the polytope. By this way, we will present in Section 4 an EVM-based algorithm for determining for a given D-OPP p. Such algorithm will lead to the specification of a procedure for computing the Discrete Compactness of an D-OPP. After that, in Section 5, it will be described a methodology, originally presented in [11, 12], for representing and manipulating color 2D animations via EVM-modeled polytopes embedded in 4D space-color-time geometry. Then, in Section 6, we will describe an application of our proposed EVM-based algorithms for computing Discrete Compactness. Specifically, we present an application oriented to classification of image sequences which correspond to a volcanoโ€™s activity. It will be seen how the obtained results provide experimental evidence about the applicability of Discrete Compactness in higher dimensional contexts.

3. The Extreme Vertices Model in the -Dimensional Space (D-EVM)

This section is a summary of results originally presented in [10, 11]. For the sake of brevity, some propositions are only enunciated. Their corresponding proofs can be found in the two aforementioned references.

3.1. The n-Dimensional Orthogonal Pseudo-Polytopes (D-OPPs)

Definition 3.1 (see [13]). A Singular n-dimensional hyper-box in is given by the continuous function A general singular k-dimensional hyper-box in the closed set is the continuous function

Definition 3.2 (see [13]). For all i, 1 i n, the two singular(-1)D hyper-boxes and are defined as follows. If , then and .

Definition 3.3 (see [13]). The orientation of an (-1)D cell is given by. It is said cell is oriented when it is expressed by the scalar-function product .

Definition 3.4 (see [13]). A formal linear combination of general singular D hyper-boxes, 1 n, for a closed set A is called a k-chain.

Definition 3.5 (see [13]). The boundary of an n-chain , where each is a general singular D hyper-box, is given by

Definition 3.6. A collection c1, c2, โ€ฆ, ck, 1 2n, of general singular D hyper-boxes is a combination of D hyper-boxes if and only if

In the above definition the first part of the conjunction establishes that the intersection between all the D general singular hyper-boxes is the origin, while the second part establishes that there are not overlapping D hyper-boxes.

Definition 3.7. An n-dimensional orthogonal pseudo-polytope, or just an nD-OPPp, is an -chain composed by D hyper-boxes arranged in such way that by selecting a vertex, in any of these hyper-boxes, it describes a combination of D hyper-boxes (Definition 3.6) composed up to 2n hyper-boxes.

3.2. D-EVMโ€™s Fundamentals

Definition 3.8. Let c be a combination of hyper-boxes in the -Dimensional space. An Odd Adjacency Edge of c, or just an Odd Edge, is an edge with an odd number of incident hyper-boxes of c. Conversely, if an edge has an even number of incident hyper-boxes of c, it is called Even Adjacency Edge, or just Even Edge.

Definition 3.9. A brink or extended edge is the maximal uninterrupted segment, built out of a sequence of collinear and contiguous odd edges of an D-OPP.

From the above definition, every even edge of an D-OPP does not belong to brinks. On the other hand, every brink consists of m odd edges, m 1, and contains m + 1 vertices. Two of these vertices are at either extreme of the brink and the remaining m-1 are interior vertices.

Definition 3.10. The ending vertices of all the brinks in will be called Extreme Vertices of an nD-OPP p. EV() will denote to the set of Extreme Vertices of .

Property 3.11. Any extreme vertex of an n D-OPP, n 1, when is locally described by a set of surrounding n D hyper-boxes, has exactly n incident linearly independent odd edges.

Figure 2 shows an example of a 3D-OPP p. Vertices v1 and v2 are nonextreme vertices because, in the case of v1, it has six incident odd edges, while vertex v2 has four incident coplanar odd edges (see Property 3.11). In the figure can be also appreciated that exactly three linearly independent odd edges are incident to the remaining vertices, actually, the Extreme Vertices of p.

The brinks in an D-OPP can be classified according to the main axis to which they are parallel. Since the extreme vertices mark the end of brinks in the orthogonal directions, is that any of the possible sets of brinks parallel to Xi-axis, 1 i , produce to the same set EV(). See in Figure 3(a) the brinks parallel to X2-axis for the 3D-OPP originally presented in Figure 2.

Definition 3.12. Let be an D-OPP. A kD extended hypervolume of , 1 n, denoted by , is the maximal set of D cells of that lies in a D space, such that a D cell belongs to a D extended hypervolume if and only if belongs to an (-1)D cell present in โˆ‚() (see Definition 3.5), that is,

Definition 3.13. Let be an D-OPP. The Extreme Vertices Model of , denoted by , is defined as the model as only stores to all the extreme vertices of .

Let Q be a finite set of points in . In [10] was defined the ABC-sorted set of Q as the set resulting from sorting Q according to coordinate A, then to coordinate B, and then to coordinate C. For instance, a set Q can be ABC-sorted in six different ways. Now, let be a 3D-OPP. According to [10] the Extreme Vertices Model of , EVM3(), denotes the ABC sorted set of the extreme vertices of . Then EVM3() = EV() except by the fact that coordinates of points in EV() are not necessarily sorted. In general, it is always assumed that coordinates of extreme vertices in the Extreme Vertices Model of an D-OPP , EVMn(), have a fixed coordinates ordering. Moreover, when an operation requires manipulating two EVMs, it is assumed that both sets have the same coordinates ordering.

Definition 3.14. The Projection Operator for (-1)D cells, points, and set of points is, respectively, defined as follows.(i)Let be an (-1)D cell embedded in the D space. Let denote the projection of the cell onto an (-1)D space embedded in D space whose supporting hyperplane is perpendicular to Xj-axis (ii)Let a point in . The projection of that point in the (-1)D space, denoted by , is given by: (iii)Let Q be a set of points in . The projection of the points in Q, denoted by , is defined as the set of points in such that In all the cases is the coordinate corresponding to Xj-axis to be suppressed.

Definition 3.15. Consider an D-OPP as follows.(i)Let be the number of distinct coordinates present in the vertices of along Xi-axis, 1 i n. (ii)Let be the th (-1)D extended hypervolume, or just a (n-1)D couplet, of which is perpendicular to Xi-axis, 1 npi.

See in Figure 3(b) the set of 2D-couplets perpendicular to X2-axis for the 3D-OPP presented in Figure 2.

Definition 3.16. A slice is the region contained in an D-OPP between two consecutive couplets of p. will denote to the th slice of which is bounded by and, 1 k

Definition 3.17. A section is the (-1)D-OPP, n 1, resulting from the intersection between an D-OPP and an (-1)D hyperplane perpendicular to the coordinate axis Xi, n โ‰ฅ i โ‰ฅ 1, which does not coincide with any (-1)D-couplet of p. A section will be called external or internal section of if it is empty or not, respectively. will refer to the th section of between and , 1 npi. Moreover, and will refer to the empty sections of before and after of, respectively.

Property 3.18. Let be an n D-OPP. All the (n -1)D hyperplanes perpendicular to Xi -axis, 1 i n, which intersect to give the same section .

The Figures 3(c), 3(d), and 3(e) show the slices for a 3D-OPP (originally presented in Figure 2) according to the supporting planes of its 2D-couplets perpendicular to X2-axis. Figure 3(f) presents its corresponding set of internal sections perpendicular to X2-axis.

3.2.1. A Note about Regularized Boolean Operations

Independently of the scheme we consider for the representation of D polytopes, it should be feasible to combine them in order to compose new objects [14]. One of the most common methods to combine polytopes is the set theoretical Boolean operations, as the Union, Difference, Intersection, and Exclusive OR. However, the application of an ordinary set theoretical Boolean operation on two polytopes does not necessarily produce a polytope. For example, the ordinary intersection between two cubes with only a common vertex is a point. Instead of using ordinary set theoretical Boolean operators, the Regularized Boolean Operators [15, 16] will be used. The practical purpose of regularization of polytope models is to make them dimensionally homogeneous [17]. The regularization operation can be defined as Regularized(S) = Closure(Interior(S)) which results in a closed regular set. Each regularized Boolean operator is defined in function of an ordinary operator in the following way: These operators are defined as the closure of the interior of the corresponding set theoretical Boolean operation [16, 18]. In this way, the regularized operations between polytopes always will generate polytopes or a null object (the empty set) [17].

3.2.2. Computing Couplets from Sections

Theorem 3.19. The projection of the set of (n -1)D couplets, , 1 i , of an D-OPP , can be obtained by computing the regularized XOR between the projections of its previous and next sections, that is, for all

3.2.3. Computing Sections from Couplets

Theorem 3.20. The projection of any section, , of an D-OPP, can be obtained by computing the regularized XOR between the projection of its previous section, , and the projection of its previous couplet :

3.2.4. The Regularized XOR Operation on the D-EVM

Theorem 3.21. Let and be two D-OPPs having and as their respective Extreme Vertices Models in D space, then .

This result allows expressing formulae for computing D-OPPs sections from couplets and viceversa by means of their corresponding Extreme Vertices Models. They are obtained by combining Theorem 3.21 with Theorem 3.19 and Theorem 3.21 with Theorem 3.20, respectively.

Corollary 3.22. One has that

Corollary 3.23. One has that

3.2.5. The Regularized Boolean Operations on the D-EVM

Corollary 3.24. Let and be two D-OPPs and = op*, where op* is in . Then . Moreover, if all these sections lie in the same (n -1)D hyperplane then .

Now we present the following.

Theorem 3.25. A regularized Boolean operation, op*, where op*โˆˆ, over two D-OPPs and , both expressed in the D-EVM, can be carried out by means of the same op* applied over their own sections, expressed through their Extreme Vertices Models, which are (n-1)D-OPPs.

This result leads into a recursive process for computing the Regularized Boolean operations using the D-EVM, which descends on the number of dimensions [10]. The base or trivial case of the recursion corresponds to the 1D-Boolean operations which can be performed using direct methods. In Section 3.4.2 will be described an algorithm for performing Regularized Boolean operations under the D-EVM which implements the above results.

3.3. Basic Algorithms for the D-EVM

Now, we introduce some primitive operations which are in fact based on those originally presented in [10]. When an operation requires manipulating two EVMs, it is assumed that both sets have the same coordinates ordering. In the following, -axis refers to the D spaceโ€™s coordinate axis associated to the first coordinate present in the vertices of EV(p). For example, given coordinates ordering for a 3D-OPP, then . (i)InitEVM( ): returns the empty set.(ii)PutHvl(EVM hvl, EVM p): appends and (-1)D couplet hvl, embedded in D space and perpendicular to XA-axis, to the D-EVM .(iii)ReadHvl(EVM p): extracts and returns the next (-1)D couplet perpendicular to XA-axis from .(iv)EndEVM(EVM p): returns true if the end of along XA-axis has been reached, otherwise, returns false.(v)SetCoord(EVM hvl, CoordType coord): sets the XA-coordinate to coord on every vertex of the (-1)D couplet hvl. For coord = 0, it performs the projection .CoordType is the chosen type for the vertex coordinates. (vi)GetCoord(EVM hvl): returns the common XA-coordinate of the (-1)D couplet hvl. (vii)GetCoordNextHvl(EVM p): returns the common XA-coordinate of the next available (-1)D couplet, perpendicular to XA-axis, from .(viii)MergeXor(EVM p, EVM q): applies the Exclusive OR operation to the vertices of and and returns the resulting EVM.

Since the EVM is a sorted model, MergeXor function consists in a simple merging-like algorithm, and therefore, it runs on linear time [10]. Its complexity is given by O(Card(EVMn(p)) + Card(EVMn(q))) because each vertex from EVMn(p) and EVMn(q) needs to be processed just once. Moreover, according to Theorem 3.21, the resulting set corresponds to the regularized XOR operation between and q.

From the above primitive operations, and specifically MergeXor, the following pair of algorithms can be easily derived ([10, 11]).(i)GetHvl(EVM Si, EVM Sj): implements Corollary 3.22, and returns the projection of the couplet between consecutive sections Si and Sj.(ii)GetSection(EVM S, EVM hvl): implements Corollary 3.23, and returns the projection of the next section of an D-OPP whose previous section is S.

the Algorithm 1 computes the sequence of sections of an D-OPP from its D-EVM using the previous functions [10, 11]. It sequentially reads the projections of the (-1)D couplets hvl of the polytope . Then it computes the sequence of sections using function GetSection. Each pair of sections Si and Sj (the previous and next sections about the current hvl) is processed by a generic processing procedure (called Process), which performs the desired actions upon Si and Sj (note that some processes may only need one of such sections).

Input: An nD-EVM p.
Procedure EVM_to_SectionSequence(EVM p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰EVM hvl // Current couplet.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰EVM Si, Sj// Previous and next sections about hvl.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰Si = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰Sj = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = ReadHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰while (Not(EndEVM(p)))
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰Sj = GetSection(Si, hvl)
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰Process(Si, Sj)
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰Si = Sj
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰hvl = ReadHvl(p) // Read next couplet.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰end-of-while
end-of-procedure

3.4. Interrogating and Manipulating D-OPPs Represented via the D-EVM
3.4.1. Computing the Content of an D-OPP

An D hyperprism can be generated by the parallel motion of an (-1)D polytope; it is bounded by the (-1)D polytope in its initial and final positions and by several (-1)D hyperprisms [19]. Consider an D hyperprism Pn whose base is an (-1)D polytope P-1 of content Cn-1. If hn is the distance between its bases, that is, the height of the hyperprism, then its content is given by [19]

If it is the case where P-1 is an (-1)D hyperprism with height hn-1 generated by the parallel motion of an (-2)D polytope P-2, then Cn-1 is given by the expression Cn-1 = Cn-2ยทhn-1, where Cn-2 is the content of P-2. This last expression yields to rewrite the above equation as

By considering that each (-)D hyperprism P- is generated by the parallel motion of an (--1)D hyperprism P--1, where = 0, 1, 2, โ€ฆ, -1, then we have that the content of Pn can be computed according to the formula where hn is the height of hyperprism Pn. In the base case, where = 1, the content of a segment is given directly by its โ€œheightโ€, that is, the distance between its two boundary points.

The previous idea is extended in order to compute the content of D space enclosed by an D-OPP. In this case we will consider the partition induced by its slices (Definition 3.16). A slice can be seen as a set of one or more disjoint D hyperprisms whose (-1)D base is the sliceโ€™s section. As pointed out in [10] the volume of a 3D-OPP can be computed as the sum of the volumes of its 3D slices, where the volume of a , is given by the product between the area of its respective section (the 2D base of ) and the distance between and (the height of the 3D prism . Now let = . The area of the 2D-OPP (see Figure 4 for an example) can be computed as the sum of the areas of its 2D slices, where the area of a , is given by the product between the length of its respective section (the 1D base of ) and the distance between and (the height of the โ€œ2D prismโ€ ). Finally let = . In the basic case the length of the 1D-OPP is computed as the sum of the lengths of its brinks.

Let be an D-OPP. The D space enclosed by , denoted by Content()(), can be computed as the sum of the contents of its D slices [11] Algorithm 2 implements the above equation in order to compute the content of D space enclosed by an D-OPP expressed through the D-EVM [10, 11].

Input: An nD-EVM p.
โ€ƒโ€ƒโ€ƒโ€ƒโ€‰The number n of dimensions.
Output: The content of nD space enclosed by p.
Procedure Content(EVM p, int n)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰real cont = 0.0// The content of nD space enclosed by p.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰EVM hvl1, hvl2// Consecutive couplets perpendicular to XA-axis.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰EVM s// Current section of p.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰if (n = 1) then return Length(p) // Base case: p is a 1D-OPP.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰else
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒs = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒhvl1 = ReadHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒwhile (Not(EndEVM(p)))
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl2 = ReadHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰s = GetSection(s, hvl1)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰cont = cont + Content(s, n-1) * dist(hvl1, hvl2)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰hvl1 = hvl2
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒend-of-while
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒreturn cont
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰end-of-else
end-of-procedure

3.4.2. The Boolean Operations Algorithm for the D-EVM

Let and be two D-OPPs represented through the D-EVM, and let op* be a regularized Boolean operator in . The algorithm, originally presented in [10] and based on Theorem 3.25, computes the resulting D-OPP = p op* q. Note that = p โŠ—* can also be trivially performed using Theorem 3.21 [10]. The idea behind the algorithm is the following.(i)The sequence of sections from and , perpendicular to XA-axis, is obtained first, based on Theorem 3.20. (ii)Then, according to Corollary 3.24, every section of can recursively be computed as (iii)Finally, can be obtained from its sequence of sections, perpendicular to XA-axis, according to Theorem 3.19.

Nevertheless, Algorithm 3 does not work in this sequential form. It actually works in a wholly merged form in which it only needs to store one section for each of the operands and and two consecutive sections for the result r.

Input: The nD-OPPs p and q expressed in the nD-EVM.
โ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰The number n of dimensions and regularized Boolean operation op.
Output: The output nD-OPP r, such that r = p op*q, codified as an nD-EVM.
Procedure BooleanOperation(EVM p, EVM q, BooleanOperator op, int n)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰EVM sP, sQ // Current sections of p and q respectively.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰EVM hvl // I/O couplet.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰boolean fromP, fromQ // flags for the source of the couplet hvl.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰CoordType coord // the common coordinate of couplets.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰EVM r, sRprev, sRcurr // nD-OPP r and two of its sections.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰if (n = 1) then // Base case
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒreturn BooleanOperation1D(p, q, op)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰else
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒn = n - 1
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒsP = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒsQ = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒsRcurr = InitEVM( )
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒNextObject(p, q, coord, fromP, fromQ)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒwhile (Not(EndEVM(p)) and Not(EndEVM(q)))
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰if (fromP = true) then
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = ReadHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰sP = GetSection(sP, hvl)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰end-of-if
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰if (fromQ = true) then
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = ReadHvl(q)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰sQ = GetSection(sQ, hvl)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰end-of-if
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰sRprev = sRcurr
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰sRcurr = BooleanOperation(sP,sQ,op,n) // Recursive call
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = GetHvl(sRprev, sRcurr)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰SetCoord(hvl, coord)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰PutHvl(hvl, r)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰NextObject(p, q, coord, fromP, fromQ)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒend-of-while
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒwhile (Not(EndEVM(p)))
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = ReadHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰PutBool(hvl, r, op)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒend-of-while
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒwhile (Not(EndEVM(q)))
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰hvl = ReadHvl(q)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰PutBool(hvl, r, op)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒend-of-while
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€ƒโ€ƒreturn r
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰end-of-if
end-of-procedure

The following are some functions present in Algorithm 3 but not defined previously.(i)Function BooleanOperation1D performs 1D Boolean operations between and that are two 1D-OPPs.(ii)Procedure NextObject considers both input objects and and returns the common coord value of the next hvl to process, using function GetCoord. It also returns two flags, fromP and fromQ, which signal from which of the operands (both inclusive) is the next hvl to come.(iii)The main loop of procedure BooleanOperation gets couplets from and/or , using function GetSection. These sections are recursively processed to compute, according to Corollary 3.24, the corresponding section of , sRcurr. Since two consecutive sections, sRprev and sRcurr, are kept, then the projection of the resulting hvl, is obtained by means of function GetHvl, and then, it is correctly positioned by procedure SetCoord.

When the end of one of the polytopes or is reached then the main iteration finishes, and the remaining couplets of the other polytope are either appended or not to the resulting polytope depending on the Boolean operation considered. Procedure PutBool performs this appending process.

3.5. Hypervoxelizations to D-EVM Conversion

First, consider the following.

Corollary 3.26 (see [10, 11]). Let and be two disjoint or quasi disjoint D-OPPs having EVMn () and EVMn () as their respective Extreme Vertices Models, then .

As previously commented in the introduction of this paper, a hypervoxelization is a set of quasi-disjoint black and white hypervoxels each one being a convex orthogonal polytope. Since the set of black hypervoxels represents an D-OPP we have [10] For each black hypervoxel it should be possible to generate a list of its 2n vertices. Because all of these 2n vertices are Extreme Vertices, and by considering Corollary 3.26, all we have to do is [10] This provides a straight and simple method for converting a hypervoxelization to the D-EVM.

4. Computing Discrete Compactness for an D-OPP Expressed in the D-EVM

In the following it is assumed an D-OPP fits exactly in a hypervoxelization, where hypervoxels are unit D hypercubes whose vertices have integer coordinates. Given a polytope expressed in the D-EVM, and in order to compute , that is, the number of shared (-1)D cells between the m hypervoxels that originally described , we start by processing its (-1)D sections perpendicular to XA-axis. By considering a section, it can be determined the number of hypervoxels that originally described its corresponding slice. Furthermore, it is possible to obtain information about internal contacts, perpendicular to XA-axis, between the hypervoxels that described such D slice. Let be the section associated to . Then, the following steps are performed.(i)Let c1 and c2 be the common coordinates of previous and next couplets, perpendicular to XA-axis, about section Sj. Let nCoords = c2 โ€“ c1 โ€“ 1 be the number of integer coordinates between c1 and c2. In fact, nCoords = Card(c1 + 1, c1 + 2, , c2 โ€“ 1). (ii)Because of โ€™s assumed original representation, it is clear by computing the D content of that it is obtained the number of black D hypervoxels that originally defined it. Now, let H be an (-1)D hyperplane perpendicular to XA-axis such that it intersects and does not coincide with the supporting hyperplanes of the previous and next couplets about section . Assuming the common XA-coordinate of the points in H is in c1 + 1, c1 + 2, , c2 โ€“ 1, and by computing the (-1)D content of the projection of section , there is obtained the number of those hypervoxels which have an (-1)D boundary cell embedded in hyperplane H. (iii)Finally, the number of internal contacts, perpendicular to XA-axis, between the hypervoxels that originally defined , is given by the product of nCoords (the number of integer coordinates between the previous and next couplets about Sj) and the (-1)D content of Sj.

The above procedure determines the number of internal contacts, perpendicular to XA-axis, between the hypervoxels that originally composed to . Now, we must determine the number of internal contacts ((-1)D adjacencies) between those hypervoxels that belong to with hypervoxels in the next slice, that is, . Those shared cells are embedded in the supporting (-1)D hyperplane of the couplet between sections and . (i)The projections of consecutive sections and are intersected in such way that it is obtained an (-1)D-OPP . (ii)The number of those (-1)D boundary cells, embedded in the supporting (-1)D hyperplane of the couplet between and , is given by computing the (-1)D content of . If is empty then it implies that one of the sections, or , is empty or projections of and are disjoint or quasi-disjoint. In both cases no (-1)D contact occurs between and .

Algorithm 4 implements the above procedures.

Input:โ€ƒโ€ƒ An nD-EVM p and the number n of dimensions.
Output:โ€ƒ The number of internal contacts, perpendicular to the XA-axis, between
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒthe hypervoxels that originally composed p.
Procedureโ€ƒ InternalContacts(EVM p, int n)
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰EVM hvl// Current couplet of p.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰EVM Si, Sj// Previous and next sections about hvl.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰EVM Sintโ€‰// The result of intersecting the projections of Si and Sj.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰int c1// Common XA-coordinate of couplet hvl.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰int c2// Common XA-coordinate of couplet next to hvl.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰int nCoords// Number of integer coordinates between c1 and c2.
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰int L = 0// Number of internal contacts ((n-1)D adjacencies).
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰Si = InitEVM( )
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰c1 = GetCoordNextHvl(p)
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰hvl = ReadHvl(p)
โ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰while (Not(EndEVM(p)))
โ€ƒโ€ƒโ€ƒโ€‰โ€‰Sj = GetSection(Si, hvl)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰c2 = GetCoordNextHvl(p)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰nCoords = c2-c1-1
โ€ƒโ€ƒโ€ƒโ€‰โ€‰L = L + nCoords * Content(Sj, n - 1)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰Sint = BooleanOperation(Si, Sj, Intersection, n - 1)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰L = L + Content(Sintโ€‰, n - 1)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰Si = Sj
โ€ƒโ€ƒโ€ƒโ€‰โ€‰c1 = c2
โ€ƒโ€ƒโ€ƒโ€‰โ€‰hvl = ReadHvl(p)// Read next couplet.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰end-of-while
โ€ƒโ€ƒโ€ƒโ€‰โ€‰return L
end-of-procedure

We will clarify the way Algorithm 4 works with the following example. Consider the object defined by the 3D boxes presented in Figure 5(a). The 3D grid where the object is embedded has dimensions The coordinates of all the boxesโ€™ vertices are in the set . When the boxes are united, according to the procedure described in Section 3.5, it is obtained the 3D-OPP shown, as a wireframe model, in Figure 5(b). Its 3D-EVM is composed by 14 extreme vertices. Figure 5(c) shows โ€™s three couplets perpendicular to X1-axis, while Figure 5(d) presents its pair of internal sections, and , also perpendicular to X1-axis. 2D section is associated to (see Figure 5(e)), while is associated to (Figure 5(f)). Suppose that 2D couplets , , and have common X1 coordinates given by 0, 4, and 8, respectively. Hence, the number of integer coordinates, along X1-axis, between couplets and is 3. Such coordinates are 1, 2, and 3. Now, consider the projection of section (Figure 5(g)). Because the boxes in the original voxelization were unitary, then the area of , 64 u2, corresponds to the number of faces embedded in a plane intersecting which does not coincide with nor , and whose common X1 coordinate is in . Therefore, the number of internal contacts (face adjacencies), between the boxes that originally composed to is given by the product 3 ยท 64 = 192.

Now, we proceed to determine the number of internal contacts in . The number of integer coordinates, along X1-axis, between couplets and is 3. Such coordinates are 5, 6, and 7. Consider the projection of section (Figure 5(h)). The area of is 48 u2. It corresponds to the number of faces embedded in a plane intersecting which does not coincide with nor , and whose common X1 coordinate is in . The number of internal contacts (face adjacencies), between the boxes that originally composed to is given by the product 3 ยท 48 = 144. Finally, we compute the regularized intersection between projections of sections and , that is, . See Figure 5(i). The area of 2D-OPP is 48 u2. This number corresponds to the number of faces, in the original voxelization, embedded in the supporting plane of couplet . Each one of these faces implies a face adjacency between a voxel that belongs to and a voxel in . Finally, the number of face adjacencies, perpendicular to X1-axis, between the boxes in pโ€™s original voxelization, is 384. Because of pโ€™s symmetry, it can be easily verified that the number of face adjacencies perpendicular to X2-axis and X3-axis is also 384. Therefore, .

As seen, Algorithm 4 extracts those sections of D-OPP p which are perpendicular to XA-axis which implies that it only counts internal contacts perpendicular to this same coordinate axis. Suppose that the coordinates ordering in EVMn(p) is given by Each one of the coordinates orderings in the set is now used for sorting EVMn(p). Such sorting is performed by calling a procedure SortEVM. Given a permutation , the function sorts the extreme vertices of p first according to coordinate , after according to coordinate , and so on until p is sorted according to coordinate . Next, it is performed a calling to Algorithm 4. By this way, it is computed the number of contacts perpendicular to each one of the axes in D space. The sum of all contacts perpendicular to all coordinate axes leads to determine . Algorithm 5 implements this procedure.

Input:โ€ƒโ€ƒ An nD-EVM p and the number n of dimensions.
Output:โ€ƒThe number of internal contacts, perpendicular to Xi-axis,
โ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰โ€‰i=1,2,โ€ฆ,n, between the hypervoxels that originally composed p.
Procedure TotalInternalContacts(EVM p, int n)
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰int Lc = 0
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰for each sorting in {X1X2โ€ฆXn-1Xn,X2X3โ€ฆXnX1,X3X4โ€ฆX1X2,โ€ฆ,XnX1โ€ฆXn-2Xn-1}โ€‰โ€‰do
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰SortEVM(p, n, sorting)
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰Lc = Lc + InternalContacts(p, n) // Call to Algorithm 4.
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰end-of-for
โ€ƒโ€ƒโ€ƒโ€‰โ€‰โ€‰โ€‰return Lc
end-of-procedure

5. Representing Color 2D-Animations through 4D-OPPs and the EVM

The procedure described in [10] for processing black and white 2D animations can be directly extended to control colored frames through a 4D-OPP represented through the EVM. This methodology was originally presented in [11, 12]. In Figure 6 an example of a simple color 2D animation composed by four frames whose resolution is 9 ร— 9 pixels is shown. In each frame can be identified white, red, blue, gray, and cyan regions. We will use this simple animation to exemplify our procedure. We will label each colored frame in the animation as fk and m will be the number of such frames.

A color animation can be handled as a 4D-OPP in the following way [11, 12].

(a) The Red-Green-Blue (RGB) components of each pixel will be integrated into a single value. Such value represents the RGB components as an integer with 32 bits. Bits 0โ€“7 correspond to the blue value, bits 8-15 correspond to the green value, bits 16โ€“23 correspond to the red value, and bits 24โ€“31 to the alpha (transparency) value. Each pixel will now be extruded towards the third dimension, where the value integrating its RGB components will now be considered as its X3 coordinate (coordinates X1 and X2 correspond to the original pixels' coordinates). See Figure 7.

Let us call to the set composed by the rectangular prisms (the extruded pixels) of each extruded frame fk. It is very important to avoid the zero value in the X3 coordinate because a pixel could not be extruded, and therefore its associated prism (a 3D-OPP) will not be obtained. See Figure 8.

(b) Let prismi be a prism in and npr the number of prisms in that set. Due to all the prisms in are quasi disjoint 3D-OPPs, we can easily obtain the final 3D-OPP and its respective 3D-EVM of the whole 3D frame via Corollary 3.26 (all the vertices in a prismi are extreme vertices) where Fk is the 3D frame (a 3D-OPP) that represents the union of all the prisms in xfk. See Figure 9.

(c) Let us extrude into the fourth dimension and thus obtain a 4D hyperprismk whose bases are and its length is proportional to the time is to be displayed. The new fourth dimension will measure and represent the time. See Figure 10.

(d) Let p be the 4D-OPP that represents the given color 2D-animation. Polytope p is defined by

Due to all the m hyperprisms are quasi disjoint 4D-OPPs, then the 4D-EVM for p can be obtained by

By representing a given color 2D-animation using a 4D-OPP p and its 4D-EVM, we have the following characteristics [11, 12].(i)The sequence of the projections of sections in p corresponds to the sequence of 3D frames, that is, .(ii)Computation of 3D frames: by Corollary 3.23 the 3D-EVM of the frame Fk is computed by .(iii)Displaying the 2D colored animation: each couplet perpendicular to the X3 axis in each 3D frame Fk contains the polygons to display. The colors to apply to those polygons are referred through the X3 coordinate that contains the integrated RGB components.

6. Discrete Compactness of 4D-OPPs: An Application

In this section there will be described our first steps towards an application of Discrete Compactness in a higher dimensional context, via the algorithms presented in Section 4, in the classification and indexing of video sequences. In the previous section, it was presented a methodology for representing color 2D animations through 4D-OPPs and the EVM. In the case to be boarded now, we will consider image sequences associated to the Popocatรฉpetl volcano which is located in the Mexican State of Puebla. The images were obtained from the CENAPRED web site [20]. The CENAPRED is a Mexican research center which has as one of its functions monitoring the volcanoโ€™s activity.

Each sequence presents the volcanoโ€™s activity along four consecutive days. The sequences are then composed by 4 images, or frames, each one taken each day. All the images were captured in the time range comprehended from 10โ€‰AM to 2โ€‰PM We have a set of 521 images which correspond to dates between January 1, 2007 and June 4, 2008. They have resolution 640 480 under the color model RGB. In a preprocessing phase, images were scaled to the new resolution 320 240, and the color model was changed to grayscale. Moreover, a multilevel threshold was applied in order to eliminate noise (specifically we applied some procedures defined in [21]). There were generated 520 sequences to which was applied the procedure described in previous section in such way that for each one was generated its corresponding 4D polytope: two geometrical dimensions (X1 and X2), one color dimension (X3), and one dimension associated to time (X4). Consequently, the obtained 4D polytopes were expressed in the EVM.

For each 4D polytope it was computed its Discrete Compactness. It is clear each generated polytope is embedded in a hyper-box with main diagonal defined by the pair of points (0,0,0,0) and (321,241,256,4). Such hyper-box will be called , and it corresponds to a sequence composed by 4 white frames. On the other hand, let be the hyper-box described by the main diagonal with start and end points given, respectively, by (0,0,0,0) and (321,241,1,4). It corresponds to a sequence where all the frames are black. The required values and are computed through Algorithm 5 by using as input the EVMs associated to hyper-boxes and , respectively. That is, and .

The 520 sequences were sorted according to the discrete compactness of their corresponding 4D polytope. Compactnessโ€™ maximum obtained value was 0.8367 while the minimum was given by 0.7236. Sequences were grouped in 12 classes (see Tables 1 and 2). Each class contains sequences whose discrete compactness is inside an arbitrarily defined range. The classes 1 to 4 group sequences with compactness major or equal to 0.72 and more minor than 0.76. These classes have 1, 3, 1, and 16 members respectively and they have as an interesting characteristic the fact that some of their members are sequences that describe intense volcanic activity. See for example the representative sequences for classes 1, 2, and 3 (Table 1). They describe the same event: an eruption which took place in December 1, 2007 [20].

Classes 5 to 8 group sequences with discrete compactness inside the range . The majority of these sequences describe volcanic activity that goes from null to moderate. The classes 9 to 12 (Table 2) have as members sequences whose 4D polytopes have Discrete Compactness in the range . In this case, a great part of these sequences have the property that they correspond to days where the visibility towards the volcano was minimized by clouds or even was null. All the sequences in classes 9, 10, and 11 have cloudy days with low visibility. Moreover, there are also sequences in which the number of days with null visibility oscillated between 1 and 3. Class 12 is the only one where there are sequences such that all four days had null visibility.

The above results are promising in the sense that discrete compactness could be applied as a mechanism for indexing/classification/comparison of -Dimensional Polytopes. In our example, we have obtained preliminary results that allow classifying 4D objects which in time describe image sequences. We implemented the algorithms and procedures described in this paper in the Java Language (Java Development Kit version 1.6). They were executed in a computer with an Intel Processor Core 2 Duo, 2.40โ€‰GHz, and 2 Gigabytes in RAM. In Tables 1 and 2 can be appreciated, for each class, the average processing time required for computing discrete compactness for our 4D polytopes. These time measures provide experimental evidence of efficiency in Discrete Compactnessโ€™ computation via the EVM. Another provided data are the referent to the average number of extreme vertices required for representing sequences. A 4D polytope that corresponds to the representation of a sequence of images could be also represented and manipulated via a 4D hypervoxelization. As described previously, all our polytopes are embedded in a 4D hyper-box with main diagonals defined by points (0,0,0,0) and (321,241,256,4). In fact, the required 4D grid for representing our polytopes through a hypervoxelization should be at least of size 320 240 256 4. This implies to store 78,643,200 4D hypervoxels. The average number of extreme vertices, required for representing the sequences contained in class 3, is 388,512. In fact, this is the maximum average from the 12 proposed classes. The ratio clearly shows how the EVM is effectively a suitable representation for these sequences because its memory requirements are much less when compared with a hypervoxelization scheme.

7. Concluding Remarks

Nowadays it is common to find applications where the search of results and properties is more suitable to be performed in hyperspaces. On one side, this implies that the representations to use must be powerful enough in the sense that conciseness, efficiency, and robustness are mandatory characteristics to be taken in account. On the other side, we consider that the notion of Discrete Compactness in higher dimensional contexts plays a fundamental role in tasks related to classification, description, and indexing of D polytopes. In such sense, this paper has been devoted to present a set of methodologies that allow the efficient computation of Discrete Compactness of those D-OPPs whose original representation was based on a hypervoxelization. In Section 3 we described the Extreme Vertices Model in the -Dimensional space which represents concisely D-OPPs. It was described a straight method for conversion of hypervoxelizations to the D-EVM. By expressing a polytope via the EVM, we have, on one hand, the important advantage related to the fact that EVMโ€™s storing requirements are much less than those required by a hypervoxelization model. On the other hand, it is available a set of EVM-based algorithms that allow the manipulation and querying of polytopes represented under our model. As commented in the previous sections, the EVM of a polytope is in fact a subset of its vertices. However, the algorithms presented in Section 3 obtain, from such subset of vertices, useful topological and geometrical information. Supported in those algorithms, we have proposed, specifically in Section 4, methodologies for performing the computation of Discrete Compactness. We have extended, in direct way, concepts presented by Bribiesca in [1, 5], in order to apply them on D-OPPs expressed under the EVM.

In Section 6 we presented how by using our EVM-based implementation of Discrete Compactness it was possible to classify in efficient way images sequences associated to Popocatรฉpetl volcano. They were grouped according to the value of their corresponding compactness. Informally, we saw how sequences with visual common properties have near compactness values. On the other hand, currently we are working in procedures for extracting the number of D elements on the boundary, of an D-OPP expressed in the EVM. Such counts by themselves are geometrical factors describing the polytope, but they can also be useful for determining, for example, topological factors such as the well-known Euler characteristic. The first steps presented in this paper, the obtained results and observations, and the new methodologies we are defining for extracting another geometrical and topological factors, encourage us to concentrate our efforts towards the following main idea. we want to determine how factors, such as Discrete Compactness, Euler characteristic, boundary elements counts, and so forth, that describe a higher dimensional polytope representing a sequence, can be used for a specification for indexing and classification of video sequences. Moreover, we will investigate if such factors, that provide us descriptive information about a higher dimensional object, can be used to infer properties and relations about the events taking place in the video sequences under consideration. The D-EVM will play a paramount role because it is expected to take full advantage of its storage requirements and its algorithmsโ€™ efficiency.

Finally, we conclude by commenting the D-EVM is a model that has been successfully applied in tasks such as image comparison by enhanced image-based reasoning, collision detection of 2D and 3D objects whose trajectories are, respectively, modeled as 3D and 4D-OPPs, concise representation and efficient querying of volume datasets, morphological operations on binary images, and connected components labeling. Applications 1, 2, and 3 are appropriately developed in [11] while applications 4 and 5 are presented in [22, 23]. In [9โ€“11, 23] there are described algorithms based on the D-EVM, besides the ones described in this paper, which are useful and efficient for performing other interrogations and manipulations on D-OPPs.