Unmanned aerial vehicle detection, tracking and observation enhancement based on mobile terminal native computational power
By performing UAV target detection and generating camera control parameters on a mobile terminal, a closed-loop feedback control is formed, which solves the problem of poor target imaging scale and quality of UAVs and achieves more stable observation results.
Patent Information
- Application Number
- CN202611189625.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-11-24
AI Technical Summary
Existing UAV detection methods suffer from poor imaging scale and quality when the target is small, off-center, or close to the edge of the image, leading to missed detections and unstable observations.
By utilizing the native computing resources of mobile terminals for drone target detection, camera control parameters are generated, forming a closed-loop feedback control between detection and imaging, and adjusting imaging parameters to optimize imaging of the drone target area.
It improves the imaging quality and observation stability of the UAV target area, especially when the target is small, off-center or close to the edge, and can improve the imaging scale and clarity in a timely manner.
Smart Images

Figure CN123160609A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of drone detection and tracking technology, specifically involving a drone detection, tracking, and observation enhancement method based on the native computing power of mobile terminals. Background Technology
[0002] With the rapid popularization of small civilian drones, the risk of drones flying illegally around airport perimeters, important facilities, major event sites, temporary control areas, and low-altitude sensitive airspace is constantly increasing. In order to detect, identify, and track aerial drone targets, existing anti-drone visual monitoring methods typically use dedicated computing platforms, airborne computers, embedded edge computing devices, or industrial control computers as image processing units, and cooperate with external industrial cameras, USB cameras, webcams, or optoelectronic imaging devices to acquire images. Then, target detection algorithms are used to identify and warn of drone targets in the images.
[0003] This method typically includes the following steps: mounting a fixed-focus or fixed-field-of-view camera on a drone, vehicle platform, fixed bracket, or temporary monitoring device; transmitting the video stream captured by the camera to an onboard computer, embedded computing board, or edge computing box via a data cable or network interface; running a drone target detection model or image processing algorithm on the computing platform; obtaining the target category, confidence level, and target bounding box position based on the model output; and finally using the detection results for display, alarm, recording, or further linkage with other devices.
[0004] However, in the application of this method, when the drone target is small, off-center from the image, short-term missed detection, or close to the edge of the image, the imaging scale of the area where the drone target is located is low and the imaging quality is poor. Summary of the Invention
[0005] The purpose of this invention is to provide a method for drone detection, tracking and observation enhancement based on the native computing power of mobile terminals, so as to improve the imaging scale and imaging quality of the area where the drone target is located when the drone target is small, off the center of the image, short-term missed detection, or close to the edge of the image.
[0006] The present invention adopts the following technical solution: A method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals, characterized by including: Acquire the video frame to be detected; the video frame to be detected is captured by the built-in camera of the mobile terminal; The target detection model is run using the native computing resources of the mobile terminal to perform drone target detection on the video frame to be detected, and the target detection box is obtained. Based on the position and size of the target detection box in the video frame, camera control parameters are generated; The camera control parameters are fed back to the built-in camera, and the imaging parameters of the built-in camera are adjusted so that the drone target in the subsequently acquired video frames is in the best observation state. Repeat the above steps to form a closed loop of detection and imaging control.
[0007] The beneficial effects of this invention are as follows: After the system completes the detection of the UAV target locally using the native computing resources of the mobile terminal, it uses the position and size of the obtained target detection box as feedback to generate camera control parameters that include digital zoom magnification, autofocus area, and automatic exposure metering area. These control parameters are then written into the imaging configuration of the built-in camera to drive the built-in camera to optimize imaging of the area where the UAV target is located during subsequent acquisition. Since the above feedback control process is continuously executed in a loop with the video stream, the imaging parameters of the built-in camera are always dynamically adjusted according to the state changes of the UAV target. Therefore, when the UAV target is small, deviates from the center of the image, is missed for a short time, or is close to the edge of the image, the system can promptly improve the target imaging scale, imaging clarity, and brightness, thereby effectively improving the imaging quality and continuous observation stability of the area where the UAV target is located. Attached Figure Description
[0008] Figure 1 This is a schematic diagram of the system structure of the present invention; Figure 2 This is a flowchart of the method of the present invention; Figure 3 This is a schematic diagram of the edge-side neural network inference and target post-processing flow of the present invention; Figure 4 This is a block diagram illustrating the closed-loop control principle of the present invention. Detailed Implementation
[0009] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0010] First, some of the terms involved in this invention will be explained. CPU stands for Central Processing Unit, GPU for Graphics Processing Unit, NPU for Neural Processing Unit, and DSP for Digital Signal Processor. All of these processors are native computing resources accessible to mobile terminals. YOLO is a single-stage object detection model (You Only LookOnce). JNI is the Java Native Interface, used by the application layer to call native inference libraries. YUV_420_888 is a commonly used image format for separating luminance and chrominance in mobile terminal cameras. NV21 is a YUV image storage format. RGB is a three-channel image format (red, green, and blue). NMS is Non-Maximum Suppression, used to remove duplicate bounding boxes. IoU is Intersection over Union, used to measure the degree of overlap between two object detection boxes. AF is Auto Focus, and AE is Auto Exposure.
[0011] In one embodiment, such as Figure 1 As shown, the system upon which the UAV detection, tracking and observation enhancement method based on the native computing power of mobile terminals of the present invention relies includes a camera acquisition module, an image preprocessing module, an edge-side inference module, a target post-processing module, a target tracking module, a camera closed-loop control module, a multi-lens state machine module, a display and interaction module, and a result output module.
[0012] The camera acquisition module is used to call the camera interface provided by the mobile terminal operating system to establish a preview stream and an image analysis stream. The preview stream is used to display the camera image on the screen in real time, and the image analysis stream is used to provide video frames to subsequent detection algorithms. For mobile terminals with multiple rear cameras, the camera acquisition module is also used to enumerate physical lenses such as wide-angle, main camera, and telephoto, and read parameters such as lens focal length, sensor orientation, effective pixel array, maximum digital zoom, and available zoom range.
[0013] The image preprocessing module is used to convert the video frames output from the image analysis stream into image data suitable for input to a neural network model.
[0014] The edge-side inference module is used to load a lightweight UAV target detection model on the mobile terminal and call on the mobile terminal's local computing resources such as CPU, GPU, NPU or DSP to complete neural network inference.
[0015] The target post-processing module is used to decode the target box, filter confidence scores, filter categories, perform coordinate mapping and non-maximum suppression on the model output to obtain candidate UAV targets.
[0016] The target tracking module is used to maintain the consistency of target identity across consecutive video frames. When multiple candidate targets exist in the frame, the target tracking module determines the current drone target to be tracked based on the candidate target's category, confidence level, target detection box area, target detection box center position, matching relationship with historical targets, and user selection status.
[0017] The camera closed-loop control module is used to calculate the target digital zoom ratio based on the size and eccentricity of the target to be tracked, and to generate the corresponding digital cropping area, autofocus area and auto exposure metering area.
[0018] The multi-lens state machine module is used to switch between different lenses such as wide-angle, main camera, and telephoto, enabling the system to adaptively switch between wide-range search, stable capture, and detailed observation.
[0019] The display interaction module is used to overlay detection boxes, category labels, confidence levels, current digital zoom levels, lens status, and alarm information on the preview screen, and allows users to click to select a target or manually adjust the system status.
[0020] The results output module is used to output information such as target category, confidence level, image coordinates, timestamp, lens status, digital zoom ratio, and alarm status to local or remote platforms.
[0021] This invention makes full use of the native hardware capabilities integrated into modern mobile terminals, including high-resolution cameras, multi-focal-length rear lenses (such as wide-angle, main camera, and telephoto), digital zoom, autofocus, auto exposure, and native computing resources such as CPU, GPU, NPU, or DSP.
[0022] This invention organizes the aforementioned native hardware capabilities into an edge-side visual closed loop for UAV detection. This means that video acquisition, target detection, and target tracking are completed on the mobile terminal itself, and the digital zoom, cropping area, focus area, exposure metering area, and multi-lens switching state are adaptively controlled based on the detection results. This improves the continuous detection capability and observation stability of long-distance small UAV targets without the need for external dedicated cameras and computing devices.
[0023] In one embodiment, the present invention provides a method for drone detection, tracking, and observation enhancement based on the native computing power of a mobile terminal, comprising: acquiring a video frame to be detected, the video frame being acquired by the built-in camera of the mobile terminal; running a target detection model using the native computing resources of the mobile terminal to detect drone targets in the video frame to be detected, obtaining a target detection box; generating camera control parameters based on the position and size of the target detection box in the video frame; feeding back the camera control parameters to the built-in camera to adjust the imaging parameters of the built-in camera so that the drone target in the subsequently acquired video frames is in a better observation state; and repeating the above steps to form a closed loop of detection and imaging control.
[0024] Specifically, such as Figure 2 As shown, the method of the present invention includes the following steps.
[0025] S1, Mobile Terminal Initialization: After the application starts, it requests camera permissions, creates a camera processing thread and an inference thread, initializes the native inference engine and related runtime resources, and reads the mobile terminal's camera parameters, supported resolutions, lens roles, maximum digital zoom magnification, and local model files. The mobile terminal can be a smartphone, tablet, or other portable terminal with a camera and a native processor. In implementation, it can use the Android system camera interface or an equivalent camera interface provided by iOS or other mobile operating systems.
[0026] S2, Establishing Preview and Image Analysis Streams: The mobile terminal uses its built-in camera to establish at least two output channels. The preview stream outputs real-time images to the display screen, while the image analysis stream provides video frames to the detection algorithm. The image analysis stream can use formats such as YUV_420_888. To reduce the computational load on the device side, the system can select an appropriate analysis resolution based on the mobile terminal's performance, such as 1280×720 or other equivalent resolutions. The system prioritizes acquiring the latest video frames rather than backlogged frames to reduce end-to-end detection latency.
[0027] To further reduce latency, the system can adopt a strategy of retaining only the latest frame, discarding older frames while the previous frame has not been processed, thus avoiding backlog in the detection thread. Video frames can be in YUV_420_888 format. Since neural networks typically require RGB format input, the image preprocessing module first converts them to NV21 or RGB format.
[0028] S3, Video Frame Preprocessing: For each frame, the system converts the camera's output YUV image into NV21 or RGB data in continuous memory, and then scales the RGB image proportionally to the input size required by the object detection model. To maintain the original image aspect ratio, the system fills the remaining area after scaling with fixed pixel values and normalizes these values. For example, the image can be scaled and filled to 640×640 pixels, with a fill value of 114 and a normalization coefficient of 1 / 255. Specific parameters can be adjusted according to the model input requirements and the performance of the mobile terminal.
[0029] During the preprocessing stage, the system scales the RGB image proportionally to the model input size and fills in any insufficient areas. Let the original video frame width and height be... and The model input width and height are respectively and The system then according to , , and Calculate the scaling factor and record the scaling factor and padding offset. The coordinates of the target detection boxes output by the subsequent model need to be calculated back to the original video frame coordinate system based on this scaling factor and padding offset.
[0030] S4, Edge-based UAV Target Detection: The mobile terminal loads a lightweight target detection model locally. This model is designed to identify at least UAV categories, and can also identify aircraft, birds, people, or other target categories as needed. The model can be a YOLO series model trained or fine-tuned with UAV samples, or other one-stage or multi-stage target detection models suitable for edge deployment. Model parameter files and weight files can be saved locally on the mobile terminal along with the application. The application calls the native inference engine via the JNI interface or an equivalent native interface, inputting the preprocessed image into the model to obtain model output containing candidate box center points, candidate box width and height, category scores, or confidence scores. This inference process is completed locally on the mobile terminal and does not rely on a cloud server.
[0031] During the model inference phase, the edge inference module inputs the preprocessed image into the lightweight UAV detection model. The model output can include multiple candidate targets, each containing center point coordinates, width, height, target confidence, and class confidence. The system can select different model sizes based on the mobile terminal's computing power and can utilize local computing resources such as CPU, GPU, NPU, or DSP to accelerate inference.
[0032] S5, Post-processing of Detection Results: The target post-processing module decodes and filters the model output. First, it reads the candidate box center point, width, height, and category score from the output tensor, selecting the category with the highest score as the candidate category. Then, it removes low-confidence candidate boxes based on a confidence threshold. Next, it inversely calculates the candidate boxes from the network input coordinate system to the original video frame coordinate system. Subsequently, it crops out-of-bounds coordinates. Finally, it sorts the boxes from highest to lowest confidence and removes duplicate target boxes using non-maximum suppression. The system can normalize anti_drone, drone, UAV, or equivalent labels to drone categories, and can also be extended to categories such as airplane, bird, and people depending on the actual application.
[0033] During the output decoding phase, the target post-processing module reads the model's output tensor, converts the center point, width, and height of each candidate target into the coordinates of its top-left and bottom-right corners, and calculates the confidence score of the candidate target. For the category output, the system selects the category with the highest category score as the candidate category and normalizes all drone-related labels to the drone category. If the confidence score of a candidate target is lower than a preset threshold, the candidate target is discarded.
[0034] During the coordinate restoration stage, the system calculates the target box from the model input coordinate system to the original video frame coordinate system based on the scaling ratio and fill offset recorded in the preprocessing stage, and performs boundary clipping on the target box to ensure that the target box coordinates do not exceed the range of the original video frame.
[0035] During the non-maximum suppression phase, the system sorts candidate boxes from high to low confidence, retains high-confidence target boxes, and deletes duplicate boxes with an intersection-union ratio (IUU) greater than a preset threshold, thus obtaining the final set of candidate UAV targets. This set is then sent to the target tracking module and the display and interaction module.
[0036] like Figure 3 As shown, the above-mentioned image input, preprocessing, model inference, output decoding, coordinate restoration, and non-maximum suppression stages together constitute the edge neural network inference and target post-processing flow.
[0037] S6, Target Selection: If a candidate UAV target exists in the current frame, the system can directly select that candidate target as the target to be tracked. If multiple candidate targets exist in the current frame, the system will comprehensively score the candidate target based on its category, confidence level, target detection box area, target detection box center distance, historical tracking status, and user-selected status, and select one target to be tracked. If the user clicks on a candidate target box in the display interface, the system will set that target as the priority tracking target and continuously attempt to re-identify and track the target for a preset holding time.
[0038] S7, Continuous Frame Target Matching and Status Update: The system matches candidate targets in the current frame with selected targets in the previous or historical frames. A matching score is calculated based on the intersection-union ratio (IU / U), normalized center distance, and confidence level of the target detection boxes. The candidate target with the highest matching score that meets the threshold condition is selected as the updated tracking target. If no target is detected in the current frame for a short period, but the historical detection results are still within the valid retention time, the display layer can continue to display the most recent valid target detection box, and the control layer can maintain the current digital zoom level or slowly regress the digital zoom level to reduce image jitter caused by short-term missed detections.
[0039] S8, Detection Box Feedback Control Camera: The system calculates the desired digital zoom ratio based on the size and eccentricity of the target in the video frame, and further calculates the digital cropping area on the effective pixel array of the camera sensor. Simultaneously, the system generates an autofocus area and an auto-exposure metering area based on the center position of the target detection box, enabling the camera to prioritize focusing and metering on the area where the drone target is located. When the drone target is small and consistently centered, the system gradually increases the digital zoom ratio; when the drone target approaches the edge of the frame or the tracking state is unstable, the system reduces or limits the digital zoom ratio to expand the field of view and prevent the target from leaving the frame.
[0040] S9, Multi-lens switching: For mobile terminals with multiple rear cameras, the system switches between wide-angle, main, and telephoto lenses based on the number of consecutively detected drone target frames, the number of lost frames, the number of centered frames, the target detection box size, and the current digital zoom level. The system can first use the wide-angle or main camera to search for the target, and then switch to the main camera or telephoto for detailed observation after the target is continuously detected and centered. When the target is close to the edge, the target detection box is too large, or the detection is unstable in telephoto mode, the system switches back to the main camera or wide-angle to recapture the target.
[0041] S10, Display, Alarm, and Result Output: The display and interaction module overlays the detection box, target label, confidence level, current digital zoom ratio, target digital zoom ratio, current lens role, and system status onto the preview screen. The system can also output alarm information and send the target category, confidence level, image coordinates, timestamp, lens status, and digital zoom ratio to a local or remote platform for manual review, on-site evidence collection, trajectory recording, or linkage with external alarm, recording, or handling systems.
[0042] In another embodiment, generating camera control parameters based on the position and size of the target detection box in the video frame includes: calculating the scaling requirement based on the size of the target detection box; calculating the eccentricity based on the offset of the center of the target detection box relative to the center of the image; when the eccentricity is greater than an edge threshold, reducing the digital zoom ratio or limiting the digital zoom ratio to continue increasing; when the eccentricity is less than or equal to the edge threshold and the drone target is continuously centered, if the scaling requirement is greater than 1, increasing the digital zoom ratio; if the scaling requirement is less than 1, reducing the digital zoom ratio.
[0043] Specifically, let the coordinates of the top-left and bottom-right corners of the target detection box in the original video frame coordinate system be respectively... and The width and height of the video frame are respectively and The coordinates of the center of the target detection box are then expressed as: , , in, and Indicates the center position of the target detection box. The center of the target detection box is in the video frame coordinate, The center of the target detection box is in the video frame coordinate.
[0044] The scale of the target detection box is represented as follows: , in, This indicates the visible scale of the target detection box in the image (i.e., the larger of the width and height).
[0045] The normalized eccentricity is expressed as: , , in, and This represents the normalized offset of the target detection box center relative to the image center. The center of the target detection box is at Normalized eccentricity of direction, The center of the target detection box is at Normalized eccentricity of direction, or The larger the value, the closer the drone target is to the edge of the frame.
[0046] The system calculates scaling requirements based on the maximum side length of the target detection box and the desired target detection box size: if the target detection box is too small, the scaling requirement is greater than 1, indicating that the digital zoom magnification needs to be increased; if the target detection box is already large enough, the scaling requirement is close to or less than 1, indicating that further zooming is not necessary or that appropriate scaling is required. The system limits the scaling requirement to a preset range to avoid sudden changes in the digital zoom magnification caused by fluctuations in single-frame detection.
[0047] The system uses the center eccentricity of the target detection box as a reference. and Determine if the drone target is close to the edge of the frame. When or When the zoom level exceeds the edge threshold, it indicates that the drone target may be about to leave the frame. At this point, the system reduces the target zoom or limits further magnification to expand the field of view. The target zoom level at this time... It can be represented as: , in, This is the current zoom level. The backoff coefficient is less than 1.
[0048] When the target is not near the edge of the frame and remains centered, the target zoom can be expressed as: , in, To limit scaling requirements within a preset range, and These are the minimum and maximum allowable zoom amounts corresponding to the current tracking state or the current camera character, respectively. This represents the amplitude limiting function.
[0049] In another embodiment, an autofocus area and an auto exposure metering area are generated in the video frame based on the center position of the target detection box, so that the built-in camera prioritizes focusing and metering on the area where the drone target is located.
[0050] Specifically, the system uses the normalized coordinates of the target detection box center in the video frame. And the cropping area corresponding to the current digital zoom magnification, the center position of the target detection box is mapped onto the current cropping area to obtain the center position of autofocus and auto exposure metering. The mapped point can be represented as: , , in, and This is the normalized offset of the top-left corner of the current digital cropped region within the original sensor pixel array. The top left corner of the cropping area coordinate, The top left corner of the cropping area coordinate, The normalized width of the current digital cropping region, and The normalized height of the current digital cropping area.
[0051] The system constructs a focus and metering rectangle with a preset or adaptive side length centered on the mapping point, and writes this rectangle into the camera's repeated preview request, enabling the camera to prioritize autofocus and auto exposure on the area where the drone target is located. To avoid increasing the load caused by frequent camera requests, the system can set a minimum update interval, updating the autofocus area and auto exposure metering area only when the center position of the target detection box changes beyond a threshold or reaches the update interval.
[0052] In another embodiment, the mobile terminal has multiple physical cameras, and the method further includes switching between the multiple physical cameras based on the number of consecutively detected frames, the number of lost frames, the eccentricity, and the target detection box size of the drone target.
[0053] Specifically, for mobile terminals with multiple rear cameras, the system establishes a multi-lens state machine to achieve automatic switching between wide-angle, main camera, and telephoto lenses. The system switches between wide-angle, main camera, and telephoto lenses based on the number of consecutive detected frames, the number of lost frames, the eccentricity, and the target detection box size, enabling the system to adaptively switch between wide-range searching, stable acquisition, and detailed observation.
[0054] To avoid screen flickering and instability caused by frequent camera switching, the system is configured with a switching cooldown time and a switching suspension flag. Before a camera switch is completed, the system pauses new camera switch requests. During the switch, the system retains the user-selected target, historical target detection frames, current digital zoom level, and necessary tracking status. After reopening the target camera, the system continues target detection, target tracking, and digital zoom level control. Automatic camera switching is only performed when conditions such as the number of consecutive detected frames, target centering accuracy, target detection frame size, and time interval are simultaneously met.
[0055] In another embodiment, the multiple physical cameras include a wide-angle camera, a main camera, and a telephoto camera. In search mode, the wide-angle camera or the main camera is used for a wide field of view search. When a drone target is detected for several consecutive frames and the eccentricity is lower than a preset threshold, the system switches to the main camera for tracking. In main camera tracking mode, when the drone target is continuously centered and the target detection box size is smaller than the desired scale, the system switches to the telephoto camera for detailed observation. In telephoto tracking mode, when the drone target is close to the edge of the frame, the number of consecutive missed detection frames exceeds a preset value, or the detection confidence is lower than a preset threshold, the system switches back to the main camera or the wide-angle camera.
[0056] Specifically, the multi-lens state machine includes at least a search state, an acquisition state, a main camera tracking state, a telephoto tracking state, and a target loss state.
[0057] In search mode, the system uses a wide-angle camera or the main camera to obtain a larger field of view, making it easier to detect suspicious aerial targets. When the system detects a drone target for several consecutive frames and the eccentricity is below a preset threshold, the state machine enters the acquisition mode. In acquisition mode, the system gradually adjusts the digital zoom to bring the drone target closer to the center of the image and increase the target's imaging scale.
[0058] When the drone target remains centered within the main camera's viewfinder, and the current digital zoom is nearing the main camera's maximum allowable zoom level or the target detection box size is still smaller than the desired scale, the system can switch to the telephoto camera for detailed observation. In telephoto tracking mode, the system continues to perform edge detection, target tracking, and digital zoom control to maintain high visibility of small, distant drone targets. When the drone target approaches the edge of the frame in telephoto mode, the target detection box becomes too large, there are consecutive missed detections, or the detection confidence decreases, the state machine switches back to the main camera or wide-angle camera to expand the field of view and re-acquire the target.
[0059] A multi-lens state machine can be represented by a state transition diagram. The diagram includes five states: "Search," "Capture," "Main Camera Tracking," "Telephoto Tracking," and "Target Loss." "Search" transitions to "Capture" after consecutive target detections; "Capture" transitions to "Main Camera Tracking" after the target is centered; "Main Camera Tracking" transitions to "Telephoto Tracking" when the target is small and the zoom is near its limit; "Telephoto Tracking" returns to "Main Camera Tracking" or "Search" when the target is near the edge, too large, or detection is unstable; any state transitions to "Target Loss" after consecutive target losses; "Target Loss" returns to "Capture" or "Main Camera Tracking" after the target is detected again.
[0060] In another embodiment, the method further includes: a user selecting candidate drone targets on a display interface; setting the selected candidate drone target as the priority tracking drone target; and, for a preset holding time, the priority tracking drone target has a higher selection priority than other candidate drone targets.
[0061] Specifically, when a user clicks on a candidate target box in the display, the system sets that candidate drone target as the priority tracking drone target. The user's target selection does not change the inference process of the underlying detection model, but it does affect target selection, digital zoom control, and lens switching strategies, making the system more suitable for scenarios such as manual patrols, on-site verification, and evidence collection. Prioritized tracking drone targets have a higher selection priority for a preset holding time. Even if other high-confidence targets appear in subsequent frames, the system will still prioritize matching the current candidate drone target with the user-selected target.
[0062] Through the aforementioned user selection locking mechanism, the system maintains the continuity and consistency of user intent among multiple candidate targets, effectively avoiding the problems of false target switching and detection box jumps caused by fluctuations in model detection results.
[0063] In another embodiment, when there are multiple candidate drone targets in a frame, the current drone target to be tracked is selected based on at least one of the following: the confidence of each candidate drone target, the target detection box area of each candidate drone target, the normalized distance between the center of each candidate drone target and the center of the drone target selected in the previous frame, the intersection-union ratio of the target detection boxes of each candidate drone target and the drone target selected in the previous frame, and whether the user has selected the candidate drone target on the display interface.
[0064] Specifically, when there are multiple candidate UAV targets in a frame, the system can select the current control target based on confidence level, target detection box area, eccentricity, and historical matching relationship.
[0065] In one implementation, the target was selected in the previous frame. and current frame candidate targets The system calculates the Intersection over Union (IoU) and Normalized Center Distance (NCD) of the two target detection boxes. and candidate target confidence The normalized central distance can be expressed as: , in, For normalized center distance, and Select target for the previous frame The center of the detection frame , coordinate, and Candidate targets for the current frame The center of the detection frame , coordinate.
[0066] Match score can be expressed as: , in, , , This is a weighting coefficient, which can be set according to the needs of the scenario. The system selects the candidate target with the highest matching score that meets the intersection-union ratio threshold or center distance threshold as the updated tracking target. This method can reduce false target switching and detection box jumps in multi-target scenarios.
[0067] In another embodiment, the method further includes drone target loss handling: when no drone target is detected in the current frame and the historical detection results are within the valid retention time, the most recent valid target detection box continues to be displayed, and the current digital zoom magnification is maintained or the digital zoom magnification is rolled back.
[0068] Specifically, the system combines the number of consecutively detected frames, the number of lost frames, and historical target states to maintain target visibility. If the drone target is not detected briefly in the current frame, but the historical detection results are still within the valid retention time, the display layer can continue to display the most recent valid target detection frame, and the control layer can maintain the current digital zoom level or slowly reduce the digital zoom level to reduce image jitter and tracking interruptions caused by short-term missed detections. If the drone target is not detected again within a short period of time, the system can continue to retain the historical target detection frame and tracking state, and reduce the digital zoom level or expand the field of view to re-acquire the target.
[0069] In another embodiment, Figure 4 This is a block diagram illustrating the closed-loop control principle of the present invention. In the diagram, the target detection module outputs the target center, target scale, and confidence level; the target state calculation module outputs the eccentricity, number of consecutively detected frames, and number of lost frames based on the above information; the zoom controller calculates the target zoom based on the target scale and eccentricity; the cropping region calculation module generates a digital cropping region; the focus and exposure controller generates autofocus and auto-exposure metering regions; the camera update request module writes the cropping region, focus region, and exposure metering region into the mobile terminal camera interface; finally, the camera outputs a new image frame, forming a closed loop.
[0070] In existing technologies, cameras are merely passive image acquisition devices, and detection algorithms are only responsible for outputting target bounding boxes and category information. The detection results are not used to control the camera's imaging parameters. This invention establishes a closed-loop feedback between the detection results and the camera's imaging parameters, enabling the camera to adaptively adjust its imaging parameters based on the real-time status of the UAV target (such as position, size, eccentricity, continuous detection status, and historical tracking status). This overcomes the shortcomings of existing technologies where the camera and detection algorithm are isolated from each other.
[0071] In another embodiment, the digital zoom magnification is adjusted using a first-order smoothing method, expressed as: , in, For the first Digital zoom magnification applied to frames. For the first Digital zoom magnification applied to frames. For smoothing coefficients, The target digital zoom ratio; When the target digital zoom ratio is greater than the digital zoom ratio applied in the previous frame, the smoothing coefficient takes the first value, causing the digital zoom to increase slowly; when the target digital zoom ratio is less than the digital zoom ratio applied in the previous frame, the smoothing coefficient takes the second value, causing the digital zoom to revert more quickly; the second value is greater than the first value.
[0072] Specifically, to avoid abrupt image changes, the system does not directly set the camera's digital zoom ratio to the target digital zoom ratio. Instead, it updates the current digital zoom ratio using a first-order smoothing method. When the target digital zoom ratio is greater than the digital zoom ratio applied in the previous frame, the system uses a smaller smoothing coefficient to gradually zoom in on the image. When the target digital zoom ratio is less than the digital zoom ratio applied in the previous frame, the system uses a larger smoothing coefficient, allowing it to quickly expand the field of view when the target is near the edge or when detection is unstable. Through this method, the system balances magnified observation of small, distant targets with continuous acquisition of moving targets.
[0073] After calculating the current digital zoom ratio, the system calculates the digital cropping region based on the sensor's effective pixel array. Let the width of the sensor's effective pixel array be... The height of the sensor's effective pixel array is The current digital zoom magnification is Then the width and height of the cropping area are: , , Based on the center of the sensor's effective pixel array, the coordinates of the top left corner of the cropped area are: , , The coordinates of the bottom right corner of the cropping area are: , , in, The upper left corner of the sensor's effective pixel array coordinate, The upper left corner of the sensor's effective pixel array coordinate, The bottom right corner of the cropping area coordinate, The bottom right corner of the cropping area coordinate.
[0074] The cropped area is calculated based on the center of the sensor's effective pixel array. The system writes the cropped area into the camera preview request, thereby realizing digital zoom control of the mobile terminal camera.
[0075] In another embodiment, before performing drone target detection on the video frame to be detected, image preprocessing is also included: converting the YUV image captured by the built-in camera into an RGB image; scaling the RGB image proportionally to the input size required by the target detection model, and filling the remaining area after scaling; recording the scaling ratio and filling offset, which are used to back-calculate the target detection box coordinates output by the target detection model to the original video frame coordinate system.
[0076] Specifically, for each frame, the system converts the YUV image output from the camera into NV21 or RGB data in continuous memory, and then scales the RGB image proportionally to the input size required by the object detection model. To maintain the original image aspect ratio, the system fills the remaining area after scaling with fixed pixel values and normalizes these values. For example, the image can be scaled and filled to 640×640 pixels, with a fill value of 114 and a normalization coefficient of 1 / 255. These specific parameters can be adjusted according to the model input requirements and the performance of the mobile terminal.
[0077] Let the original video frame width and height be respectively and The model input width and height are respectively and The system then according to , , and Calculate the scaling factor and record the scaling factor and padding offset. The coordinates of the target detection boxes output by the subsequent model need to be calculated back to the original video frame coordinate system based on this scaling factor and padding offset.
[0078] During the coordinate restoration stage, the system calculates the target detection box from the model input coordinate system to the original video frame coordinate system based on the scaling ratio and fill offset recorded in the preprocessing stage, and performs boundary clipping on the target detection box to ensure that the target detection box coordinates do not exceed the range of the original video frame.
[0079] In another embodiment, the display interaction module displays the camera preview on the mobile terminal screen in real time, and overlays the drone target detection box, target label, confidence level, current digital zoom level, target digital zoom level, current lens role, and system status.
[0080] Specifically, users can start and stop detection, switch models, switch target categories, start and stop automatic zoom, start and stop automatic lens switching, manually adjust zoom magnification, and click to select or clear target selection via the interface. The system can also output alarm information when a drone target is detected.
[0081] The output module can output the drone target category, confidence level, target bounding box image coordinates, timestamp, current camera status, current zoom level, target tracking status, and alarm status to local storage or a remote platform. The output information can be used for manual verification, audible and visual alarms, trajectory recording, on-site evidence collection, or in conjunction with other legally compliant anti-drone disposal equipment.
[0082] In another embodiment, during the model loading process, when the mobile terminal performance is insufficient, or during system debugging, the present invention can also set up a backup detection method. The backup detection method can find compact regions that are significantly brighter than the background brightness in the image brightness plane, and exclude excessively large regions or obvious background interference based on region area, aspect ratio, motion continuity, and positional changes. This backup method can be used to quickly verify the automatic zoom loop closure, and can also be fused with neural network detection results to improve the system's robustness against specific sky backgrounds.
[0083] The implementation of this invention is not limited to a specific object detection model, a specific mobile inference framework, or a specific operating system. In addition to the YOLO series models, other object detection networks suitable for edge deployment can also be used, such as SSD, EfficientDet, MobileNet-SSD, NanoDet, PP-YOLOE, etc.; in addition to the NCNN inference engine, TensorFlow Lite, ONNX Runtime Mobile, MNN, OpenVINO, Core ML, SNPE, etc. can also be used; in addition to Android mobile terminals, it can also be implemented on other mobile terminals with cameras, processors, memory, and displays.
Claims
1. A method for UAV detection, tracking, and observation enhancement based on the native computing power of mobile terminals, characterized in that, include: Obtain the video frames to be detected; The video frames to be detected are captured by the built-in camera of the mobile terminal; The target detection model is run using the native computing resources of the mobile terminal to perform UAV target detection on the video frame to be detected, and target detection boxes are obtained. Based on the position and size of the target detection box in the video frame, camera control parameters are generated; The camera control parameters are fed back to the built-in camera, and the imaging parameters of the built-in camera are adjusted so that the drone target in the subsequently acquired video frames is in the best observation state. Repeat the above steps to form a closed loop of detection and imaging control.
2. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 1, characterized in that, Based on the position and size of the target detection box in the video frame, camera control parameters are generated, including: Calculate the scaling requirement based on the size of the target detection box; The eccentricity is calculated based on the offset of the center of the target detection box relative to the center of the image. When the eccentricity is greater than the edge threshold, the digital zoom magnification is reduced or the digital zoom magnification is limited to continue to increase. When the eccentricity is less than or equal to the edge threshold and the UAV target is continuously centered, if the scaling requirement is greater than 1, the digital zoom ratio is increased; if the scaling requirement is less than 1, the digital zoom ratio is decreased.
3. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 2, characterized in that, Also includes: Based on the center position of the target detection box, an autofocus area and an auto exposure metering area are generated in the video frame, so that the built-in camera prioritizes focusing and metering on the area where the drone target is located.
4. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 3, characterized in that, The mobile terminal has multiple physical cameras, and the method further includes: The system switches between the multiple physical cameras based on the number of consecutively detected frames, the number of lost frames, the eccentricity, and the target detection box size of the drone target.
5. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 4, characterized in that, The multiple physical cameras include a wide-angle camera, a main camera, and a telephoto camera; In search mode, use the wide-angle camera or the main camera to perform a wide field of view search; When the drone target is detected in several consecutive frames and the eccentricity is lower than a preset threshold, the system switches to the main camera for tracking. In main camera tracking mode, when the drone target is continuously centered and the target detection box size is smaller than the desired scale, switch to telephoto camera for detailed observation; In telephoto tracking mode, when the drone target approaches the edge of the frame, the number of consecutive missed frames exceeds a preset value, or the detection confidence level is lower than a preset threshold, the camera switches back to the main camera or the wide-angle camera.
6. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 5, characterized in that, Also includes: Users select candidate drone targets on the display interface; Set the candidate drone target selected by the user as the priority drone target to track; During a preset holding time, the priority tracking drone target has a higher selection priority than other candidate drone targets.
7. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 6, characterized in that, When multiple candidate drone targets exist in a frame, the current drone target to be tracked is selected based on at least one of the following: The confidence level of each candidate drone target, the area of the target bounding box of each candidate drone target, the normalized distance between the center of each candidate drone target and the center of the selected drone target in the previous frame, the intersection-union ratio of the target detection boxes of each candidate drone target and the selected drone target in the previous frame, and whether the user has selected the candidate drone target on the display interface.
8. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 7, characterized in that, This also includes handling drone target loss: If no drone target is detected in the current frame and the historical detection results are within the valid retention time, the most recent valid target detection will continue to be displayed, and the current digital zoom magnification will be maintained or the digital zoom magnification will be rolled back.
9. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 8, characterized in that, The adjustment of the digital zoom magnification adopts a first-order smoothing method, which is expressed as: , in, For the first Digital zoom magnification applied to frames. For the first Digital zoom magnification applied to frames. For smoothing coefficients, The target digital zoom ratio; When the target digital zoom ratio is greater than the digital zoom ratio applied in the previous frame, the smoothing coefficient takes the first value, so that the digital zoom is slowly magnified. When the target digital zoom ratio is less than the digital zoom ratio applied in the previous frame, the smoothing coefficient takes a second value, so that the digital zoom can be rolled back more quickly. The second value is greater than the first value.
10. The method for drone detection, tracking, and observation enhancement based on the native computing power of mobile terminals according to claim 9, characterized in that, Before performing UAV target detection on the video frame to be detected, image preprocessing is also included: Convert the YUV images captured by the built-in camera into RGB images; The RGB image is scaled proportionally to the input size required by the target detection model, and the remaining area after scaling is filled. Record the scaling ratio and padding offset, which are used to back-calculate the target bounding box coordinates output by the target detection model back to the original video frame coordinate system.
