如何量化表面法线 [英] How to quantize surface normals

查看:45
本文介绍了如何量化表面法线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将表面法线量化为 8 个 bin.

例如,当计算像 HOG 这样的特征来量化 2D 梯度时 [x,y] 分成 8 个区间,我们只取与 y 平面的角度,即 arctan(y/x),这会给我们一个 0-360 度之间的角度.

我的问题是,给定一个 3D 方向 [x,y,z],在这种情况下是一个表面法线,我们如何以类似的方式对其进行直方图?我们是否只是投影到一个平面上并使用该角度,例如 [x,y,z][0,1,0] 的点积?>

谢谢

编辑

我最近还阅读了一篇论文,他们对表面法线进行了量化通过测量围绕直圆锥形状排列的法线向量和预先计算的向量之间的角度.我在问题中添加了这篇论文的链接(第 3.3.2 节最后一段),这是一种有效的方法吗?如果是这样,我们如何计算这些向量?

解决方案

量化一个连续的拓扑空间对应于对其进行分区并为每个分区分配标签.这种情况的直接标准方法(量化法线)如下.

  1. 选择您最喜欢的均匀多面体:
  2. 开发从单位球体上的法线到与法线相交的所选多面体的面的映射函数.
    • 我建议对多面体面进行 argmax,取法线和每个多面体面法线的点积.给出最高点积的那个是你的法线应该被装箱的脸.
  3. 使用每个多面体面的法线作为该面的标签.

这种方法比其他人建议的映射到球坐标然后分箱的方法更受欢迎.这种方法在球体两极附近过于敏感.

编辑

在您添加到问题的论文中,使用了相同的想法.然而,在那里,法线被限制在一个半球——图像中唯一直接可见的表面的表面法线与从表面到视点的向量的距离不超过 90 度.

论文希望将这些表面法线量化为 8 个值,由 8 位整数表示,其中一位设置为 1,其余设置为 0.8 个预先计算的法线计算如下:

ntx = cos(a)*cos(t)

nty = cos(a)*sin(t)

ntz = sin(a)

其中 a = pi/4 和 t = 0, pi/4, 2*pi/4, 3*pi/4, ..., 7*pi/4.

通知

[cos(a)*cos(t)]2 + [cos(a)*sin(t)]2 + [sin(a)]2 = cos2(a)[cos2(t) + sin2(t)] + sin2(a) = cos2(a) + sin2(a) = 1

I am trying to quantize surface normals into let's say 8 bins.

For example, when computing features like HOG to quantize 2D gradients [x,y] into 8 bins we just take the angle with the y plane i.e. arctan(y/x) which will give us an angle between 0-360.

My question is, given a 3D direction [x,y,z], a surface normal in this case, how can we histogram it in a similar way? Do we just project onto one plane and use that angle i.e. the dot product of [x,y,z] and [0,1,0] for example?

Thanks

EDIT

I also read a paper recently where they quantized surface normals by measuring angles between normal and precomputed vectors that which are arranged around a right circular cone shape. I have added a link to this paper in the question (section 3.3.2 last paragraph), is this an effective approach? And if so, how do we compute these vectors?

解决方案

Quantizing a continuous topological space corresponds to partitioning it and assigning labels to each partition. The straightforward standard approach for this scenario (quantizing normals) is as follows.

  1. Choose your favorite uniform polyhedron:
  2. Develop a mapping function from a normal on the unit sphere to the face of your chosen polyhedron that the normal intersects.
    • I would advise doing an argmax across polyhedron faces, taking the dot product of your normal and each polyhedron face normal. The one that gives the highest dot product is the face your normal should be binned into.
  3. Use the face normal for each polyhedron face as the label for that face.

Prefer this approach to the approach suggested by others of mapping to spherical coordinates and then binning those. That approach suffers from too much sensitivity near the poles of the sphere.

Edit

In the paper you added to your question, the same idea is being used. There, however, the normals are restricted to a hemisphere - the only surfaces directly visible in an image have surface normals no more than 90 degrees away from the vector from the surface to the viewpoint.

The paper wants to quantize these surface normals into 8 values, represented by 8-bit integers with exactly one bit set to 1 and the rest set to 0. The 8 precomputed normals are computed as:

ntx = cos(a)*cos(t)

nty = cos(a)*sin(t)

ntz = sin(a)

where a = pi/4 and t = 0, pi/4, 2*pi/4, 3*pi/4, ..., 7*pi/4.

Notice

[cos(a)*cos(t)]2 + [cos(a)*sin(t)]2 + [sin(a)]2 = cos2(a)[cos2(t) + sin2(t)] + sin2(a) = cos2(a) + sin2(a) = 1

这篇关于如何量化表面法线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆