|
发布时间: 2018-04-16 |
GDC 2017会议专栏 |
|
|
收稿日期: 2017-07-04; 修回日期: 2017-09-24
基金项目: 浙江省自然科学基金项目(LY15F020024);浙江省文物局基金项目(2014014)
第一作者简介:
潘翔(1977-), 男, 教授, 博士生导师, CCF会员, 2005年于浙江大学获计算机应用专业博士学位, 主要研究方向为计算机图形学。E-mail:panx@zjut.edu.cn.
中图法分类号: TP391.41
文献标识码: A
文章编号: 1006-8961(2018)04-0564-08
|
摘要
目的 逆向工程中3维扫描数据通常产生孔洞影响逆向造型精度.针对已有算法补洞会导致的边界突变问题,提出基于插值细分和基于径向基函数的孔洞修复算法。方法 首先,对有噪声孔洞边界进行拉普拉斯平滑预处理;其次,通过快速重心插值细分孔洞;然后,结合孔洞周围曲率信息,利用边界和法线约束点进行隐式曲面求解;最后,利用求得的隐式曲面方程,利用梯度下降法调整孔洞插值点,获得平滑修补孔洞结果。结果 对3维经典造型以及实际机械工件等两类不同的数据进行扫描并进行孔洞修补实验。由于算法针对有噪声孔洞结合了孔洞周围曲率信息并通过插值细分进行约束求解,保证了补洞效果的平滑性。实验结果表明,本文算法使得基于径向基函数隐式曲面对有噪声孔洞的适应性更强,其修补结果更加平滑,符合周围曲率变化,改进了已有孔洞修补的边缘突变和修补痕迹明显问题。结论 本文算法针对基于径向基函数的隐式曲面求解对噪声敏感的局限性,进行平滑预处理,结合孔洞周围曲率,提高了孔洞修补效果。由于基于径向基函数的隐式曲面对光顺的流形曲面模拟较好,所以算法对特征孔洞的修补存在一定的不足,快速重心插值法针对不规则孔洞也有一定的局限性。
关键词
图像重建; 孔洞修补; 插值细分; 梯度调整; 径向基函数; 隐式曲面方程
Abstract
Objective The development of 3D reconstruction technology has led to the wide application of 3D scanning technology in the cultural relic reconstruction and reverse engineering industries. However, scanning models usually include many holes after reconstruction due to the scanning environment, scanning techniques, and other factors. Models with holes affect follow-up application in the cultural relic reconstruction industry and industrial reverse industry. Radial basis function has been widely used in repairing holes. However, implicit surfaces based on radial basis function are sensitive to noise data. Therefore, they cannot be efficiently used in noise hole filling. This study proposes an improved hole-filling algorithm based on radial basis function. The algorithm mainly consists of smoothing noise data, interpolation subdivision hole structure, and radial basis function. In this way, the proposed algorithm can resolve the boundary mutation problem for noise hole repair. Method First, the algorithm uses the Laplace function to smooth the boundary of noisy holes. We use the topological structure of adjacent triangles on the model to check the boundary of holes and identify holes. After identifying holes, we smooth their boundary by multiple neighborhoods before building an implicit surface. The algorithm uses the smoothed data to solve the implicit surface on the basis of the radial basis function. Second, the algorithm subdivides the holes by applying the fast center of gravity interpolation method for regular holes. The gravities of boundary and convergence are used to perform a subdivision process. Third, the algorithm combines the curvature features around the holes to make the filling holes consistent features with scanning data. Therefore, boundary and normal constraint points are used to define the implicit surface solution. The boundary constraint points are taken from the multiple neighborhoods from the boundary of holes, and the normal constraint points are taken with the constraint of normal direction. Finally, the algorithm adjusts the interpolation point with the gradient descent method. The points of interpolation subdivision holes are usually not on the scanning surface of the holes. The algorithm uses the obtained implicit surface equation to find the partial derivative to adjust the interpolation points to the scanning surface rapidly. We use the gradient descent method and the setting error threshold to adjust the interpolation points of holes. In this way, we can achieve smooth patch of filling results. Result 3D classical models and actual mechanical workpieces are scanned to verify our algorithm. The comparison experiment is conducted by applying the wave-front method and Geomagic software method to the same holes. Our algorithm uses a preprocessing method for smoothing holes and keeps the curvature features around the holes. An implicit surface based on the radial basis function is applied to ensure the smoothness of repairing holes. The repairing holes become highly consistent with the surrounding curvature. The experimental results show that the proposed algorithm based on radial basis function is adaptable to noise holes. The results of this algorithm are consistent with the curvature variation around the holes. Therefore, the filling results are natural and smooth. The algorithm is a good way to improve the existing problems of edge mutation and trace obvious. Conclusion The algorithm solves the noise sensitivity problem of implicit surfaces based on radial basis function by the curvature features around holes. However, the results of the algorithm are not ideal for filling some complicated holes. The fast barycentric interpolation function also has limitations for irregular holes.
Key words
image reconstruction; interpolation subdivision; gradient adjustment; Radial Basis Function; implicit surface equation;
0 引言
随着3维扫描技术的不断发展和进步, 人们可以用各种3维扫描设备获取不同形状的数字点云模型, 然后完成物体重建。该技术尤其在工业领域的逆向工程中被广泛应用。然而, 由于扫描物体本身具有复杂的几何形状, 扫描过程中物体遮挡, 物体本身残缺, 扫描过程的光线反射等原因, 会造成不同程度的扫描物体重建后出现孔洞, 孔洞的存在对后续模型处理比如逆向工业原件生产等造成不同程度的障碍。因此需要对孔洞完成修补, 这也是当前3维数据处理的一个难题。
对于孔洞修补, 符号距离场体积扩散的方法是最为典型的方法Davis[1]。Argudo等人[2]基于符号距离场提出双谐波场的体积网格修复算法, 该算法对处理岛屿和一般复杂拓扑孔洞取得了很好的修补效果。Carr和张丽艳等人[3-5]运用径向基函数来模拟孔洞隐式曲面和通过径向基函数进行孔洞修补。Centin等人[6]结合泊松重建和三角网格化方法也对不同类型孔洞取得理想的修补结果。Wang等人[7]提出一种使用有序双法线和高斯映射来恢复缺失特征曲线和拐角的补洞方法, 应用于CAD模型孔洞修补中。刘振等人[8]应用动态规划方法并根据匹配特征线信息对显著几何特征取得不错的恢复效果。Qiu等人[9]利用均值坐标和自动控制变形程度避免碰撞的方法,把补洞应用在牙齿和牙龈的孔洞上也取得了令人满意的结果。Pérez和Guo等人[10-11]对已有补洞算法进行了实验分析,可以发现,径向基函数能够取得更好的补洞效果[12]。
但是对于基于径向基函数隐式曲面表示的孔洞修补算法,一个主要问题是隐式曲面对于散乱点噪声十分敏感, 从而导致修复效果呈现不连续.因此, 论文提出采用对孔洞及周围邻域进行拉普拉斯平滑处理.然后通过插值细分得到采样点.最后通过径向基函数通过隐式曲面完成约束求解, 并通过梯度下降得到符合孔洞曲率的修补曲面.通过实验分析表明,算法对于不同的扫描数据,修复效果都要优于逆向软件GeoMagic和文献[13]。
1 拉普拉斯光顺平滑
为了能够消除孔洞边界存在的突变点,在这里采用拉普拉斯对孔洞进行平滑处理。虽然径向基函数对散乱点隐式曲面表示有最好的逼近效果。但是径向基函数在逼近曲面计算中, 对参与计算的噪声散乱点十分敏感, 对有噪声的散乱点集无法很好地计算出符合曲率变化的隐式曲面。特别是有部分噪声点参与计算的隐式曲面是畸形的, 甚至无法计算的情况,无法很好地拟合原始曲面。因此在针对有噪声点的隐式曲面求解前,需要结合滤波相关算法,先对孔洞周围噪声点进行基础光顺, 以达到径向基函数求解对散乱点的基础要求。
拉普拉斯算子是
$ \Delta = {\Delta ^2} = \frac{{{\partial ^2}}}{{\partial {x^2}}} + \frac{{{\partial ^2}}}{{\partial {y^2}}} + \frac{{{\partial ^2}}}{{\partial {z^2}}} $ | (1) |
在3维空间模型应用中,拉普拉斯滤波可以看成是一种逐步扩散的过程,即
$ \frac{{\partial {p_i}}}{{\partial t}} = \lambda L\left( {{p_i}} \right) $ | (2) |
通过上述扩散过程,曲面的一些钉状物、噪声起伏会很快扩散到周围领域中, 最终使得整个曲面变得光顺。若拉普拉斯算子采用显式欧拉积分法表示,则
$ p_i^{n + 1} = \left( {1 + \lambda {\rm{d}}t \cdot L} \right)p_i^n $ | (3) |
拉普拉斯平滑就是找到一个顶点的邻域,然后把该顶点移动到邻域的重心位置上,即
$ L\left( {{p_i}} \right) = {p_i} + \lambda \left( {\frac{{\sum\limits_{j = 1}^k {{\omega _j}{q_j}} }}{{\sum\limits_{j = 1}^k {{\omega _j}} }} - {p_i}} \right) $ | (4) |
式中,
针对径向基函数模拟隐式曲面, 需要比计算隐式曲面更大的邻域数据点集来进行拉普拉斯光顺计算。例如需要孔洞周围三阶邻域数据来计算径向基函数, 在计算拉普拉斯基础平滑光顺时,可以选择五阶邻域进行拉普拉斯光顺,一方面由于本身拉普拉斯在平滑过程中有较大的收缩,另外一方面为了后续补洞结构与周围有更加自然的衔接过渡。
2 径向基函数隐式曲面求解
在完成拉普拉斯平滑后,接下来就需要根据孔洞周围数据,来构建符合孔洞曲率变化的隐式曲面。
对于孔洞采样点的隐式曲面重建, 具体问题描述为:给出R3空间的
在3维空间中基于径向基函数的隐式曲面方程可以定义为
$ f\left( r \right) = \sum\limits_{j = 1}^n {{\omega _j}\phi \left( {r - {c_j}} \right)} + P\left( r \right) $ | (5) |
式中,
$ P\left( r \right) = {p_0} + {p_1}x + {p_2}y + {p_3}z $ | (6) |
本文进行散乱点插值时采用的径向基核函数为
$ \phi \left( r \right) = {\left\| r \right\|^3}。$ |
令
$ \begin{array}{*{20}{c}} {f\left( {{c_i}} \right) = \sum\limits_{j = 1}^n {{\omega _j}\phi \left( {{c_i} - {c_j}} \right) + P\left( {{c_i}} \right)} = {h_i}}\\ {i = 1,2, \cdots ,n} \end{array} $ | (7) |
和正交条件
$ \sum\limits_{j = 1}^n {{\omega _j}} = \sum\limits_{j = 1}^n {{\omega _j}c_j^x} = \sum\limits_{j = 1}^n {{\omega _j}c_j^y} = \sum\limits_{j = 1}^n {{\omega _j}c_j^z} = 0 $ | (8) |
令
$ \left[ {\begin{array}{*{20}{c}} {{\phi _{11}}}&{{\phi _{12}}}& \cdots &{{\phi _{1n}}}&1&{c_1^x}&{c_1^y}&{c_1^z}\\ {{\phi _{21}}}&{{\phi _{22}}}& \cdots &{{\phi _{2n}}}&1&{c_2^x}&{c_2^y}&{c_2^z}\\ \vdots&\vdots &{}& \vdots&\vdots&\vdots&\vdots&\vdots \\ {{\phi _{n1}}}&{{\phi _{n2}}}& \cdots &{{\phi _{nn}}}&1&{c_n^x}&{c_n^y}&{c_n^z}\\ 1&1& \cdots &1&0&0&0&0\\ {c_1^x}&{c_2^x}& \cdots &{c_n^x}&0&0&0&0\\ {c_1^y}&{c_2^y}& \cdots &{c_n^y}&0&0&0&0\\ {c_1^z}&{c_2^z}& \cdots &{c_n^z}&0&0&0&0 \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {{\omega _1}}\\ {{\omega _2}}\\ \vdots \\ {{\omega _n}}\\ {{p_0}}\\ {{p_1}}\\ {{p_2}}\\ {{p_3}} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {{h_1}}\\ {{h_2}}\\ \vdots \\ {{h_n}}\\ 0\\ 0\\ 0\\ 0 \end{array}} \right] $ | (9) |
由于上述方程是对称和半正定的, 所以上述线性系统有唯一解。
上述用于在隐式曲面插值中, 曲面上的点约束为
则上述构建(2×
$ \begin{array}{*{20}{c}} {f\left( {x,y,z} \right) = }\\ {\sum\limits_{j = 1}^n {{\omega _j}{{\left( {\sqrt {{{\left( {x - c_j^x} \right)}^2} + {{\left( {y - c_j^y} \right)}^2} + {{\left( {z - c_j^z} \right)}^2}} } \right)}^3}} + }\\ {{p_0} + {p_1}x + {p_2}y + {p_3}z} \end{array} $ | (10) |
由于边界约束点和法线约束点本身是包含孔洞多边形曲率变化信息的, 这样计算的径向基函数拟合孔洞曲面是和孔洞周围曲面曲率变化一致的, 调整插值点到隐式曲面后, 其修补效果很好地拟合了周围曲率的变化。由于问题需求一致, 求解边界约束点和法线约束点的过程与已有的方法基本一致。
使用径向基函数插值隐式曲面求解过程中, 当插值散乱点数量增多, 线性系统增大, 造成求解效率很低。然而, 由于补洞插值数据点仅取自孔洞多边形周围, 对于一般孔洞, 点量相对较少, 计算效率较高。
3 孔洞插值细分和梯度调整
在完成孔洞隐式曲面求解之后,接下来需要再针对孔洞进行插值细分,并通过梯度调整,从而使得孔洞内部的散乱点能够符合周围曲率,维持隐式曲面的特征。
为了提高算法效率,论文对孔洞边界为凸多边形时在插值细分上采用重心法。首先求出孔洞多边形重心,然后对计算出的重心, 重新连接孔洞多边形顶点, 组成新的三角面,不断如此迭代求重心连接细分,定义孔洞多边形重心和孔洞点连接的新三角面的重心为边缘重心(图 1黑色点),连接对第1次细分的三角面的重心构造临时孔洞多边形, 定义为收敛孔洞多边形(图 1红色多边形),构造收敛孔洞多边形的点和原重心连接的三角面的重心定义为收敛重心(图 1红色点),本文快速插值点就是由边缘重心和收敛重心组成。如图 1所示。
具体孔洞多边形快速插值步骤:
1) 首先计算孔洞多边形重心
2) 对上述插值点与
3) 重复步骤2)迭代3次即可达到所需点量, 迭代次数可以自行设定。
4) 针对第1次细分求解的三角面重心, 重新连接为新的收敛孔洞多边形, 用新的收敛空洞多边形顶点重新连接重心
5) 重复步骤4)迭代4~6次即可基本收敛到孔洞重心位置。
经过上述步骤就可以得到一个孔洞足够的插值数量点细分孔洞。
由于快速插值点并没有考虑孔洞曲面的曲率信息, 所以需要对快速插值点进行顶点调整, 使其符合隐式曲面。本文参照文献[14]的思想,应用梯度下降法对插值点进行调整。由于梯度方向是下降最快的方向,所以可以不断迭代最快地达到所要调整的位置。则利用第2节求解孔洞隐式曲面方程为
$ \nabla f = \left( {\frac{{\partial f}}{{\partial x}},\frac{{\partial f}}{{\partial y}},\frac{{\partial f}}{{\partial z}}} \right) $ | (11) |
$ \begin{array}{*{20}{c}} {\frac{{\partial f}}{{\partial x}} = 3\sum\limits_{j = 1}^n {\left[ {{\omega _j}\left( {x - c_j^x} \right) \times } \right.} }\\ {\left. {\left( {\sqrt {{{\left( {x - c_j^x} \right)}^2} + {{\left( {y - c_j^y} \right)}^2} + {{\left( {z - c_j^z} \right)}^2}} } \right) + {p_1}} \right]} \end{array} $ |
$ \begin{array}{*{20}{c}} {\frac{{\partial f}}{{\partial y}} = 3\sum\limits_{j = 1}^n {\left[ {{\omega _j}\left( {y - c_j^y} \right) \times } \right.} }\\ {\left. {\left( {\sqrt {{{\left( {x - c_j^x} \right)}^2} + {{\left( {y - c_j^y} \right)}^2} + {{\left( {z - c_j^z} \right)}^2}} } \right) + {p_2}} \right]} \end{array} $ |
$ \begin{array}{*{20}{c}} {\frac{{\partial f}}{{\partial z}} = 3\sum\limits_{j = 1}^n {\left[ {{\omega _j}\left( {z - c_j^z} \right) \times } \right.} }\\ {\left. {\left( {\sqrt {{{\left( {x - c_j^x} \right)}^2} + {{\left( {y - c_j^y} \right)}^2} + {{\left( {z - c_j^z} \right)}^2}} } \right) + {p_3}} \right]} \end{array} $ |
具体算法流程如下:
1) 首先计算
$ {r_{k + 1}} = {r_k} - \frac{{f\left( {{r_k}} \right)}}{{{{\left\| {\nabla f\left( {{r_k}} \right)} \right\|}^2}}}\nabla f\left( {{r_k}} \right) $ | (12) |
2) 计算新点位置和梯度调整前位置的距离
3) 所有插值点都梯度调整到隐式曲面上后结束。
由于边界约束点和法线约束点计算出的隐式曲面方程拟合的是孔洞周围曲面, 充分考虑了曲率信息, 所以梯度调整到隐式曲面后, 对孔洞的修补的结果符合孔洞周围曲率, 有理想的修补效果。
4 实验分析和比较
为了验证论文算法的有效性,在主频2.4 GHz、内存4 GB的Intel i5上对不同网格模型孔洞进行修补和实验比较。比较对象采用目前逆向工程使用最为广泛的商业软件Geomagic Studio.该系统具有强大的拓扑修复和补洞效果, 以及文献[13]中被广泛应用的波前法进行实验对比。
在实验数据上采取两类数据,一类是学术界使用较为广泛的大卫、弥勒佛数据(图 2);另外一类是机械部件(图 3)。采用国产Hscan330 3维扫描仪得到扫描数据。首先针对大卫头像得到扫描数据并进行修复处理。从大卫头像中针对有明显曲率变化的部位进行孔洞修复,结果表明即使在有明显曲率变化的颈部也可以达到令人满意的修补效果。本文算法修补结果在有很好拟合孔洞边缘曲率变化的前提下,比Geomagic和文献[13]有更加自然的边缘过渡。在实验对比图中,给出了孔洞修复前后的局部放大和比较效果。从细节对比图中可以发现, Geomagic补洞的孔洞曲面虽然拟合了周围曲率变化,但是其边缘过度有更加明显的修补痕迹;文献[13]中的修补效果在孔洞边缘曲率拟合以及孔洞曲面边缘过度方面都无法达到令人满意的结果,而本文算法的补洞结果更为平滑自然,大大提高了逆向工程性能。
进一步地,针对弥勒佛进行扫描和修复实验.和大卫数据相比较, 弥勒佛数据细节更为丰富, 补洞难度更大。本文算法在边缘曲率拟合程度以及补洞曲面边缘过度方面也较Geomagic和文献[13]好,达到了令人满意的修补效果。
为了进一步验证算法在逆向工程应用的有效性。论文对机械扫描工件进行了孔洞修补的实验对比,包括变速轮和手刹器。可以发现,本文算法即使在有噪声干扰的情况下依旧可以达到满意的修补效果。
5 算法效率与不足
6 结论
论文提出了一种基于细分插值和径向基函数的孔洞修补算法。该算法针对噪声孔洞的采样点问题通过拉普拉斯平滑、细分插值和梯度调整提高数据质量,从而使得重建的曲面能够更好地维持曲率特征。和商业软件Geomagic以及文献[13]算法相比较,本文算法可以针对有明显曲率变化和周围有噪声的孔洞达到理想的修补效果。目前算法已经作为某公司的3维扫描仪配套软件发布, 算法性能得到了充分肯定。
下一步需要针对孔洞边界复杂狭长,在尖锐特征处出现的孔洞进行研究, 从而使得细分插值方法更加有效, 孔洞特征恢复更好, 进而使算法能够适应各种形式的孔洞问题。
参考文献
-
[1] Davis J, Marschner S R, Garr M, et al. Filling holes in complex surfaces using volumetric diffusion[C]//The First International Symposium on 3D Data Processing Visualization and Transmission, 2002. Padova, Italy: IEEE, 2002: 428-441. [DOI:10.1109/TDPVT.2002.1024098]
-
[2] Argudo O, Brunet P, Chica A, et al. Biharmonic fields and mesh completion[J]. Graphical Models, 2015, 82: 137–148. [DOI:10.1016/j.gmod.2015.06.010]
-
[3] Carr J C, Fright W R, Beatson R K. Surface interpolation with radial basis functions for medical imaging[J]. IEEE Transactions on Medical Imaging, 1997, 16(1): 96–107. [DOI:10.1109/42.552059]
-
[4] Du J, Zhang L Y, Wang H T, et al. Hole repairing in triangular meshes based on radial basis function[J]. Journal of Computer-Aided Design & Computer Graphics, 2005, 17(9): 1976–1982. [杜佶, 张丽艳, 王宏涛, 等. 基于径向基函数的三角网格曲面孔洞修补算法[J]. 计算机辅助设计与图形学学报, 2005, 17(9): 1976–1982. ] [DOI:10.3321/j.issn:1003-9775.2005.09.014]
-
[5] Carr J C, Beatson R K, Cherrie J B, et al. Reconstruction and representation of 3D objects with radial basis functions[C]//Proceedings of the 28th Annual Conference on Computer Graphics and Interactive Techniques. New York, NY, USA: ACM, 2001: 67-76. [DOI:10.1145/383259.383266]
-
[6] Centin M, Pezzotti N, Signoroni A. Poisson-driven seamless completion of triangular meshes[J]. Computer Aided Geometric Design, 2015, 35-36: 42–55. [DOI:10.1016/j.cagd.2015.03.006]
-
[7] Wang X C, Liu X P, Lu L F, et al. Technical section:automatic hole-filling of CAD models with feature-preserving[J]. Computers & Graphics, 2012, 36(2): 101–110. [DOI:10.1016/j.cag.2011.12.007]
-
[8] Liu Z, Wang Y B, Bai L L, et al. Detail-preserving hole-filling for complex 3D models[J]. Journal of Computer-Aided Design & Computer Graphics, 2016, 28(12): 2052–2059. [刘震, 王艳宾, 白丽丽, 等. 曲面细节特征保持的三维模型孔洞修复方法[J]. 计算机辅助设计与图形学学报, 2016, 28(12): 2052–2059. ] [DOI:10.3969/j.issn.1003-9775.2016.12.002]
-
[9] Qiu N N, Fan R, You L H, et al. An efficient and collision-free hole-filling algorithm for orthodontics[J]. The Visual Computer, 2013, 29(6-8): 577–586. [DOI:10.1007/s00371-013-0820-6]
-
[10] Pérez E, Salamanca S, Merchán P, et al. A comparison of hole-filling methods in 3D[J]. International Journal of Applied Mathematics and Computer Science, 2016, 26(4): 885–903. [DOI:10.1515/amcs-2016-0063]
-
[11] Guo X Y, Xiao J, Wang Y. A survey on algorithms of hole filling in 3D surface reconstruction[J]. The Visual Computer, 2016. [DOI:10.1007/s00371-016-1316-y]]
-
[12] Franke R, Nielson G. Smooth interpolation of large sets of scattered data[J]. International Journal for Numerical Methods in Engineering, 1980, 15(11): 1691–1704. [DOI:10.1002/nme.1620151110]
-
[13] Liepa P. Filling holes in meshes[C]//2003 Eurographics/ACM SIGGRAPH Symposium on Geometry Processing. Aachen, Germany: ACM, 2003: 200-205.
-
[14] Jin X G, Sun H Q, Peng Q S. Subdivision interpolating implicit surfaces[J]. Computers & Graphics, 2003, 27(5): 763–772. [DOI:10.1016/S0097-8493(03)00149-3]
-
[15] Turk G, O'Brien J F. Modelling with implicit surfaces that interpolate[J]. ACM Transactions on Graphics, 2002, 21(4): 855–873. [DOI:10.1145/571647.571650]