## 3 System Overview
### ROI Management
#### 3.2.3 ROI Adjustment
Figure 4 shows a visual representation that compares the ROI center tracked by using optical flow and UAV detection. The x-axis indicates the frame number of a UAV video, and the y-axis indicates the coordinates of the ROI center. The accuracy of the ROI tracking using optical flow is illustrated in the figure. If the x and y coordinates calculated using the ROI tracking scheme introduced in this paper are close to the coordinates retrieved by using the UAV detection algorithm, the proposed scheme is accurate. As depicted in the figure, the ROI tracked by using optical flow matches the ROI derived using UAV detection. Figure 4c shows huge spikes near \(x=0\) and \(x=120\). These are not outliers: the UAV briefly jerked, and the ROI responded abruptly. However, the target UAV never goes out of the ROI set. This is the same case for Figure 4d,f. Authors have noticed that the slower the UAV, the better it is for tracking. Prior research of [33; 34] support our claim. In Table 2, the average differences of the predicted midpoint are shown. The proposed algorithm predicts the location of the UAV and bounds it with the ROI box. The differences were measured in pixels by comparing its prediction to the prediction of YOLOv7 applied to every frame. Since the proposed system's technique is a dead reckoning process, the error tends to accumulate over time. The accumulated error is resolved by applying the periodic UAV detection of I-frames. Overall, the locations of the two ROIs matched, indicating that our proposed scheme was as accurate as YOLO. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Video Name** & **Resolution** & **Original File Size** & **No. of Frames** \\ \hline
0 & 1920 \(\times\) 1080 & 81.4 MB & 1180 \\ \hline
1 & 1920 \(\times\) 1080 & 36.8 MB & 654 \\ \hline
2 & 1920 \(\times\) 1080 & 30 MB & 839 \\ \hline kaggle01 & 3840 \(\times\) 2160 & 41.4 MB & 1735 \\ \hline kaggle02 & 3840 \(\times\) 2160 & 16.3 MB & 665 \\ \hline Youtube & 1280 \(\times\) 720 & 18.2 MB & 300 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Video information. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Video Name**} & \multicolumn{2}{c}{**X-Coordinates**} & \multicolumn{2}{c}{**Y-Coordinates**} \\  & **Avg. Difference (pixels)** & **Avg. Difference (pixels)** \\ \hline
0 & 0 & 0 \\ \hline
1 & 0.007393715 & 0.007393715 \\ \hline
2 & 0.003726708 & 0.002484472 \\ \hline kaggle01 & 3.395935529 & 2.116327961 \\ \hline kaggle02 & 0.004622496 & 0.001540832 \\ \hline Youtube & 0.389105058 & 0.892023346 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Pixel difference of ROI midpoint. Figure 4: Accuracy of ROI management using optical flow. (**a**) Video 0. (**b**) Video 1. (**c**) Video 2. (**d**) Kaggle01. (**e**) Kaggle02. (**f**) Youtube. ### Image Quality Analysis

In this section, the visual quality of the proposed system's output is evaluated by comparing the encoded videos using the proposed scheme to videos produced by YOLOv7. Figure 5 presents a visual representation of the encoded videos. The right images are frames from the video encoded with the proposed system, and the left images are frames from the video processed by YOLOv7. As shown in the figure, the image quality around the UAV is maintained at a high level, while the quality of other regions is degraded. The two different visual qualities within a single image depicted in the figure indicate that our proposed system can successfully encode with varying compression rates. The slight degradation of visual quality is due to the extra compression on non-ROI. The quality within ROI is maintained. Also, the dampness in image quality was only in the non-important area, and the image quality in the important area was maintained. Thus, we can conclude that the proposed system efficiently encodes ROI and non-ROI with two different compression rates. ### Volume Size Analysis

This subsection investigates the effect of the XROI-DCT on file size. Table 3 shows the video file size produced by the proposed system and YOLOv7.