# Fuzzy Frankot-Chellappa Algorithm for Surface Normal Integration
## 3 Classic Frankot-Chellappa Surface Normal Integration  
Let us briefly recall the classic Frankot-Chellappa method [5]. Given a normal field \(\vec{n}(u,v)=[\,n_{1}(u,v),\,n_{2}(u,v),\,n_{3}(u,v)\,]^{\top}\) defined on domain \(\Omega\subset\mathbb{R}^{2}\) (with \(\|\vec{n}(u,v)\|=1\)), we seek a surface \([u,v,z(u,v)]^{\top}\) such that \(\vec{n}(u,v)\) is orthogonal to surface at each point. Equivalently,  
\[\
abla z(u,v)= \begin{pmatrix}\frac{\partial z}{\partial u}\\ \frac{\partial z}{\partial v}\\ \frac{\partial z}{\partial v}\end{pmatrix} = \begin{pmatrix}-\frac{n_{1}(u,v)}{ n_{3}(u,v)}\\ -\frac{n_{2}(u,v)}{n_{3}(u,v)}\end{pmatrix} = \begin{pmatrix}p(u,v)\\ q(u,v)\end{pmatrix} =:g(u,v).\]  
In practice, the observed \(g(u,v)\) may not be exactly integrable (i.e., there may not exist a single-valued \(z\) whose gradient is \(g\) everywhere) due to noise or discretization. The Frankot-Chellappa solution is to find a function \(z(u,v)\) that minimizes the distance between \(\
abla z\) and \(g\) in a least-squares sense:  
\[\min_{z}\int_{\Omega}\|\
abla z(u,v)-g(u,v)\|^{2}\,du\,dv\.\]The optimality condition for this minimization is the Poisson equation  
\[\frac{\partial^{2}z}{\partial u^{2}}+\frac{\partial^{2}z}{\partial v^{2}}=\Delta z (u,v)=\frac{\partial p}{\partial u}+\frac{\partial q}{\partial v}\,\ \text{in}\ \Omega \tag{5}\]  
with Dirichlet boundary conditions \(z|_{\partial\Omega}=0\). Here, \(\partial\Omega\) denotes the boundary of the computational domain \(\Omega\). For instance, if \(\Omega=[0,1]^{2}\), then \(\partial\Omega\) consists of all points \((u,v)\) where either \(u=0\), \(u=1\), \(v=0\), or \(v=1\). The Dirichlet boundary condition \(z=0\) on \(\partial\Omega\) ensures compatibility with the discrete sine transform (sT), which implicitly assumes zero values at the domain boundaries. The right-hand side is the divergence of the gradient estimate. We discretize the domain \(\Omega=[0,1]^{2}\) into an \((m+1)\times(n+1)\) uniform grid with step sizes \(h\). The continuous coordinates are given by \(u_{i}=ih\), \(v_{j}=jh\), where \(i=0,\ldots,m\) and \(j=0,\ldots,n\). For simplicity and without loss of generality, we assume a uniform square grid where the step sizes in both directions are equal also, that is, \(z(u_{i},v_{j})=z_{i,j}\). To solve this numerically, one applies a 5-point finite difference stencil on a uniform grid of spacing \(h\):  
\[\frac{z_{i+1,j}+z_{i-1,j}+z_{i,j+1}+z_{i,j-1}-4z_{i,j}}{h^{2}}=f_{i,j}\, \tag{6}\]  
where the right-hand side is approximated using central differences:  
\[f_{i,j}=\frac{p_{i+1,j}-p_{i-1,j}}{2h}+\frac{q_{i,j+1}-q_{i,j-1}}{2h}\.\]  
[PERSON] and [PERSON] observed that this discrete Poisson problem with zero Dirichlet boundary conditions can be efficiently solved via the sT. Let \(\{\overline{f}_{k,l}\}\) and \(\{\overline{z}_{k,l}\}\) denote the sT coefficients of \(\{f_{i,j}\}\) and \(\{z_{i,j}\}\), respectively. Then  
\[\overline{z}_{k,l}=\frac{h^{2}\overline{f}_{k,l}}{2\Big{(}\cos\left(\frac{ \pi k}{m}\right)+\cos\left(\frac{\pi l}{n}\right)-2\Big{)}}\, \tag{7}\]  
for \(k=1,\ldots,m-1\) and \(l=1,\ldots,n-1\). The final surface \(z_{i,j}\) is then recovered by applying the inverse sT.  
**Summary of the classical FC algorithm:**  
1. Compute \(p(u,v)\) and \(q(u,v)\) from the normal field. 2. Evaluate \(f(u,v)=\partial_{u}p+\partial_{v}q\) using finite differences. 3. Apply the forward sT to \(f\) to obtain \(\overline{f}_{k,l}\). 4. Use the analytical solution in the frequency domain to compute \(\overline{z}_{k,l}\). 5. Apply the inverse sT to reconstruct \(z(u,v)\). This classical FC approach serves as the foundation for our fuzzy-enhanced integration method introduced in Section 4. It is important to note that surface reconstruction from normal vectors is generally determined only up to an additive constant. This is because the gradient field \((p,q)\) corresponds to infinitely many surfaces differing by a constant vertical shift.