An unmanned aerial vehicle switching control method based on visual detection
Patent Information
- Application Number
- CN202611218820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-20
AI Technical Summary
本发明提出的一种基于视觉检测的无人机切换控制方法,通过构建无人机视觉控制数据预处理、视觉图像序列与飞行状态序列生成、改进Mamba-YOLO网络检测分析、DeepOC-SORT算法轨迹关联以及控制模式候选集合生成流程,提高了无人机在复杂视觉环境下的控制模式切换准确性。相比传统仅依据单帧目标检测框、检测类别或检测置信度进行切换判断的方法,本发明将视觉图像、飞行状态和当前控制模式按照采集时间索引进行关联,使无人机控制模式切换判断具备连续时序依据,降低了目标短时遮挡、检测置信度波动和飞行视角变化对切换判断的干扰。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and in particular to a method for switching control of unmanned aerial vehicles based on visual inspection. Background Technology
[0002] With the development of unmanned aerial vehicle (UAV) platforms, airborne visual sensors, target detection networks, and autonomous flight control technologies, UAVs have been widely applied in scenarios such as target tracking, low-altitude cruise, emergency search and rescue, site inspection, intelligent landing, and reconnaissance in complex environments. Existing UAVs typically acquire flight environment images through airborne visible light cameras, depth cameras, or multi-sensor devices, and combine this with flight status data to identify targets, obstacles, passable areas, and landing areas. Based on the identification results, they then perform flight control tasks such as target tracking, obstacle avoidance, hovering repositioning, landing alignment, or return-to-home protection. With the development of deep learning target detection networks, vision-based UAV control methods can quickly identify mission targets and environmental risks in image frames and provide the detection results to subsequent flight control modules for control command generation. Compared to methods relying on manual remote control or single sensor judgment, this approach offers stronger environmental perception, more flexible mission execution, and a higher degree of autonomous control.
[0003] Existing vision-based UAV control methods often use target detection results as the basis for single-frame judgment, directly triggering tracking, obstacle avoidance, or landing control based on target bounding box position, target category, and detection confidence. This lacks a structured representation of flight viewpoint disturbances, forward airspace risk distribution, and visual states during scene transitions. Pitch, roll, yaw, speed changes, and altitude changes during UAV flight cause image target and background structure shifts. Existing methods easily misinterpret image drift caused by flight control actions as actual target movement, leading to unstable trajectory correlation. Furthermore, existing methods typically only determine the presence of obstacles in the image, without considering the risk state in different airspace slices based on the UAV's forward flight direction, resulting in inaccurate obstacle avoidance takeover timing. During control mode switching, a short-term departure from the main target's field of view, occlusion, or weak detection response can easily be misinterpreted as target loss, leading to frequent switching, lag, or discontinuous control commands between target tracking, hovering relocation, obstacle avoidance takeover, and landing alignment.
[0004] Therefore, how to provide a vision-based drone switching control method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a vision-based UAV switching control method. This invention utilizes an improved Mamba-YOLO network, the Deep OC-SORT algorithm, forward airspace risk analysis, and trajectory switching feature extraction techniques to jointly process UAV visual images, flight status, and current control mode. This generates a sequence of detected objects, a forward airspace risk slice sequence, a switching scene visual atom sequence, and a target trajectory feature set. Based on these, the target control mode and UAV control commands are determined, enabling stable switching between target tracking, obstacle avoidance takeover, primary target reconnection, hovering repositioning, and landing alignment. Compared to traditional switching judgments based on single-frame detection results, this invention offers advantages such as strong adaptability to flight perspective disturbances, accurate target trajectory recognition, clear airspace risk representation, and stable control mode switching.
[0006] A vision-based unmanned aerial vehicle (UAV) switching control method according to an embodiment of the present invention includes: Collect UAV visual control data and perform preprocessing to generate a standardized UAV visual control dataset; A data acquisition time index is established based on a standardized UAV visual control dataset, and visual image sequences, flight status sequences, and current control mode sequences are generated according to the data acquisition time index. An improved Mamba-YOLO network is constructed, which includes a flight viewpoint disturbance feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer. The network is given as input visual image sequences and flight state sequences, and generates detection object sequences, forward airspace risk slice sequences, and scene switching visual atom sequences. The detection object sequence is input into the Deep OC-SORT algorithm, and combined with the flight state sequence and the current control mode sequence, the detection object is subjected to trajectory association, flight control inversion trajectory decoupling processing and main target freeze and reconnection operation to generate target trajectory feature set; Based on the target trajectory feature set, forward airspace risk slice sequence and switching scene visual atom sequence, extract the target tracking status, obstacle avoidance takeover status, main target reconnection status and target loss status, and generate a control mode candidate set. The target control mode is determined based on the candidate set of control modes and the current control mode sequence. The speed adjustment, heading adjustment, altitude adjustment and attitude adjustment corresponding to the target control mode are generated, and the UAV control commands are formed. Issue UAV control commands, collect switching control feedback data, generate switching control feedback records, and update the standardized UAV visual control dataset, improve Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters.
[0007] Optionally, generating a standardized UAV visual control dataset includes: Collect UAV visual control data, which includes airborne visual images, image acquisition time, flight status data, current control mode records, and historical control command records; Based on the UAV number, mission number, and image acquisition time, the UAV visual control data is correlated to generate the original UAV visual control data sequence. Based on the original visual control data sequence of the UAV, the airborne visual images are processed by removing invalid frames, deleting duplicate frames, unifying image size and normalizing pixel values to generate standardized visual image data. Based on the original visual control data sequence of the UAV, timestamp calibration, missing field filling, abnormal state removal and numerical standardization are performed on the flight status data, current control mode record and historical control command record to generate standardized flight control data. Standardized visual image data and standardized flight control data are mapped according to the image acquisition time to generate a standardized UAV visual control dataset.
[0008] Optionally, the generation of the visual image sequence, flight state sequence, and current control mode sequence includes: Read the standardized UAV visual control dataset, extract standardized flight status data, current control mode records and corresponding acquisition times from the standardized flight control data, and extract standardized visual image data; The standardized visual image data, standardized flight status data, and current control mode records are sorted in chronological order of acquisition time to generate an acquisition time index; Based on the acquisition time index, standardized visual image data is written to the corresponding time position to generate a visual image sequence; Based on the collection time index, standardized flight status data is written to the corresponding time position to generate a flight status sequence, which includes the UAV position, flight speed, flight altitude, attitude angle and yaw angle. Based on the acquisition time index, the current control mode record is written to the corresponding time position to generate the current control mode sequence; Perform time index consistency checks on the visual image sequence, flight status sequence, and current control mode sequence to generate visual image sequences, flight status sequences, and current control mode sequences with the same acquisition time index.
[0009] Optionally, the generation of the detection object sequence, the forward spatial risk slice sequence, and the scene switching visual atom sequence includes: An improved Mamba-YOLO network was constructed, which includes a flight viewpoint perturbation feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer. The flight viewpoint perturbation feature correction layer reads the visual image sequence and the flight state sequence, extracts the background structure offset, target candidate region response and image edge change in adjacent visual images, and combines the attitude angle, yaw angle, flight speed and flight altitude in the flight state sequence to perform viewpoint perturbation correction on the detection features output by the Mamba-YOLO backbone network to generate a viewpoint corrected detection feature sequence. The forward airspace risk slice analysis layer reads the yaw angle in the viewpoint correction detection feature sequence and flight state sequence, divides the visual image into the center forward slice, left forward slice, right forward slice, ascending avoidance slice and descending avoidance slice according to the forward flight direction of the UAV, and analyzes the target candidate area, obstacle candidate area and passable area in each forward airspace slice to generate the forward airspace risk slice sequence. The scene switching visual atom generation layer reads the viewpoint correction detection feature sequence and the forward spatial risk slice sequence to generate a detection object sequence. Based on the positional relationship, occlusion relationship and regional occupancy relationship of the detection objects in the forward spatial risk slice, the scene switching visual atom sequence is generated. The scene switching visual atom sequence includes target forward appearance atom, obstacle occupancy atom, safe area visible atom, target occupancy atom and landing area visible atom. The improved Mamba-YOLO network was trained using a combination of object classification error, bounding box localization error, viewpoint perturbation correction error, forward spatial domain slice recognition error, and scene switching visual atom recognition error as joint optimization objectives. The network parameters of the flight viewpoint perturbation feature correction layer, the forward spatial domain risk slice parsing layer, and the scene switching visual atom generation layer were continuously optimized. When the change in the joint loss value in five consecutive training rounds was less than 0.001, the improved Mamba-YOLO network was considered to have completed convergence training.
[0010] Optionally, generating the target trajectory feature set includes: Read the detection object sequence, flight status sequence, and current control mode sequence, and write the target detection objects and obstacle detection objects in the detection object sequence into the observation queue of the Deep OC-SORT algorithm according to the acquisition time index; The Deep OC-SORT algorithm extracts appearance features from the image region corresponding to the detected object based on the detection box center, detection box boundary, category identifier, and detection confidence. It performs trajectory association on the detected objects under adjacent acquisition time indices to generate trajectory association results, target initial trajectory, and obstacle initial trajectory. Based on the flight speed, flight altitude, attitude angle and yaw angle in the flight state sequence, the initial trajectory of the target is decoupled by flight control inversion, separating the flight control induced trajectory component and the target motion trajectory component to generate the target's true motion trajectory; Identify the control mode change interval based on the current control mode sequence, determine the main target trajectory from the initial target trajectory, perform main target freeze and reconnection operation on the main target trajectory within the control mode change interval, record the main target trajectory number, last visible position, appearance features and departure direction, and perform reconnection discrimination on the target detection object after the control mode change interval, generating the main target reconnection trajectory and trajectory loss record; The target's actual trajectory, the obstacle's initial trajectory, the main target's return trajectory, trajectory loss records, and trajectory association results are combined according to the acquisition time index to generate a target trajectory feature set.
[0011] Optionally, the generation of the control mode candidate set includes: Read the target trajectory feature set, forward spatial risk slice sequence and switching scene visual atom sequence, and establish the trajectory-spatial-visual atom correspondence according to the acquisition time index; Based on the target's actual motion trajectory, the main target's reconnection trajectory, trajectory loss records, and trajectory association results in the target trajectory feature set, the target tracking status, the main target's reconnection status, and the target's loss status are extracted. Based on the forward airspace risk slice sequence, the obstacle occupancy status and passability status corresponding to each forward airspace slice are extracted to generate the obstacle avoidance takeover status. Based on the visual atomic sequence of the switching scene, the target tracking state, obstacle avoidance takeover state, main target reconnection state and target loss state are mapped to generate control mode trigger records. Based on the control mode trigger record, a control mode candidate set with acquisition time index and mode trigger order is generated. The control mode candidate set includes target tracking candidate mode, obstacle avoidance takeover candidate mode, target re-tracking candidate mode, hovering repositioning candidate mode, and landing alignment candidate mode.
[0012] Optionally, the process of generating UAV control commands includes: Read the control mode candidate set and the current control mode sequence, extract the current control mode corresponding to the current acquisition time index, and establish a mode correspondence table between the current control mode and the control mode candidate set; The correspondence between the current control mode and the control mode candidate set is determined according to the mode correspondence table. The candidate control mode with the earlier mode triggering order under the current acquisition time index is selected as the target control mode from the control mode candidate set. A control parameter adjustment table is generated based on the target control mode. The control parameter adjustment table includes speed adjustment, heading adjustment, altitude adjustment and attitude adjustment. Speed control parameters are generated based on speed adjustment, heading control parameters are generated based on heading adjustment, altitude control parameters are generated based on altitude adjustment, and attitude control parameters are generated based on attitude adjustment. The speed control parameters, heading control parameters, altitude control parameters, attitude control parameters, and target control mode are combined to form UAV control commands.
[0013] Optionally, generating the switching control feedback record and performing feedback updates includes: Send UAV control commands to the UAV flight controller and record the target control mode, speed control parameters, heading control parameters, altitude control parameters and attitude control parameters corresponding to the UAV control commands; Collect switching control feedback data after the execution of UAV control commands. The switching control feedback data includes feedback visual images, feedback flight status, feedback control mode, and command execution status. Based on the data acquisition time index and UAV control command number, the handover control feedback data is associated with the UAV control command to generate a handover control feedback record; The standardized UAV visual control dataset is updated based on the switching control feedback record, and the feedback visual image, feedback flight status and feedback control mode are written into the corresponding acquisition time index. Update and improve the Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters based on the handover control feedback records.
[0014] The beneficial effects of this invention are: This invention proposes a vision-based UAV switching control method. By constructing a process involving UAV visual control data preprocessing, generation of visual image sequences and flight state sequences, improved Mamba-YOLO network detection and analysis, DeepOC-SORT algorithm trajectory association, and control mode candidate set generation, this method improves the accuracy of UAV control mode switching in complex visual environments. Compared to traditional methods that rely solely on single-frame target detection boxes, detection categories, or detection confidence levels for switching decisions, this invention associates visual images, flight states, and the current control mode according to the acquisition time index. This provides continuous temporal basis for UAV control mode switching decisions, reducing interference from short-term target occlusion, detection confidence fluctuations, and changes in flight perspective.
[0015] This invention, by incorporating a flight viewpoint disturbance feature correction layer, a forward airspace risk slice analysis layer, and a switching scene visual atom generation layer into an improved Mamba-YOLO network, enables a structured representation of viewpoint disturbances, forward airspace risk distribution, and switching scene visual states during UAV flight. The flight viewpoint disturbance feature correction layer reduces the impact of pitch, roll, yaw, speed changes, and altitude changes on detection features; the forward airspace risk slice analysis layer extracts obstacle occupancy and passability states from different airspace slices according to the UAV's forward flight direction; and the switching scene visual atom generation layer transforms visual states such as target forward appearance, obstacle occupancy, safe zone visibility, target occupancy, and landing area visibility into the data foundation required for subsequent switching decisions, thereby improving the UAV's comprehensive perception capability of targets, obstacles, and safe zones.
[0016] This invention performs trajectory association on the detected object sequence using the Deep OC-SORT algorithm and performs flight control inversion trajectory decoupling processing in conjunction with the flight state sequence. This can distinguish between image displacement caused by flight control actions and trajectory changes caused by the target's own motion, improving the accuracy of identifying the target's true motion trajectory. Through the main target freeze-and-reconnect operation, the main target trajectory can be recorded and reconnection discrimination can be performed during control mode changes, reducing the problem of false loss caused by the main target briefly leaving the field of view or weak detection response. Based on the target trajectory feature set, forward airspace risk slice sequence, and switching scene visual atom sequence, a control mode candidate set is generated, and further UAV control commands are formed. This can improve the switching stability between target tracking, obstacle avoidance takeover, target reconnection tracking, hovering repositioning, and landing alignment, reducing the problems of frequent switching, switching lag, and discontinuous control commands. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a vision-based UAV switching control method proposed in this invention; Figure 2 This is a schematic diagram of the structure of an improved Mamba-YOLO network for a vision-based UAV switching control method proposed in this invention. Figure 3 This is a flowchart illustrating the Deep OC-SORT algorithm for generating target trajectory feature sets in a vision-based UAV switching control method proposed in this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0019] refer to Figure 1 , Figure 2 and Figure 3 A vision-based UAV switching control method includes: Collect UAV visual control data and perform preprocessing to generate a standardized UAV visual control dataset; A data acquisition time index is established based on a standardized UAV visual control dataset, and visual image sequences, flight status sequences, and current control mode sequences are generated according to the data acquisition time index. An improved Mamba-YOLO network is constructed, which includes a flight viewpoint disturbance feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer. The network is given as input visual image sequences and flight state sequences, and generates detection object sequences, forward airspace risk slice sequences, and scene switching visual atom sequences. The detection object sequence is input into the Deep OC-SORT algorithm, and combined with the flight state sequence and the current control mode sequence, the detection object is subjected to trajectory association, flight control inversion trajectory decoupling processing and main target freeze and reconnection operation to generate target trajectory feature set; Based on the target trajectory feature set, forward airspace risk slice sequence and switching scene visual atom sequence, extract the target tracking status, obstacle avoidance takeover status, main target reconnection status and target loss status, and generate a control mode candidate set. The target control mode is determined based on the candidate set of control modes and the current control mode sequence. The speed adjustment, heading adjustment, altitude adjustment and attitude adjustment corresponding to the target control mode are generated, and the UAV control commands are formed. Issue UAV control commands, collect switching control feedback data, generate switching control feedback records, and update the standardized UAV visual control dataset, improve Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters.
[0020] In this embodiment, generating a standardized UAV visual control dataset includes: Collect UAV visual control data, which includes airborne visual images, image acquisition time, flight status data, current control mode records, and historical control command records, among which: Collecting visual control data for the drone, specifically: The airborne visual images are acquired at a rate of 25 frames per second using the UAV's onboard visual acquisition terminal, and each frame of the airborne visual image is written with an image frame number and an image acquisition time. Flight status data is read synchronously from the drone flight control terminal according to the image acquisition time. The flight status data includes the drone's position, flight speed, flight altitude, attitude angle, and yaw angle. The current control mode record is read by the UAV control terminal according to the image acquisition time. The current control mode record includes target tracking mode record, obstacle avoidance takeover mode record, target re-tracking mode record, hovering repositioning mode record, and landing alignment mode record. The historical control command records are read by the UAV control terminal according to the image acquisition time. The historical control command records include speed control parameters, heading control parameters, altitude control parameters, and attitude control parameters. Based on the UAV number, mission number, and image acquisition time, the UAV visual control data is correlated to generate the original UAV visual control data sequence. Based on the original visual control data sequence of the UAV, invalid frames were removed, duplicate frames were deleted, image size was standardized, and pixel values were normalized to generate standardized visual image data, including: Generate standardized visual image data, specifically: Read the airborne visual images, image frame numbers, and image acquisition times from the original visual control data sequence of the UAV, and calculate the pixel integrity rate, mean brightness, and Laplacian variance of each frame of airborne visual image; When the pixel integrity rate of an airborne visual image is less than 0.98, or the average brightness is less than 0.05, or the average brightness is greater than 0.95, or the Laplacian variance is less than 80, the corresponding airborne visual image is marked as an invalid frame and discarded. The mean pixel difference between adjacent airborne visual images after removing invalid frames is calculated. When the mean pixel difference between two adjacent airborne visual images is less than 0.01, the airborne visual image with the earlier image acquisition time is retained, and the airborne visual image with the later image acquisition time is deleted. The retained airborne visual image is scaled to 640×640 pixels in a proportional manner. When there are blank areas at the boundaries of the scaled image, a boundary fill value of 114 pixels is used to fill them to generate a visual image of uniform size. Normalization is performed on each pixel channel in a uniform-sized visual image by dividing the original pixel value of each pixel channel by 255 to generate standardized visual image data with pixel values in the range of 0 to 1. Based on the original visual control data sequence of the UAV, timestamp calibration, missing field filling, abnormal state removal, and numerical standardization are performed on the flight status data, current control mode records, and historical control command records to generate standardized flight control data, including: Perform missing field filling and abnormal state removal as follows: The flight status data, current control mode records, and historical control command records are sorted according to the image acquisition time to establish a data continuity relationship between adjacent acquisition times; When there are missing data in three or fewer consecutive acquisition time indices for flight speed, flight altitude, attitude angle, or yaw angle, the data values corresponding to the two valid acquisition time indices before and after the missing position are read, and linear interpolation is performed according to the acquisition time interval to generate the filled flight status data. When the number of consecutive missing data points for flight speed, flight altitude, attitude angle, or yaw angle exceeds three acquisition time indices, the data entries in the corresponding time interval will be marked as unusable flight status data and filtered out during the standardized flight control data generation process. When a single acquisition time index is missing in the current control mode record, the current control mode record corresponding to the previous valid acquisition time index at the missing position is read and filled in; When the number of consecutive missing records in the current control mode exceeds two acquisition time indices, the data entries in the corresponding time interval will be marked as unavailable control mode records. When a single acquisition time index is missing in the speed control parameter, heading control parameter, altitude control parameter, or attitude control parameter in the historical control command record, the historical control command record corresponding to the previous valid acquisition time index at the missing position is read and filled in. Anomaly removal is performed on the filled-in flight status data. When the flight speed is less than 0 m / s or greater than 20 m / s, the flight altitude is less than 0 m or greater than 120 m, the change in flight speed between adjacent acquisition time indices is greater than 6 m / s, the change in flight altitude between adjacent acquisition time indices is greater than 10 m, the absolute value of the attitude angle is greater than 60°, or the change in yaw angle between adjacent acquisition time indices is greater than 90°, the corresponding flight status data entries are marked as abnormal and removed. Perform abnormal state elimination on the current control mode record. When the current control mode record does not belong to the target tracking mode, obstacle avoidance takeover mode, target re-tracking mode, hovering repositioning mode, and landing alignment mode, mark the corresponding current control mode record as an abnormal control mode record and eliminate it. Abnormal status elimination is performed on historical control command records. When the speed control parameter, heading control parameter, altitude control parameter or attitude control parameter lacks the corresponding control command number, or the control command number cannot be correlated with the image acquisition time, the corresponding historical control command record is marked as an abnormal control command record and eliminated. Standardized visual image data and standardized flight control data are mapped according to the image acquisition time to generate a standardized UAV visual control dataset.
[0021] In this embodiment, the generation of the visual image sequence, flight status sequence, and current control mode sequence includes: Read the standardized UAV visual control dataset, extract standardized flight status data, current control mode records and corresponding acquisition times from the standardized flight control data, and extract standardized visual image data; The standardized visual image data, standardized flight status data, and current control mode records are sorted in chronological order of acquisition time to generate an acquisition time index; Based on the acquisition time index, standardized visual image data is written to the corresponding time position to generate a visual image sequence; Based on the collection time index, standardized flight status data is written to the corresponding time position to generate a flight status sequence, which includes the UAV position, flight speed, flight altitude, attitude angle and yaw angle. Based on the acquisition time index, the current control mode record is written to the corresponding time position to generate the current control mode sequence; Perform time index consistency checks on the visual image sequence, flight status sequence, and current control mode sequence to generate visual image sequences, flight status sequences, and current control mode sequences with the same acquisition time index, where: The execution time index consistency check is performed as follows: Read the acquisition time index from the visual image sequence, flight status sequence, and current control mode sequence, and generate a visual image time index table, a flight status time index table, and a control mode time index table, respectively; Using the visual image time index table as the base index table, we query the flight status time index table and the control mode time index table to see if there is a common acquisition time index. When visual images, flight status, and current control mode exist simultaneously under the same acquisition time index, the corresponding acquisition time index will be marked as a valid and consistent index. When there is no flight status under the same acquisition time index, search for the valid flight status records before and after the acquisition time index. When the time interval between adjacent valid flight status records is no greater than 0.12s, perform linear interpolation on the flight status according to the acquisition time interval, and write the interpolated flight status into the corresponding acquisition time index. When there is no current control mode under the same acquisition time index, read the current control mode corresponding to the previous valid acquisition time index and write the read current control mode into the corresponding acquisition time index. When a visual image is missing under the same acquisition time index, or the flight status cannot be completed by linear interpolation, or the current control mode cannot be completed by the previous valid acquisition time index, the corresponding acquisition time index will be marked as an invalid index. Delete the data entries corresponding to invalid indexes, retain the visual images, flight status and current control modes corresponding to valid and consistent indexes, and generate a visual image sequence, flight status sequence and current control mode sequence with the same acquisition time index.
[0022] In this embodiment, the generation of the detection object sequence, the forward spatial risk slice sequence, and the scene switching visual atom sequence includes: An improved Mamba-YOLO network is constructed, comprising a flight viewpoint perturbation feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer, wherein: The following steps are taken to build an improved Mamba-YOLO network: Based on the traditional Mamba-YOLO network's backbone, detection neck, and detection head structure, the state space feature extraction structure of the backbone network and the target bounding box output structure of the detection head are retained. A flight view disturbance feature correction layer is added at the output end of the backbone network to receive the detection features and flight state sequence output by the backbone network and correct the detection feature offset caused by UAV attitude change, yaw change and altitude change. After the flight view disturbance feature correction layer, a forward airspace risk slice analysis layer is added. The forward flight direction is determined based on the yaw angle in the flight state sequence, and the target candidate area, obstacle candidate area and passable area in each forward airspace slice are analyzed. A new scene switching visual atom generation layer is added to the output end of the detection head. The scene switching visual atom sequence is generated based on the positional relationship, occlusion relationship and region occupancy relationship of the detected object in the forward spatial risk slice, resulting in an improved Mamba-YOLO network. The flight viewpoint perturbation feature correction layer reads the visual image sequence and the flight state sequence, extracts the background structure offset, target candidate region response, and image edge changes from adjacent visual images, and combines the attitude angle, yaw angle, flight speed, and flight altitude from the flight state sequence to perform viewpoint perturbation correction on the detection features output by the Mamba-YOLO backbone network, generating a viewpoint-corrected detection feature sequence, where: The flight view disturbance feature correction layer includes: Image frame buffer queue: stores texture features, target candidate region features, and edge structure features of adjacent visual images; Flight status register set: stores attitude angle, yaw angle, flight speed and flight altitude; Background Structure Offset Calculator: Calculates the background structure offset between adjacent visual images; Target candidate response extractor: Extracts the response value, center location, and boundary location of the target candidate region; Image Edge Change Record Table: Records the changes in the number of edges, the changes in the direction of edges, and the changes in the position of edges in adjacent visual images; Flight disturbance mapping table: stores the mapping relationship between changes in flight state and image feature offsets; Viewpoint perturbation correction calculator: performs position and response correction on the detection features output by the Mamba-YOLO backbone network; Correction feature buffer: Stores the corrected detection features and their corresponding acquisition time index; Feature sequence outputter: Outputs the viewpoint correction detection feature sequence in the order of acquisition time; In the flight viewpoint disturbance feature correction layer, the texture features, target candidate region features, and edge structure features stored in the image frame buffer queue are input into the background structure offset calculator, the target candidate response extractor, and the image edge change record table, respectively, to generate background structure offset, target candidate region response, and image edge change. The attitude angle, yaw angle, flight speed, and flight altitude recorded in the flight status register group are input into the flight disturbance mapping table to generate image feature offset. The background structure offset, target candidate region response, image edge change, and image feature offset are input into the viewpoint disturbance correction calculator to perform position correction and response correction on the detection features output by the Mamba-YOLO backbone network. The corrected detection features are written into the correction feature buffer, and the feature sequence outputter outputs the viewpoint correction detection feature sequence in the order of acquisition time. Extracting background structure offset, target candidate region response, and image edge changes specifically involves: Read two adjacent visual images according to the acquisition time index, and record them as the previous visual image and the current visual image. Convert the previous visual image and the current visual image into grayscale images respectively, and divide them into multiple image blocks according to the grid size of 32×32 pixels. Calculate the grayscale variance and gradient mean of each image block, and select image blocks with grayscale variance greater than 30 and gradient mean greater than 12 as background structure candidate blocks. Background corner points are extracted from the candidate blocks of the background structure. The 16×16 pixel neighborhood corresponding to each background corner point in the previous visual image is matched with the neighborhood of the candidate corner points in the current visual image using normalized correlation matching. When the normalized correlation value is greater than 0.82, the corner point correspondence is established. Read the coordinates of the previous corner point and the current corner point in each set of corner point correspondences, calculate the difference between the horizontal coordinate and the vertical coordinate, remove corner point correspondences with an absolute value of the difference between the horizontal coordinate and the vertical coordinate greater than 80 pixels, calculate the average of the difference between the horizontal coordinates of the remaining corner point correspondences to obtain the horizontal offset of the background, and calculate the average of the difference between the vertical coordinates of the remaining corner point correspondences to obtain the vertical offset of the background. Edge extraction is performed on the previous visual image and the current visual image respectively, generating a set of previous edge segments and a set of current edge segments; For each previous edge segment, calculate the center coordinates, direction angle, and length of the segment. In the current set of edge segments, find edge segments with a direction angle difference of no more than 10° and a center distance of no more than 50 pixels, and establish the correspondence between edge segments. Read the center coordinate difference in each set of edge segment correspondences, calculate the horizontal offset and vertical offset of the edge segment, and then fuse the background horizontal offset and background vertical offset obtained from the corner point correspondence with the horizontal offset and vertical offset obtained from the edge segment correspondence to generate the background structure offset. Read the detection features output by the Mamba-YOLO backbone network, and mark the locations of feature points with response values greater than 0.60 and connected region areas of not less than 64 as target candidate regions; For each target candidate region, read the response values of all feature points within the region, calculate the peak response, mean response, and variance of the response, and generate the candidate region boundary position based on the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the feature points within the region. Calculate the candidate region center position based on the candidate region boundary position, and generate the target candidate region response. Read the number of edge segments in the previous visual image and the current visual image, calculate the current number of edge segments minus the previous number of edge segments, and generate the change value of the number of edge segments; The edge direction angle is divided into 18 direction intervals from 0° to 180°. The number of edge line segments in each direction interval of the previous visual image and the current visual image is counted. The absolute value of the difference between the current number and the previous number in the same direction interval is calculated. The 18 absolute values of the difference are summed to generate the edge direction change value. Read the center coordinate difference of the line segments in the correspondence of the edge line segments, take the square root of the sum of the squares of the center coordinate differences of each group of line segments to generate a single group of edge position offset values, and average all single group edge position offset values to generate edge position change values. The image edge variation is generated by combining the edge quantity change value, edge direction change value, and edge position change value. Perform viewpoint perturbation correction on the detected features, specifically as follows: Read the detection features, background structure offset, target candidate region response, image edge changes and flight state sequence output by the Mamba-YOLO backbone network, and obtain the feature map width, feature map height, visual image width and visual image height corresponding to the detection features; Based on the ratio between the feature map width and the visual image width, the background horizontal offset in the background structure offset is mapped to the feature horizontal background offset; based on the ratio between the feature map height and the visual image height, the background vertical offset in the background structure offset is mapped to the feature vertical background offset. Based on the attitude angle, yaw angle, flight speed and flight altitude corresponding to adjacent acquisition time indices in the flight state sequence, calculate the changes in attitude angle, yaw angle, flight speed and flight altitude, and generate the lateral offset and longitudinal offset of flight disturbance through the flight disturbance mapping table. The lateral background offset of the feature is averaged with the lateral offset of the flight disturbance to generate the lateral view correction value. The longitudinal background offset of the feature is averaged with the longitudinal offset of the flight disturbance to generate the longitudinal view correction value. Based on the horizontal and vertical view corrections, the center position and boundary position of the target candidate region in the target candidate region response are translated and corrected to generate the corrected center position and boundary position of the target candidate region. Based on the changes in the number of edges, the direction of edges, and the position of edges in the image edge changes, edge perturbation correction is performed on the boundary position of the corrected target candidate region, and the corrected target candidate region is written back to the corresponding position in the detection features to generate the corrected detection features. Write the corrected detection features, the corrected target candidate region center position, the corrected target candidate region boundary position and the corresponding acquisition time index into the correction feature buffer, and output the view correction detection feature sequence according to the acquisition time index order; The forward airspace risk slice analysis layer reads the yaw angle from the viewpoint correction detection feature sequence and flight state sequence. Based on the UAV's forward flight direction, it divides the visual image into a central forward slice, a left forward slice, a right forward slice, an ascending avoidance slice, and a descending avoidance slice. It then analyzes the target candidate region, obstacle candidate region, and passable region within each forward airspace slice to generate a forward airspace risk slice sequence, where: The forward airspace risk slice resolution layer includes: Yaw angle register: stores the yaw angle and the corresponding acquisition time index; Forward Direction Calculator: Determines the forward flight direction based on the yaw angle; Spatial space slice template table: stores the division rules for each forward spatial space slice; Slice Boundary Mapper: Maps the spatial slice template to the current visual image coordinate system; Candidate region parsing queue: Receives the viewpoint correction detection feature sequence and caches the candidate region parsing results; Slice attribution discriminator: determines the forward spatial slice to which a candidate region belongs; Obstacle Occupancy Status Record Table: Records the number, area, and location of obstacles in each slice; Accessibility Status Record Table: Records the area, center location, and boundaries of accessible areas in each slice; Risk slice outputter: Outputs the forward spatial risk slice sequence according to the acquisition time index; In the forward airspace risk slice analysis layer, the yaw angle stored in the yaw angle register is input into the forward direction calculator to generate the forward flight direction. The division rules in the airspace slice template table and the forward flight direction are input into the slice boundary mapper to generate the slice boundary in the current visual image coordinate system. The viewpoint correction detection feature sequence is input into the candidate region analysis queue. The candidate region analysis queue extracts the target candidate region, obstacle candidate region, and passable region. The extraction results are input into the slice classification discriminator along with the slice boundary to generate the slice result to which the candidate region belongs. The slice result to which the candidate region belongs is written into the obstacle occupancy status record table and the passable status record table, respectively, forming the obstacle occupancy status and passable status in each forward airspace slice. The risk slice outputter outputs the forward airspace risk slice sequence according to the acquisition time index. The forward flight direction of the UAV is determined based on the yaw angle, specifically as follows: Read the yaw angle corresponding to each acquisition time index in the flight status sequence and convert the yaw angle to a uniform range of -180° to 180°; Read the image width and image height of the visual image, take half of the image width as the x-coordinate of the starting point in the forward direction, and take half of the image height as the y-coordinate of the starting point in the forward direction to generate the image center point; Divide the yaw angle by 180 and multiply by pi to generate the yaw angle in radians; The sine of the radian yaw angle is used as the lateral component of the forward direction, and the negative of the cosine of the radian yaw angle is used as the longitudinal component of the forward direction to generate a unit vector in the forward direction. Starting from the center point of the image, a forward direction unit vector is extended to the visual image boundary to generate the forward direction axis of the UAV. Write the acquisition time index, yaw angle, image center point, forward direction unit vector, and UAV forward direction axis into the direction recording area corresponding to the yaw angle register to determine the UAV's forward flight direction under the corresponding acquisition time index; The visual image is divided into forward spatial slices, specifically: Read the image center point, forward direction unit vector, and UAV forward direction axis in the direction recording area corresponding to the yaw angle register, and generate a lateral reference vector perpendicular to the UAV forward direction axis based on the forward direction unit vector; Taking the center point of the image as the origin, calculate the position vector of each pixel in the visual image relative to the center point of the image. The projection value of the position vector on the forward unit vector is recorded as the forward projection value, and the projection value of the position vector on the horizontal reference vector is recorded as the horizontal projection value. When the forward projection value of a pixel position is greater than 0, the ordinate of the pixel position is less than the ordinate of the image center point, and the vertical distance from the pixel position to the forward axis of the drone is not greater than 0.20 times the image height, the corresponding pixel position is included in the ascending avoidance slice. When the forward projection value of a pixel position is greater than 0, the ordinate of the pixel position is greater than the ordinate of the image center point, and the vertical distance from the pixel position to the forward axis of the drone is not greater than 0.20 times the image height, the corresponding pixel position is included in the descent avoidance slice. When the forward projection value of a pixel position is greater than 0, the absolute value of the lateral projection value is not greater than 0.25 times the forward projection value, and the corresponding pixel position is not included in the rising avoidance slice or the falling avoidance slice, the corresponding pixel position is included in the center forward slice. When the forward projection value of a pixel position is greater than 0, the lateral projection value is less than -0.25 times the forward projection value, and the corresponding pixel position is not included in the upward or downward avoidance slice, the corresponding pixel position is included in the left forward slice. When the forward projection value of a pixel position is greater than 0, the lateral projection value is greater than 0.25 times the forward projection value, and the corresponding pixel position is not included in the rising or falling avoidance slice, the corresponding pixel position is included in the right forward slice. Write the set of pixel positions corresponding to the center forward slice, left forward slice, right forward slice, rising avoidance slice and falling avoidance slice into the forward spatial domain slice partitioning result, and generate the forward spatial domain slice partitioning result of the corresponding visual image according to the acquisition time index. The target candidate region, obstacle candidate region, and passable region are analyzed, specifically as follows: Read the viewpoint correction detection feature sequence and the forward spatial domain slice division result. Under each acquisition time index, establish the mapping relationship between feature point coordinates and pixel positions based on the feature map width, feature map height, visual image width and visual image height corresponding to the viewpoint correction detection feature sequence. Under each acquisition time index, the feature points in the viewpoint correction detection feature sequence are written into the center forward slice, left forward slice, right forward slice, rising avoidance slice and falling avoidance slice according to the mapped pixel position; Within each forward spatial slice, regions with a target category channel response value greater than 0.60 and a connected region area of not less than 64 feature points are extracted as target candidate regions, and regions with an obstacle category channel response value greater than 0.55 and a region area of not less than 80 feature points are extracted as obstacle candidate regions. Read the continuous regions within each forward airspace slice that are not occupied by the target candidate region and obstacle candidate region. When the area of the continuous region accounts for no less than 0.35 of the area of the corresponding forward airspace slice, mark the corresponding continuous region as a passable region. The number of target candidate regions, the number of obstacle candidate regions, the total area of obstacle candidate regions, the total area of passable regions, and the center position of passable regions in each forward airspace slice are counted to generate the slice analysis results corresponding to each forward airspace slice. Arrange the slice parsing results corresponding to the center forward slice, left forward slice, right forward slice, rising avoidance slice and falling avoidance slice under each acquisition time index in order of acquisition time to generate a forward airspace risk slice sequence. The scene switching visual atom generation layer reads the viewpoint correction detection feature sequence and the forward spatial risk slice sequence to generate a detection object sequence. Based on the positional relationships, occlusion relationships, and region occupancy relationships of the detected objects in the forward spatial risk slice, a scene switching visual atom sequence is generated. This sequence includes target forward appearance atoms, obstacle occupancy atoms, safe zone visibility atoms, target occupancy atoms, and landing area visibility atoms. Switching the scene visual atom generation layer includes: Detection object cache queue: Stores target detection objects, obstacle detection objects, and landing area detection objects generated by the viewpoint correction detection feature sequence; Risk Slice Index Table: Stores slice numbers, slice boundaries, obstacle occupancy status, and passability status in the forward airspace risk slice sequence; Object-Slice Location Mapper: Calculates the positional correspondence between the detected object and the forward spatial risk slice; Occlusion Relationship Determination Table: Records the overlap area, occlusion direction, and occlusion ratio between the target detection object and the obstacle detection object; Area Occupancy Statistician: Calculates the occupied area of obstacle detection objects, passable areas, and landing areas in each forward airspace slice; Visual Atom Trigger Register: Stores the trigger status of atoms that appear in front of the target, atoms that are occupied by obstacles, atoms that are visible in the safe zone, atoms that are occluded by the target, and atoms that are visible in the landing area; Visual Atom Encoding Table: Assigns an atom number, acquisition time index, and corresponding detection object number to each type of visual atom in a switching scene; Visual Atom Sequence Buffer: Stores the generation results of visual atoms for various switching scenarios according to the acquisition time index; Atomic Sequence Outputter: Outputs the visual atomic sequences of the switching scenes in chronological order of acquisition time; In the scene switching visual atom generation layer, the detection object cache queue outputs the detection objects, and the risk slice index table outputs the forward spatial risk slice information. Both are input into the object-slice position mapper to generate positional relationships. The positional relationships are then input into the occlusion relationship discrimination process and the region occupancy statistician to generate occlusion relationships and region occupancy relationships. The occlusion relationships are written into the occlusion relationship discrimination table. The occlusion relationships, region occupancy relationships, and positional relationships are input into the visual atom trigger register to generate visual atom trigger states. The visual atom trigger states are input into the visual atom encoding table to generate visual atom records with atom numbers, acquisition time indexes, and detection object numbers. The visual atom records are written into the visual atom sequence cache, and the scene switching visual atom sequence is output by the atom sequence outputter. Generate the sequence of objects to be detected, specifically as follows: Read the viewpoint correction detection feature sequence and extract the viewpoint correction detection features corresponding to each frame in sequence according to the acquisition time index; In each frame of view correction detection features, the response regions corresponding to the target detection objects, the obstacle detection objects, and the landing area detection objects are extracted. When there is a connected region in the response region corresponding to the target detection object with a response value greater than 0.60 and a connected region area of not less than 64 feature points, the corresponding connected region is determined as the target detection object region; When there is a connected region in the response region corresponding to the obstacle detection object with a response value greater than 0.55 and a connected region area of not less than 80 feature points, the corresponding connected region is determined as the obstacle detection object region; When there is a connected region in the response region corresponding to the landing area detection object with a response value greater than 0.58 and a connected region area of not less than 120 feature points, the corresponding connected region is determined as the landing area detection object region. Read the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of all feature points within the target detection area, obstacle detection area, and landing area detection area, generate the detection box boundary of the corresponding detection area, and calculate the center coordinate of the detection box based on the detection box boundary; The response values within the target detection area, obstacle detection area, and landing area detection area are averaged to generate corresponding detection confidence scores, which are then written into the target category identifier, obstacle category identifier, and landing area category identifier, respectively. The detection object record is generated by combining the detection object number, detection box boundary, detection box center coordinates, detection confidence level, category identifier, and acquisition time index. All detection object records are arranged according to the collection time index to generate a detection object sequence; The positional relationship of the detected objects within the forward airspace risk slice is as follows: Based on the detection object sequence and the forward spatial risk slice sequence, the detection object number, category identifier, detection box boundary, detection box center coordinates and slice boundary of each forward spatial slice under the same acquisition time index are extracted; Calculate the area of the overlapping region between the detection box and each forward spatial slice, and divide the area of the overlapping region by the area of the detection box to generate the overlapping area ratio. The forward spatial slice with the largest overlap area ratio is taken as the master slice, and the remaining forward spatial slices with an overlap area ratio of not less than 0.30 are taken as associated slices. The positional relationship of the detected object in the forward spatial risk slice is generated by combining the object number, category identifier, center coordinates of the detection frame, main slice, associated slice, overlap area ratio, and acquisition time index. Occlusion relationship determination, specifically: Based on the positional relationship of the detected objects in the forward airspace risk slice, target detection objects and obstacle detection objects that are in the same main slice or have the same associated slice under the same acquisition time index are filtered to generate object pairs to be judged. Read the bounding boxes of the target detection object and the obstacle detection object in the object to be judged, and calculate the overlapping area between the two detection boxes; Divide the overlapping area by the detection box area of the target object to generate the target occlusion ratio; Read the center coordinates of the detection boxes of the target detection object and the obstacle detection object, and generate the occlusion direction based on the horizontal and vertical differences between the center coordinates of the two detection boxes; When the target occlusion ratio is not less than 0.25, the pair of objects to be judged is marked as having an occlusion relationship; when the target occlusion ratio is less than 0.25, the pair of objects to be judged is marked as not having an occlusion relationship. Write the target detection object number, obstacle detection object number, target occlusion ratio, occlusion direction, occlusion relationship, and acquisition time index into the occlusion relationship discrimination table; The generation of area occupancy relationships is as follows: Based on the positional and occlusion relationship discrimination table of the detected objects in the forward airspace risk slice, the obstacle detection objects, landing area detection objects and passable areas in each forward airspace slice are read according to the collection time index. Calculate the slice area of each forward airspace slice, and calculate the area of the obstacle detection object, the area of the landing area detection object, and the area of the passable area respectively; Divide the area of the obstacle detection object, the area of the landing area detection object, and the area of the passable area by the corresponding forward airspace slice area to generate the obstacle occupancy ratio, the landing area occupancy ratio, and the passable area ratio, respectively. Write the obstacle occupancy ratio, passable area ratio, landing area occupancy ratio, occupancy relationship, and collection time index into the area occupancy statistician to generate the area occupancy relationship; Generate the visual atomic sequence for scene transitions, specifically: Read the positional relationship, occlusion relationship discrimination table and regional occupancy relationship of the detected object in the forward spatial risk slice, and establish a visual atom generation record according to the acquisition time index; When the main slice of the target detection object belongs to any forward spatial domain slice, the target forward appearance atom is generated; When the obstacle occupancy ratio is not less than 0.10, or when there is an obstacle detection object in the same forward spatial slice, an obstacle occupancy atom is generated; When the proportion of passable area is not less than 0.35, visible atoms in the safe area are generated; When the target occlusion ratio in the occlusion relationship discrimination table is not less than 0.25, target occlusion atoms are generated; when the landing area occupancy ratio is not less than 0.15, landing area visible atoms are generated. Write the atoms that appear in the forward direction of the target, the atoms that are occupied by obstacles, the atoms that are visible in the safe area, the atoms that are occluded by the target, and the atoms that are visible in the landing area into the visual atom encoding table to generate a visual atom record containing the atom number, the acquisition time index, the detected object number, the forward spatial domain slice to which it belongs, and the triggering state. The visual atom records are written to the visual atom sequence buffer, and the visual atom sequences of the switching scenes are output in the order of acquisition time. The improved Mamba-YOLO network was trained using a combination of object classification error, bounding box localization error, viewpoint perturbation correction error, forward spatial domain slice recognition error, and scene transition visual atom recognition error as the joint optimization objective. The network parameters of the flight viewpoint perturbation feature correction layer, the forward spatial domain risk slice parsing layer, and the scene transition visual atom generation layer were continuously optimized. When the change in the joint loss value over five consecutive training rounds was less than 0.001, the improved Mamba-YOLO network was considered to have completed convergence training. The improved Mamba-YOLO network was trained as follows: Read the visual image sequence, flight state sequence, object detection annotation, forward airspace slice annotation, and scene switching visual atom annotation from the training samples. Input the visual image sequence and flight state sequence into the improved Mamba-YOLO network and output the object detection category prediction result, bounding box prediction result, viewpoint correction detection feature sequence, forward airspace risk slice prediction result, and scene switching visual atom prediction result. The detection object classification error is generated based on the difference between the predicted detection object category and the detected object label; the detection box localization error is generated based on the coordinate difference between the predicted detection box boundary and the detection box boundary label; the viewpoint perturbation correction error is generated based on the distance between the center position of the corrected target candidate region and the center position of the stable target in the viewpoint correction detection feature sequence; the forward spatial domain risk slice recognition error is generated based on the difference between the forward spatial domain slice prediction result and the forward spatial domain slice label; and the switching scene visual atom recognition error is generated based on the difference between the switching scene visual atom prediction result and the switching scene visual atom label. The object classification error, bounding box localization error, viewpoint perturbation correction error, forward spatial domain slice recognition error, and scene transition visual atom recognition error are multiplied by 0.30, 0.25, 0.20, 0.15, and 0.10 respectively, and then summed to generate a joint loss value. The parameters are updated using 64 training samples as a training batch. The gradient value corresponding to the joint loss value is multiplied by 0.0005 and then subtracted from the current network parameter value to obtain the updated network parameter value. This updated value is then written into the flight viewpoint perturbation feature correction layer, the forward spatial domain risk slice parsing layer, and the scene transition visual atom generation layer. When the change in the joint loss value in 5 consecutive training rounds is less than 0.001, the improved Mamba-YOLO network is considered to have completed convergence training.
[0023] In this embodiment, generating the target trajectory feature set includes: Read the detection object sequence, flight status sequence, and current control mode sequence, and write the target detection objects and obstacle detection objects in the detection object sequence into the observation queue of the Deep OC-SORT algorithm according to the acquisition time index; The Deep OC-SORT algorithm uses the detection box center, detection box boundaries, category identifier, and detection confidence of the detected object, and extracts appearance features from the image region corresponding to the detected object. It then performs trajectory association on detected objects at adjacent acquisition time indices, generating trajectory association results, the initial trajectory of the target, and the initial trajectory of the obstacle. Extracting appearance features from the image region corresponding to the detected object, specifically: Based on the acquisition time index and detection box boundary in the detection object record, read the detection object image region in the corresponding visual image; When the detection box boundary exceeds the visual image boundary, the excess part is cropped into the visual image boundary to generate an effective detection object image region; The effective detection object image area is adjusted to 128×256 pixels, and the pixel values are normalized to the range of 0 to 1 to generate a standardized object image block; The standardized object image patch is input into the appearance feature extraction branch of the Deep OC-SORT algorithm to extract object texture features, color distribution features and local contour features; Channel concatenation is performed on the object's texture features, color distribution features, and local contour features, and then global average pooling is applied to generate an appearance feature vector. Normalize the appearance feature vector, associate the normalized appearance feature vector with the detection object number, category identifier and acquisition time index to generate the appearance feature corresponding to the detection object; Execution trajectory association, specifically: Read the detected objects under adjacent acquisition time indexes, pair the target detected objects with each other according to the category identifier, pair the obstacle detected objects with each other, and generate candidate associated object pairs; Read the center of the detection box of the previous detection object and the current detection object in the candidate associated object pair, calculate the sum of the square of the difference between the horizontal coordinates of the two detection box centers and the square root of the sum of the squares to generate the center distance; Calculate the detection box width and height based on the detection box boundary, and calculate the absolute value of the width difference and the absolute value of the height difference between the previous detection object and the current detection object to generate the detection box size difference; Read the appearance feature vectors of the candidate associated object pairs, calculate the sum of squares of the differences in the corresponding dimensions of the two appearance feature vectors, and take the square root of the sum of squares to generate the appearance feature distance; Read the detection confidence of candidate associated object pairs, calculate the absolute value of the difference between the two detection confidences, and generate the confidence difference; The center distance, detection box size difference, appearance feature distance, and confidence difference are normalized to the interval between 0 and 1, and then accumulated according to the following proportions: center distance accounts for 0.40, detection box size difference accounts for 0.20, appearance feature distance accounts for 0.30, and confidence difference accounts for 0.10, to generate the association cost of candidate associated object pairs. When the association cost of a candidate associated object pair is no greater than 0.45, the previous detected object and the current detected object are determined to be the same trajectory object and written into the trajectory association result; When the target object is associated with consecutive adjacent acquisition time indices, the center of the detection frame of the target object is connected according to the acquisition time index to generate the initial trajectory of the target. When the obstacle detection objects are all associated under consecutive adjacent acquisition time indices, the detection frame center of the obstacle detection objects is connected according to the acquisition time index to generate the initial trajectory of the obstacle; Based on the flight speed, altitude, attitude angle, and yaw angle in the flight state sequence, flight control inversion trajectory decoupling processing is performed on the target's initial trajectory to separate the flight control-induced trajectory component and the target motion trajectory component, generating the target's true motion trajectory, where: The flight control inversion trajectory decoupling process is performed as follows: Read the center coordinates of the target detection box corresponding to the adjacent acquisition time index in the target's initial trajectory. Subtract the x-coordinate of the target detection box center under the current acquisition time index from the x-coordinate of the target detection box center under the previous acquisition time index to obtain the horizontal trajectory displacement of the image. Subtract the y-coordinate of the target detection box center under the current acquisition time index from the y-coordinate of the target detection box center under the previous acquisition time index to obtain the vertical trajectory displacement of the image. Read the flight speed, flight altitude, attitude angle and yaw angle corresponding to adjacent acquisition time indices in the flight state sequence, and calculate the changes in flight speed, flight altitude, attitude angle and yaw angle respectively; A flight control inversion mapping table is established based on the changes in flight speed, flight altitude, attitude angle, and yaw angle. The flight control inversion mapping table records the correspondence between the changes in flight state and the displacement induced by the image plane. By querying the flight control inversion mapping table, the lateral flight control induced displacement and longitudinal flight control induced displacement under the corresponding acquisition time index can be obtained. Subtracting the lateral flight control-induced displacement from the lateral trajectory displacement of the image yields the lateral target motion displacement; subtracting the longitudinal flight control-induced displacement from the longitudinal trajectory displacement of the image yields the longitudinal target motion displacement. The lateral flight control induced displacement and the longitudinal flight control induced displacement are combined to generate flight control induced trajectory components; The lateral and longitudinal target motion displacements are combined to generate target motion trajectory components; The target motion trajectory components are accumulated according to the acquisition time index to generate the target's true motion trajectory, and the target's true motion trajectory is associated with the corresponding target initial trajectory number; Based on the current control mode sequence, identify the control mode change interval, determine the main target trajectory from the initial target trajectory, perform a main target freeze and reconnection operation on the main target trajectory within the control mode change interval, and record the main target trajectory number, last visible position, appearance features, and departure direction. Furthermore, perform reconnection discrimination on target detection objects after the control mode change interval, generating the main target reconnection trajectory and trajectory loss record, where: The main target trajectory is determined from the initial target trajectory, specifically as follows: Read the trajectory number, number of consecutive associated frames, detection confidence sequence, detection box center coordinate sequence, appearance feature sequence and trajectory association result corresponding to each target trajectory in the initial trajectory of the target; The acquisition time index interval for target tracking mode is determined based on the current control mode sequence, and the initial trajectory of the target is selected within this acquisition time index interval. Calculate the main target score for each target's initial trajectory. The main target score is the sum of the normalized value of the number of consecutive associated frames multiplied by 0.40, the mean detection confidence multiplied by 0.35, and the trajectory association success rate multiplied by 0.25. The initial trajectory of the target with the highest main target score is determined as the main target trajectory, and the main target trajectory number, detection box center coordinate sequence, detection confidence sequence, and appearance feature sequence are recorded. Perform the main target freeze and reconnection operation, specifically as follows: Based on the current control mode sequence, identify the start and end positions of the control mode change under adjacent acquisition time indices, and generate the control mode change interval; Within the control mode change range, read the last valid acquisition time index of the main target trajectory, generate the departure direction based on the center coordinates of the detection box corresponding to the last two valid acquisition time indices of the main target trajectory, and write the main target trajectory number, last visible position, appearance features and departure direction into the frozen trajectory record. After the control mode change interval ends, read the center coordinates and appearance features of the detection box corresponding to the target detection object, calculate the center distance between the target detection object and the last visible position in the frozen trajectory record, and calculate the feature distance between the appearance features of the target detection object and the appearance features in the frozen trajectory record. When the center distance is no greater than 80 pixels and the feature distance is no greater than 0.35, the target detection object is reconnected to the main target trajectory number in the frozen trajectory record to generate the main target reconnection trajectory; When the center distance is greater than 80 pixels or the feature distance is greater than 0.35, the corresponding frozen trajectory record will be written into the trajectory loss record. The target's actual trajectory, the obstacle's initial trajectory, the main target's return trajectory, trajectory loss records, and trajectory association results are combined according to the acquisition time index to generate a target trajectory feature set.
[0024] In this embodiment, generating the control mode candidate set includes: Read the target trajectory feature set, forward spatial risk slice sequence and switching scene visual atom sequence, and establish the trajectory-spatial-visual atom correspondence according to the acquisition time index; Based on the target's actual motion trajectory, the main target's recapture trajectory, trajectory loss records, and trajectory association results in the target trajectory feature set, the target tracking status, the main target's recapture status, and the target's loss status are extracted, among which: Extract the target tracking status, main target reconnection status, and target loss status, specifically as follows: Read the target's actual motion trajectory and trajectory association results. When the target's actual motion trajectory has corresponding trajectory association results within 5 consecutive acquisition time indices, mark the corresponding acquisition time index as the target tracking status. Read the main target recovery trajectory. When there is a main target trajectory number in the main target recovery trajectory that corresponds to the frozen trajectory record, mark the corresponding collection time index as the main target recovery status. Read the trajectory loss record. If the trajectory loss record contains the main target trajectory number and the target's actual movement trajectory does not have a corresponding trajectory association result within 10 consecutive acquisition time indices, mark the corresponding acquisition time index as the target loss status. Write the target tracking status, main target reconnection status, and target loss status into the target status record table according to the acquisition time index; Based on the forward airspace risk slice sequence, the obstacle occupancy status and passability status corresponding to each forward airspace slice are extracted to generate the obstacle avoidance takeover status, where: The obstacle avoidance takeover state is generated as follows: Read the forward airspace risk slice sequence and extract the obstacle occupancy status and passability status corresponding to the center forward slice, left forward slice, right forward slice, ascending avoidance slice and descending avoidance slice under the same acquisition time index; When the obstacle occupancy status of the central forward slice is "obstacle occupancy" for three consecutive acquisition time indices, the corresponding acquisition time index is marked as obstacle avoidance takeover status. When the passable state of the left forward slice, right forward slice, upward obstacle avoidance slice, or downward obstacle avoidance slice is that there is a passable area, the corresponding slice is recorded as an obstacle avoidance passable slice. Write the obstacle avoidance takeover status, the obstacle avoidance passable slice, and the corresponding acquisition time index into the obstacle avoidance status record table; Based on the visual atomic sequence of the scene switching, the target tracking state, obstacle avoidance takeover state, main target re-attachment state, and target loss state are mapped to generate a control mode trigger record, where: Generate control mode trigger records, specifically: Read the trajectory-spatial-visual atom correspondence, target status record table and obstacle avoidance status record table, and establish the correspondence between visual atoms and target tracking status, obstacle avoidance takeover status, main target reconnection status and target loss status according to the acquisition time index; When an atom appears in the forward direction of the target and corresponds to the target tracking state, a target tracking trigger record is generated; When an obstacle-occupied atom corresponds to an obstacle avoidance takeover state, an obstacle avoidance takeover trigger record is generated; When the target occlusion atom corresponds to the target loss state, a hover relocation trigger record is generated; When the primary target reconnection status is marked, a target reconnection tracking trigger record is generated; When visible atoms exist in the landing area and the target loss status is not marked, a landing alignment trigger record is generated; Write the target tracking trigger record, obstacle avoidance takeover trigger record, hovering repositioning trigger record, target re-tracking trigger record, and landing alignment trigger record into the control mode trigger record according to the acquisition time index; Based on the control mode trigger records, a control mode candidate set is generated, which includes a data acquisition time index and a mode trigger order. The control mode candidate set includes target tracking candidate modes, obstacle avoidance takeover candidate modes, target re-tracking candidate modes, hovering repositioning candidate modes, and landing alignment candidate modes, among which: The control mode candidate set is generated as follows: Read the control mode trigger records and extract the target tracking trigger records, obstacle avoidance takeover trigger records, target re-tracking trigger records, hovering repositioning trigger records, and landing alignment trigger records according to the acquisition time index; When an obstacle avoidance takeover trigger record exists, the obstacle avoidance takeover candidate mode is written into the control mode candidate set under the corresponding acquisition time index, and the mode triggering order is recorded as the first order; When a hover repositioning trigger record exists, the hover repositioning candidate mode is written into the control mode candidate set under the corresponding acquisition time index, and the mode triggering order is recorded as the second order. When a target reconnection tracking trigger record exists, the target reconnection tracking candidate mode is written into the control mode candidate set under the corresponding acquisition time index, and the mode triggering order is recorded as the third order. When a landing alignment trigger record exists, the landing alignment candidate mode is written into the control mode candidate set under the corresponding acquisition time index, and the mode trigger order is recorded as the fourth order. When a target tracking trigger record exists, and there are no obstacle avoidance takeover trigger records or hovering repositioning trigger records under the same acquisition time index, the target tracking candidate mode is written into the control mode candidate set under the corresponding acquisition time index, and the mode triggering order is recorded as the fifth order. By associating the acquisition time index, candidate modes, and mode triggering order, a control mode candidate set is generated.
[0025] In this embodiment, the generation of UAV control commands includes: Read the control mode candidate set and the current control mode sequence, extract the current control mode corresponding to the current acquisition time index, and establish a mode correspondence table between the current control mode and the control mode candidate set; The correspondence between the current control mode and the control mode candidate set is determined according to the mode correspondence table. The candidate control mode with the earlier mode triggering order under the current acquisition time index is selected as the target control mode from the control mode candidate set. A control parameter adjustment table is generated based on the target control mode. The control parameter adjustment table includes speed adjustment, heading adjustment, altitude adjustment and attitude adjustment. Speed control parameters are generated based on speed adjustment, heading control parameters are generated based on heading adjustment, altitude control parameters are generated based on altitude adjustment, and attitude control parameters are generated based on attitude adjustment. The speed control parameters, heading control parameters, altitude control parameters, attitude control parameters, and target control mode are combined to form UAV control commands.
[0026] In this embodiment, generating the switching control feedback record and performing feedback updates includes: Send UAV control commands to the UAV flight controller and record the target control mode, speed control parameters, heading control parameters, altitude control parameters and attitude control parameters corresponding to the UAV control commands; Collect switching control feedback data after the execution of UAV control commands. The switching control feedback data includes feedback visual images, feedback flight status, feedback control mode, and command execution status. Based on the data acquisition time index and UAV control command number, the handover control feedback data is associated with the UAV control command to generate a handover control feedback record; The standardized UAV visual control dataset is updated based on the switching control feedback record, and the feedback visual image, feedback flight status and feedback control mode are written into the corresponding acquisition time index. Update and improve the Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters based on the handover control feedback records.
[0027] Example 1: To verify the feasibility of this invention in practice, it was applied to a closed low-altitude flight verification scenario. The UAV performed continuous visual tracking and switching control tasks. The scenario included one moving target, six pole-shaped obstacles, two plate-shaped obstructions, one passable area, and one landing area marked with visual markers. The UAV's flight altitude was controlled between 18.5m and 21.8m, and its flight speed ranged from 1.4m / s to 3.1m / s. The onboard visual image resolution was 1280×720 pixels, and the acquisition frame rate was 25fps. The entire sample segment contained 1500 frames of visual images, 1500 sets of flight status data, and 1500 records of the current control mode. Target tracking accounted for 620 frames, obstacle avoidance takeover for 310 frames, primary target reconnection for 185 frames, hovering repositioning for 210 frames, and landing alignment for 175 frames. Traditional methods use ordinary target detection results and single-frame confidence thresholds to make switching decisions. When the target detection confidence is below 0.45, hovering is triggered, and when the obstacle box enters the center region of the image, obstacle avoidance is triggered. The method of the present invention performs visual state analysis, trajectory decoupling, and control mode candidate generation on the same batch of data according to the process in the claims.
[0028] During the data preprocessing stage, the original visual control data contained 39 duplicate images, 27 images with abnormal exposure, and 14 sets of missing flight status records. After preprocessing the UAV visual control data, the processing workflow retained 1420 valid images, uniformly resizing them to 1280×720 pixels and normalizing pixel values to the 0–1 range. The velocity, altitude, attitude angle, and yaw angle in the flight status data were standardized. Before standardization, the flight velocity ranged from 1.4 m / s to 3.1 m / s; after standardization, it ranged from 0.00 to 1.00. Before standardization, the yaw angle ranged from -18.6° to 22.4°; after standardization, it ranged from 0.00 to 1.00. After processing, a standardized UAV visual control dataset was generated, containing 1420 standardized visual image frames, 1420 sets of standardized flight control data, and 1420 records of the current control mode.
[0029] During the sequence generation phase, the processing flow establishes an acquisition time index based on the image acquisition time, writes standardized visual image data into the visual image sequence, standardized flight status data into the flight status sequence, and the current control mode record into the current control mode sequence. After time index consistency verification, the visual image sequence, flight status sequence, and current control mode sequence all contain 1420 valid time positions, and the time index gaps are reduced from the original 14 to 0. Taking the 486th time position as an example, the target center coordinates in the visual image are (642, 381), the flight speed is 2.6 m / s, the flight altitude is 20.4 m, the attitude angles are pitch 3.2°, roll -1.8°, yaw angle 11.6°, and the current control mode record is target tracking mode.
[0030] In the improved Mamba-YOLO network processing stage, visual image sequences and flight state sequences are input into the network. The flight viewpoint perturbation feature correction layer reads the background structure offset, target candidate region response, and image edge changes in adjacent visual images. Between frames 486 and 515, the UAV's yaw angle changes from 11.6° to 18.9°, resulting in an average background structure offset of 46 pixels. Ordinary detection methods mistakenly interpret the target box center offset as lateral target movement. After the method of this invention performs viewpoint perturbation correction on the detection features output by the Mamba-YOLO backbone network, the average target candidate region response increases from 0.58 to 0.76, and the average background false response decreases from 0.31 to 0.19. The forward airspace risk slice analysis layer determines the forward flight direction based on the yaw angle and divides the image into a center forward slice, a left forward slice, a right forward slice, an ascending avoidance slice, and a descending avoidance slice. In frame 620, a candidate region for a rod-shaped obstacle was identified in the central forward slice, with an obstacle detection confidence of 0.84. The passable region response was concentrated in the right forward slice, with a passability value of 0.79. The scene switching visual atom generation layer generates a sequence of detected objects, a sequence of forward spatial risk slices, and a sequence of scene switching visual atoms based on the positional relationship, occlusion relationship, and region occupancy relationship of the detected objects in the forward spatial risk slice. In this sample, the detected object sequence contains 1420 candidate trajectory targets, 312 candidate obstacle detections, and 175 candidate landing area detections; the scene switching visual atom sequence contains 618 forward appearance atoms for targets, 306 obstacle occupancy atoms, 812 visible safe area atoms, 172 target occlusion atoms, and 174 visible landing area atoms.
[0031] In the Deep OC-SORT algorithm processing stage, the sequence of detected objects is written into the observation queue. The algorithm performs trajectory association on detected objects under adjacent acquisition time indices based on the detection box center, detection box size, category identifier, detection confidence, and appearance features extracted from the corresponding image region of the detected object. From frame 620 to frame 705, the conventional method causes two trajectory identity switching due to the target box displacement caused by the UAV's yaw. The method of this invention combines the flight state sequence to perform flight control inversion trajectory decoupling processing, separating the target image displacement in this interval into flight control induced trajectory components and target motion trajectory components. The flight control induced trajectory component accounts for an average of 68.4%, and the target motion trajectory component accounts for an average of 31.6%, ultimately generating a continuous true target motion trajectory. From frame 810 to frame 856, the mission target is occluded by a plate-like occluder, and the target detection confidence drops from 0.81 to 0.32. The traditional method triggers target loss after 13 consecutive frames with a confidence level below 0.45. The method of this invention identifies the control mode change interval based on the current control mode sequence, determines the main target trajectory from the target's initial trajectory, records the main target trajectory number, last visible position (711, 398), appearance features and departure direction, and performs a reconnection judgment after the target reappears in frame 857. The main target reconnection trajectory recovers the original trajectory number within 0.44s, without triggering an erroneous return.
[0032] During the control mode candidate generation phase, the processing flow establishes the trajectory-airspace-visual atom correspondence based on the target trajectory feature set, the forward airspace risk slice sequence, and the switching scene visual atom sequence. From frames 620 to 705, obstacle-occupied atoms continuously appear in the central forward slice, the obstacle avoidance takeover state is extracted, and the control mode candidate set generates obstacle avoidance takeover candidate modes. From frames 857 to 930, the main target re-tracking trajectory is restored, and the control mode candidate set generates target re-tracking and tracking candidate modes. After frame 1240, visible atoms continuously appear in the landing area, and the control mode candidate set generates landing alignment candidate modes. Based on the current control mode sequence and the control mode candidate set, the processing flow determines the target control mode and generates speed adjustment, heading adjustment, altitude adjustment, and attitude adjustment. Taking frame 624 as an example, the target control mode switched from target tracking mode to obstacle avoidance takeover mode. The speed adjustment was -0.42 m / s, the heading adjustment was 13.5° to the right, the altitude adjustment was +0.8 m, and the attitude adjustments were -2.1° pitch and 4.3° roll, ultimately forming the UAV control commands. After the commands were issued, flight feedback showed that the minimum distance between the UAV and the obstacle was 2.26 m, while the minimum distance using traditional methods in the same segment was 1.38 m.
[0033] In the comparative verification, the number of training samples was 9800 frames, the number of verification samples was 2100 frames, and the number of test samples was 2100 frames.
[0034] The average accuracy rate of object detection using traditional methods is 88.6%, while the accuracy rate using the method of this invention is 94.3%. The accuracy rate of forward airspace risk identification using traditional methods is 82.1%, while the accuracy rate using the method of this invention is 92.8%. The traditional method requires 15 target trajectory identity switching operations, while the method of this invention requires only 4. The traditional method results in 12 instances of target loss, while the method of this invention results in 3 instances. The success rate of reconnection after the main target is occluded using traditional methods is 73.5%, while the success rate of the method of this invention is 91.2%. The average delay for obstacle avoidance takeover using traditional methods is 0.88s, while the delay using the method of this invention is 0.41s. The traditional method has a control mode mis-switching count of 10 times, while the method of this invention has a count of 2 times. The traditional method requires 17 control command mutations, while the method of this invention requires only 5. The average deviation of the landing area alignment using the traditional method is 0.46m, while the deviation using the method of this invention is 0.22m.
[0035] As can be seen from Example 1, the method of the present invention forms a clear data transmission relationship in each processing step, and shows verifiable improvement effects in flight view disturbance suppression, target true trajectory recognition, obstacle takeover triggering, main target freeze reconnection and continuous generation of control commands, which can support the UAV to complete stable switching control in complex visual environments.
[0036] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A visual detection-based UAV switching control method, characterized in that, include: Collect UAV visual control data and perform preprocessing to generate a standardized UAV visual control dataset; A data acquisition time index is established based on a standardized UAV visual control dataset, and visual image sequences, flight status sequences, and current control mode sequences are generated according to the data acquisition time index. An improved Mamba-YOLO network is constructed, which includes a flight viewpoint disturbance feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer. The network is given as input visual image sequences and flight state sequences, and generates detection object sequences, forward airspace risk slice sequences, and scene switching visual atom sequences. The detection object sequence is input into the Deep OC-SORT algorithm, and combined with the flight state sequence and the current control mode sequence, the detection object is subjected to trajectory association, flight control inversion trajectory decoupling processing and main target freeze and reconnection operation to generate target trajectory feature set; Based on the target trajectory feature set, forward airspace risk slice sequence and switching scene visual atom sequence, extract the target tracking status, obstacle avoidance takeover status, main target reconnection status and target loss status, and generate a control mode candidate set. The target control mode is determined based on the candidate set of control modes and the current control mode sequence. The speed adjustment, heading adjustment, altitude adjustment and attitude adjustment corresponding to the target control mode are generated, and the UAV control commands are formed. Issue UAV control commands, collect switching control feedback data, generate switching control feedback records, and update the standardized UAV visual control dataset, improve Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters.
2. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generation of the standardized UAV visual control dataset includes: Collect UAV visual control data, which includes airborne visual images, image acquisition time, flight status data, current control mode records, and historical control command records; Based on the UAV number, mission number, and image acquisition time, the UAV visual control data is correlated to generate the original UAV visual control data sequence. Based on the original visual control data sequence of the UAV, the airborne visual images are processed by removing invalid frames, deleting duplicate frames, unifying image size and normalizing pixel values to generate standardized visual image data. Based on the original visual control data sequence of the UAV, timestamp calibration, missing field filling, abnormal state removal and numerical standardization are performed on the flight status data, current control mode record and historical control command record to generate standardized flight control data. Standardized visual image data and standardized flight control data are mapped according to the image acquisition time to generate a standardized UAV visual control dataset.
3. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generated visual image sequence, flight status sequence, and current control mode sequence include: Read the standardized UAV visual control dataset, extract standardized flight status data, current control mode records and corresponding acquisition times from the standardized flight control data, and extract standardized visual image data; The standardized visual image data, standardized flight status data, and current control mode records are sorted in chronological order of acquisition time to generate an acquisition time index; Based on the acquisition time index, standardized visual image data is written to the corresponding time position to generate a visual image sequence; Based on the collection time index, standardized flight status data is written to the corresponding time position to generate a flight status sequence, which includes the UAV position, flight speed, flight altitude, attitude angle and yaw angle. Based on the acquisition time index, the current control mode record is written to the corresponding time position to generate the current control mode sequence; Perform time index consistency checks on the visual image sequence, flight status sequence, and current control mode sequence to generate visual image sequences, flight status sequences, and current control mode sequences with the same acquisition time index.
4. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generation of the detection object sequence, the forward spatial risk slice sequence, and the scene switching visual atom sequence includes: An improved Mamba-YOLO network was constructed, which includes a flight viewpoint perturbation feature correction layer, a forward airspace risk slice parsing layer, and a scene switching visual atom generation layer. The flight viewpoint perturbation feature correction layer reads the visual image sequence and the flight state sequence, extracts the background structure offset, target candidate region response and image edge change in adjacent visual images, and combines the attitude angle, yaw angle, flight speed and flight altitude in the flight state sequence to perform viewpoint perturbation correction on the detection features output by the Mamba-YOLO backbone network to generate a viewpoint corrected detection feature sequence. The forward airspace risk slice analysis layer reads the yaw angle in the viewpoint correction detection feature sequence and flight state sequence, divides the visual image into the center forward slice, left forward slice, right forward slice, ascending avoidance slice and descending avoidance slice according to the forward flight direction of the UAV, and analyzes the target candidate area, obstacle candidate area and passable area in each forward airspace slice to generate the forward airspace risk slice sequence. The scene switching visual atom generation layer reads the viewpoint correction detection feature sequence and the forward spatial risk slice sequence to generate a detection object sequence. Based on the positional relationship, occlusion relationship and regional occupancy relationship of the detection objects in the forward spatial risk slice, the scene switching visual atom sequence is generated. The scene switching visual atom sequence includes target forward appearance atom, obstacle occupancy atom, safe area visible atom, target occupancy atom and landing area visible atom. The improved Mamba-YOLO network was trained using a combination of object classification error, bounding box localization error, viewpoint perturbation correction error, forward spatial domain slice recognition error, and scene switching visual atom recognition error as joint optimization objectives. The network parameters of the flight viewpoint perturbation feature correction layer, the forward spatial domain risk slice parsing layer, and the scene switching visual atom generation layer were continuously optimized. When the change in the joint loss value in five consecutive training rounds was less than 0.001, the improved Mamba-YOLO network was considered to have completed convergence training.
5. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generated target trajectory feature set includes: Read the detection object sequence, flight status sequence, and current control mode sequence, and write the target detection objects and obstacle detection objects in the detection object sequence into the observation queue of the Deep OC-SORT algorithm according to the acquisition time index; The Deep OC-SORT algorithm extracts appearance features from the image region corresponding to the detected object based on the detection box center, detection box boundary, category identifier, and detection confidence. It performs trajectory association on the detected objects under adjacent acquisition time indices to generate trajectory association results, target initial trajectory, and obstacle initial trajectory. Based on the flight speed, flight altitude, attitude angle and yaw angle in the flight state sequence, the initial trajectory of the target is decoupled by flight control inversion, separating the flight control induced trajectory component and the target motion trajectory component to generate the target's true motion trajectory; Identify the control mode change interval based on the current control mode sequence, determine the main target trajectory from the initial target trajectory, perform main target freeze and reconnection operation on the main target trajectory within the control mode change interval, record the main target trajectory number, last visible position, appearance features and departure direction, and perform reconnection discrimination on the target detection object after the control mode change interval, generating the main target reconnection trajectory and trajectory loss record; The target's actual motion trajectory, the initial trajectory of the obstacle, the main target's return trajectory, trajectory loss records, and trajectory association results are combined according to the acquisition time index to generate a target trajectory feature set.
6. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generated control mode candidate set includes: Read the target trajectory feature set, forward spatial risk slice sequence and switching scene visual atom sequence, and establish the trajectory-spatial-visual atom correspondence according to the acquisition time index; Based on the target's actual motion trajectory, the main target's reconnection trajectory, trajectory loss records, and trajectory association results in the target trajectory feature set, the target tracking status, the main target's reconnection status, and the target's loss status are extracted. Based on the forward airspace risk slice sequence, the obstacle occupancy status and passability status corresponding to each forward airspace slice are extracted to generate the obstacle avoidance takeover status. Based on the visual atomic sequence of the switching scene, the target tracking state, obstacle avoidance takeover state, main target reconnection state and target loss state are mapped to generate control mode trigger records. Based on the control mode trigger record, a control mode candidate set with acquisition time index and mode trigger order is generated. The control mode candidate set includes target tracking candidate mode, obstacle avoidance takeover candidate mode, target re-tracking candidate mode, hovering repositioning candidate mode, and landing alignment candidate mode.
7. The UAV switching control method based on vision detection according to claim 1, characterized in that, The formation of UAV control commands includes: Read the control mode candidate set and the current control mode sequence, extract the current control mode corresponding to the current acquisition time index, and establish a mode correspondence table between the current control mode and the control mode candidate set; The correspondence between the current control mode and the control mode candidate set is determined according to the mode correspondence table. The candidate control mode with the earlier mode triggering order under the current acquisition time index is selected as the target control mode from the control mode candidate set. A control parameter adjustment table is generated based on the target control mode. The control parameter adjustment table includes speed adjustment, heading adjustment, altitude adjustment and attitude adjustment. Speed control parameters are generated based on speed adjustment, heading control parameters are generated based on heading adjustment, altitude control parameters are generated based on altitude adjustment, and attitude control parameters are generated based on attitude adjustment. The speed control parameters, heading control parameters, altitude control parameters, attitude control parameters, and target control mode are combined to form the UAV control commands.
8. The UAV switching control method based on vision detection according to claim 1, characterized in that, The generation of switching control feedback records and the execution of feedback updates include: Send UAV control commands to the UAV flight controller and record the target control mode, speed control parameters, heading control parameters, altitude control parameters and attitude control parameters corresponding to the UAV control commands; Collect switching control feedback data after the execution of UAV control commands. The switching control feedback data includes feedback visual images, feedback flight status, feedback control mode, and command execution status. Based on the data acquisition time index and UAV control command number, the handover control feedback data is associated with the UAV control command to generate a handover control feedback record; The standardized UAV visual control dataset is updated based on the switching control feedback record, and the feedback visual image, feedback flight status and feedback control mode are written into the corresponding acquisition time index. Update and improve the Mamba-YOLO network parameters and Deep OC-SORT algorithm parameters based on the handover control feedback records.
