Print

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




    计算机图形学    




  <<上一篇 




  下一篇>> 





三次B样条插值的网格拼接和融合
expand article info 刘姝玉, 韩燮, 贾彩琴
中北大学大数据学院, 太原 030051

摘要

目的 网格模型的拼接和融合是3维模型编辑的一个重要方面。为了提高3维模型之间拼接曲面的精度和效率,提出一种基于三次均匀B样条曲线曲面的网格融合方法。方法 首先,利用协变分析和数据驱动方法在目标模型上选定融合区域、确定要融合模型的大小及方向;其次,根据选定的3维网格模型,确定待拼接区域的边界,识别并记录边界点集,利用三次B样条插值边界点集;然后,对边界曲线进行双三次B样条曲面插值得到拼接区域连续曲面,并以此作为两模型拼接时的过渡面;最后,对拼接区域重采样,并对其三角化,以实现网格模型的无缝光滑拼接和融合。结果 为了验证本文方法对3维模型拼接的有效性,选取4组不同的模型,分别对其使用本文提出的融合拼接方法进行实验,对前两组模型的拼接效果进行了对比试验,实验结果表明,本文方法可以达到很好的拼接效果,对于融合区域以外的部分能够保持源模型的细节特征,拼接部分的过渡区域光顺平滑,拼接后的模型完整性佳。在运行时间相差0.05 s内,与数据驱动的建模方法相比,本文方法可以处理的节点数至少多2 000个,面片数至少多5 000个。结论 本文方法能够适用于具有任何边界的模型,在选取模型时,对于模型的形状、大小、拓扑结构等的要求较低,适用于新模型的快速建造,因此,该算法可应用于医学、商业广告、动画娱乐以及几何建模和制造等较为广阔的应用领域。

关键词

3维重组; 网格拼接; 网格融合; 三次B样条; 曲线曲面

Cubic B-spline-interpolation-based mesh splicing and fusion
expand article info Liu Shuyu, Han Xie, Jia Caiqin
School of Data Science and Technology, North University of China, Taiyuan 030051, China
Supported by: National Natural Science Foundation of China(61672473, 61379080)

Abstract

Objective 3D reconstruction has attracted considerable attention in the editing operation of 3D models. Various applications, such as 3D model registration, classification and retrieval, segmentation, reconstruction and modeling, guiding model editing, and automatic model synthesis, can benefit from 3D reconstruction. Mesh model is a mainstream 3D model. The editing and transforming of existing 3D models are an important method used to improve the model and to rapidly acquire new models. The technology of mesh mosaic fusion is a commonly used method in acquiring a new model. The fusion and splicing of the mesh can also be called the technology of mesh reconstruction. Graphs and images have widely appeared in daily life with the development of the society. The rapid and easy acquisition of new image models, the rapid reconstruction of existing models, and other issues play a dominant role in the field of graphic processing with the development of corresponding hardware technologies. Spline interpolation is an interpolation method that is commonly used in the industry to obtain a smooth curve. B-spline interpolation is a widely applied method. B-spline interpolation possesses powerful functions in representing and designing curves and surfaces, and is a mainstream method used in mathematical shape description. Therefore, in this study, we utilize the advantage of B-spline interpolation in dealing with boundary curves and surfaces and apply it to the mesh model splicing and interpolate model boundary to achieve the high integrity of grid models with various boundary conditions. In addition, the splicing transition can be sufficient to achieve the high integrity of the new model. The existing 3D model splicing fusion methods, which pursue several certain splicing results, may cause problems, such as large calculation amount, low splicing precision, and program redundancy. To improve the visual appearance of a synthetic model in terms of its continuity and flexibility, the splicing result at the joint is smoothened and the precision and efficiency of the spliced surface between the 3D models are improved. In this study, a mesh fusion method based on three uniform B-spline curves and surfaces is proposed. Method First, the region of interest is selected on the source model, the fusion region is selected on the target model by using the co-variation analysis and data-driven method, and the size and direction of the model to be merged are determined. Second, on the basis of the selected 3D mesh model, the boundary and adjacent curve of the area to be spliced between the source model and target model are determined, respectively. The points of the boundary and adjacent curve are also identified and recorded. In the set, a cubic B-spline is used to interpolate the boundary point and adjacent curve point sets of the source and target models. Subsequently, four cubic B-spline interpolation curves are obtained. Third, the boundary surface curve is interpolated by bi-cubic B-spline surfaces to obtain the continuous surface of the stitched area, which is used as the transition surface when the two models are spliced. Finally, the spliced area is resampled and triangulated by using a Laplacian smoothing algorithm to smooth the spliced regions to achieve seamless smooth splicing and fusion of mesh models. Results To verify the effectiveness of proposed method for the 3D model splicing, four different models were selected for the experiments, and the splicing result of the first two models were selected for comparison. The proposed fusion splicing method was used on the selected models. The experimental results showed that the proposed method can achieve remarkable results. The splicing effect can maintain the detailed features of the other parts of the source model, the spliced model shows good integrity, and a good result of smooth processing of the transition region of the spliced portion can be obtained. Compared with the data-driven modeling method, the proposed method can process at least 2 000 nodes and 5 000 patches within 0.05 s. Conclusion The proposed B-spline curve interpolation model is suitable with any boundary conditions and does not require to deal with the boundary of the model. Thus, considerable attention can be paid on the splicing of the model. The splicing area is resampled using the control points that generate and mesh the cubic B-spline surface. This method can improve the efficiency and reduce the computational complexity. Meanwhile, the proposed method can obtain the smooth splicing area. The shape, size, and topology requirements are low in selecting models. Therefore, the algorithm can be applied to medicine, commercial advertising, animation and entertainment, teaching models, geometric modeling, and manufacturing. This algorithm has a good effect on grid fusion and can be used for the rapid construction of new models.

Key words

3D restruction; mesh splicing; mesh merging; cubic B-spline; curve and surface

0 引言

随着现代化制造技术的不断进步,3维重组作为3维模型编辑操作中一个研究的热点,俨然已越来越受到重视[1-4]。它可以受益于各种应用,如3维模型配准、分类、检索、分割、重建和建模,引导模型编辑和模型自动合成。点云模型和网格模型是目前主流的3维模型表现方式。针对点云模型拼接技术的研究,有文献[5-6]采用径向基函数法生成过渡曲面,文献[7]的布尔运算法等,但在拼接模型时,点云模型的待拼接区域特征不易提取且计算量太大,所以现有模型拼接融合算法大部分针对的是网格模型。

2009年,Yang等人[8]使用最小二乘法实现了获取模型和设计模型几何之间的直接布尔交集,而不需要模型转换。2011年,王卫红等人[9]利用RBF(radial basis function)隐函数表示切割转化后的点模型,并把布尔运算生成的曲面三角化后得到网格模型,但该方法需要将模型在3维与2维曲面间多次转换。同年,Takayama等人[10]在不考虑模型相对位置的前提下,对网格拼接技术进行了改进,本文也受到此方法的启发。2012年,Deng等人[11]提出了一种原网格与平均值坐标合并的网格拼接方法,计算源网格和目标网格两个边界之间的差异,通过MVC(mean value coordinates)内插边界差来获得整个区域的差异,将这些差异添加到源网格上以形成新的网格融合。2013年,缪永伟等人[12]将二次B样条应用于插值边界点集,并利用Hermite插值技术获取待拼接的连续曲面。从而进行光滑的网格模型拼接融合操作。但是,当边界间存在较大空隙时,模型的细节特征将得不到保留。2014年,Alhashi等人[13]引入了一种通过拓扑变化的形状混合算法生成新的3维模型,这是一种以结构为向导的技术,然而该方法受限于模型的分割和模型的部分对应。虽然3D建模的精度低于实际的手动过程,但可以降低成本并缩短开发的过程,Li等人[14]在2017年提出了一种自动3D模型建造的编辑框架,该框架利用相对全局定位以及曲面网格的局部融合方法,并将其应用于服装造型设计领域。然而,上述方法仅仅追求某个方面的拼接结果,这就可能出现计算量大,拼接精度低,程序冗余等问题。为了提高合成模型的视觉外观,考虑到模型外观的连续性和灵活性,防止拼接结果在拼接处不够平滑,提出了本文方法。

本文提出一种新的网格融合方法,利用三次B样条的优势,在编辑曲面造型时,可以更加灵活。基本思想是:在确定融合模型及其待融合区域后,利用三次B样条曲线和双三次B样条曲面先后分别插值待拼接区域的边界点集和边界曲线,得到拼接曲面,其后,利用重采样的方法对拼接区域进行三角化。实验结果表明,本文方法对于绝大部分模型边界具有普适性,且能够无缝光滑地将两个网格模型拼接融合在一起,此外,对于融合区域外的部分,该方法能够较完整地保留源模型的细节特征。

1 相关工作

1.1 系统工作流程

本文实验的工作流程如图 1所示。导入源模型$A$和目标模型$B$,在$A$上选择所需要的部分进行复制并确定方向,在模型$B$上选择要融合的部位,根据$A$选择的部分在$B$上自动生成部分区域及方向,将复制的模型$A$的部分融合在$B$上。最终生成新模型。

图 1 系统工作流程图
Fig. 1 The workflow of the system

1.2 3维模型的选取

3维网格模型以其很好的灵活性成为当前主流的3维离散数字模型的代表。在过去,大部分关于网格拼接的研究为了达到平滑处理拼接结果的目标,其工作都集中于源和目标网格的详细信息中;而现在,随着计算机存储设备的不断发展,可以兼顾网格模型的存储简便与低冗余度,这就使得三角网格模型更易获取和操作。

现有模型$A$与模型$B$,并将二者置于一起,若想利用二者无缝组合成新模型或利用二者的某部分组成新模型,则需要拖动模型$A$的边界并使其黏附到模型$B$的表面。然而,这样的做法使得模型$A$的特征被扭曲,从而导致模型$A$变形,这种模型特征错误的变化实际上来自于$A$边界的延伸。当在物体的一个点进行拉伸时,受力点以及其相邻部分会因为力的作用导致形变。本文方法即基于保留源模型特征的要求所提出的。

不同于2维图像编辑,本文选取的3维模型中源模型与目标模型没有任何联系。由此,本文方法对拼接边界没有限制。

1.3 三次B样条曲线曲面插值

工程中应用最为广泛的曲面片是由两个三次参数($u$$v$)定义的曲面片,称为双三次曲面片[15]

1.3.1 三次B样条曲线插值

给定$m$+$n$+1个控制点$P_h$($h$=0, 1, 2, …, $m$+$n$),$n$次B样条曲线段的参数表达式为

$ {p_{i, n}}\left( t \right) = \sum\limits_{k = 0}^n {{P_{i + k}}{N_{k, n}}\left( t \right), t \in \left[{0, 1} \right]} $ (1)

式中,$K_{k, n}$$(t)$$n$次B样条基函数,其形式为

$\begin{array}{l} {N_{k, n}}\left( t \right) = \frac{1}{{n!}}\sum\limits_{j = 0}^{n - k} {{{\left( { - 1} \right)}^j}C_{n + 1}^j{{\left( {t + n - k - j} \right)}^n}} \\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;C_{n + 1}^j = \frac{{\left( {n + 1} \right)!}}{{j!\left( {n + 1 - j} \right)!}} \end{array} $

式(1)为$n$次B样条曲线的第$i$段曲线($i$=0, 1, 2, …, $m$)。连接全部曲线段($m$+1段)所组成的整条曲线称为$n$次B样条曲线。依次用线段连接控制点$P_{i+k}$($k$=0, 1, 2, …, $n$)组成的多边形称为B样条曲面在第$i$段的控制多边形。

由于$n$次B样条曲线可以达到$n$-1阶连续性,在工程设计中,三次均匀B样条曲线的应用较为广泛。三次均匀B样条曲线的$n$=3, $k$=0, 1, 2, 3。控制多边形有4个控制点$P_0$$P_1$$P_2$$P_3$。三次均匀B样条曲线是三次多项式

$ \begin{array}{l} {N_{0, 3}}\left( t \right) = \frac{1}{6}( - {t^3} + 3{t^2} - 3t + 1)\\ {N_{1, 3}}\left( t \right) = \frac{1}{6}(3{t^3} - 6{t^2} + 4)\\ {N_{2, 3}}\left( t \right) = \frac{1}{6}( - 3{t^3} + 3{t^2} + 3t + 1)\\ {N_{3, 3}}\left( t \right) = \frac{1}{6}{t^3} \end{array} $ (2)

由此,三次均匀B样条曲线的表达式可以表示成

$ \begin{array}{l} \;\;\;\;\;\;\;\;\;\;\;\;{p_{i, 3}}\left( t \right) = \sum\limits_{k = 0}^3 {{P_{i + k}}{N_{k, 3}}\left( t \right)} = \\ {P_i} \cdot {N_{0, 3}}\left( t \right) + {P_{i + 1}} \cdot {N_{1, 3}}\left( t \right) + {P_{i + 2}} \cdot {N_{2, 3}}\left( t \right) + \\ \;\;\;\;\;\;\;\;\;\;{P_{i + 3}} \cdot {N_{3, 3}}\left( t \right), i = 0, 1, 2, \cdots, m \end{array} $ (3)

一般来说构造的曲线不一定是封闭曲线,取最后一个控制顶点与第一个顶点相同$P_{m+1}$=$P_{0}$,同时多取两个控制顶点$P_{m+2}$=$P_{1}$$P_{m+3}$=$P_{2}$即可构造封闭曲线。如图 2所示。

图 2 三次B样条闭合曲线
Fig. 2 Cubic B-spline closure curve

本文方法首先需要根据选取的模型融合区域的边界提取一组顶点$Q_i$($i$=0, 1, 2, …, $m$, $m$ > 3),过这组顶点构造一条插值三次均匀B样条曲线。这样,就需要通过这些顶点反求三次均匀B样条曲线的控制点$P_1$$P_2$$P_3$,…,$P_m$。利用文献[16]中提供的方法可以求得这些控制点,进而求得插值三次均匀B样条曲线。

1.3.2 三次B样条曲面插值

给定空间中$\left( {m + 1} \right) \times \left( {n + 1} \right)$个控制点${P_{i, j}}\left( {i = 0, 1, \cdots, m;j = 0, 1, \cdots, n} \right)$$m \times n$次B样条曲面的定义为

$ \begin{array}{l} p\left( {u, v} \right) = \sum\limits_{i = 0}^m {\sum\limits_{j = 0}^n {{P_{i, j}}{N_{i, m}}\left( u \right){N_{j, n}}\left( v \right)} } \\ \;\;\;\;\;\;\;\;\left( {u, v} \right) \in \left[{0, 1} \right] \times \left[{0, 1} \right] \end{array} $ (4)

式中,${P_{i, j}}\left( {i = 0, 1, \cdots, m;j = 0, 1, \cdots, n} \right)$$\left( {m + 1} \right) \times \left( {n + 1} \right)$个控制点。${{N_{i, m}}\left( u \right)}$${{N_{j, n}}\left( v \right)}$$m \times n$次B样条基函数。

依次用线段连接点列${P_{i, j}}\left( {i = 0, 1, \cdots, m;j = 0, 1, \cdots, n} \right)$中相邻两点所形成的空间网格称为控制网格。如果取$m$=$n$=3,则由4×4=16个顶点构成控制网格,该控制网格相应的曲面称为双三次B样条曲面。

由式(4),双三次B样条曲面的展开式为

$ \begin{array}{l} p\left( {u, v} \right) = \left[{{N_{0, 3}}\left( u \right){\rm{ }}{N_{1, 3}}\left( u \right){\rm{ }}{N_{2, 3}}\left( u \right){\rm{ }}{N_{3, 3}}\left( u \right)} \right] \cdot \\ \;\;\;\;\;\;\;\;\;\;\left[{\begin{array}{*{20}{c}} {{P_{0, 0}}}&{{P_{0, 1}}}&{{P_{0, 2}}}&{{P_{0, 3}}}\\ {{P_{1, 0}}}&{{P_{1, 1}}}&{{P_{1, 2}}}&{{P_{1, 3}}}\\ {{P_{2, 0}}}&{{P_{2, 1}}}&{{P_{2, 2}}}&{{P_{2, 3}}}\\ {{P_{3, 0}}}&{{P_{3, 1}}}&{{P_{3, 2}}}&{{P_{3, 3}}} \end{array}} \right] \cdot \left[\begin{array}{l} {N_{0, 3}}\left( v \right)\\ {N_{1, 3}}\left( v \right)\\ {N_{2, 3}}\left( v \right)\\ {N_{3, 3}}\left( v \right) \end{array} \right] \end{array} $

式中,${N_{0, 3}}\left( u \right)$${N_{1, 3}}\left( u \right)$${N_{2, 3}}\left( u \right)$${N_{3, 3}}\left( u \right)$${N_{0, 3}}\left( v \right)$${N_{1, 3}}\left( v \right)$${N_{2, 3}}\left( v \right)$${N_{3, 3}}\left( v \right)$是三次B样条基函数。

图 3可以看出,双三次B样条曲面是由三次均匀B样条曲线交织而成。曲面生成时可以先固定$u$,变化$v$得到一簇三次均匀B样条曲线,然后固定$v$,变化$u$得到另一簇三次均匀B样条曲线。可以将前面插值三次均匀B样条得到的曲线作为$u$方向的簇,这样只需求$v$方向的簇,以求得三次B样条插值曲面。如图 3所示,是16个控制点的双三次B样条曲面。

图 3 16个控制点的双三次B样条曲面
Fig. 3 Bicubic B-spline surfaces with 16 control points

2 算法设计与实现

2.1 算法设计

本文在选取目标模型区域和融合模型大小上使用了协变分析工具和数据驱动方法。为了使网格模型的拼接区域达到连续、光滑的效果,本文首先利用三次B样条曲线插值待拼接区域边界,随后对生成的插值曲线进行三次B样条曲面插值,得到拼接区域,对该区域网格化、光顺处理。图 4给出了本文算法的流程图。

图 4 本文算法流程图
Fig. 4 The algorithm process

2.2 区域选择

对于大部分模型融合操作,要融合的模型大小和方向都是由用户手动调整,为了操作更灵活便捷,借鉴文献[17]中的协变分析工具和数据驱动的方法确定目标模型拼接区域大小和方向,可以将源模型待拼接区域的大小进行自动调整,以适应目标模型的拼接区域,做到合理拼接。

当用户编辑模型某区域时,设置该区域的属性$\mathit{\boldsymbol{X}}$={$\mathit{\boldsymbol{x}}_1$$\mathit{\boldsymbol{x}}_2$,…,$\mathit{\boldsymbol{x}}_n$,($k$ > 0)},这些属性表示模型的每个部分的几何形状,并将这些形状进行抽象表示,诸如边界框尺寸,边界框中心等。系统会自动将编辑结果所得到的属性值传递到其他属性$\mathit{\boldsymbol{V}}_\mathit{\boldsymbol{x}}$,这是属性$\mathit{\boldsymbol{V}}$中来自于$\mathit{\boldsymbol{X}}$的一组变量,用这种方法编辑得到的模型属性是全局有效的。将$\mathit{\boldsymbol{X}}$作为约束条件,$\mathit{\boldsymbol{V}}_\mathit{\boldsymbol{x}}$作为自由变量。由此,可以得到条件概率$P$($\mathit{\boldsymbol{V}}_\mathit{\boldsymbol{x}}$|$\mathit{\boldsymbol{X}}$=$\mathit{\boldsymbol{x}}$)最大化的问题,该问题等价于在约束条件不变的情况下,找到一个自由变量可以使得联合概率$P$($\mathit{\boldsymbol{V}}$)最大。即在源模型所选区域的区域属性值不变的情况下,得到目标模型区域融合最好的部分。定义$\mathit{\boldsymbol{U}}$是已经更新的一组变量集合,$\mathit{\boldsymbol{F}}$是需要更新的一组变量集合。$\mathit{\boldsymbol{N}}_\mathit{\boldsymbol{x}}$是覆盖范围内的属性值,$\mathit{\boldsymbol{x}}'$$\mathit{\boldsymbol{x}}$的最优值。该算法分两步,描述如下:

输入:所有变量$\mathit{\boldsymbol{V}}$的集合和约束$\mathit{\boldsymbol{X}}$的列表。$\mathit{\boldsymbol{U}}=\mathit{\boldsymbol{X}}$$\mathit{\boldsymbol{F}}=\mathit{\boldsymbol{V}}_\mathit{\boldsymbol{x}}$

1) 正向传递。以已经修正过的自由变量的值为基础,顺序更新自由变量的值。

while $\mathit{\boldsymbol{F}}$是非空集合

{ $\mathit{\boldsymbol{X}}_0=\mathit{\boldsymbol{U}}$

for $\mathit{\boldsymbol{x}} \in {\mathit{\boldsymbol{N}}_{{\mathit{\boldsymbol{x}}_0}}} \cap \mathit{\boldsymbol{F}}$

{

$\mathit{\boldsymbol{x}}' = {\rm{argma}}{{\rm{x}}_x}P(\mathit{\boldsymbol{x}}|N{' _x})$, $N{' _x}$的值已估计;

$\mathit{\boldsymbol{x}} = \mathit{\boldsymbol{x}}' $

$\mathit{\boldsymbol{U}} = \mathit{\boldsymbol{U}} \cup \{ \mathit{\boldsymbol{x}}\} $

}

$\mathit{\boldsymbol{F}}:\mathit{\boldsymbol{F}}=\mathit{\boldsymbol{F}}-\mathit{\boldsymbol{U}}$中删除新编辑的变量;

}

2) 整体优化。依次遍历所有自由变量,并优化它们的值。

repeat

if $\mathit{\boldsymbol{x}} \in {\mathit{\boldsymbol{V}}_x}$

{

$ \mathit{\boldsymbol{x}}' = {\rm{arg}}\;{\rm{ma}}{{\rm{x}}_x}P(\mathit{\boldsymbol{x}}|\mathit{\boldsymbol{N}}{ _x})$

$\mathit{\boldsymbol{x}} = \mathit{\boldsymbol{x}}' $

}

until:所有变量的变化小于阈值0.01。

图 5所示,先在源模型上选择感兴趣的区域,然后确定目标模型上要拼接的区域的大小及方向。由于模型是网格的,所以源模型和目标模型的所选区域不会完全一样。源模型的部分会根据所选位置的大小和方向自动调整以适应目标模型。

图 5 目标模型区域选择
Fig. 5 Target model area selection
((a)source model area; (b) target model area; (c) result)

2.3 算法实现

该方法的具体实现步骤如下:

输入:源模型$A$和目标模型$B$

输出:新模型。

1) 识别边界点集。在源模型$A$上选择要融合的区域,利用文献[18]方法识别选取模型区域的边界$\mathit{\boldsymbol{s}}_{11}$,以及相邻边界$\mathit{\boldsymbol{s}}_{12}$,分别记录它们的点集$\mathit{\boldsymbol{V}}_{11}$$\mathit{\boldsymbol{V}}_{12}$

2) B样条曲线插值。对边界点集$\mathit{\boldsymbol{V}}_{11}$$\mathit{\boldsymbol{V}}_{12}$利用1.3节中的方法插值三次均匀B样条曲线,便在模型$A$上形成两条三次均匀B样条曲线$\mathit{\boldsymbol{S}}_{11}$$\mathit{\boldsymbol{S}}_{12}$

在目标模型$B$上用2.2节中的方法自动生成融合区域。重复步骤1)和步骤2),得到边界$\mathit{\boldsymbol{s}}_{21}$$\mathit{\boldsymbol{s}}_{22}$,及相应点集$\mathit{\boldsymbol{V}}_{21}$$\mathit{\boldsymbol{V}}_{22}$,生成三次B样条插值曲线$\mathit{\boldsymbol{S}}_{21}$$\mathit{\boldsymbol{S}}_{22}$。定义曲线的切线方向,将源模型的切线方向定义为模型向外,目标模型的切线方向定义为模型向内,这样保证了4条三次均匀B样条曲线的切线方向是一致的,定义为$u$方向。将调整好的源模型部分复制到指定位置。

3) B样条曲面插值。将$\mathit{\boldsymbol{S}}_{11}$$\mathit{\boldsymbol{S}}_{12}$$\mathit{\boldsymbol{S}}_{21}$$\mathit{\boldsymbol{S}}_{22}$作为$v$方向的簇,固定$u$方向,变化$v$方向,计算得到$u$方向的簇,交织而成一张插值双三次B样条曲面。

4) 三角网格化。本文结果是网格模型,为此,要将融合区域网格化。对在第3)步中利用交织而成的簇得到的控制点进行重采样,将之前记录的边界点集和重采样得到的点进行三角网格化,这样,两模型就可以连续地拼接成新的三角网格模型。若新生成的模型未达到预期结果,拼接区域有偏差,可重复上述步骤。否则,进行以下步骤。

5) 光顺处理。为了新生成模型的拼接区域看起来过渡自然,最后,本文采用Laplacian平滑算法对该区域进行光顺处理,使模型光滑拼接。

3 实验结果与分析

3.1 实验结果

为了证明本文提出的利用B样条曲线曲面对3维网格模型进行的拼接和融合操作的有效性,该方法已经在Win7 64位的操作系统,Visual Studio 2015平台上,采用C++语言编程并结合OpenGL得以实现。

基于以上实验平台,选取4组模型进行实验,将其分别设置为源网格模型与目标网格模型。并控制源网格模型、目标网格模型和源网格模型待拼接部分的顶点数和面片数,记录运行时间。图 6-图 9分别展示了利用本文方法对模型所进行的融合操作。图 6(a)(b)分别为鲨鱼和马的原始模型,分别选择鲨鱼的3个鳍,将其分别融合在马的背部和身体的两侧,图 6(c)为融合结果。图 7(a)(b)分别为茶壶和熊的原始模型,选择茶盖的钮,将其融合在熊的臀部,选择茶壶的嘴,融合在熊的脸部,图 7(c)为融合结果。图 8(a)(b)分别是女孩半身像和杯子的原始模型,选择女孩的辫子区域,将其融合在杯身上,记为1,将杯子改变方向,在杯身上融合第2个女孩的辫子,记为2,图 8(c)为融合结果。图 9(a)(b)分别是女孩半身像和猫模型的原始模型,选择女孩的辫子区域,将其融合在猫模型的头部,图 9(c)为融合结果。从图 8图 9中能够明显地看出模型的拼接处头发的细节仍然保留。实验结果表明利用本文所提出的方法进行模型的拼接和融合后,除拼接处以外的部分能够完整地保留源模型的细节特征。

图 6 鲨鱼和马模型的融合
Fig. 6 Fusion between shark and horse model
((a)source model; (b) target model; (c) fusion result)
图 7 茶壶和熊模型的融合
Fig. 7 Fusion between teapot and bear model
((a)source model; (b) target model; (c) fusion result)
图 8 女孩头发和杯子模型的融合
Fig. 8 Fusion between girl's hair and cup model
((a)source model; (b) target model; (c) fusion result)
图 9 女孩辫子和猫模型的融合
Fig. 9 Fusion between bun and cat model
((a)source model; (b) target model; (c) fusion result)

3.2 结果分析与比较

图 6图 7中的模型使用文献[10]中的方法进行了拼接操作,结果如图 10所示,图 10(a)图 6中的模型的拼接结果,图 10(b)图 7中的模型的拼接结果,从图 10中能够很容易地看出模型拼接处有明显的凹陷或变形。本文方法与之相比较后发现,本文方法有较好的平滑拼接效果,拼接处过渡自然,没有明显的变形区域。

图 10 利用文献[10]方法的拼接结果
Fig. 10 Fusion results using method in reference [10]
((a) fusion result of the model in figure 6; (b) fusion result of the model in figure 7)

将本文方法与文献[14]中数据驱动的建模方法进行比较。表 1展示了图 6-图 9运行时的数据参数,包括源模型、源模型待拼接区域以及目标模型的顶点数和面片数,本文方法的运行时间。运行时间会随着模型的顶点数和面片数的增加而增加,顶点数和面片数相近的模型,运行时间会随着模型的复杂程度加大而增加。与文献[14]选用的模型相比,本文所用模型比较复杂。对于模型拼接区域的边界,本文方法适用于任何边界的模型,而文献[14]中的方法要求源模型和目标模型的边界相似且都近似为圆形。当模型的顶点数和面片数很小时,文献[14]中的方法用时很短,但随着模型顶点数和面片数的增加,它的时间也急剧增加,相较之下,本文方法的运行时间增加并不十分明显。从表 2中数据可以看出在运行时间相差在0.05 s内,本文方法可以处理的节点数比文献[14]至少多2 000个,面片数至少多5 000个。由此,本文方法不仅适用于数据量较大的模型拼接,同时也适用于更为广泛的拼接模型区域类型的拼接。

表 1 模型参数和算法的运行时间
Table 1 The run time of different parameters of algorithms

下载CSV
模型 源网格 源网格待拼接部分 目标网格 运行时间/s
顶点数 面片数 顶点数 面片数 顶点数 面片数
背部鳍 223 420 0.122
图 6 左侧鳍 5 000 9 992 281 528 5 000 9 996 0.132
右侧鳍 285 543 0.122
图 7 5 600 11 200 450 868 3 000 5 996 0.140
壶嘴 917 1 776 0.167
图 8 1 10 000 19 996 1 222 2 342 5 000 10 000 0.226
2 0.261
图 9 5 000 9 996 1 040 2 000 5 000 10 000 0.213

表 2 本文与文献[14]运行时间比较
Table 2 The run time between methods in reference [14] and this paper

下载CSV
文献[14] 本文
顶点总数 面片总数 运行时间/s 顶点总数 面片总数 运行时间/s
7 483 14 742 0.104 8 600 17 196 0.153
6 430 12 494 0.209 15 000 29 996 0.243
7 483 14 742 0.104 10 000 19 988 0.125

4 结论

本文利用三次B样条在曲线曲面方面的优势,提出了一种新的网格拼接融合方法,该方法能够实现拼接区域的光滑处理。首先使用协变分析工具确定融合区域的大小,利用三次B样条插值待编辑区域的边界点集,插值边界曲线,生成过渡曲面。B样条曲线插值模型边界的使用,使得具有任意边界情形的模型都适用,不需再对模型的边界做过多的处理。因为本文是对网格模型的拼接融合,所以将模型融合以后,利用生成三次B样条曲面的控制点对拼接区域重采样并将其三角网格化,得到最终的网格模型,这种方法既可以提高工作效率又可以降低计算复杂度。并且本文方法是在模型的局部区域做拼接融合,保证了其他区域在融合前后模型的细节特征不变。从上述实验结果中可以看出,本文方法在3维模型编辑方面有很好的效果,可以在模型短缺的情况下快速生成新模型。

参考文献

  • [1] Wuttke S, Perpeet D, Middelmann W. Quality preserving fusion of 3D triangle meshes[C]//Proceedings of the 201215th International Conference on Information Fusion. Singapore: IEEE, 2012: 1476-1481. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6289982
  • [2] Wei X M, Chen L, Gao C W. Automatic mesh fusion for dental crowns and roots in a computer-aided orthodontics system[C]//Proceedings of the 20158th International Conference on Biomedical Engineering and Informatics. Shenyang: IEEE, 2015: 280-290.[DOI: 10.1109/BMEI.2015.7401516]
  • [3] Liu H, Xia J Z, Chen J E, et al. Detection of hierarchical intrinsic symmetry structure in 3D models[J]. Computers & Graphics, 2018, 70: 8–16. [DOI:10.1016/j.cag.2017.07.035]
  • [4] Ibrahim M, Yan D M. Fold and fit:space conserving shape editing[J]. Computers & Graphics, 2018, 70: 316–326. [DOI:10.1016/j.cag.2017.08.002]
  • [5] Zou W H, Ding Z, Ye X Z, et al. Interactive point cloud blending by drag-and-drop[J]. Journal of Zhejiang University-Science A, 2007, 8(10): 1633–1641. [DOI:10.1631/jzus.2007.A1633]
  • [6] Sun J H. Research on key technologies of point cloud segmentation and fusion[D]. Nanjing: Nanjing University of Aeronautics and Astronautics, 2013. [孙金虎.点云模型分割与融合关键技术研究[D].南京: 南京航空航天大学, 2013.] http://cdmd.cnki.com.cn/Article/CDMD-10287-1014060776.htm
  • [7] Yang Z Y, Zheng W T, Peng Q S. Interactive boolean operations on general point models[J]. Journal of Computer-Aided Design & Computer Graphics, 2005, 17(5): 954–961. [杨振羽, 郑文庭, 彭群生. 一般点模型的交互式布尔运算[J]. 计算机辅助设计与图形学学报, 2005, 17(5): 954–961. ] [DOI:10.3321/j.issn:1003-9775.2005.05.012]
  • [8] Yang P H, Qian X P. Direct boolean intersection between acquired and designed geometry[J]. Computer-Aided Design, 2009, 41(2): 81–94. [DOI:10.1016/j.cad.2008.12.006]
  • [9] Wang W H, Qin X J. Bending algorithm for mesh models[J]. Journal of Chinese Computer Systems, 2011, 32(6): 1113–1117. [王卫红, 秦绪佳. 一种网格融合算法[J]. 小型微型计算机系统, 2011, 32(6): 1113–1117. ]
  • [10] Takayama K, Schmidt R, Singh K, et al. GeoBrush:interactive mesh geometry cloning[J]. Computer Graphics Forum, 2011, 30(2): 613–622. [DOI:10.1111/j.1467-8659.2011.01883.x]
  • [11] Deng Z J, Chen G Y, Wang F W, et al. Mesh merging with mean value coordinates[C]//Proceedings of the 20124th International Conference on Digital Home. Guangzhou: IEEE, 2012: 278-282.[DOI: 10.1109/ICDH.2012.31]
  • [12] Miao Y W, Lin H B, Shou H H. Mesh stitching and fusion based on Hermite interpolation scheme[J]. Journal of Image and Graphics, 2013, 18(12): 1651–1659. [缪永伟, 林海斌, 寿华好. 基于Hermite插值的网格拼接和融合[J]. 中国图象图形学报, 2013, 18(12): 1651–1659. ] [DOI:10.11834/jig.20131214]
  • [13] Alhashim I, Li H H, Xu K, et al. Topology-varying 3D shape creation via structural blending[J]. ACM Transactions on Graphics, 2014, 33(4): #158. [DOI:10.1145/2601097.2601102]
  • [14] Liu L, Su Z, Fu X D, et al. A data-driven editing framework for automatic 3D garment modeling[J]. Multimedia Tools and Applications, 2017, 76(10): 12597–12626. [DOI:10.1007/s11042-016-3688-4]
  • [15] Kong L D. Computer Graphics:Based on MFC 3D Graphics Development[M]. Beijing: Tsinghua University Press, 2014. [ 孔令德. 计算机图形学——基于MFC三维图形开发[M]. 北京: 清华大学出版社, 2014.]
  • [16] Karim S A A, Pang K V, Saaban A. Positivity preserving interpolation using rational bicubic spline[J]. Journal of Applied Mathematics, 2015, 2015: #572768. [DOI:10.1155/2015/572768]
  • [17] Laga H, Tabia H. Modeling and exploring co-variations in the geometry and configuration of man-made 3D Shape families[J]. Computer Graphics Forum, 2017, 36(5): 13–25. [DOI:10.1111/cgf.13241]
  • [18] Xie Q R, Geng G H. Research on hole-filling algorithm for 3D models[J]. Application Research of Computers, 2013, 30(10): 3175–3177. [谢倩茹, 耿国华. 三维模型孔洞修补方法的研究[J]. 计算机应用研究, 2013, 30(10): 3175–3177. ] [DOI:10.3969/j.issn.1001-3695.2013.10.074]