# Flying Watchdog-Based Guard Patrol with Check Point Data Verification
## 3 Proposed Flying Watchdog Architecture
### PGP Detection Model
Among the array of edge detection algorithms available, the widely acclaimed Canny edge detector is frequently employed for its exceptional performance. This step is pivotal, as it is crucial in detecting encryption patterns characterized by various shapes. In this context, we use the Canny edge detector to detect edges within our images effectively. The procedure comprises several key stages, including Gaussian smoothing, gradient computation, non-maximum suppression, and edge tracking through hysteresis. The process commences with Gaussian smoothing, a critical step to reduce noise within the image. This operation involves applying a 2D Gaussian filter to the original photo, with the parameters of the Gaussian kernel determined by a formula that incorporates the standard deviation (\(\sigma\)), as seen in Equation (2). The outcome is a smoothed image rendition, setting the stage for subsequent and precise edge detection. \[\mathrm{G(x,y)}=\frac{1}{(2\pi\mathrm{\sigma^{2}})}\exp\left(-\frac{\left(x^{2} +y^{2}\right)}{(2\sigma^{2})}\right) \tag{2}\]  
The Gaussian kernel object position in a two-dimensional axis (x, y) is represented with \(\mathrm{G(x,y)}\). The standard deviation of the Gaussian distribution controls the amount of smoothing. After applying Gaussian smoothing, we focus on calculating image gradients to pinpoint regions displaying significant pixel intensity changes, which serve as key indicators of potential edges. This gradient computation is conducted in a horizontal (\(\mathrm{I_{x}}\)) and vertical (\(\mathrm{I_{y}}\)) directions through specialized filters represent this state, as seen in Equation (3). \[ \begin{bmatrix}\mathrm{I_{x}}\\ \mathrm{I_{y}}\end{bmatrix} =\mathrm{G} \begin{bmatrix}\mathrm{img}\begin{bmatrix} -1&0&1\\ \mathrm{img}\begin{bmatrix}-1&0&1\end{bmatrix}\end{bmatrix}\end{bmatrix}  \tag{3}\]  
Figure 5: The PGP detection scheme. In our analysis, the image obtained after Gaussian smoothing is denoted as 'G,' while the original image is symbolized as 'img'. We employ a concise 1 \(\times\) 3 matrix to establish image boundaries, representing the [left, center, right] positions. The central value (0 in the matrix) is multiplied by the corresponding pixel in the image. The left value (\(-1\) in the matrix) is multiplied by the pixel to the left. The correct value (1 in the matrix) is multiplied by the pixel to the right. We compute the gradient magnitude to gauge the intensity of edges at every pixel. This magnitude (mag) is derived as the square root of the sum of squared gradients in both the horizontal (x) and vertical (y) directions, which can be calculated using Equation (4). The gradient direction is computed using the tangent function to ascertain the orientation of edges, providing insight into edge orientations at each pixel, which can be seen in Equation (5). The symbol of 'dir' represented the gradient direction in radians. \[\text{mag}=\sqrt{\text{I}_{\text{x}}{}^{2}+\text{I}_{\text{y}}{}^{2}} \tag{4}\]  
\[\text{dir}=\tan^{-1}\big{(}\text{I}_{\text{x}},\text{I}_{\text{y}}\big{)} \tag{5}\]  
In the pursuit of refining detected edges, we implement non-maximum suppression as a pivotal step. This technique selectively preserves local gradient maxima while discarding less pronounced gradients, effectively thinning the edges and maintaining detection accuracy. Subsequently, we employ edge tracking via hysteresis to connect neighboring strong edge pixels, thereby establishing continuous edges. This process hinges on two threshold values: a high threshold (T\({}_{\text{high}}\)) and a low threshold (T\({}_{\text{low}}\)). Pixels with gradient magnitudes exceeding T\({}_{\text{high}}\) are classified as solid edges, while those falling between T\({}_{\text{low}}\) and T\({}_{\text{high}}\) are deemed weak edges. Weak edges are considered part of an edge if interconnected with solid edges, thus forming a coherent edge map.