# E2-VINS: An Event-Enhanced Visual-Inertial SLAM Scheme for Dynamic Environments
## 3 Methodology
### Event-Based Dynamicity Metrics  
To obtain event-based pixel-level dynamicity metrics at a specific time, IMU-assisted self-motion compensation is required to achieve spatiotemporal alignment of the events. Subsequently, normalized mean timestamps are computed from the motion-compensated event frames, serving as dynamicity metrics. * IMU-assisted Motion Compensation In the IMU-assisted self-motion compensation approach used in E2-VINS, the IMU's rotation information is applied to each event on the pixel plane using a rigid-body rotation model and a pinhole imaging model, resulting in sharper restored frames, as shown in Figure 3. Specifically, on the image plane, the pixel coordinates of a set of events are adjusted back to their corresponding positions at a common timestamp \(t_{\text{ref}}\) using a warping field. To demonstrate this approach, let \(\mathcal{E}=\{e_{k}\}_{k=1}^{N_{\mathcal{B}}}\) be a set of events within a time interval \(\mathcal{T}=\{t_{k}\}_{k=1}^{N_{\mathcal{B}}}\), where \(N_{e}\) is the group size. Assuming the angular rate \(\omega^{i}\) has been converted to the event camera coordinate system, it can be decomposed into three components: \(\phi^{i}\), \(\theta^{e}\), and \(\psi^{e}\) on the X, Y, and Z axes, respectively. In addition, for each event \(e_{k}\) in \(\mathcal{E}\), the time difference \(\delta t_{k}=t_{k}-t_{\text{ref}}\) is calculated. Using the angular rate and time difference, the corresponding rotation angles \(\phi_{k}\), \(\theta_{k}\), and \(\psi_{k}\) for the X, Y, and Z axes are computed. These rotation angles are applied to compensate the pixel coordinates \(\mathbf{u}_{k}=\left[x_{k},y_{k}\right]^{T}\) of event \(e_{k}\), adjusting them to their corresponding positions \(\mathbf{u}_{k}^{{}^{\prime}}=\left[ \begin{smallmatrix}\omega_{k}^{{}^{\prime} },y_{k}^{{}^{\prime}}\end{smallmatrix} \right]^{T}\) at the reference timestamp  
Figure 2: The illustration of the visual–inertial alignment. By matching the visual structure with IMU preintegration, the system estimates the gyroscope bias and calibrates IMU measurements. \(t_{\text{ref}}\) using a warping function, as shown in Figure 4. The warping function applied to a single event in the group is defined as  
\[\mathbf{u}_{k}^{{}^{\prime}}=[\mathbf{R}(\mathbf{u}_{k}-\mathbf{o})-\mathbf{t}]+ \mathbf{o}, \tag{5}\]  
where \(\mathbf{o}\) denotes the coordinates of the center of the pixel plane, \(\mathbf{R}\in\mathbb{R}^{2\times 2}\) is the rotation matrix resulting from Z axis rotation, and \(\mathbf{t}\in\mathbb{R}^{2}\) is the two-dimensional translation vector resulting from rotation around the X axis and Y axis. The rotation matrix \(\mathbf{R}\) and the translation vector \(\mathbf{t}\) can be calculated as follows:  
\[\mathbf{R} =\left[ \begin{array}{cc}\cos\psi_{k}&\sin\psi_{k}\\ -\sin\psi_{k}&\cos\psi_{k}\end{array} \right], \tag{6}\] \[\mathbf{t} =(\mathbf{u}_{k}-\mathbf{o})-f/s\tan(\mathbf{\xi}),\] \[\mathbf{\xi} =\left[ \begin{array}{c}\mathbf{\xi}_{x}\\ \mathbf{\xi}_{y}\end{array} \right]=\left[ \begin{array}{c}\arctan(x_{k}s/f) -\theta_{k}\\ \arctan(y_{k}s/f)-\phi_{k}\end{array} \right].\]  
Here, \(f\) represents the focal length, and \(s\) denotes the pixel size. The compensated events set \(\mathcal{E}^{{}^{\prime}}\) is derived by the initial set \(\mathcal{E}\) through the warping function. Figure 3: The differences between the distributions of the raw events and the motion-compensated ones (blue: positive events; red: negative events). The event camera moves freely and observes scenes of an office and a moving person. (**a**) shows the distribution of the raw events in the spatiotemporal space. (**b**) shows the event frame formed by the accumulation of raw events. (**c**,**d**) show the motion-compensated results corresponding to (**a**,**b**), respectively. * Event-based Dynamicity Metrics Our dynamic pixel detection strategy leverages the significant differences in the mean timestamps of events triggered by dynamic objects compared to those from static backgrounds [337, 34].