# Optical Flow Odometry with Panoramic Image Based on Spherical Congruence Projection
## 3 Materials and Methods
### SCP-VO Method  
With the advantages of the SCP images, an SCP-based Visual Odometry (SCP-VO) is proposed accordingly. The SCP-VO leverages the optical flow principles to accurately identify and track features on the projected SCP images. \[\mathrm{H}_{7}^{\mathrm{g}}=\mathrm{H}_{7}^{\mathrm{u}}+\mathrm{H}_{7}^{ \mathrm{m}} \tag{3}\]  
\[\mathrm{H}_{7}^{\mathrm{u}}= \begin{bmatrix}&-a&&+a&\\ -b&&0&&+b\\ &-a&&+a&\end{bmatrix}  \tag{4}\]  
\[\mathrm{H}_{7}^{\mathrm{g}}= \begin{bmatrix}&-b&&-a&\\ -a&&0&&+a\\ &+a&&+b&\end{bmatrix}  \tag{5}\]  
\[\mathrm{H}_{7}^{\mathrm{m}}= \begin{bmatrix}&-a&&-b&\\ +a&&0&&-a\\ &+b&&+a&\end{bmatrix}  \tag{6}\]  
On planar images, gradient operators are typically constructed along two orthogonal and independent directions--horizontal and vertical. In contrast, the QUVS pixel structure employed in this work is defined over a spherical domain and is characterized by three symmetric axes, denoted as \(u\), \(v\), and \(m\), which are rotationally related by 60 degrees. Due to the inherently two-dimensional nature of the spherical surface, these three axes are geometrically coupled rather than mutually independent. Let \(H_{7}^{\mathrm{u}}\), \(H_{7}^{\mathrm{g}}\), and \(H_{7}^{\mathrm{m}}\) represent the discrete gradient operators along the \(u\), \(v\), and \(m\) directions, respectively. Their mutual spatial constraints are described in Equation (3). Based on the rotational symmetry of the QUVS structure, we construct three directional gradient operators using six sampling directions--\([-v,-m,u,v,m,-u]\)--as shown in Equations (4)-(6). These directions correspond to pixel indices #1 through #6 illustrated in Figure 7.  
By jointly considering the spatial constraint relationship in Equation (3) and the gradient formulation in Equation (4), we derive the following parameter constraint in the gradient operator:  
\[b=2a \tag{7}\]  
To estimate camera motion by minimizing photometric error, it is essential to compute pixel-wise gradients for tracking feature displacements across consecutive frames. In our framework, we select the \(u\) and \(v\) axes as two independent directions for gradient computation and consider both RR and LR cases. Specifically, the gradient operator in \(u\) and \(v\) directions for \(\mathcal{S}_{RR}\) are  
\[G_{u}^{RR}= \begin{bmatrix}0&-a&a\\ -b&0&b\\ -a&a&0\end{bmatrix}  \tag{8}\]  
\[G_{v}^{RR}= \begin{bmatrix}0&-b&-a\\ -a&0&a\\ a&b&0\end{bmatrix}  \tag{9}\]  
The gradient operator for \(u\) and \(v\) directions in \(\mathcal{S}_{LR}\) are calculated as  
\[G_{u}^{LR}= \begin{bmatrix}-a&a&0\\ -b&0&b\\ 0&-a&a\end{bmatrix}  \tag{10}\]  
\[G_{v}^{LR}= \begin{bmatrix}-b&-a&0\\ -a&0&a\\ 0&a&b\end{bmatrix}  \tag{11}\]  
Generally, neighboring pixels within the integration window are assumed to exhibit consistent motion. Thus, the pixel velocity can be characterized by the vector \(\bar{\eta}\) that minimizes the photometric error across all pixels within the integration window. This minimization can be efficiently achieved using a one-step computation as follows:  
\[\bar{\eta}=G^{-1}\bar{b} \tag{12}\]  
Figure 7: Topological diagram of spherical pixel-to-storage and pixel spatial mapping. The coordinate axes u, v, and m represent the directional axes of hexagonal pixels. The vectors \(u_{\perp}\), \(v_{\perp}\), and \(m_{\perp}\) denote the normal vectors of the u, v, and m axes, respectively. where \(\bar{b}\) represents the image mismatch vector, and \(G\) denotes the spatial gradient matrix and is defined below. Let the width and height of the associated integration window be \((2*w_{u}+1)\times(2*w_{\bar{v}}+1)\). Then, the calculation of \(G\) and \(\bar{b}\) can be expressed as  
\[G=\sum_{u=p_{u}-w_{u}}^{p_{u}+w_{u}}\sum_{v=p_{u}-w_{v}}^{p_{v}+w _{v}} \begin{bmatrix}G_{u}^{2}(u,v)&G_{u}(u,v)G_{v}(u,v)\\ G_{u}(u,v)G_{v}(u,v)&G_{v}^{2}(u,v)\end{bmatrix}  \tag{13}\] \[\bar{b}=\sum_{u=p_{u}-w_{u}}^{p_{u}+w_{u}}\sum_{v=p_{v}-w_{v}}^{ p_{v}+w_{v}} \begin{bmatrix}\delta I(u,v)\cdot G_{u}(u,v)\\ \delta I(u,v)\cdot G_{v}(u,v)\end{bmatrix}