What is Signed Distance Function ?

Ankit .
2 min readJan 4, 2021

--

I was reading a paper on 3D reconstruction when I came across a term Truncated Signed Distance Function (TSDF). TSDF encodes the 3D space in a voxel. A voxel in 3D space is like a pixel in a 2D image. SDFs are used in applications like real-time rendering and computer vision.

Signed Distance Function (SDF) [1] gives us a distance of point X from the boundary of a surface. The major advantage of this function is to determine if a point lies inside the boundary of the surface or outside the boundary.
An example in 2D Euclidian space,

Figure 1 :implicit function f(x,y) of circle centered at origin with unit radius and it’s SDF

Properties of SDF :

Property 1 states that the norm of the gradient vector of SDF is 1. For the SDF in Figure 1, the norm of the gradient vector will be 1. Try it yourself.

Figure 2 illustrates Property 2 & 3 using a 1D example. The two functions used are |x|-1 and x²-1.

Figure 2. (Left image) minimum of two sdf functions and (right image) maximum of two sdf functions.

SDF function is used in 3D reconstruction use-cases. The idea is very simple, the surface is at those locations where SDF function is 0. Figure 3 explains this using an example of a circle in 2D space. Points marked in green have SDF value > 0 and red have SDF value <0. The surface can be reconstructed using the marching-squares algorithm as explained in [4]. Check squares/cells where both red and green marked points are present. Similar to 2D example a 3D surface can be reconstructed by interpolating such cells in voxel space. More details are in [4].

Figure 3. Example of SDF in discrete space.

References:
[1] https://en.wikipedia.org/wiki/Signed_distance_function
[2] https://en.wikipedia.org/wiki/Fast_marching_method
[3] http://faculty.missouri.edu/duanye/course/cs8620-spring-2017/lecture-notes/3b-signed-distance-function.pdf
[4] http://faculty.missouri.edu/duanye/course/cs8620-spring-2017/lecture-notes/3a-implicit-geometry.pdf

--

--

No responses yet