Point cloud normals

Description link

The normal definition of the point cloud

For a regular three-dimensional curved surface R of the (u, v), the tangent plane (Ru, Rv) at the point (u, v) is the surface normal vector at the point (u, v) of the normal vector. Cloud point is a point of the sample surface, the sample surface normal vector is a normal vector point cloud.

point normal

We give each point a line normal to the display, the direction of line normal direction, as shown in FIG. This display method is simple, but it is not convenient to see the correctness of normal. Here's the point cloud rendering can be more intuitive to see the correctness of normal.

point normal


The normal application of point cloud

  • Cloud Point Rendering: normal information can be used to render the illumination. As shown below, the left point cloud pure color rendering, rendering is right Phone illumination model, which is an approximate realistic lighting model. It simulates the light diffuse reflection, diffuse lighting comply with Lambert's cosine law, i.e., proportional to the intensity of diffusely reflected light N * L, N is the normal direction, L is a point light source vector. Therefore, at the edge of the model, N is approximately perpendicular to L, it will be relatively dark colored.

point normal

Point cloud rendering can also be used to check the correctness of normal. As shown below, in front of a light source model, the left renderings look more consistent with our intuitive sense, right are rendered not seem, because the normal is caused by inaccurate. By rendering the point cloud, you can quickly check the qualitative normals are correct. As for the right Why does not look right, this is an intuitive feeling, correct renderings to see more, there will be feeling.

point normal

  • Cloud Point Reconstruction: For a closed surface, we can define a function of the shape Indicator in space: 1 = internal surface, the external surface is zero. The shape of the gradient function is only on the surface is not 0, the gradient direction is the normal direction of the surface. We can apply the normal information to calculate the shape function. With the shape function, the method can be extracted by extracting the surface shape of the isosurface point cloud.

normal reconstruction 2d

  • Distinguish between positive and negative sheet: Occasionally scanning thin board, the board sides of the scanning spot are very close, some low accuracy of the scanner, so that the positive and negative points even mixed together, as shown, blue and green dots They represent the sides of the scanning spot. This can be a good time to distinguish between the normal positive and negative. Directed normals should do a good job while scanning, if the latter is oriented to the whole, positive and negative sheet points on the normal zone inseparable.

thin_plante_normal

  • 法线贴图:下面两个图是一个人脸网格的UV展开,属于平面网格。它们的区别在于法线信息,右图的法线继承了原始网格的法线,它使得平面网格也可以渲染出凹凸感。这个技巧常用于游戏场景的渲染,用低面片数的网格加上高质量的法线贴图信息,来增强模型的几何凹凸感。

normal_map_face


点云法线计算

点云采样于物体表面,物体表面的法线即为点云法线,故可先对物体表面的几何进行估计,即可计算出点云法线。一般可用低阶多项式曲面进行局部拟合,如左图所示。如果点云均匀分布,希望计算速度快,也可以用平面进行局部拟合,平面法线即为点云法线,如右图所示。

平面的局部拟合,可以采用PCA(主成分分析)的方法。因为曲面局部是平坦的,法线所在的方向是主成分最低的方向,也就是PCA里面最小特征值对应的特征方向。具体操作如下:1)给每个点计算K邻近邻域(也可以用半径邻域);2)计算PCA的协方差矩阵 Cov = ∑ (Ni – C) X (Ni – C),其中Ni为邻域点,C为中心点。这个协方差矩阵的最小特征值对应的特征向量即为这个点的法线方向。

curve line

在特征比较尖锐的地方,如左图所示,法线计算容易被光滑掉。右图直线是物体真实的几何,可以比较红色法线方向的差别。特征点的法线,可以用迭代权重的方法来修正,如先用平面局部拟合,然后给局部的点计算权重,离平面越远的点权重越小,然后再用带权重的点局部拟合平面,如此迭代即可。

feature normal


点云法线定向

点云法线经过上面介绍的PCA计算以后,还有一个问题是全局定向。法线有两个互为相反的方向。所谓全局定向,就是视觉上连续的一片点云法线方向要一致,片于片之间的定向也要视觉一致。如下图所示,左图的法线定向是乱的,而右图的法线有一致的定向。对于任给的一个点云,想要完全正确的定向,是不可能的,因为信息的缺失,有些局部上的正确定向是不可能的。但是,也有一些启发式的方法来给点云法线定向,一般情况下是可以正确有效的定向的。

normal_orientation

下面介绍一种简单的方法,它是图形学学者Hugues Hoppe在1992年发表的一篇Siggraph论文提到的方法。Hugues Hoppe目前是Google研究院的一名学者,他之前微软研究院工作,毕业于华盛顿大学。早期发表了很多关于曲面重建和网格优化的论文。

HuguesHoppe

如果点云分布比较均匀,在光滑的地方,相邻两个点法线的夹角会很小,可以认为近似平行,即|Ni * Nj| ≈ 1,如果定向一致,则Ni * Nj ≈ 1。一个经典的定向方法是,给点云的每个点找k个最近点,并连上k条边,这样点云就变成一个图结构了,也叫Riemannian图。然后给每条边一个权重w = 1 - |Ni * Nj|。w越小,表明两点之间的法线越接近。然后从某一点出发,找出这个图的最小支撑树(Prim算法和Kruskal算法),并使得相邻点的定向一致。

mst

这个定向方法在不光滑的地方,距离很近的薄板等情况下,可能会出问题。另外,如果点云有多个片区,虽然每个片区内部可以定向一致,但是片区之间的整体定向也是很难确定的。有不少论文针对这些情况设计了新的定向方法,但是新方法的条件假设也更多了。从全局效果来讲,不如这个方法的适普性好。因为算法假设越少,适普性也就越好。


扫描数据的完美定向

扫描数据是可以完美定向的。因为扫描得到的深度点云,法线与相机方向(Z轴)的夹角小于90度。由于法线有两个互为相反的方向,取与相机方向夹角小于90度的方向(向量点积大于0)。点云做了刚体变换(Matrix4x4::TransformPoint)后,点云法线也要做相应的变换(Matrix4x4::RotateVector,注意坐标点和向量的刚体变换是有区别的)。法线只有在最初的相机坐标系下是可以完美定向的。之后一旦做了刚体变换,想要再去全局定向,就只能采用之前介绍的“法线如何定向”的方法。这些全局定向的方法,都不能做到一定正确,它只能保证每个点云小片的定向一致,片之间的定向一致是没法保证的。

CameraDirection

有兴趣的读者,欢迎参考视频版本

Guess you like

Origin www.cnblogs.com/threepark/p/11724040.html