Print

发布时间: 2018-07-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.170559
2018 | Volume 23 | Number 7




    计算机图形学    




  <<上一篇 




  下一篇>> 





分组渐进迭代逼近算法拟合数据点集
expand article info 郑国1, 张莉1, 张世杰1, 杜壮平1, 刘逸2, 檀结庆1,2
1. 合肥工业大学数学学院, 合肥 230009;
2. 合肥工业大学计算机与信息学院, 合肥 230009

摘要

目的 在计算机辅助设计领域里,曲线或曲面的渐进迭代逼近(PIA)性质在插值与拟合问题中有着广泛的应用。如果直接使用PIA方法对所有的数据点集进行拟合,那么在拟合大规模数据点时就缺少一定的灵活性。为了进一步提高渐进迭代逼近方法在拟合大规模点集时的灵活性,提出基于分组的渐进迭代逼近方法。方法 首先对待拟合点集进行分组;其次对分组后的点集采用PIA方法或是基于最小二乘的渐进迭代逼近方法(LSPIA)来得到一组插值或拟合精度不断改善的曲线/曲面;最后运用曲线/曲面拼接算法保证曲线/曲面的连续性,得到1条/张插值或拟合于给定点集的曲线/曲面。结果 给定相同的数据点集,分别采用分组PIA方法,PIA方法和LSPIA方法进行拟合。分组PIA方法与PIA方法相比误差减少的倍数与组数相当;分组PIA方法与LSPIA方法相比误差减少一半。结论 本文将分组思想引入渐进迭代逼近方法之中,提出了基于分组的渐进迭代逼近方法。该分组算法适用于拟合大规模数据点集,在拟合过程中,可以提高渐进迭代逼近方法在拟合大规模点集时的灵活性;经过理论推导证明了曲线/曲面的迭代效率有所提高,且与PIA方法相比误差有较大的改善。

关键词

几何迭代法; 分组迭代; 拼接; G2连续性; 迭代效率

Grouped progressive iterative approximation method of data fitting
expand article info Zheng Guo1, Zhang Li1, Zhang Shijie1, Du Zhuangping1, Liu Yi2, Tan Jieqing1,2
1. School of Mathematics, Hefei University of Technology, Hefei 230009, China;
2. School of Computer and Information, Hefei University of Technology, Hefei 230009, China
Supported by: National Natural Science Foundation of China (61472466, 61100126)

Abstract

Objective The progressive iterative approximation (PIA) method has a wide range of applications for solving interpolation and fitting problems in computer-aided design. The PIA format presents an intuitive way of data fitting by adjusting the control points iteratively. This method format generates a sequence of curves/surfaces with fine precision. According to the PIA property, the limit of the curve/surface sequence interpolates the initial data points if the blending basis is normalized and totally positive and its corresponding collocation matrix is nonsingular. To increase the flexibility of the PIA method in the large-scale fitting of data points, a new PIA method, which is based on grouping, is proposed in this work. Method First, the initial data points to be fitted are divided into several groups. Second, by applying the PIA or LSPIA method on these grouped data points separately, we can obtain a sequence of curves/surfaces with the PIA property for each group of data. Then, by adjusting the control points on the boundary according to the continuity conditions, a blending algorithm is implemented on these separate curves/surfaces. Thus, we finally acquire one whole curve/surface piece and ensure its continuity. Moreover, by grouping the data points, we can reduce the computation and improve the iteration efficiency. Result We use the PIA, LSPIA, and proposed methods on a single data set to fit data points. The grouped PIA method is convergent because we use the PIA or LSPIA method to fit each group of data points. Compared with the fitting error of the PIA method, that of the grouped PIA method decreases according to the number of groups we divide. That is, the more groups we divide, the more the fitting error is reduced. Compared with the fitting error of the LSPIA method, that of the grouped PIA method is lower by approximately one half. Conclusion This study mainly aims to combine the grouping idea with the PIA method and proposes a grouped PIA method of fitting the data set. This method not only brings enhanced flexibility to the large-scale fitting of data points but also delivers a higher convergence rate and fewer errors than the PIA and LSPIA methods do. Numerous numerical examples are presented to show the effectiveness of this technique.

Key words

geometric iterative methods; grouped progressive iteration; blending algorithm; G2 continuity; iteration efficiency

0 引言

散乱数据点的逼近和拟合问题是计算机辅助几何设计(CAGD)中一个基础而重要的研究课题。渐进迭代逼近方法(PIA), 由于其收敛稳定、具备自适应性、有明显的几何意义等诸多优点, 近年来受到了广泛的关注。渐进迭代逼近方法由齐东旭[1]和de Boor[2]提出, 蔺宏伟等人[3-4]对其进行了深入而细致的研究, 将其进一步推广到标准全正基(NTP)的情形,对于配置矩阵不是标准全正的,陈杰等人[5]首次证明了一般的混合基函数在满足一定的条件时生成的曲线具有推广的PIA性质。在此基础上,张莉等人[6]指出三角域上Said-Ball基具有广义的渐进迭代性质。西班牙学者Delgado和Pena[7]对由它们生成的曲线(曲面)使用PIA方法迭代的收敛速度进行了比较, 发现B样条曲线(曲面)具有最快的收敛速度。为了加快PIA的收敛速度, 陆利正[8]提出一种带权渐进迭代逼近(WPIA)方法, 通过对调整向量加权来加快收敛速度。刘晓艳等人[9]结合Jacobi迭代法, 提出了用非均匀三次B样条曲线插值的Jacobi-PIA算法。2010年, 蔺宏伟[10]提出一种局部渐进迭代逼近(LPIA)方法, 由于此方法只调整初始控制顶点的一个子集, 所以与全局PIA方法相比更加灵活。当给定的数据点较多时, 蔺宏伟[11]提出了一种推广的PIA方法(EPIA), 即通过对给定点集进行分组来并行计算调整向量, 从而提高了迭代效率, 使得其在拟合大规模数据点时有很大的优势。2014年, 邓重阳等人[12]又进一步提出了基于最小二乘的渐进迭代逼近方法(LSPIA), 使得拟合的极限曲线/曲面为给定点集的最小二乘拟合曲线/曲面。此后, 该方法又被推广到带不同权值的情形[13-14]。2015年, 蔺宏伟[15]从理论和应用两方面对PIA方法进行了综述, 展示了其应用的广泛性。

本文提出了分组渐进迭代逼近方法, 用以提高PIA方法在拟合大规模点集时的灵活性。其基本思想是:首先对待拟合点集进行分组; 其次对分组后的点集采用渐进迭代逼近方法或者基于最小二乘法的渐进迭代逼近方法得到一组拟合精度不断改善的曲线/曲面; 最后运用曲线/曲面拼接算法得到一条/张拟合所有给定点集的曲线/曲面。这种方法的主要优点是灵活、迭代次数少且容易控制。这里的灵活一方面是指分组的灵活, 即数据点集可以根据我们的需要进行分组; 另一方面是指分组后运用方法的灵活, 例如分组后可以运用PIA方法, 也可以运用LSPIA方法, 亦可根据需要继续进行分组。

1 预备知识

给定一组非负基函数${\overline B _n}\left(t \right) = \left\{ {{{\overline B }_0}\left(t \right), {{\overline B }_1}\left(t \right), \cdots, {{\overline B }_n}\left(t \right)} \right\}$, 若这组基满足$\sum\limits_{i = 1}^n {{B_i}\left(t \right) = 1} $, 且在任意一组单调递增的实数列$t_{0}≤t_{1}≤…≤t_{m}$下的配置矩阵

$ \mathit{\boldsymbol{M}}\left[ \begin{array}{l} {{\bar B}_0} \cdots {{\bar B}_n}\\ {t_0}\;\; \cdots \;\;{t_m} \end{array} \right] = \left[ \begin{array}{l} {{\bar B}_0}\left( {{t_0}} \right)\;\;\;{{\bar B}_1}\left( {{t_0}} \right)\;\;\; \cdots \;\;\;{{\bar B}_n}\left( {{t_0}} \right)\\ {{\bar B}_0}\left( {{t_1}} \right)\;\;\;{{\bar B}_1}\left( {{t_1}} \right)\;\;\;\; \cdots \;\;\;{{\bar B}_n}\left( {{t_1}} \right)\\ \;\; \vdots \;\;\;\;\;\;\;\;\;\;\;\;\; \vdots \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; \vdots \;\;\;\;\\ {{\bar B}_0}\left( {{t_m}} \right)\;\;\;{{\bar B}_1}\left( {{t_m}} \right)\;\;\; \cdots \;\;\;{{\bar B}_n}\left( {{t_m}} \right) \end{array} \right] $

是全正(TP)矩阵, 那么称这组基函数是一组标准全正基[4], 基于这组标准全正基和一组给定的有序点集$\{\mathit{\boldsymbol{P}}_{i}\}^{n}_{i=0}$, 可以得到一条曲线$C(t)=\sum\limits_{i = 0}^n {{\mathit{\boldsymbol{P}}_i}{{\bar B}_i}\left(t \right)} $。类似的,也可以得到一张曲面$S\left({u, v} \right) = \sum\limits_{i = 0}^m {\sum\limits_{j = 0}^n {{\mathit{\boldsymbol{P}}_{ij}}{{\bar B}_i}\left(u \right){{\bar B}_j}\left(v \right)} } $

2 分组PIA方法

采用B样条曲线或曲面分别对2维和3维数据点进行分组渐进迭代逼近。

为讨论简便起见, 文中数据点的数量在2 000范围内, 实际问题中数据点数量可能更大, 但处理的方法仍然是类似的。此外, 文中对于数据点, 主要采用二分法进行分组, 但亦可采用非均匀分组方法。如本文的数值实例就是根据数据点分布的特征来进行分组的。对于分组后的点集, 往往利用PIA方法进行并行计算来提高迭代效率。

2.1 基于曲线的分组PIA方法

2.1.1 曲线的分组

假设给定一列数据点$\{\mathit{\boldsymbol{P}}_{i}\}^{n}_{i=0}$。下面对数据点运用二分法进行第一次分组, 得到两组有序数据点集, 即$\{\mathit{\boldsymbol{P}}_{i}\}$, $i = 0, 1, \cdots, \left\lfloor {\frac{n}{2}} \right\rfloor $, 和$\{\mathit{\boldsymbol{P}}_{j}\}$, $j = \left\lfloor {\frac{n}{2}} \right\rfloor, \cdots, n$。对这两组有序数据点集我们可以运用二分法再次进行分组得到4组有序数据点集。分组依次进行下去, 直到每一组的数据点的个数均不超过$m$($m$根据实际需要取值)。

2.1.2 基于曲线的PIA方法

$(B_{0}(t), B_{1}(t), …, B_{n}(t))$是一组标准全正基, 不妨记分组后的一组有序数据点集为$\{\mathit{\boldsymbol{P}}_{i}\}^{n_{1}}_{i=0}$, 以该点集作为初始的控制顶点, 得到初始曲线${\mathit{\boldsymbol{C}}^0}\left(t \right) = \sum\limits_{i = 0}^{{n_1}} {\mathit{\boldsymbol{P}}_i^0{\mathit{\boldsymbol{B}}_i}\left(t \right)} $, 其中, $\mathit{\boldsymbol{P}}^{0}_{i}=\mathit{\boldsymbol{P}}_{i}$, $i=0, 1, …, n_{1}$, 然后, 对每个控制顶点计算调整向量${\mathit \Delta} ^{0}_{i}=\mathit{\boldsymbol{P}}_{i}-\mathit{\boldsymbol{C}}^{0}(t_{i})$, 并且令$\mathit{\boldsymbol{P}}^{1}_{i}=\mathit{\boldsymbol{P}}_{i}+{\mathit \Delta} ^{0}_{i}$, $i=0, 1, …, n_{1}$, 可以得到$\mathit{\boldsymbol{C}}^{1}(t)=\sum\limits_{i = 0}^{{n_1}} \mathit{\boldsymbol{P}}^{1}_{i}B_{i}(t)$。重复这一过程, 可以得到不断靠近给定点集的曲线序列$\{\mathit{\boldsymbol{C}}^{k}(t)\}$, 且$\{\mathit{\boldsymbol{C}}^{k}(t)\}$的极限曲线会插值于给定的有序点集。

2.1.3 曲线的连续性

以双三次B样条曲线为例。对于上述分组之后两相邻的数据点集分别为$\{\mathit{\boldsymbol{P}}_{i}\}^{n_{1}}_{i=0}$$\{\mathit{\boldsymbol{Q}}_{i}\}^{n_{2}}_{i=0}$, 运用PIA方法分别得到两条三次B样条曲线$P(t)$$Q(t)$(如图 1中实线与虚线分别为双三次B样条曲线$P(t)$$Q(t)$, )。由于数据点满足$\mathit{\boldsymbol{P}}_{n_{1}}=\mathit{\boldsymbol{Q}}_{0}$, 因此曲线在拼接点处满足${\rm G}^{0}$连续(如图 1(a))。

图 1 双三次B样条曲线
Fig. 1 Two bi-cubic B-spline curve ((a) ${\rm G}^{0}$ continuity; (b) ${\rm G}^{1}$ continuity; (c) ${\rm G}^{2}$ continuity)

调整$\mathit{\boldsymbol{Q}}_{1}$, 使得

$ \frac{{{\mathit{\boldsymbol{P}}_{{n_1}}} - {\mathit{\boldsymbol{P}}_{{n_1} - 1}}}}{{\left\| {{\mathit{\boldsymbol{P}}_{{n_1}}} - {\mathit{\boldsymbol{P}}_{{n_1} - 1}}} \right\|}} = \frac{{{\mathit{\boldsymbol{Q}}_1} - {\mathit{\boldsymbol{Q}}_0}}}{{\left\| {{\mathit{\boldsymbol{Q}}_1} - {\mathit{\boldsymbol{Q}}_0}} \right\|}} $ (1)

成立。这样就保证了整合曲线在拼接点处的${\rm G}^{1}$连续性[16-17](如图 1(b))。

再调整$\mathit{\boldsymbol{Q}}_{2}$, 使得在上述基础上满足

$ \begin{array}{l} \left[ {\left( {{\mathit{\boldsymbol{P}}_{{n_1}}} - {\mathit{\boldsymbol{P}}_{{n_1} - 1}}} \right) \times \left( {{\mathit{\boldsymbol{P}}_{{n_1}}} - 2{\mathit{\boldsymbol{P}}_{{n_1} - 1}}{\rm{ + }}{\mathit{\boldsymbol{P}}_{{n_1} - 2}}} \right)} \right] \times \\ \;\;\;\;\left[ {\left( {{\mathit{\boldsymbol{Q}}_1} - {\mathit{\boldsymbol{Q}}_0}} \right) \times \left( {{\mathit{\boldsymbol{Q}}_2} - 2{\mathit{\boldsymbol{Q}}_1} + {\mathit{\boldsymbol{Q}}_0}} \right)} \right] = 0 \end{array} $ (2)

这样可以保证整合曲线的${\rm G}^{2}$连续性[17](如图 1(c))。每次迭代时均按照上述几何连续条件确定端点以及端点附近的点,其余点仍然按照PIA迭代计算。这样整合得到的一列曲线均满足${\rm G}^{2}$连续性。

2.2 基于曲面的分组PIA方法

以下主要采用二分法对数据点实施分组, 在实际操作中, 根据数据点的分布以及逼近精度需要, 可以采用更为灵活的分组。

2.2.1 曲面的分组

假设给定数据点集$\{\mathit{\boldsymbol{P}}_{ij}\}^{m, n}_{i=0, j=0}$, 对数据点运用二次二分法进行第一次分组, 得到四组有序数据点集。第1组数据点集为$\{\mathit{\boldsymbol{P}}_{{i_1}{j_1}}\}$, 其中$i_{1}=0, 1, …, \left\lfloor {\frac{m}{2}} \right\rfloor $, $j_{1}=0, 1, …, \left\lfloor {\frac{n}{2}} \right\rfloor $。第2组数据点集为$\{\mathit{\boldsymbol{P}}_{{i_2}{j_2}}\}$, 其中$i_{2}=0, 1, …, \left\lfloor {\frac{m}{2}} \right\rfloor $, $j_{2}=\left\lfloor {\frac{n}{2}} \right\rfloor, …, n$。第3组数据点集为$\{\mathit{\boldsymbol{P}}_{{i_3}{j_3}}\}$, 其中$i_{3}=\left\lfloor {\frac{m}{2}} \right\rfloor, …, m$, $j_{3}=0, 1, …, \left\lfloor {\frac{n}{2}} \right\rfloor $。第4组数据点集为$\{\mathit{\boldsymbol{P}}_{{i_4}{j_4}}\}$, 其中$i_{4}=\left\lfloor {\frac{m}{2}} \right\rfloor, …, m$, $j_{4}=\left\lfloor {\frac{n}{2}} \right\rfloor, …, n$。对这4组数据点集, 可以根据精度或数据点分布, 继续对某组数据点类似分组。

2.2.2 基于曲面的PIA方法

不妨记分组后的一组数据点集为$\{\mathit{\boldsymbol{P}}_{ij}\}^{m_{1}, n_{1}}_{i=0, j=0}$。以该点集作为初始的控制顶点, 得到初始曲面$S^{0}(u, v)=\sum\limits_{i = 0}^{{m_1}} {\sum\limits_{j = 0}^{{n_1}} } \mathit{\boldsymbol{P}}^{0}_{ij}B_{i}(u)B_{j}(v)$, 其中$B_{i}(u)$$B_{j}(v)$均为标准全正基函数, 且$\mathit{\boldsymbol{P}}^{0}_{ij}=\mathit{\boldsymbol{P}}_{ij}$, $i=0, 1, …, m_{1}$, $j=0, 1, …, n_{1}$。对每个控制顶点计算调整向量${\mathit \Delta} ^{0}_{ij}=\mathit{\boldsymbol{P}}_{ij}-\mathit{\boldsymbol{S}}^{0}(u_{i}, v_{j})i=0, 1, …, m_{1}$, $j=0, 1, …, n_{1}$, 并且令$\mathit{\boldsymbol{P}}^{1}_{ij}=\mathit{\boldsymbol{P}}_{ij}+{\mathit \Delta} ^{0}_{ij}$, $i=0, 1, …, m_{1}$, $j=0, 1, …, n_{1}$, 可以得到第1张迭代曲面$\mathit{\boldsymbol{S}}^{1}(u,v)=\sum\limits_{i = 0}^{{m_1}} {\sum\limits_{j = 0}^{{n_1}} } \mathit{\boldsymbol{P}}^{1}_{ij}B_{i}(u)B_{j}(v)$。重复这一过程, 可以得到不断靠近给定点集的曲面序列$\{\mathit{\boldsymbol{S}}^{k}(u, v)\}$, 且$\{\mathit{\boldsymbol{S}}^{k}(u, v)\}$的极限曲面会插值于给定的有序点集。

2.2.3 曲面的连续性

不妨假设分组之后两组相邻的点集分别为$\{\mathit{\boldsymbol{P}}_{ij}\}^{m_{1}, n_{1}}_{i=0, j=0}$$\{\mathit{\boldsymbol{Q}}_{ij}\}^{m_{2}, n_{2}}_{i=0, j=0}$(分别对应图 2中粗线左边与右边的点), 其中$n_{1}=n_{2}$。满足$\mathit{\boldsymbol{P}}_{0i}=\mathit{\boldsymbol{Q}}_{0i}$, $i=0, 1, …, n_{1}$(对应图 2中最粗的线上的点), 此时曲面${ G}^{0}$连续。调整$\mathit{\boldsymbol{Q}}_{1i}$, $i=0, 1, …, n_{1}$, 使得当给定点集作为控制顶点时, 存在$α$, $β$, $R_{i}$满足

$ \begin{array}{l} \;\;\alpha \left( {{\mathit{\boldsymbol{P}}_{\left( {{m_1} - 1} \right)i}} - {\mathit{\boldsymbol{P}}_{{m_1}i}}} \right) + \\ \beta \left( {{\mathit{\boldsymbol{Q}}_{2i}} - {\mathit{\boldsymbol{Q}}_{1i}}} \right) + {R_i} = 0 \end{array} $ (3)

图 2 曲面的分组与拼接
Fig. 2 Grouping and blending of surface

此时曲面${\rm G}^{1}$连续[16-17]。类似可得曲面${\rm G}^{2}$连续的条件[17]。每次迭代时均按照上述几何连续条件确定角点以及角点附近的点。这样整合得到的一列曲面均满足${\rm G}^{2}$连续性。

以例1为例说明运用分组渐进迭代逼近方法实现曲面${\rm G}^{2}$连续的过程。

例1用patches拟合28个数据点。用二分法对数据点集进行分组, 两组中其中一组含有16个数据点, 另一组也含有16个数据点, 两组数据点集分别记为

$ P_{00}[6, 0, 1.5];P_{01}[7, 1, 1.5];\\ P_{02}[7, 3, 1.5];P_{03}[6, 4, 1.5];P_{10}[4, 0, -1];P_{11}[4, 1, -1];\\ P_{12}[4, 3, -1];P_{13}[4, 4,-1];P_{20}[2, 0, 2];\\ P_{21}[2, 1, 2];P_{22}[2, 3, 2];P_{23}[2, 4, 2];P_{30}[0, 0, 1];\\ P_{31}[0, 1, 1];P_{32}[0, 3, 1];P_{33}[0, 4, 1]Q_{00}[6, 0, 1.5];\\ Q_{01}[7, 1, 1.5];Q_{02}[7, 3, 1.5];Q_{03}[6, 4, 1.5];\\ Q_{10}[5, 0, 4];Q_{11}[6, 1, 4];Q_{12}[6, 3, 4];Q_{13}[5, 4, 4];\\ Q_{20}[9, -2, 6];Q_{21}[11, 0, 6];Q_{22}[11, 2, 6];\\ Q_{23}[9, 4, 6];Q_{30}[2, -1, 10];Q_{31}[1, 1, 10]; $

$Q_{32}[1, 3, 10];Q_{33}[2, 4, 10].$然后用三次B样条曲面分别对每一组的数据点集进行拟合。为保证最后所得到的整合曲面的${\rm G}^{2}$连续性, 下面给出实现整合曲面${\rm G}^{2}$连续的过程。

1) 如图 3所示, 保证两曲面边界处的数据点集相同, 即$P_{0i}=Q_{0i}, i=0, 1, 2, 3$实现整合曲面${\rm G}^{0}$连续。

图 3 曲面${\rm G}^{0}$连续
Fig. 3 $G^{0 }$smooth blending

2) 如图 4所示, 通过调整的控制顶点$Q_{1j}(j=0, 1, 2, 3)$, 实现整合曲面${\rm G}^{1}$连续。

图 4 曲面${\rm G}^{1}$连续
Fig. 4 $G^{1 }$smooth blending

3) 如图 5所示, 在(2)的基础上通过调整控制顶点$Q_{2j}(j=0, 1, 2, 3)$, 实现整合曲面的${\rm G}^{2}$连续。

图 5 曲面${\rm G}^{2}$连续
Fig. 5 $G^{2 }$smooth blending

2.3 分组PIA方法的收敛性及迭代效率分析

在分组PIA方法中, 对每组中的数据点集使用的依然是PIA方法或是LSPIA方法, 这些方法的收敛性和稳定性都已经过了严格的理论证明, 所以分组PIA方法是收敛的和稳定的。

在PIA迭代过程中, 运算量主要体现于调整控制顶点时所做的加法次数与生成迭代曲线/曲面时所做的加法次数与乘法次数。而与其他PIA方法相比, 分组PIA方法在迭代时所做的加法次数不会增加, 所以下面我们仅以迭代过程中所做的乘法次数为标准来衡量分组PIA方法用曲面拟合给定点集的迭代效率。

定理  若给定有序点集为$\{\mathit{\boldsymbol{P}}_{ij}\}^{m, n}_{i=0, j=0}$, 那么分组PIA方法与未分组PIA方法相比, 若只进行一次二分法分组, 乘法次数的最高量级由${\rm O}(m^{2}n^{2})$降为${\rm O}(\frac{1}{2}m^{2}n^{2})$; 若进行$t$次二分法分组, 乘法次数的最高量级由${\rm O}(m^{2}n^{2})$降为${\rm O}({(\frac{1}{2})}^{t}m^{2}n^{2})$

证明  因为基于曲面的PIA方法, 在迭代过程中, 对于调节向量有迭代公式

$ {\Delta ^{k + 1}} = \left( {\mathit{\boldsymbol{I}} - \mathit{\boldsymbol{B}}} \right){\Delta ^k} $

式中,配置矩阵$\mathit{\boldsymbol{B}}$$\mathit{\boldsymbol{B}}_{1}$$\mathit{\boldsymbol{B}}_2$的克罗内克积(Kronecker Product)

$ \begin{array}{l} \;\;\;\;\;\;\;\;\;\mathit{\boldsymbol{B}} = {\mathit{\boldsymbol{B}}_1} \otimes {\mathit{\boldsymbol{B}}_2}\\ {\mathit{\boldsymbol{B}}_1}{\rm{ = }}\left( \begin{array}{l} {B_0}\left( {{u_0}} \right)\;\;\; \cdots \;\;\;{B_m}\left( {{u_0}} \right)\\ \;\; \vdots \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; \vdots \;\;\\ {B_o}\left( {{u_m}} \right)\;\;\; \cdots \;\;\;{B_m}\left( {{u_m}} \right) \end{array} \right)\\ {\mathit{\boldsymbol{B}}_2}{\rm{ = }}\left( \begin{array}{l} {B_0}\left( {{v_0}} \right)\;\;\; \cdots \;\;\;{B_n}\left( {{v_0}} \right)\\ \;\; \vdots \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; \vdots \;\;\\ {B_o}\left( {{v_n}} \right)\;\;\; \cdots \;\;\;{B_n}\left( {{v_n}} \right) \end{array} \right) \end{array} $

所以, 对于PIA方法, 由于配置矩阵$\mathit{\boldsymbol{B}}$$\mathit{\boldsymbol{B}}_{1}$$\mathit{\boldsymbol{B}}_2$的克罗内克积, 所以其阶数为$(m+1)×(n+1)$。这样一来, 经过一次迭代所做的乘法次数为

$ T = {\left( {m + 1} \right)^2} \times {\left( {n + 1} \right)^2} $

对于分组PIA方法, 若进行一次二分法分组, 得到两组有序数据点集。不妨设$m$为偶数, 那么以$u_{i}$, $i=0, 1, …, m$为基准进行分组, 得到两组数据点集$\{\mathit{\boldsymbol{P}}_{i_{1}, j}$, $i_{1}=0, 1, …, \left\lfloor {\frac{m}{2}} \right\rfloor $, $j=0, 1, …, n$$\{\mathit{\boldsymbol{P}}_{i_{2}, j}\}$, $i_{2}=\left\lfloor {\frac{m}{2}} \right\rfloor, …, m$, $j=0, 1, …, n$。容易计算出经过一次迭代一共所做的乘法次数为

$ {T_2} = \frac{{{m^2}{n^2} + 4m{n^2} + 4{n^2}}}{2} $

此时乘法次数的最高量级为${\rm O}(\frac{1}{2}m^{2}n^{2})$。若进行$t$次二分法分组, 得到$2^{t}$组有序数据点集。那么容易得出乘法次数的最高量级为${\rm O}((\frac{1}{2})^{t}m^{2}n^{2})$。所以分组PIA方法用曲面拟合给定点集既提高了迭代的灵活性, 还提高了迭代的效率。

2.4 算法流程

下面给出基于曲线/曲面的分组PIA方法的算法流程图(如图 6所示), 步骤如下:

图 6 分组PIA方法算法流程图
Fig. 6 Algorithm flow chart of grouped PIA method

输入:初始数据点集。

输出:一条/张插值或拟合初始数据点集的曲线/曲面。

1) 用$count$保存组数, 初始值设为1。

2) 判断数据点的个数是否满足实际需要, 若满足则跳到步骤5), 否则进行下一步。

3) 对数据点进行分组, $count$++。

4) 分别判断每一组的数据点个数是否满足实际需要, 若满足则进行下一步, 否则返回步骤3)。

5) 采用PIA方法或是基于最小二乘法的渐进迭代逼近方法。

6) 判断组数$count>1$是否成立, 若成立则进行下一步, 否则跳到步骤8)。

7) 对分组之后得到的曲线/曲面, 采用曲线/曲面拼接算法。

8) 得到插值或拟合给定点集的曲线/曲面。

3 数值实例

通过数值实例来验证本文理论推导的正确性和文中方法的有效性。

例2用三次B样条曲线拟合从恐龙轮廓曲线上采的721个数据点, 通过观察先确定数据点的分布情况,根据数据点的分布将数据点分成20组, 然后对每一组的数据点分别运用LSPIA方法画出拟合曲线(如图 7(a)-(f)), 最后整合得到完整的恐龙轮廓拟合曲线(如图 7(g))。

图 7 分组PIA方法用恐龙轮廓曲线拟合给定点集
((a) back contour curve of dinosaur; (b) chest contour curve of dinosaur; (c) foot contour curve of dinosaur; (d) head contour curve of dinosaur; (e) fin profile curve of dinosaur; (f) tail profile curve of dinosaur; (g) outline integration curve of dinosaur)
Fig. 7 The outline of a dinosaur by using grouped PIA method

例3用三次B样条曲线拟合从龙轮廓曲线上采的1 894个数据点, 通过观察数据点的分布情况,根据数据点的分布将数据点分成5组, 每组数据点的个数分别为432个、362个、372个、370个、362个, 然后对每一组的数据点分别运用LSPIA方法画出拟合曲线(如图 8(a)-(e)), 最后整合得到完整的龙轮廓拟合曲线(如图 8(f))。表 1展示的是LSPIA方法与分组LSPIA方法的拟合误差。其中误差函数为

$ e\left( k \right) = \mathop {\max }\limits_{\begin{array}{*{20}{c}} {i = 0,1, \cdots ,m}\\ {j = 0,1, \cdots ,n} \end{array}} {\kern 1pt} \left\| {P_{i,j}^0 - P_{i,j}^k} \right\| $ (7)

图 8 分组PIA方法用龙轮廓曲线拟合给定点集
((a) beard contour curve of dragon; (b) maxilla contour curve of dragon; (c) angular contour curve of dragon; (d) angular contour curve of dragon; (e) angular contour curve of dragon; (f) outline integration curve of dragon)
Fig. 8 The outline of a dragon by using grouped PIA method

表 1 LSPIA方法与分组LSPIA方法的拟合误差比较
Table 1 The comparison of errors between LSPIA method and our method

下载CSV
LSPIA方法 分组LSPIA方法
$E_{0}$ $4.818~8$ $3.627~3$
$E_{1}$ $6.495~5×10^{-1}$ $1.964~4×10^{-1}$
$E_5$ $1.854~3×10^{-1}$ $2.228~9×10^{-2}$
$E_∞$ $2.427~0×10^{-2}$ $1.375~0×10^{-2}$

$k$为迭代次数。

例4用三次B样条曲面拟合从3D mesh surface曲面上采的289个数据点。图 9是直接运用PIA方法画出的拟合曲面, 图 10图 11是分别运用二次二分法和四次二分法对数据点进行分组, 然后对每一组的数据点分别运用PIA方法画出拟合曲面, 最后整合得完整的拟合曲面。表 2展示的是分组PIA方法,在各种分组策略下的拟合误差,误差函数同例3。

图 9 PIA方法的拟合曲面
Fig. 9 3D mesh surface fitted by using PIA method ((a) 1 step; (b) 5 steps; (c) 10 steps)
图 10 运用二次二分法分组的完整拟合曲面
Fig. 10 3D mesh surface fitted by dividing data points into four groups ((a) 1 step; (b) 5 steps; (c) 10 steps)
图 11 运用四次二分法分组的完整拟合曲面
Fig. 11 3D mesh surface fitted by dividing data points into sixteen groups ((a) 1 step; (b) 5 steps; (c) 10 steps)

表 2 不同分组策略下分组PIA方法的拟合误差比较
Table 2 The comparison of errors of different kinds of grouped PIA methods

下载CSV
PIA方法 二分法 三分法 二次二分法 六分法 四次二分法
$E_0$ $6.865~6×10^{-1}$ $4.138~9×10^{-1}$ $1.100~7×10^{-1}$ $1.841~6×10^{-1}$ $1.350~0×10^{-1}$ $1.245~7×10^{-1}$
$E_1$ $3.348~7×10^{-1}$ $1.430~1×10^{-1}$ $7.552~4×10^{-2}$ $7.423~3×10^{-2}$ $5.899~1×10^{-2}$ $3.084~9×10^{-2}$
$E_5$ $8.294~6×10^{-2}$ $3.206~1×10^{-2}$ $2.314~2×10^{-2}$ $2.752~8×10^{-2}$ $1.648~8×10^{-2}$ $2.288~6×10^{-3}$
$E_{10}$ $4.093~7×10^{-2}$ $1.762~8×10^{-2}$ $8.785~0×10^{-3}$ $7.513~2×10^{-3}$ $4.708~4×10^{-3}$ $8.090~9×10^{-4}$

例5用三次B样条曲面拟合从peaks曲面上采的625数据点。图 12是直接运用PIA方法画出的拟合曲面, 图 13图 14分别用二次二分法和四次二分法对数据点进行分组, 然后对每一组的数据点分别运用PIA方法画出拟合曲面, 最后整合得完整的peaks曲面。表 3展示的是分组PIA方法,在各种分组策略下的拟合误差, 误差函数同例3。

图 12 PIA方法的拟合曲面
Fig. 12 Peaks surface fitted by using PIA method ((a) 1 step; (b) 5 steps; (c) 10 steps)
图 13 运用二次二分法分组的完整拟合曲面
Fig. 13 Peaks surface fitted by dividing data points into four groups ((a) 1 step; (b) 5 steps; (c) 10 steps)
图 14 运用四次二分法分组的完整拟合曲面
Fig. 14 Peaks surface fitted by dividing data points into sixteen groups ((a) 1 step; (b) 5 steps; (c) 10 steps)

表 3 不同分组策略下分组PIA方法的拟合误差比较
Table 3 The comparison of errors of different kinds of grouped PIA methods

下载CSV
PIA方法 二分法 三分法 二次二分法 六分法 四次二分法
$E_0$ $3.852~9$ $2.596~3$ $1.204~8$ $2.199~9$ $1.241~6$ $1.570~2$
$E_1$ $2.383~9$ $1.343~6$ $7.178~9×10^{-1}$ $6.290~8×10^{-1}$ $3.454~9×10^{-1}$ $5.493~1×10^{-1}$
$E_5$ $8.612~8×10^{-1}$ $4.292~2×10^{-1}$ $2.255~7×10^{-1}$ $2.415~7×10^{-1}$ $7.899~6×10^{-2}$ $1.185~4×10^{-1}$
$E_{10}$ $5.479~5×10^{-1}$ $2.632~7×10^{-1}$ $1.223~8×10^{-1}$ $1.287~9×10^{-1}$ $4.122~4×10^{-2}$ $3.769~2×10^{-2}$

4 结论

本文主要介绍了分组渐进迭代逼近方法, 在理论上证明了此方法能使曲面的迭代效率有所提高。文中使用了曲线(曲面)的拼接技术来保证整合曲线(曲面)的连续性。同时还展示了数值实例, 对分组LSPIA方法与LSPIA方法的误差进行了比较,并在不同的分组策略下,对分组PIA方法的迭代误差进行了比较。实验结果表明, 在相同迭代次数下, 本文方法减少了误差, 实际中还可以根据数据点分布及逼近精度调整分组细节, 更加灵活方便。

本文方法适用于拟合大规模数据点集,如果在拟合少量数据点集时使用本文方法,那么不仅算法的灵活性将受到较大的限制,而且由于拼接算法的影响,会使算法整体计算量与PIA方法相比反而增加。作为未来的工作,我们将会用本文方法研究一些复杂曲线曲面问题。

参考文献

  • [1] Qi D X, Tian Z X, Zhang Y X, et al. The method of numeric polish in curve fitting[J]. Acta Mathematica Sinica, 1975, 18(3): 173–184. [齐东旭, 田自贤, 张玉心, 等. 曲线拟合的数值磨光方法[J]. 数学学报, 1975, 18(3): 173–184. ]
  • [2] de Boor C. How does agee's smoothing method work?[R]. Washington, DC: Army Research Office, 1979: 299-302. https://www.researchgate.net/publication/266720210_How_does_Agees_smoothing_method_work
  • [3] Lin H W, Wang G J, Dong C S. Constructing iterative non-uniform B-spline curve and surface to fit data points[J]. Science in China Series:Information Sciences, 2004, 47(3): 315–331. [DOI:10.1360/02yf0529]
  • [4] Lin H W, Bao H J, Wang G J. Totally positive bases and progressive iteration approximation[J]. Computers & Mathematics with Applications, 2005, 50(3-4): 575–586. [DOI:10.1016/j.camwa.2005.01.023]
  • [5] Chen J, Wang G J, Jin C J. Two kinds of generalized progressive iterative approximations[J]. Acta Automatica Sinica, 2012, 38(1): 135–139. [陈杰, 王国瑾, 金聪健. 两类推广的渐近迭代逼近[J]. 自动化学报, 2012, 38(1): 135–139. ] [DOI:10.3724/SP.J.1004.2012.00135]
  • [6] Zhang L, Li Y Y, Yang Y, et al. Generalized progressive iterative approximation for Said-Ball bases on triangular domains[J]. Journal of Image and Graphics, 2014, 19(2): 275–282. [张莉, 李园园, 杨燕, 等. 三角域上Said-Ball基的推广渐近迭代逼近[J]. 中国图象图形学报, 2014, 19(2): 275–282. ] [DOI:10.11834/jig.20140213]
  • [7] Delgado J, Peña J M. Progressive iterative approximation and bases with the fastest convergence rates[J]. Computer Aided Geometric Design, 2007, 24(1): 10–18. [DOI:10.1016/j.cagd.2006.10.001]
  • [8] Lu L Z. Weighted progressive iteration approximation and convergence analysis[J]. Computer Aided Geometric Design, 2010, 27(2): 129–137. [DOI:10.1016/j.cagd.2009.11.001]
  • [9] Liu X Y, Deng C Y. Jacobi-PIA algorithm for non-uniform cubic B-spline curve interpolation[J]. Journal of Computer-Aided Design & Computer Graphics, 2015, 27(3): 485–491. [刘晓艳, 邓重阳. 非均匀三次B样条曲线插值的Jacobi-PIA算法[J]. 计算机辅助设计与图形学学报, 2015, 27(3): 485–491. ]
  • [10] Lin H W. Local progressive-iterative approximation format for blending curves and patches[J]. Computer Aided Geometric Design, 2010, 27(4): 322–339. [DOI:10.1016/j.cagd.2010.01.003]
  • [11] Lin H W, Zhang Z Y. An extended iterative format for the progressive-iteration approximation[J]. Computers & Graphics, 2011, 35(5): 967–975. [DOI:10.1016/j.cag.2011.07.003]
  • [12] Deng C Y, Lin H Y. Progressive and iterative approximation for least squares B-spline curve and surface fitting[J]. Computer-Aided Design, 2014, 47: 32–44. [DOI:10.1016/j.cad.2013.08.012]
  • [13] Zhang L, Ge X Y, Tan J Q. Least square geometric iterative fitting method for generalized B-spline curves with two different kinds of weights[J]. The Visual Computer, 2016, 32(9): 1109–1120. [DOI:10.1007/s00371-015-1170-3]
  • [14] Zhang L, Tan J Q, Ge X Y, et al. Generalized B-splines' geometric iterative fitting method with mutually different weights[J]. Journal of Computational and Applied Mathematics, 2018, 329: 331–343. [DOI:10.1016/j.cam.2017.05.034]
  • [15] Lin H W. Survey on geometric iterative methods with applications[J]. Journal of Computer-Aided Design & Computer Graphics, 2015, 27(4): 582–589. [蔺宏伟. 几何迭代法及其应用综述[J]. 计算机辅助设计与图形学学报, 2015, 27(4): 582–589. ]
  • [16] Che X J, Liang X Z. G1 continuity conditions of b-spline surfaces[J]. Northeastern Mathematical Journal, 2002, 18(4): 343–352.
  • [17] Gao Z H. The smooth connection algorithm between b-spline patches[D]. Changchun: Jilin University, 2004. [高占恒. B样条曲面间的光滑拼接算法[D]. 长春: 吉林大学, 2004.] http://cdmd.cnki.com.cn/Article/CDMD-10183-2004099735.htm