# Flying Watchdog-Based Guard Patrol with Check Point Data Verification
## 3 Proposed Flying Watchdog Architecture
### PGP Detection Model  
This study presents an innovative real-time pipeline that detects and recognizes PGP characterized by distinct colors and patterns. As detailed in Section 2, contemporary light detection technology predominantly finds application in traffic light detection. These systems are typically tailored for fixed-shaped objects, such as traffic lights, and primarily rely on three distinct detection colors coupled with specific algorithms for recognition. In our research, we adopted an edge light detection approach and a greyscale color translation algorithm to expedite the capturing and filtering of the emitted LED light. The proposed system leverages an Intel D435 camera, capable of capturing high-resolution 1080p videos, which is seamlessly interfaced with an NVIDIA Jetson, serving as the primary image processing unit. The system rigorously analyzes various lighting conditions to ensure  
Figure 2: The architecture of flying watchdog. robust performance. In addition to its sophisticated image processing capabilities, the study also delves into the design and investigation of PGP variants, comprising three unique shapes and dot patterns, each distinguished by a diverse color palette, as exemplified in Figure 4. Specifically, white is adopted for the PGP shape, while the dot patterns exhibit a harmonious blend of blue, red, purple, yellow, and white hues. The PGP detection model is constructed with a multi-stage approach encompassing essential preprocessing steps, color space transformation, segmentation via thresholding and contouring, and morphological operations. Within the preprocessing stage, the system identifies regions of interest, performs image denoising, and rectifies images, particularly in low-light settings. The threshold value is meticulously computed through the thresholding and contouring process to effectively distinguish between daytime and night-time scenarios, ensuring accurate image segmentation. Subsequently, the image is subjected to critical procedures, including feature extraction, classification, and verification. The verification stage represents the final step, validating the color and shape codes against predefined targets before transmitting data via a laser medium. The proposed PGP detection scheme, elucidating the intricate workings of this model, is thoughtfully depicted in Figure 5, providing valuable insights into the system's operational flow and critical components. Figure 4: PGP based on: (**a**) dot square shape; (**b**) pattern (triangle, square, and pentagon). Figure 3: Flying watchdog schematic design. The detection process involves thresholding and contouring, where the initial step focuses on segmenting the image into regions or objects of interest based on pixel intensity values. The image is first converted to grayscale to facilitate intensity-based analysis. Each pixel's intensity is quantified on a scale from 0 (representing black) to 255 (indicating white). Subsequently, a threshold value (T) is meticulously selected, considering the unique characteristics of the image and the desired segregation of objects from the background. This thresholding operation transforms the grayscale image into a binary image, with each pixel assuming a value of either 0 (black) if its intensity (Int) falls below the threshold (Int \(<\) T) or 255 (white) if its intensity surpasses or equals the threshold (Int \(\geq\) T). Equation (1) represents the mathematical terms for a binary pixel (b). \[\mathrm{f(b)}=\left\{ \begin{array}{cl}0,\,\mathrm{if}\,\mathrm{Int}<\mathrm{ T}\\ 255,\,\,\mathrm{if}\,\mathrm{Int}\geq\mathrm{T}\end{array} \right. \tag{1}\]  
In the second phase of the contouring process, we aim to identify and outline the boundaries of objects or regions within the binary image precisely. The identification process involves a series of sequential operations, commencing with the crucial edge detection step. Edge detection accentuates parts of rapid intensity change within the image, which directly correspond to the boundaries of objects.