无符号距离函数(Unsigned Distance Function)是计算物体表面距离的一种数学函数。它通常用于计算机图形学中的体素渲染、几何形状重建和碰撞检测等应用。图1是一些常见无符号距离场的原理示意图。
D w a s ( x ) = 1 K ∑ p ∈ N k ( x ) ∥ x − p ∥ 2 D_{was}(x)=\sqrt{\frac{1}{K} \sum_{p \in N_k(x)} \Vert x-p \Vert^2} Dwas(x)=K1p∈Nk(x)∑∥x−p∥2
N k ( x ) : N_k(x): Nk(x): the set of K K K nearest neighbours to x x x
K K K: a tradeoff between robustness and accuracy
不够精确,只能用来确定大致的区域。
D E ( p , q ) = ( p − q ) 2 D_E(p,q) = \sqrt{(p-q)^2} DE(p,q)=(p−q)2
p , q p,q p,q: they are two points from R N \mathbb{R}^N RN
Distance between two probability measures
W p ( μ , v ) = ( inf γ ∈ Γ ( μ , v ) E ( x , y ) ∼ γ d ( x , y ) p ) 1 / p W_p(\mu, v) = \left( \inf_{\gamma \in \Gamma(\mu, v)} E_{(x,y) \sim \gamma } d(x,y)^p \right)^{1/p} Wp(μ,v)=(γ∈Γ(μ,v)infE(x,y)∼γd(x,y)p)1/p
μ , v \mu, v μ,v: two probability measures on M M M
Γ ( μ , v ) \Gamma(\mu, v) Γ(μ,v): the set of all couplings of μ \mu μ and v v v
Distance between a point and one probability measure
计算一个点 x \mathbf{x} x 到一个点集或分布 D D D 的马氏距离 D M ( x ) D_M(\mathbf{x}) DM(x) 的公式通常表达为:
D M ( x ) = ( x − μ ) T Σ − 1 ( x − μ ) D_M(\mathbf{x}) = \sqrt{(\mathbf{x} - \mu)^T \Sigma^{-1} (\mathbf{x} - \mu)} DM(x)=(x−μ)TΣ−1(x−μ)
其中:
x \mathbf{x} x: 是要计算的点。
μ \mu μ: 是点集 D D D 的均值向量。
Σ − 1 \Sigma^{-1} Σ−1: 是点集 D D D 的协方差矩阵的逆, Σ = 1 n − 1 ( x − μ ) T ( x − μ ) \Sigma = \frac{1}{n-1}(\mathbf{x} - \mu)^T (\mathbf{x} -\mu) Σ=n−11(x−μ)T(x−μ)。
T ^T T: 表示向量的转置。
d ( p ) = ∑ j = 1 k ω i d ( p , p j ) d(p) = \sum_{j=1}^k \omega_i d(p, p_j) d(p)=j=1∑kωid(p,pj)
p p p: the query point
p i p_i pi: the j j j-th nearest neighbour of point p p p
d ( p , p j ) d(p,p_j) d(p,pj): the distance of point p p p and p j p_j pj
ω i \omega_{i} ωi: the weight of point p i p_i pi, it can be some common distance functions, e.g. ω i = − e d ( p , p i ) 2 2 σ 2 \omega_i = -e^{\frac{d(p, p_i)^2}{2\sigma^2}} ωi=−e2σ2d(p,pi)2, σ ( p i ) = s ∑ j = 1 k ∥ p i − p i , j ∥ \sigma(p_i)= s \sum_{j=1}^k \Vert p_i - p_{i,j}\Vert σ(pi)=s∑j=1k∥pi−pi,j∥
k k k: the number of neighbours for calculating distance
源自文章
[1] 2011, Chazal et al., Geometric Inference for Probability Measures. Foundations of Computational Mathematics
[2] 2013, Noise-adaptive shape reconstruction from raw point sets. CGF
d μ , m 2 : R n → R , x ↦ 1 m ∫ B ( x , r μ , m ( x ) ) ∥ x − y ∥ 2 d μ ( y ) d_{\mu, m}^2: \mathbb{R}^n \to \mathbb{R}, x \mapsto \frac{1}{m} \int_{B(x, r_{\mu,m}(x))} \Vert x-y \Vert^2 d\mu(y) dμ,m2:Rn→R,x↦m1∫B(x,rμ,m(x))∥x−y∥2dμ(y)
x : x: x: a query point
μ : \mu: μ: a probability distribution in R n \mathbb{R}^n Rn
r μ , m ( x ) : r_{\mu, m} (x): rμ,m(x): the minimum radius such that the ball centered at x x x with radius r r r encloses a mass of at least m m m.
m : m: m: m ∈ ( 0 , 1 ] m\in(0,1] m∈(0,1], a user-defined parameter.
Φ ( x ) = ( x − p i ) ⋅ n i \Phi(\bm{x})=(\bm{x}-\bm{p}_i) \cdot \bm{n}_i Φ(x)=(x−pi)⋅ni
x : \bm{x}: x:属于 R 3 \mathbb{R}^3 R3空间
p i : \bm{p}_i: pi:是点 x \bm{x} x的最近邻点
则表面为距离场 Φ \bm{\Phi} Φ的零等值面,该距离场对法向很敏感。
[1] [读论文]点云表面重建: SDF, TSDF, MLS, RBF