# Optical Flow Odometry with Panoramic Image Based on Spherical Congruence Projection
## 3 Materials and Methods
### Spherical Congruence Projection
#### 3.2.2 Pixel Storage  
To facilitate pixel storage and calculation in physical memory, which usually contains the linear layout, the pixels in subregions with hexagonal coordinates are transferred to the Cartesian coordinate system. According to the pixel distribution of each subregion, they can be divided into two categories, where subregions in quadrants \(\left\{\omega_{N}^{1},\omega_{N}^{2}\right\}\), \(\left\{\omega_{N}^{3},\omega_{N}^{4}\right\}\), and \(\left\{\omega_{N}^{5},\omega_{N}^{6}\right\}\) are regarded as Right-leaning Region (RR) \(\mathcal{S}_{RR}\), while subregions in quadrants \(\left\{\omega_{N}^{2},\omega_{N}^{4}\right\}\), \(\left\{\omega_{N}^{4},\omega_{N}^{5}\right\}\), and \(\left\{\omega_{N}^{6},\omega_{N}^{1}\right\}\) form Left-leaning Region (LR) \(\mathcal{S}_{LR}\). In each subregion, the pixels are indexed according to their centroid coordinates \((x,y)\) along the axes, where \(x\) and \(y\) represent indices along the \(\omega_{N}^{x}\) and \(\omega_{N}^{y}\) axes, respectively. Note that the origins for \(\mathcal{S}_{RR}\) and \(\mathcal{S}_{LR}\) are located at \(O_{N}\). As shown in Figure 6, these pixel indices in the hexagonal coordinate are transformed into the Cartesian coordinate while maintaining the topological structure of pixels, i.e., \((x,y)\Longrightarrow(u,v)\), where \(u\) and \(v\) denote the corresponding positions of \(x\) and \(y\) in the Cartesian coordinate. The transformed output, denoted as \(\mathcal{G}\), represents the final SCP image. Since the typology structure between \(\mathcal{S}_{L}\) and \(\mathcal{G}\) remains unchanged, \(u\) and \(v\) are typically consistent with \(x\) and \(y\).  
Figure 6: Taking the \(\left\{\omega_{N}^{1},\omega_{N}^{2}\right\}\) subregion and \(\left\{\omega_{N}^{6},\omega_{N}^{1}\right\}\) subregion as examples, the coordinate transformation relationships for RR and LR subregions are given above.  
After the transformation, the height \(H\) and width \(W\) of \(\mathcal{G}\) are given as follows:  
\[H=2*\left(2^{\frac{L-1}{2}}+1\right)-1 \tag{1}\]  
\[W=3*\left(2^{\frac{L-1}{2}}+1\right)-2 \tag{2}\]  
where \(L\) represents the refinement level of the original QUVS image \(\tilde{\mathcal{S}_{L}}\). Taking the north pole \(O_{N}\) as the origin, the coordinates of pentagonal pixels \(\{p_{RR}^{1},p_{RR}^{2},p_{RR}^{3},p_{RR}^{4}\}\) in \(\mathcal{S}_{RR}\) are located at \(\left(0,\frac{H-1}{2}\right)\), \(\left(\frac{W-1}{3},H-1\right)\), \(\left(W-1,\frac{H-1}{2}\right)\), \(\left(\frac{2\left(W-1\right)}{3},0\right)\), respectively. Similarly, the positions of pentagonal pixels \(\left\{p_{LR}^{1},p_{LR}^{2},p_{LR}^{3},p_{LR}^{4}\right\}\) in \(\tilde{\mathcal{S}_{LR}}\) are \(\left(0,\frac{H-1}{2}\right)\), \(\left(\frac{2\left(W-1\right)}{3},0\right)\), \(\left(W-1,\frac{H-1}{2}\right)\), and \(\left(\frac{W-1}{3},H-1\right)\). As mentioned above, the boundary pixels of adjacent \(\tilde{\mathcal{S}_{RR}}\) and \(\tilde{\mathcal{S}_{LR}}\) are shared. Taking the pentagonal pixels in Figure 6 as the example, \(p_{RR}^{4}\) and \(p_{RR}^{3}\) on the boundary of \(\tilde{\mathcal{S}_{RR}}\) correspond to the \(p_{LR}^{2}\) and \(p_{LR}^{3}\) in \(\tilde{\mathcal{S}_{LR}}\).