## 2 Materials and Methods
### Global Optimization  
Given the initial guess of the registration pose with the approximate normal direction and translation, the problem of solving the remained offset \(T_{\Delta}\) is equivalent to solving the pose transformation of the virtual camera that makes the image area of the projected CAD model completely superimposed with that of the imaged object. The problem is solved under a 3D image alignment framework [11; 15; 25] by optimizing an image registration error function regarding the pose parameters, which is shown as follow:  
\[E(\mathrm{vec}(T_{R}))=\frac{1}{n}\sum_{i=1}^{n}\left(O(\mathcal{I}_{\mathrm{ c}},\mathbf{x}_{i})-O(\mathcal{I}_{R},\left(W(\mathbf{x}_{i},\mathrm{vec}(T_{R} \cdot T_{\Delta}))\right)\right)^{2}, \tag{7}\]  
where \(O(\cdot)\) is a series of operations on \(\mathcal{I}_{\mathrm{c}}\) and \(\mathcal{I}_{\mathrm{R}}\) to minimize the registration error \(E(T_{\mathrm{R}})\), \(\mathrm{vec}(\cdot)\) is the exponential map minimal parameterization of a \(4\times 4\) size pose matrix, \(T_{R}\) is the transformed projection matrix in Equation (6), \(\mathbf{x}_{i}=[u_{i},v_{i},1]^{\mathrm{T}}\) is the projected point of the 3D object point \(\mathbf{X}=[U_{i},V_{i},W_{i},1]^{\mathrm{T}}\), \(n\) is the number of densely sampled pixels on \(\mathcal{I}_{\mathrm{c}}\) and \(\mathcal{I}_{\mathrm{R}}\). Different from the computation method of \(O(\cdot)\) presented by [PERSON] et al. in [15], which uses a pixel intensity-based feature, this work continues to use the strong gradient features extracted in Section 2.2 to simplify the computation, as shown in Algorithm 1.  
Figure 6: Initial pose guesses obtained by the bounding box projection.  
Substituting \(O(\cdot)\) in Equation (7), the objective function of the registration error \(E(T_{R})\) regarding \(T_{\Delta}\) is obtained. Consequently, \(T_{\Delta}\) that achieves the minimum \(E(T_{R})\) results in the maximum superimposing area. To solve \(T_{\Delta}\) in the non-linear \(E(T_{R})\), an inverse compositional optimization framework is employed [25] using the first-order approximation [11] and Gauss-Newton iteration. By using the first-order approximation, Equation (7) is rewritten as:  
\[E(\text{vec}(T_{\Delta}))=\frac{1}{n}\sum_{i=1}^{n}{(O_{\text{c}}(W(\mathbf{x} _{i},\text{vec}(T_{R})))+\mathbf{J}_{E}(\mathbf{x}_{i},\text{vec}(T_{R}))\text {vec}(T_{\Delta})-O_{R}(\mathbf{x}_{i}))^{2}}, \tag{8}\]  
where \(O_{\text{c}}\) and \(O_{R}\) are the dense gradient descriptor calculated using Algorithm 1 on \(\mathcal{I}_{\text{c}}\) and \(\mathcal{I}_{\text{R}}\) respectively. According to the Gauss-Newton optimization scheme, the solution of \(\text{vec}(T_{\Delta})\) is:  
\[\text{vec}(T_{\Delta})=\mathbf{H}_{E}^{-1}(\text{vec}(T_{R}))\sum_{i=1}^{n} \mathbf{J}_{E}^{\text{T}}(\mathbf{x}_{t},\text{vec}(T_{R}))(O_{R}(\mathbf{x} _{t})-O_{c}(W(\mathbf{x}_{t},\text{vec}(T_{R})))), \tag{9}\]  
where \(\mathbf{J}_{E}\) and \(\mathbf{H}_{E}\) are the Jacobian matrix and the Hessian matrix of \(E(T_{R})\), respectively. After solving \(T_{\Delta}\) each time, the \(T_{R}\) is updated by:  
\[T_{R}=T_{M}\cdot T_{o1}\cdot T_{o2}\cdot T_{\Delta}. \tag{10}\]  
Repeat the computation of Equations (8)-(10) until \(\text{vec}(T_{\Delta})\) converges to a small value, which is set as \(\{\epsilon\}<10^{-3}\) that considers both the convergence precision and speed, \(\text{vec}(T_{\Delta})\) is then solved and the final \(\Delta T\) is obtained by reverse mapping of \(\text{vec}(T_{\Delta})\) by Equations (2) and (3). The global optimization will result in the minimal gradient difference \(E(T_{M}\cdot T_{O})\), which is equivalent to a maximum AR alignment area. An example of the optimization result is shown in Figure 7.