Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

The morphing of geographical features by Fourier transformation

  • Jingzhong Li ,

    Roles Formal analysis, Funding acquisition, Investigation, Methodology, Writing – original draft, Writing – review & editing

    00009232@whu.edu.cn

    Affiliation School of Resource and Environmental Sciences, Wuhan University, Wuhan, Hubei, China

  • Pengcheng Liu,

    Roles Methodology

    Affiliation College of Urban and Environmental Science, Central China Normal University, Wuhan, Hubei, China

  • Wenhao Yu,

    Roles Visualization

    Affiliation Faculty of Information Engineering, China University of Geosciences, Wuhan, Hubei, China

  • Xiaoqiang Cheng

    Roles Conceptualization, Data curation

    Affiliation Faculty of Resources and Environmental Science, Hubei University, Wuhan, Hubei, China

Abstract

This paper presents a morphing model of vector geographical data based on Fourier transformation. This model involves three main steps. They are conversion from vector data to Fourier series, generation of intermediate function by combination of the two Fourier series concerning a large scale and a small scale, and reverse conversion from combination function to vector data. By mirror processing, the model can also be used for morphing of linear features. Experimental results show that this method is sensitive to scale variations and it can be used for vector map features’ continuous scale transformation. The efficiency of this model is linearly related to the point number of shape boundary and the interceptive value n of Fourier expansion. The effect of morphing by Fourier transformation is plausible and the efficiency of the algorithm is acceptable.

1 Introduction

Morphing is an important technique in computer graphics and computer vision [1]. In general, morphing can be defined as a gradual and smooth transformation of one key shape into another [2]. Traditional vector morphing involves two basic processes: characteristic correspondence and shape interpolation [3]. The purpose of characteristic correspondence is to establish a characteristic matching relationship between the initial and the target graphs, and the purpose of shape interpolation is to implement a smooth gradient from the initial graphic to the target graphic on the basis of the matching relationship.

In the field of computer graphics, there are two kinds of methods to determine the characteristic correspondence of vector graphics. One is to establish global characteristic correspondence based on optimization technology, and the other is to establish local correspondence based on shape similarity measurement [4]–[6]. As the geometry and topology characteristics of the graphs need to be consistent in the interpolation process, a lot of work has been done on shape interpolation. Sederberg et al [6] proposed an intrinsic interpolation method, which can avoid the shrinkages by both interpolating of the edge length and the point angle of two input shapes. As-rigid-as-possible interpolation method was presented to improve the effect of boundary interpolation by rigid motion and compatible triangulations [7, 8].

In the field of cartography and Geographical Information System (GIS), morphing technology can be used to realize continuous generalization and multi-scale representation of spatial data [9]. For the characteristic matching problem, Cecconi and Galanda [10] built a one-to-one correspondence between two graphics by inserting additional points based on the proportional chord-length principle. Nöellenburg et al. [11] presented a dynamic programming based matching method to get the global feature correspondence. Deng and Peng [12] split the two linear features into pairs of subpolylines and got the correspondence relationship between the subpolylines by shape similarity measurement. A simulated annealing based optimization algorithm for characteristic matching and shape interpolation was discussed in [13]. To match the orthogonal boundary characteristics, Li et al. [14] proposed a turning function based matching method for building footprints’ continuous generalization. For the trajectories problem of shape interpolation, straight-line trajectories are the most popular method. Whited and Rossignac [15] used ball-maps to detect corresponding points for two smooth objects, and then five different trajectories–hat, linear, tangent, circular and parabolic–were used for morphing.

Whether in the computer graphics or GIS fields, it is difficult to establish the characteristic correspondence relationship, especially when the boundaries of two anchor shapes are totally different. To avoid the problem of characteristics matching, an alternative strategy is to transform two input geometric graphics into two implicit functions and generates the intermediate shapes by fusing the implicit functions with different parameters. For example, Hughes [16] presented a scheduled Fourier transform to perform morphing in which both basic states were represented as a combined function of high frequency and low frequency, and the morphing effect was achieved by the fusion of the two functions. He et al. [17] decomposed the two basic states into a set of frequency wavelet bands, applied a smooth interpolation to each band, and reconstructed the results to generate the intermediate state. This paper proposes a morphing method of geographical features based on Fourier transformation, which does not require the process of characteristic correspondence. The basic idea of morphing by Fourier transformation is to transform the vector coordinates of geographical feature in spatial domain into function expression in frequency domain using Fourier transformation, then a weighted combination of Fourier expressions of two vector shapes is used to construct the functional expression of the intermediate shape, finally an inverse transformation is performed on the intermediate functional to get the intermediate shape.

The rest of paper is organized as follows. Section 2 investigates the methodology of morphing model by Fourier transformation. The experiments on different geographical features are given in Section 3. Section 4 presents conclusions with suggestions for future improvements.

2 Methodology of morphing model by Fourier transformation

2.1 Conceptual model

In mathematics a two-dimensional vector boundary can be converted into a one-dimensional real function or complex function based on a certain shape signature [18]–[20]. The vector expressions of area and linear geographic features in GIS can also be converted into a one-dimensional function. Assuming that α and β are two vector representations of the same geographical entity at large scale s1 and small scale s2, their corresponding function expressions are f1 and f2 respectively, and then the function of intermediate representation rg can be represented as: (1)

In Formula (1), f is a composite function based on f1 and f2, and g is a normalized weight parameter related to intermediate scale. Assuming that the interpolation scale is sg, then the relationship between g and scales can be expressed as the following formula. (2)

Because of s2sgs1, so 0 ≤ g ≤ 1. The greater the value of g, which means the smaller the scale sg, then the function f is more similar to f2; the smaller the value of g, which means the greater the scale sg, then the function f is more similar to f1. But how to establish the reciprocal transformation relationships between α and f1, β and f2, and rg and f. Fourier transformation has the property of reversibility besides the invariance to rotation, translation, and scaling [19]–[23]. Here we use Fourier transformation to implement conversions between geometry coordinates and shape signature function.

2.2 Fourier transformation of vector curve: A brief review

Fourier transformation is a way to represent a periodic function or periodic signal into the sum of a set of simple oscillating functions, namely sines and cosines. In GIS, discrete Fourier transformation and inverse transformation usually use an equal-distance sampling approach to represent cartographic curve [24]–[27]. Actually simple area object (polygon without inner ring) can be considered as the “trajectory” formed by a point object’s periodic motion. The coordinates of “trajectory” can be described as(X(s), Y(s)), where X(s) and Y(s) are the segmental functions of path length S which can be expressed as Eqs (3) and (4). (3) (4)

Where (Xi, Yi) is the coordinate of the ith point on the curve, Si is the path length from the start point to the ith point along the curve, S is the moving point’s path length from the start point, and SiSS(i+1) and 0 ≤ iN − 1. Given the total point number of a closed curve is N, the function X(s) and Y(s) are periodical functions with a period of SN. Then the functions can be expressed as Eqs (5) and (6) by Fourier series [20]: (5) (6)

Where K is an integer, n is the interceptive value of describing the Fourier expansion of curve needed, and (7) (8) (9) (10)

Eqs (7)(10) are known as the Fourier transformation which converts a two-dimensional closed curve into a one-dimensional function, and Eqs (5) and (6) are the inverse Fourier transformations which can reconstruct the curve. Generally, the larger the value of n, the smaller the values of AX,n, BX, n, AY, n and BY, n are. When n approaches to infinite, AX,n, BX,n, AY,n and BY,n will approximately be zero. In other words, the larger the value of n, the closer the Eqs (5) and (6) are to the original curve.

2.3 Morphing model by Fourier transformation

According to Formulas (1), (5) and (6), shape signature functions f1, f2 and f can be denoted as follows: (11) (12) (13)

From the above discussion, the value of n determines the approximation degree of the Fourier expansion series to the original shape. If we specify the value of approximation degree in advance, the value of n can also be determined through a certain way. First of all, we need to define a function to measure the similarity between two shapes. Assume that the original and intermediate shapes are r0 and rg (The rg is at intermediate scale and generated by Fourier transformation)respectively, and their intersection is r0∩g. We can define the approximation degree of two shapes as follows: (14)

The parameter OD ranges from 0 to 1. The closer the value is to 1, the higher the accuracy of the approximation. Then OD can be considered as the accuracy of original shape expression by Fourier series. While given a specific OD value, the minimal n, which can firstly reach the OD, is chosen as the interceptive value. For the same OD, the shape rα and rβ will be approximated with different n values because of their different shape complexity. According to the Formula (13), the morphing model has only one value of n. Here we choose the bigger n as the common interceptive value of the two source shapes α and β.

For linear features in GIS, their boundaries are often expressed as open curves. Although open curves can also be expressed as piecewise functions, they are not periodical functions. Therefore, the linear features cannot be directly fitted by Fourier series. To express the open curve with Fourier series, we can expand the piecewise function into periodic function by mirroring the open curve through the line that connects the first and the last points of the curve [20]. Based on the closed curve, the same processes of extracting Fourier coefficients and inverse Fourier transformation can be applied as described above. But the range of S is instead of [0, Sn] for open curve.

3 Experimental analysis

We design three sets of experiments to verify the feasibility and effectiveness of the morphing model by Fourier transformation. The first set of experiments are designed to validate the feasibility of Fourier function representation of vector data. Especially we focus on the discussion of truncation parameter n and its’ variation with different geometry shapes. The second set of experiments are used to validate the feasibility of the morphing model based on Fourier transformation for continuous scale transformation of map data. We validate the experiment by using three kinds of data such as orthogonal boundary area features, smooth boundary area features and smooth boundary linear features. The third set of experiments are used to validate the effectiveness of the morphing model based on Fourier transformation by contrast experiments.

3.1 The experiment of Fourier series representation of vector data

To illustrate the feasibility of Fourier function representation of vector data, we use seven sets of experimental data to perform the experimental verification. The experimental data includes circle, ellipse, square, rectangle, convex polygon, concave polygon with smooth boundary and concave polygon with orthogonal boundary, which can be denoted as P1, P2, P3, P4, P5, P6, P7. In Fig 1, the leftmost polygons on each column are P1 to P7, and the remaining 9 polygons on each column are approximated by Fourier series with different interceptive value n. From left to right, the values of n are 1, 5, 9, 13, 17, 21, 25, 29 and 33 respectively. Table 1 is the approximation degree between the original polygon and the fitting polygon by Fourier expansion with different interceptive value n. The Fourier expansion method is based on Formula (5) and (6), and the approximation degrees are calculated by Formula (14).

thumbnail
Fig 1. The polygon approximation by Fourier descriptors for different shape types at different interceptive values.

https://doi.org/10.1371/journal.pone.0191136.g001

thumbnail
Table 1. The degrees of approximation (OD) of different shapes at designated interceptive values.

https://doi.org/10.1371/journal.pone.0191136.t002

From Table 1 we can see that the interceptive parameter n is sensitive to the morphological characteristics of vector data. Generally, the shapes with high compactness, high degree of convex and smooth boundary are faster to achieve the specified approximations degree OD with smaller n values. The shape of circle is the easiest one to be fitted by Fourier transformation. Meanwhile, ellipse and square can be quickly fitted by Fourier transformation with small n values. For example, when OD = 0.99, their n = 5 and 9. The convex polygon P5 is easier to approximate than concave polygons P6 and P7 by this method and the concave polygon with a smooth boundary P6 is easier to approximate than the concave polygon with an orthogonal boundary P7.

Generally speaking, the Fourier transformation model can capture the main outline-information of the shape in low frequency (small n-value) while capture the detail information in high frequency (large n-value). We can obtain the approximate expression of original polygon gradually through a gradual increase in the n-value. So this method can be used to fit the vector data in GIS.

3.2 The morphing of vector data by Fourier transformation

The main application of morphing model in cartography and GIS are continuous generalization and multi-scale representation. Here we will test the feasibility of continuous generalization of geographical features using the morphing model presented in section 2. Three type of different geographical features are used to finished this experiment, which are showed in Fig 2. They are building features with orthogonal boundary, lake features with smooth boundary and linear features with smooth boundary. Each set of experimental data consists of two representations of the same geographic entity, one corresponding to a large scale representation, and the other corresponding to a small scale representation. Obviously, the representations at large scale are more detailed than these at small scale. These line features, who’s geometry are open curves, need to be reconstructed into closed curves by mirroring. Table 2 shows the relationship between the degree of approximation OD and the interceptive value n of the three sets of data.

thumbnail
Fig 2. The experimental data.

(Group one is building feature with orthogonal boundary. Group two is lake feature with smooth boundary. Group three is linear feature with smooth boundary).

https://doi.org/10.1371/journal.pone.0191136.g002

thumbnail
Table 2. The degree of approximation OD with different interceptive value n.

https://doi.org/10.1371/journal.pone.0191136.t003

In order to ensure the accuracy of morphing, we need to set a high OD value in the process of Fourier fitting of vector data, saying OD = 0.99. When OD = 0.99, we can get the related interceptive value n for B1, B2, H1, H2, L1, L2 are 57, 41, 49, 37, 61 and 53 respectively from Table 2. So for the morphing model in Formula (13), the parameters n for building feature, lake feature and linear feature are 57, 49 and 61 respectively. From the discussion in conceptual model we know that we can get representations of vector data with different resolutions by tuning the parameter g. To test the sensitivity of the morphing model to parameter g, two series of g are designed. One series are 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, the interval of g is 0.1, and the experimental results are showed in Fig 3. The other series are 0.95, 0.94, 0.93, 0.92, 0.91, the interval of g is 0.01, and the results are showed in Fig 4. For convenience of observation, some details within the circle area in the second row in Fig 4 are enlarged and shown in the first and third rows.

thumbnail
Fig 3. The morphing effects of different features with g interval 0.1.

https://doi.org/10.1371/journal.pone.0191136.g003

thumbnail
Fig 4. The morphing effects of lake feature with g interval 0.01.

https://doi.org/10.1371/journal.pone.0191136.g004

From Fig 3 we can find that the overall trend in graphic expression of building, lake and linear features is from fine to coarse with the gradual increase of g value. In other words, this morphing model can reflect the gradual process of map representation from big scale to small scale, and all intermediate shapes are fused from the initial (e.g., B1, H1, L1) and final figures (e.g., B2, H2, L2). So it is a process of continuous generalization. At the same time, we also find that the model has better application effect on the feature with smooth boundary (such as lake and contour line features) than that with orthogonal boundary (such as building footprint). In the first row of Fig 3, there are some obvious non orthogonal boundary during the gradual process from B1 to B2, these results are not consistent with the specification of building footprint. For the lake and linear features with smooth boundary, their boundaries always maintain a smooth and continuous gradient during the process of interpolation, and the results are plausible.

Considering the adaptability of the morphing model to different features, the other experiment with g series of 0.95, 0.94, 0.93, 0.92, 0.91 is only conducted for the lake feature with smooth boundary. From the amplification effects in Fig 4, we can see even small changes of g (saying 0.01) can cause tiny but smooth, continuous gradients in geometric shapes. So this morphing model is sensitive to scale variations and it is suitable for continuous scale transformation.

3.3 Comparative experiment

The following experiments will test the interpolation effect and time efficiency of the morphing model proposed in this paper by comparative analysis and time analysis. The experiment data is still the same as shown in Fig 2, and the g series is still 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. The comparative experiment uses the linear interpolation method proposed in [10]. First we get the one-to-one correspondence between two boundary points by inserting abundant points into the boundary with less points based on the proportional chord-length principle. Then we conduct linear interpolation between the corresponding coordinate points to get the intermediate shape series. Experimental results are shown in Fig 5, from which we can see that the interpolation graph series of building, lake and contour line are abnormal and there are some cases of self-intersection at intermediate scales. Compared with the experimental effects in Fig 3, we can conclude that the morphing model proposed in this paper is better than the simple linear interpolation and the gradient effect is reasonable and effective.

thumbnail
Fig 5. The morphing effects by linear interpolation method.

https://doi.org/10.1371/journal.pone.0191136.g005

For the morphing of vector data by Fourier transformation, the main time consumption includes three parts: the conversion from vector data to Fourier series by Formula (7)(10), the generation of intermediate function by combination of the two Fourier series related the large and small scale by Formula (13), and the reverse conversion from the combination function to vector data by Formula (5) and (6). All of these processes are linear time series. So the time consumption mainly depends on two factors: the point number of shape boundary and the interceptive value n of Fourier expansion. The point number of boundary of B1, B2, H1, H2, L1, L2 are 37, 26, 260, 196, 152 and 93 respectively. The linear features are open curves, and the point actually participating in calculation is double of the real number because of the mirroring operation. So the point numbers of L1 and L2 should be 304 and 186.

Table 3 records the time consumption (including all three main processes) of the Fourier transformation of the six figures in Fig 2 with different interceptive value n from 1 to 61, the Fig 6 reflects the relationship of time consumption and the interceptive value, and the Fig 7 reflects the relationship of time consumption and the number of point. From which we can see that the time consumption is linearly related to the number of point and the interceptive value of Fourier expansion series. So the time efficiency is acceptable. For most of moderate complex map objects, the accuracy of the Fourier transformation is close to 0.99 when the interceptive value n = 50 is used, and time consumption for morphing by Fourier transformation is about 150 milliseconds. So the morphing model proposed in this paper can generate about seven high quality intermediate shapes of moderate complexity per second. If the shape accuracy requirement decreases, the efficiency can be further improved by using a smaller n.

thumbnail
Table 3. The time cost of morphing model by Fourier transformation.

https://doi.org/10.1371/journal.pone.0191136.t004

thumbnail
Fig 6. The relationship of time consumption and the interceptive value n.

https://doi.org/10.1371/journal.pone.0191136.g006

thumbnail
Fig 7. The relationship of time consumption and the number of point N.

https://doi.org/10.1371/journal.pone.0191136.g007

4 Conclusion

This paper presents a morphing model of vector geographical data based on Fourier transformation. The basic idea of the model is to transform the spatial representation of vector data into function expression in frequency domain, and then get the intermediate shapes by functions composition and inverse Fourier transformation. Subject to the constraints of periodic functions, linear objects must be closed before subsequent morphing transformation can be performed. Experimental results show that this method can be used for vector map features’ continuous scale transformation. This morphing model is sensitive to scale variations and even small changes of parameter g (saying 0.01) can cause tiny but smooth and continuous gradients in geometric shapes. The efficiency of this method mainly depends on the point number of shape boundary and the interceptive value n of Fourier expansion, and the time consumption is linearly related to these two factors. Generally speaking, there are two advantages of the proposed method compared with the previous method. First, by introducing Fourier transformation, complex characteristics points matching process can be avoided. It is a simple morphing model. Second, this model can be used for morphing transformation of both linear and area features. It is a practical morphing model.

Finally, we can conclude that the morphing model proposed in this paper is suitable for these vector map features who have smooth boundary. For those features with orthogonal boundary, their orthogonality property cannot be maintained in the morphing process. It is not suitable for the morphing of building footprint, nor can it be used for the morphing of polygon with inner island.

Acknowledgments

This work was supported by the National Key Research and Development Program of China under Grant 2017YFB0503601; the National Natural Science Foundation of China under Grant 41671448; and China Scholarship Council (CSC) under Grant 201706275018.

References

  1. 1. Gomes J, Darsa L, Costa B, Velho L. Warping and morphing of graphical objects. San Francisco: Morgan Kaufman Publishers Inc.; 1999.
  2. 2. Efrat A, Har-Peled S, Guibas LJ, Murali TM. Morphing between polylines. In Proceedings of the 12th ACM-SIAM symposium discrete algorithms.2001; pp:680–689.
  3. 3. Yang WW, Feng JQ. 2D shape morphing via automatic feature matching and hierarchical interpolation. Computers and Graphics. 2009; 33(3):414–423.
  4. 4. Sederberg T, Greenwood E. A physically based approach to 2D shape blending. ACM Computer Graphics. 1992; 26(2):25–34.
  5. 5. Sederberg T, Gao P, Wang G, Mu H. 2-D shape blending: an intrinsic solution to the vertex path problem. Computer Graph. 1993; 27:15–18.
  6. 6. Van OR, Veltkamp RC. Parametric search made practical. Computational Geometry: Theory and Applications. 2004; 28:75–88.
  7. 7. Alexa M, Cohen-Or D, Levin D. As-rigid-as-possible shape interpolation. In:SIGGRAPH’00. 2000; pp:157–164.
  8. 8. Surazhsky V, Gotsman C. Intrinsic morphing of compatible triangulations. International Journal of Shape Modelling. 2003; 9(2):191–201.
  9. 9. Danciger J, Devadoss SL, Mugno J, Sheehy D, Ward R. Shape deformation in continuous map generalization. Geoinformatica. 2009; 13:203–221.
  10. 10. Cecconi A, Galanda M. Adaptive zooming in Web cartography. Computer Graphics Forum. 2002;21(4):787–799.
  11. 11. Nöellenburg M,Merrick D,Wolff A, Benkert M. Morphing polylines: A step towards continuous generalization. Computers, Environment and Urban Systems. 2008;32(4):248–260.
  12. 12. Deng M, Peng D. Morphing Linear Features Based on Their Entire Structures. Transactions in GIS. 2015;19(5):653–677.
  13. 13. Li JZ, Ai TH, Liu PC, Yang M. Continuous Scale Transformations of Linear Features Using Simulated Annealing-Based Morphing. ISPRS Int. J. Geo-Inf. 2017;6(8):1–15.
  14. 14. Li JZ, Li XG, Xie T. Morphing of Building Footprints Using a Turning Angle Function. ISPRS Int. J. Geo-Inf. 2017;6(6),173;
  15. 15. Whited B, Rossignac J. B-morphs between b-compatible curves in the plane. New York:In Proceedings of the ACM/SIAM Joint Conference on Geometric and Physical Modeling. 2009;187–198.
  16. 16. Hughes JF. Scheduled Fourier Volume Morphing. ACM SIGGRAPH Computer Graphics’92 Proceedings, 1992. 26(2): 43–46.
  17. 17. He, T, Wang S, Kaufman, A. Wavelet-Based Volume Morphing. In Proceedings of the IEEE Visualization, Washington, DC, USA, 21 October 1994; pp. 85–92.
  18. 18. Persoon E, Fu KS. Shape Discrimination Using Fourier Descriptors. IEEE Trans. On Systems, Man and Cybernetics. 1997;SMC-7:170–179.
  19. 19. Ai TH, Cheng XQ, Liu PC, Yang M. A shape analysis and template matching of building features by the Fourier transform method. Computers Environment and Urban Systems. 2013;41:219–233.
  20. 20. Liu PC, Li XG, Liu WB, Ai TH. Fourier based multi-scale representation and progressive transmission of cartographic curves on the internet. Cartography and Geographic Information Science. 2015;
  21. 21. Zahn CT, Roskies RZ. Fourier Descriptors for Plane Closed Curves. IEEE Transactions on Computers. 1972;C-21(3): 269–281.
  22. 22. Persoon E, Fu KS. Shape Discrimination Using Fourier Descriptors. IEEE Transactions on Systems, Man and Cybernetics. 1997; 7(3):170–179.
  23. 23. Kauppinen H, Seppanen T, Pietikainen M. An Experimental Comparison of Autoregressive and Fourier-Based Descriptors in 2D Shape Classification. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1995; 17(2):201–207.
  24. 24. Clarke KC, R Cippoletti, G Olsen. Empirical Comparison of Two Line Enhancement Methods. Minneapolis, MN: in Proceedings of Eleventh International Symposium on Computer-Assisted Cartography. 1993, October; 72–81.
  25. 25. Lawford GJ. Fourier Series and the Cartographic Line. International Journal of Geographical Information Science. 2006; 20(1):31–52.
  26. 26. Fritsch E, Lagrange JP. Spectral Representations of Linear Features for Generalisation. In: Frank AU and Kuhn U editor, Spatial Information Theory A Theoretical Basis for GIS,Berlin Heidelberg: Springer-Verlag. 1995; 157–171.
  27. 27. Boutoura C. Line Generalization Using Spectral Techniques. Cartographica: The International Journal for Geographic Information and Geovisualization. 1989; 26(3–4): 33–48.