A digital risk assessment method for urban low-altitude non-cooperative drones

By combining lens distortion correction, stereo matching and deep learning algorithms, and using the YOLOX target detection model and binocular camera to conduct risk assessment of low-altitude urban drones, the difficulties of identifying and assessing the risks of non-cooperative drones in complex backgrounds are solved, and safe and efficient drone management is achieved.

CN115359371BActive Publication Date: 2025-09-19NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210819759.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-13
Publication Date
2025-09-19
Estimated Expiration
2042-07-13

AI Technical Summary

Technical Problem

Existing technologies make it difficult to effectively identify and assess the operational risks of low-altitude non-cooperative drones in cities, especially in complex backgrounds, where it is difficult and costly to judge the type of drone and perceive the risks.

Method used

By combining lens distortion correction, stereo matching and deep learning algorithms, the urban low-altitude UAV operation database is trained through the YOLOX target detection model. Stereo matching and least squares method are used with binocular cameras to obtain the three-dimensional coordinates of the UAV space, and risk assessment is performed based on motion trends.

Benefits of technology

It achieves accurate identification and risk assessment of non-cooperative drones, promotes the safe and efficient operation of drones in low-altitude urban scenarios, and provides early warning and alarm functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115359371B_ABST
    Figure CN115359371B_ABST
Patent Text Reader

Abstract

The present invention discloses a digital risk assessment method for urban low-altitude non-cooperative drones, comprising: constructing an urban low-altitude drone operation database; training a YOLOX target detection model; collecting images within the field of view using a binocular camera, performing stereo matching to generate a disparity map, and obtaining first depth information of the target; performing target detection on the collected images using the trained YOLOX target detection model to obtain the pixel coordinates of the drone detected in the left and right images, and obtaining second depth information of the target; performing airspace positioning of the non-cooperative drone and outputting the airspace number where the non-cooperative drone is located; performing risk assessment of the non-cooperative drone, and representing the risk assessment results in the form of a data link after being connected in series with the airspace number. The method of the present invention realizes the identification of specific types of drones by combining lens distortion correction, stereo matching, deep learning algorithms, etc., and performs risk assessment based on the calculated depth information and motion trends.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of unmanned aerial vehicle (UAV) operation management, and specifically relates to a digital risk assessment method for urban low-altitude non-cooperative UAVs. Background Art

[0002] With the rapid adoption of drones across various industries, demand for low-altitude drone flights in cities is increasing, and air traffic is becoming increasingly frequent. However, in recent years, the phenomenon of illegal drone flights in low-altitude airspace has become increasingly frequent, leading to various security risks. These unauthorized drones are mostly rotary-wing drones. Researching monitoring technologies for these unauthorized drones, also known as non-cooperative drones, can promote the safe, orderly, and efficient operation of rotary-wing drones in low-altitude urban airspace. Existing drone monitoring methods are mostly based on detection technology, rather than visual monitoring technology, and are primarily used in the military. These methods are costly and unsuitable for identifying and assessing the risk of non-cooperative drones in urban settings. This makes it difficult to collect evidence for the control and management of non-cooperative drone operations in low-altitude urban airspace. Current non-cooperative drone monitoring methods based on visual positioning technology focus on accurately measuring the relative distance between the observation point and the drone. Due to the complex and ever-changing background of drone flights in low-altitude urban airspace, different types of flying objects can easily be confused with drones, resulting in low video recognition accuracy. Currently, no drone operation risk identification method based on visual positioning technology has been developed for low-altitude urban airspace. Summary of the Invention

[0003] In response to the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a digital risk assessment method for low-altitude non-cooperative UAVs in cities, so as to solve the problems in the prior art methods that the intentions of non-cooperative UAV operators are difficult to predict and unsafe flights are difficult to identify; the method of the present invention combines lens distortion correction, stereo matching, deep learning algorithms, etc. to realize the identification of specific types of UAVs, and performs risk assessment based on the calculated depth information and motion trends.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] The digital risk assessment method for urban low-altitude non-cooperative drones of the present invention comprises the following steps:

[0006] (1) Build a database of urban low-altitude drone operations;

[0007] (2) inputting the urban low-altitude UAV operation database in step (1) into the YOLOX target detection model for training to obtain a trained YOLOX target detection model;

[0008] (3) Capturing images within the field of view through a binocular camera, and performing stereo matching to generate a disparity map to obtain the first depth information of the target;

[0009] (4) Using the YOLOX target detection model trained in step (2) to perform target detection on the image collected in step (3), the pixel coordinates of the drone detected in the left and right images are obtained, and the least squares method is used to obtain the three-dimensional coordinates of the drone space to obtain the second depth information of the target;

[0010] (5) Positioning the non-cooperative UAV in the airspace based on the target first depth information and the target second depth information, and outputting the airspace number where the non-cooperative UAV is located;

[0011] (6) Perform risk assessment on non-cooperative UAVs based on the binocular camera position information in step (3), and represent the risk assessment results in the form of a data link after being connected in series with the airspace number in step (5).

[0012] Furthermore, the step (1) specifically includes:

[0013] (11) Collect relevant video data required to build a database of urban low-altitude drone operations;

[0014] The video data includes flying objects in different backgrounds and weather conditions, as well as their positions and postures. Flying objects include rotary-wing drones, fixed-wing aircraft, birds, and close-up insects that may appear in the current scene. The video data also includes front, side, bottom, and top views of flying objects at different distances and positions.

[0015] (12) Generate video frames;

[0016] Using a fixed frame interval, video images are extracted at equal intervals to remove images with blurred targets due to camera motion, as well as images that are too far away or have too small a proportion of the image to have unclear features, thus forming a dataset for the detected targets.

[0017] (13) Target marking;

[0018] Use the annotation tool to annotate the detection targets in the images in the dataset and generate the x coordinates of the targets in the image coordinate system. min 、y min 、x max 、y max And the target name information xml format file, where x min 、y min 、x max 、y max They represent the coordinates x of the upper left corner of the target annotation box, with the upper left corner of the image as the origin (0, 0), the horizontal right direction as the positive direction of the x-axis, and the vertical downward direction as the positive direction of the y-axis.min 、y min , the lower right corner coordinate x max 、y max ;

[0019] (14) Format conversion;

[0020] Extract data from the XML file obtained in step (13), and extract the corresponding image file path information and the target frame x min 、y min 、x max 、y max The values ​​are integrated into the txt text.

[0021] Furthermore, the step (2) specifically includes:

[0022] (21) Training set and validation set division;

[0023] The data set of the detected target in step (12) is divided into a training set, a validation set, and a test set to meet the needs of target feature learning;

[0024] (22) Mosaic data enhancement at the input end;

[0025] Use any 4 images in the dataset, randomly scale, randomly crop, and randomly arrange them for splicing, increase the detection dataset, randomly scale and add small targets, and enhance the robustness of the network;

[0026] (23) Input-end adaptive anchor frame calculation;

[0027] The anchor box is adaptively changed according to the target images of different sizes in the training set. The output feature maps of three scales are 13×13, 26×26, and 52×52, corresponding to 9 anchors with sizes of (10,13), (16,30), (33,23), (30,61), (62,45), (59,119), (116,90), (156,198), and (373,326). Each scale is divided into 3 anchors, of which (10,13), (16,30), and (33,23) correspond to small-scale feature maps, (30,61), (62,45), and (59,119) correspond to medium-sized feature maps, and (116,90), (156,198), and (373,326) correspond to large-scale feature layers.

[0028] (24) Input-side adaptive image scaling;

[0029] (241) Calculate the scaling ratio;

[0030] Calculate the scaling factor of the original scaled size and the corresponding width and height of the original image, and choose the smaller of the two;

[0031] (242) Calculate the scaled size;

[0032] The original image width and height are multiplied by the minimum scaling factor to obtain the scaled image;

[0033] (243) Calculate the gray edge filling value;

[0034] The edge fill value is gray, i.e. (114, 114, 114), obtained by taking the remainder of the difference between the zoomed image and the original zoomed image using the numpy library np.mod. The np.mod method first subtracts 32 and then takes the remainder.

[0035] (25) Backbone network;

[0036] The Backbone network uses a Focus structure followed by a CBS structure and a CSP1_X structure, followed by a Neck network, to obtain a feature weight file based on the database constructed in step (1).

[0037] (26) Target feature matching;

[0038] Compare the test set divided in step (21) with the feature weight file obtained in step (25) to match the class names;

[0039] (27) Target confidence analysis;

[0040] Output the confidence level of the matching result obtained in step (26). The specific process is as follows:

[0041] (271) Loss function;

[0042] The YOLOX target detection model uses the intersection-over-union function:

[0043]

[0044] Among them, ρ 2 (A, B) represents the square of the Euclidean distance between the true box A and the predicted box B; c represents the diagonal length of the smallest box containing the true box and the predicted box; α represents the weight function; υ is used to measure the consistency of aspect ratio, W gt Indicates the width of the real box A, which is numerically equal to x max -x min ;h gt Indicates the height of the real box A, which is numerically equal to y max -y min ;Wp Indicates the width of the prediction box B; h p Represents the height of the predicted box B; π represents pi; the range of arctan is [0, π / 2);

[0045] The loss function used in the YOLOX target detection model is defined as:

[0046]

[0047] Among them, IoU represents the ratio of the intersection area of ​​the real box A and the predicted box B to the union area.

[0048] (272)nms non-maximum suppression;

[0049] If the CIoU coefficient is greater than 0.5, the candidate box with the highest confidence among those that meet the conditions will be displayed; if the CIoU coefficient is less than 0.5, it will not be displayed;

[0050] (273) Target feature learning evaluation;

[0051] The results of steps (22) and (23) were evaluated according to the following indicators:

[0052] (2731) Accuracy: the proportion of all correct predictions (positive and negative) to the total;

[0053]

[0054] Among them, TP represents the number of targets detected as positive in the positive class; TN represents the number of targets detected as negative in the negative class; FP represents the number of targets detected as positive in the negative class; FN represents the number of targets detected as negative in the positive class;

[0055] (2732) Precision, the ratio of correctly predicted positive results to all positive results.

[0056]

[0057] (2733) Recall, the ratio of correctly predicted positive results to all actual positive results.

[0058]

[0059] (2734) F1 value (H-mean value), the F1 value is the arithmetic mean divided by the geometric mean, and the larger the better, that is, F1 is the weighted value of Precision and Recall;

[0060]

[0061] The formula is transformed into:

[0062]

[0063] Set the Accuracy, Precision, Recall, and F1 values ​​to no less than 90%, end the target feature learning, and obtain the trained YOLOX target detection model.

[0064] Furthermore, the step (3) specifically includes:

[0065] (31) Collect images within the field of view based on the opencv binocular camera;

[0066] (32) Binocular camera parameter calibration;

[0067] Use Zhang's calibration method to correct the distortion of the binocular camera, obtain the camera distortion parameters, camera intrinsic parameters, and camera extrinsic parameters, and construct the rotation and translation matrix [R, T] relative to the world coordinate system with the left camera as the origin;

[0068] (33) Binocular camera stereo matching;

[0069] (331) Pretreatment;

[0070] Based on the relevant parameters obtained in the above step (32), the left and right camera images obtained in the above step (31) are aligned on the same plane, and the SGBM semi-global stereo matching algorithm is used to achieve stereo matching of the left and right camera images. The SGBM semi-global stereo matching algorithm uses the Sobel operator to pre-process the image. The formula is:

[0071] Sobel(u,v)=2[P(u+1,v)-P(u-1,v)]+P(u+1,v-1)-P(u-1,v-1)+P(u+1,v+1)-P(u-1,v+1)

[0072] Where P(u,v) is the pixel value of any pixel position in the pixel coordinate system. The formula represents the horizontal Sobel algorithm, which is obtained by subtracting the values ​​of the lower right, upper left, upper right, and lower left pixels from twice the value between adjacent pixels in the same horizontal direction. The image is processed horizontally by the Sobel operator pixel by pixel to map it into a new image. The mapping function is:

[0073]

[0074] Among them, P is the pixel value of any point before image mapping, preFilterCap is a constant parameter, P NEW Represents the pixel value on the new image;

[0075] (332) Cost calculation;

[0076] The left and right camera images obtained after step (331) are substituted pixel by pixel into the following formula to calculate the gradient cost C AD (α,d) and C SAD (α,d);

[0077] C AD (α,d)=|I L (α)-I R (α-d)|

[0078] C SAD (α,d)=∑ q∈Nα |I L (α)-I R (α-d)|

[0079] Where C AD (α, d) represents the absolute value of the difference between the grayscale value of the pixel at point α of the left camera and the grayscale value of the pixel at point p of the right camera at a horizontal distance d. SAD (α, d) represents the C of all pixels in the neighborhood of the pixel to be matched AD The sum of (α, d); the left image pixel to be matched is α (the default is the pixel principal point), and its neighborhood is N α , q is a point in the neighborhood; the corresponding pixel point in the right image is α-d;

[0080] (333) Dynamic programming;

[0081] Determine the loss function:

[0082]

[0083] Get the disparity map:

[0084]

[0085] Where D represents the disparity map; E(D) represents the energy function corresponding to the disparity map; p, q represent a pixel in the image; Np represents the neighboring pixel of pixel p; C(p, D p ) indicates that the current pixel disparity is D p When , the cost (loss) of the pixel point; P1 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is equal to 1 pixel; P2 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is greater than 1 pixel; I[.] function means that if the function parameter is true, it returns a value of 1, otherwise it returns a value of 0, and P 2> P1 ensures that the disparity map changes smoothly. If the loss function only has In one term, the local optimum is the global optimum; in the loss term, q∈N, the optimal disparity of the current pixel is obtained by the optimal disparity of the surrounding pixels, which is determined by the path cost aggregation method. The formula is as follows:

[0086]

[0087] Among them, L r (p, d) represents the path aggregation cost when the disparity of pixel point p aggregated from direction r is d, and C(p, d) is the loss value of pixel point p when the disparity is d. The penalty coefficients P1 and P2 are expressed as follows:

[0088] P1=8×cn×sgbmSADWindowSize×sgbmSADWindowSize

[0089] P2=32×cn×sgbmSADWindowSize×sgbmSADWindowSize

[0090] Among them, the parameter cn represents the mapping value of the selected area in the image, and SADWindowSize represents the size of the SAD window, which is an odd number in the range of 3×3 to 21×21. If the parameters cn and SADWindowSize are fixed, the penalty coefficients P1 and P2 represent two fixed values.

[0091] (334) post-processing;

[0092] (3341) uniqueness test;

[0093] When the lowest cost within the disparity window is (1 + uniquenessRatio / 100) times the second lowest cost, the disparity value corresponding to the lowest cost is the disparity of the pixel point. Otherwise, the disparity of the pixel point is 0 to ensure the uniqueness of the match. UniquenessRatio is a constant parameter.

[0094] (3342) Left and right consistency check;

[0095] Take the left image as the reference image, get the reference image disparity dispL[x], and calculate the corresponding right image disparity value dispR[xd], where d represents the disparity; by finding the minimum matching cost among the disp[x] data values, the minimum matching cost value is the correct difference;

[0096] (3353) Detect connected regions;

[0097] A threshold is set and all pixel points are compared with the threshold. The size comparison is used to determine whether there are any mismatched points. A detected pixel point has at least one point that meets the connectivity requirement around it. After the detection is completed, the adjacent points around the point are set as the starting points for detection and determination. The points that meet the connectivity requirement around the adjacent points are found. If the number of detected points exceeds the threshold, the disparity value of the area is set to the correct disparity value. Otherwise, it will be determined as a noise point and removed.

[0098] (335) Target ranging;

[0099] (3351) Parallax method to find the three-dimensional coordinates of a spatial point;

[0100] Point A is a point in the spatial coordinate system. Taking the left camera C1 as the world coordinate system, the coordinates of point A under the left camera C1 are A = (X, Y, Z, 1), and the coordinates under the right camera C2 are A = (Xb, Y, Z, 1), where b represents the baseline, i.e., the distance between the projection centers of the left and right cameras, f represents the focal length of the left camera, and u0 and v0 represent the intrinsic parameters of the left camera. After correction, the mapping matching point of point A in the left and right images is A. l =(u1,v1,1) T and A r =(u2,v2,1) T Let parallax d = u1-u2, according to the camera imaging model and triangle principle, we can get:

[0101]

[0102] Thus, the first depth information of the target is obtained.

[0103] Furthermore, the step (4) specifically includes:

[0104] (41) Using the YOLOX target detection model trained in step (2) to detect the binocular image obtained in step (3), obtain the rectangular outline of the drone target in the left and right images, and obtain the pixel coordinates of the center point of the left and right images of the drone;

[0105] (42) Target ranging;

[0106] The least squares method is used to obtain the three-dimensional coordinates of a spatial point;

[0107] Using the rotation and translation matrices [R, T] of the left camera relative to the world coordinate system obtained in step (32) above, and the corresponding matching points of the target object in the known left and right images, the three-dimensional coordinates of the spatial point are calculated using the following formula:

[0108]

[0109]

[0110] Among them, [u1 v1 1] T is the pixel coordinate in the left image coordinate system, [u2 v2 1] T is the pixel coordinate in the right image coordinate system, [X W Y W Z W 1] T is the world coordinate of the projected object of the left and right images, M1 and M2 are the calibration results of the parameter matrices of the left and right cameras respectively, [R1, T1] and [R2, T2] are the rotation and translation vectors of the left and right camera coordinate systems relative to the world coordinate system, and Z in the formula is replaced by C1 ,Z C2 After elimination, we can get the following four linear equations:

[0111]

[0112]

[0113]

[0114]

[0115] Convert the formula into matrix form:

[0116] AP=b

[0117] in:

[0118]

[0119] P=[X W Y W Z W ] T

[0120]

[0121] The least square method is used to solve the unknown quantity (X W Y W Z W ) That is, the spatial coordinate value of the spatial point in the world coordinate system is obtained using the following formula:

[0122] P=(A T A) -1 A T b

[0123] Thus, the second depth information of the target is obtained.

[0124] Furthermore, the step (5) specifically includes:

[0125] Combine step (335) and step (42) to obtain Z and Z W value, select the left camera optical center as the main point, select Z and Z W The smallest value is used as the distance to the principal point. The field of view airspace with a horizontal distance from the principal point less than 300mm is defined as A, the field of view airspace with a horizontal distance from the principal point greater than 300mm and less than 600mm is defined as B, the field of view airspace with a horizontal distance from the principal point greater than 600mm and less than 900mm is defined as C, the field of view airspace with a horizontal distance from the principal point greater than 900mm and less than 1200mm is defined as D, and the field of view airspace with a horizontal distance from the principal point greater than 1200mm is defined as E. Combined with the current longitude and latitude of the shooting camera, the principal point direction, lens tilt, airspace position, and time are merged into a data link and used as the airspace number where the non-cooperative UAV is detected.

[0126] Furthermore, the step (6) specifically includes:

[0127] (61) The airspace number obtained in the above step (5) is combined with the detection frame size position change obtained in step (4) to determine the movement trend of the non-cooperative drone as approaching, moving away or crossing; the time when YOLOX detects the target and generates the detection frame is the initial moment, and the image coordinates of the target center point are returned as the initial position at the current moment. When the position change of the target center point in the left and right camera image coordinates within 1 second before and after is no more than 1 pixel unit, and the detection frame area change range is between 95% and 100%, the target is considered to be in a crossing state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to increase, and the area change exceeds 5%, the target is considered to be in an approaching state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to decrease, and the area change exceeds 5%, the target is considered to be in a moving away state; Z and Z in step (5) are combined. W The smallest value is defined as the distance. When the distance is less than 50 meters and there is an approaching trend, the risk level is VI; when the distance is less than 50 meters and there is no approaching trend (crossing state or moving away state), the risk level is V; when the distance is greater than 50 meters and less than 100 meters and there is an approaching trend, the risk level is IV; when the distance is greater than 50 meters and less than 100 meters and there is no approaching trend (crossing state or moving away state), the risk level is III; when the distance is greater than 100 meters and there is an approaching trend, the risk level is II; when the distance is greater than 100 meters and there is no approaching trend (crossing state or moving away state), the risk level is I.

[0128] (62) The risk level is concatenated with the airspace number obtained in step (5) to represent the digital risk assessment of urban low-altitude non-cooperative drones.

[0129] Beneficial effects of the present invention:

[0130] The method of the present invention is based on the fusion results of YOLOX target detection and binocular ranging. The obtained depth data results are used to analyze the relative positions of the distance detection points of urban low-altitude non-cooperative UAVs. The risk level of non-cooperative UAVs is assessed in combination with the target motion trend, so as to achieve early warning and alarm, and promote the safe, efficient and orderly operation of UAVs in urban low-altitude scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0131] Figure 1 Schematic diagram of the process of the present invention.

[0132] Figure 2 This is a schematic diagram of the urban low-altitude drone operation database of the present invention.

[0133] Figure 3 This is a schematic diagram of the chain representation of the airspace division of the present invention. DETAILED DESCRIPTION

[0134] In order to facilitate understanding by those skilled in the art, the present invention will be further described below with reference to embodiments and drawings. The contents mentioned in the embodiments are not intended to limit the present invention.

[0135] Reference Figure 1 As shown, the digital risk assessment method of a low-altitude non-cooperative urban UAV of the present invention comprises the following steps:

[0136] (1) Build a database of urban low-altitude UAV operations; specifically,

[0137] (11) Collect relevant video data required to build a database of urban low-altitude drone operations;

[0138] The video data includes flying objects in different backgrounds and weather conditions, as well as their positions and postures. Flying objects include rotary-wing drones, fixed-wing aircraft, birds, and insects that may appear in the current scene. The video data also includes front, side, top, and bottom views of flying objects at different distances and positions. The shooting distance is within 150 meters. Figure 2 As shown;

[0139] (12) Generate video frames;

[0140] Using a fixed frame interval, video images are extracted at equal intervals to remove images with blurred targets due to camera motion, as well as images that are too far away or have too small a proportion of the image to have unclear features, thus forming a dataset for the detected targets.

[0141] (13) Target marking;

[0142] Use the annotation tool to annotate the detection targets in the images in the dataset and generate the x coordinates of the targets in the image coordinate system. min 、y min 、x max 、y max And the target name information xml format file, where x min 、y min 、x max 、y max They represent the coordinates x of the upper left corner of the target annotation box, with the upper left corner of the image as the origin (0, 0), the horizontal right direction as the positive direction of the x-axis, and the vertical downward direction as the positive direction of the y-axis. min 、y min , the lower right corner coordinate x max 、y max ;

[0143] (14) Format conversion;

[0144] Extract data from the XML file obtained in step (13), and extract the corresponding image file path information and the target frame x min 、y min 、x max 、y max The values ​​are integrated into the txt text.

[0145] (2) Inputting the urban low-altitude UAV operation database in step (1) into the YOLOX target detection model for training to obtain a trained YOLOX target detection model; specifically comprising:

[0146] (21) Training set and validation set division;

[0147] The data set of the detected target in step (12) is divided into a training set, a validation set, and a test set to meet the needs of target feature learning;

[0148] (22) Mosaic data enhancement at the input end;

[0149] Use any 4 images in the dataset, randomly scale, randomly crop, and randomly arrange them for splicing, increase the detection dataset, randomly scale and add small targets, and enhance the robustness of the network;

[0150] (23) Input-end adaptive anchor frame calculation;

[0151] The anchor box is adaptively changed according to the target images of different sizes in the training set. The output feature maps of three scales are 13×13, 26×26, and 52×52, corresponding to 9 anchors with sizes of (10,13), (16,30), (33,23), (30,61), (62,45), (59,119), (116,90), (156,198), and (373,326). Each scale is divided into 3 anchors, of which (10,13), (16,30), and (33,23) correspond to small-scale feature maps, (30,61), (62,45), and (59,119) correspond to medium-sized feature maps, and (116,90), (156,198), and (373,326) correspond to large-scale feature layers.

[0152] (24) Input-side adaptive image scaling;

[0153] (241) Calculate the scaling ratio;

[0154] Calculate the scaling factor of the original scaled size and the corresponding width and height of the original image, and choose the smaller of the two;

[0155] (242) Calculate the scaled size;

[0156] The original image width and height are multiplied by the minimum scaling factor to obtain the scaled image;

[0157] (243) Calculate the gray edge filling value;

[0158] The edge fill value is gray, i.e. (114, 114, 114), obtained by taking the remainder of the difference between the zoomed image and the original zoomed image using the numpy library np.mod. The np.mod method first subtracts 32 and then takes the remainder.

[0159] (25) Backbone network;

[0160] The Backbone network uses a Focus structure followed by a CBS structure and a CSP1_X structure, followed by a Neck network, to obtain a feature weight file based on the database constructed in step (1).

[0161] (26) Target feature matching;

[0162] Compare the test set divided in step (21) with the feature weight file obtained in step (25) to match the class names;

[0163] (27) Target confidence analysis;

[0164] Output the confidence level of the matching result obtained in step (26). The specific process is as follows:

[0165] (271) Loss function;

[0166] The YOLOX target detection model uses the intersection-over-union function:

[0167]

[0168] Among them, ρ 2 (A, B) represents the square of the Euclidean distance between the true box A and the predicted box B; c represents the diagonal length of the smallest box containing the true box and the predicted box; α represents the weight function; υ is used to measure the consistency of aspect ratio, W gt Indicates the width of the real box A, which is numerically equal to x max -x min ;h gt Indicates the height of the real box A, which is numerically equal to y max -y min ;W p Indicates the width of the prediction box B; h p Represents the height of the predicted box B; π represents pi; the range of arctan is [0, π / 2);

[0169] The loss function used in the YOLOX target detection model is defined as:

[0170]

[0171] Among them, IoU represents the ratio of the intersection area of ​​the real box A and the predicted box B to the union area.

[0172] (272)nms non-maximum suppression;

[0173] If the CIoU coefficient is greater than 0.5, the candidate box with the highest confidence among those that meet the conditions will be displayed; if the CIoU coefficient is less than 0.5, it will not be displayed;

[0174] (273) Target feature learning evaluation;

[0175] The results of steps (22) and (23) were evaluated according to the following indicators:

[0176] (2731) Accuracy: the proportion of all correct predictions (positive and negative) to the total;

[0177]

[0178] Among them, TP represents the number of targets detected as positive in the positive class; TN represents the number of targets detected as negative in the negative class; FP represents the number of targets detected as positive in the negative class; FN represents the number of targets detected as negative in the positive class;

[0179] (2732) Precision, the ratio of correctly predicted positive results to all positive results.

[0180]

[0181] (2733) Recall, the ratio of correctly predicted positive results to all actual positive results.

[0182]

[0183] (2734) F1 value (H-mean value), the F1 value is the arithmetic mean divided by the geometric mean, and the larger the better, that is, F1 is the weighted value of Precision and Recall;

[0184]

[0185] The formula is transformed into:

[0186]

[0187] Set the Accuracy, Precision, Recall, and F1 values ​​to no less than 90%, end the target feature learning, and obtain the trained YOLOX target detection model.

[0188] (3) Capturing images within the field of view through a binocular camera and performing stereo matching to generate a disparity map to obtain the first depth information of the target; specifically,

[0189] (31) Collect images within the field of view based on the opencv binocular camera;

[0190] (32) Binocular camera parameter calibration;

[0191] Use Zhang's calibration method to correct the distortion of the binocular camera, obtain the camera distortion parameters, camera intrinsic parameters, and camera extrinsic parameters, and construct the rotation and translation matrix [R, T] relative to the world coordinate system with the left camera as the origin;

[0192] (33) Binocular camera stereo matching;

[0193] (331) Pretreatment;

[0194] Based on the relevant parameters obtained in the above step (32), the left and right camera images obtained in the above step (31) are aligned on the same plane, and the SGBM semi-global stereo matching algorithm is used to achieve stereo matching of the left and right camera images. The SGBM semi-global stereo matching algorithm uses the Sobel operator to pre-process the image. The formula is:

[0195] Sobel(u,v)=2[P(u+1,v)-P(u-1,v)]+P(u+1,v-1)-P(u-1,v-1)+P(u+1,v+1)-P(u-1,v+1)

[0196] Where P(u,v) is the pixel value of any pixel position in the pixel coordinate system. The formula represents the horizontal Sobel algorithm, which is obtained by subtracting the values ​​of the lower right, upper left, upper right, and lower left pixels from twice the value between adjacent pixels in the same horizontal direction. The image is processed horizontally by the Sobel operator pixel by pixel to map it into a new image. The mapping function is:

[0197]

[0198] Among them, P is the pixel value of any point before image mapping, preFilterCap is a constant parameter, P NEW Represents the pixel value on the new image;

[0199] (332) Cost calculation;

[0200] The left and right camera images obtained after step (331) are substituted pixel by pixel into the following formula to calculate the gradient cost C AD (α,d) and C SAD (α,d);

[0201] C AD (α,d)=|I L (α)-I R (α-d)|

[0202] C SAD (α,d)=∑ q∈Nα |I L (α)-I R (α-d)|

[0203] Where C AD (α, d) represents the absolute value of the difference between the grayscale value of the pixel at point α of the left camera and the grayscale value of the pixel at point p of the right camera at a horizontal distance d. SAD (α, d) represents the C of all pixels in the neighborhood of the pixel to be matched AD The sum of (α, d); the left image pixel to be matched is α (the default is the pixel principal point), and its neighborhood is N α, q is a point in the neighborhood; the corresponding pixel point in the right image is α-d;

[0204] (333) Dynamic programming;

[0205] Determine the loss function:

[0206]

[0207] Get the disparity map:

[0208]

[0209] Where D represents the disparity map; E(D) represents the energy function corresponding to the disparity map; p, q represent a pixel in the image; Np represents the neighboring pixel of pixel p; C(p, D p ) indicates that the current pixel disparity is D p When , the cost (loss) of the pixel point; P1 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is equal to 1 pixel; P2 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is greater than 1 pixel; I[.] function means that if the function parameter is true, it returns a value of 1, otherwise it returns a value of 0, and P 2> P1 ensures that the disparity map changes smoothly. If the loss function only has In one term, the local optimum is the global optimum; in the loss term, q∈N, the optimal disparity of the current pixel is obtained by the optimal disparity of the surrounding pixels, which is determined by the path cost aggregation method. The formula is as follows:

[0210]

[0211] Among them, L r (p, d) represents the path aggregation cost when the disparity of pixel point p aggregated from direction r is d, and C(p, d) is the loss value of pixel point p when the disparity is d. The penalty coefficients P1 and P2 are expressed as follows:

[0212] P1=8×cn×sgbmSADWindowSize×sgbmSADWindowSize

[0213] P2=32×cn×sgbmSADWindowSize×sgbmSADWindowSize

[0214] Among them, the parameter cn represents the mapping value of the selected area in the image, and SADWindowSize represents the size of the SAD window, which is an odd number in the range of 3×3 to 21×21. If the parameters cn and SADWindowSize are fixed, the penalty coefficients P1 and P2 represent two fixed values.

[0215] (334) post-processing;

[0216] (3341) uniqueness test;

[0217] When the lowest cost within the disparity window is (1 + uniquenessRatio / 100) times the second lowest cost, the disparity value corresponding to the lowest cost is the disparity of the pixel point. Otherwise, the disparity of the pixel point is 0 to ensure the uniqueness of the match. UniquenessRatio is a constant parameter.

[0218] (3342) Left and right consistency check;

[0219] Take the left image as the reference image, get the reference image disparity dispL[x], and calculate the corresponding right image disparity value dispR[xd], where d represents the disparity; by finding the minimum matching cost among the disp[x] data values, the minimum matching cost value is the correct difference;

[0220] (3353) Detect connected regions;

[0221] A threshold is set and all pixel points are compared with the threshold. The size comparison is used to determine whether there are any mismatched points. A detected pixel point has at least one point that meets the connectivity requirement around it. After the detection is completed, the adjacent points around the point are set as the starting points for detection and determination. The points that meet the connectivity requirement around the adjacent points are found. If the number of detected points exceeds the threshold, the disparity value of the area is set to the correct disparity value. Otherwise, it will be determined as a noise point and removed.

[0222] (335) Target ranging;

[0223] (3351) Parallax method to find the three-dimensional coordinates of a spatial point;

[0224] Point A is a point in the spatial coordinate system. Taking the left camera C1 as the world coordinate system, the coordinates of point A under the left camera C1 are A = (X, Y, Z, 1), and the coordinates under the right camera C2 are A = (Xb, Y, Z, 1), where b represents the baseline, i.e., the distance between the projection centers of the left and right cameras, f represents the focal length of the left camera, and u0 and v0 represent the intrinsic parameters of the left camera. After correction, the mapping matching point of point A in the left and right images is A. l =(u1,v1,1) T and A r =(u2,v2,1) T Let parallax d = u1-u2, according to the camera imaging model and triangle principle, we can get:

[0225]

[0226] Thus, the first depth information of the target is obtained.

[0227] (4) Using the YOLOX target detection model trained in step (2) to perform target detection on the image collected in step (3), obtain the pixel coordinates of the drone detected in the left and right images, and perform the least squares method to obtain the three-dimensional coordinates of the drone space to obtain the second depth information of the target; specifically including:

[0228] (41) Using the YOLOX target detection model trained in step (2) to detect the binocular image obtained in step (3), obtain the rectangular outline of the drone target in the left and right images, and obtain the pixel coordinates of the center point of the left and right images of the drone;

[0229] (42) Target ranging;

[0230] The least squares method is used to obtain the three-dimensional coordinates of a spatial point;

[0231] Using the rotation and translation matrices [R, T] of the left camera relative to the world coordinate system obtained in step (32) above, and the corresponding matching points of the target object in the known left and right images, the three-dimensional coordinates of the spatial point are calculated using the following formula:

[0232]

[0233]

[0234] Among them, [u1 v1 1] T is the pixel coordinate in the left image coordinate system, [u2 v2 1] T is the pixel coordinate in the right image coordinate system, [X W Y W Z W 1] T is the world coordinate of the projected object of the left and right images, M1 and M2 are the calibration results of the parameter matrices of the left and right cameras respectively, [R1, T1] and [R2, T2] are the rotation and translation vectors of the left and right camera coordinate systems relative to the world coordinate system, and Z in the formula is replaced by C1 ,Z C2 After elimination, we can get the following four linear equations:

[0235]

[0236]

[0237]

[0238]

[0239] Convert the formula into matrix form:

[0240] AP=b

[0241] in:

[0242]

[0243] P=[X W Y W Z W ] T

[0244]

[0245] The least square method is used to solve the unknown quantity (X W Y W Z W ) That is, the spatial coordinate value of the spatial point in the world coordinate system is obtained using the following formula:

[0246] P=(A T A) -1 A T b

[0247] Thus, the second depth information of the target is obtained.

[0248] (5) Based on the target first depth information and the target second depth information, the non-cooperative UAV airspace is located and the airspace number of the non-cooperative UAV is output; Figure 3 As shown, specifically including:

[0249] Combine step (335) and step (42) to obtain Z and Z W value, select the left camera optical center as the main point, select Z and Z W The smallest value is used as the distance to the principal point. The field of view airspace with a horizontal distance from the principal point less than 300mm is defined as A, the field of view airspace with a horizontal distance from the principal point greater than 300mm and less than 600mm is defined as B, the field of view airspace with a horizontal distance from the principal point greater than 600mm and less than 900mm is defined as C, the field of view airspace with a horizontal distance from the principal point greater than 900mm and less than 1200mm is defined as D, and the field of view airspace with a horizontal distance from the principal point greater than 1200mm is defined as E. Combined with the current longitude and latitude of the shooting camera, the principal point direction, lens tilt, airspace position, and time are merged into a data link and used as the airspace number where the non-cooperative UAV is detected.

[0250] (6) Conduct risk assessment of non-cooperative UAVs based on the binocular camera position information in step (3), and represent the risk assessment results in the form of a data link after being connected in series with the airspace number in step (5); specifically, including:

[0251] (61) The airspace number obtained in the above step (5) is combined with the detection frame size position change obtained in step (4) to determine the movement trend of the non-cooperative drone as approaching, moving away or crossing; the time when YOLOX detects the target and generates the detection frame is the initial moment, and the image coordinates of the target center point are returned as the initial position at the current moment. When the position change of the target center point in the left and right camera image coordinates within 1 second before and after is no more than 1 pixel unit, and the detection frame area change range is between 95% and 100%, the target is considered to be in a crossing state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to increase, and the area change exceeds 5%, the target is considered to be in an approaching state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to decrease, and the area change exceeds 5%, the target is considered to be in a moving away state; Z and Z in step (5) are combined. W The smallest value is defined as the distance. When the distance is less than 50 meters and there is an approaching trend, the risk level is VI; when the distance is less than 50 meters and there is no approaching trend (crossing state or moving away state), the risk level is V; when the distance is greater than 50 meters and less than 100 meters and there is an approaching trend, the risk level is IV; when the distance is greater than 50 meters and less than 100 meters and there is no approaching trend (crossing state or moving away state), the risk level is III; when the distance is greater than 100 meters and there is an approaching trend, the risk level is II; when the distance is greater than 100 meters and there is no approaching trend (crossing state or moving away state), the risk level is I.

[0252] (62) The risk level is concatenated with the airspace number obtained in step (5) to represent the digital risk assessment of urban low-altitude non-cooperative drones.

[0253] The present invention has many specific application paths. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements can be made without departing from the principles of the present invention. These improvements should also be considered as the scope of protection of the present invention.

Claims

1. A digital risk assessment method for low-altitude non-cooperative urban drones, characterized by: Here are the steps: (1) Build a database of urban low-altitude drone operations; (2) inputting the urban low-altitude UAV operation database in step (1) into the YOLOX target detection model for training to obtain a trained YOLOX target detection model; (3) Capturing images within the field of view through a binocular camera, and performing stereo matching to generate a disparity map to obtain the first depth information of the target; (4) Using the YOLOX target detection model trained in step (2) to perform target detection on the image collected in step (3), the pixel coordinates of the drone detected in the left and right images are obtained, and the least squares method is used to obtain the three-dimensional coordinates of the drone space to obtain the second depth information of the target; (5) Positioning the non-cooperative UAV in the airspace based on the target first depth information and the target second depth information, and outputting the airspace number where the non-cooperative UAV is located; (6) Conduct risk assessment of non-cooperative UAVs based on the binocular camera position information in step (3), and represent the risk assessment results in the form of a data link after being connected in series with the airspace number in step (5); The step (5) specifically includes: Combine steps (3) and (4) to get the depth Z of c1 in the camera coordinate system and the depth Z of the space point in the world coordinate system W value, select the left camera optical center as the main point, select Z and Z W The smallest value is used as the distance to the principal point. The field of view airspace with a horizontal distance from the principal point less than 300mm is defined as A, the field of view airspace with a horizontal distance from the principal point greater than 300mm and less than 600mm is defined as B, the field of view airspace with a horizontal distance from the principal point greater than 600mm and less than 900mm is defined as C, the field of view airspace with a horizontal distance from the principal point greater than 900mm and less than 1200mm is defined as D, and the field of view airspace with a horizontal distance from the principal point greater than 1200mm is defined as E. Combined with the current longitude and latitude of the shooting camera, the principal point direction, lens tilt, airspace position, and time are merged into a data link and used as the airspace number where the non-cooperative drone was detected. The step (6) specifically includes: (61) The airspace number obtained in the above step (5) is combined with the detection frame size position change obtained in step (4) to determine the movement trend of the non-cooperative drone as approaching, moving away or crossing; the time when YOLOX detects the target and generates the detection frame is the initial moment, and the image coordinates of the target center point are returned as the initial position at the current moment. When the position change of the target center point in the left and right camera image coordinates within 1 second before and after is no more than 1 pixel unit, and the detection frame area change range is between 95% and 100%, the target is considered to be in a crossing state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to increase, and the area change exceeds 5%, the target is considered to be in an approaching state; if the position change of the target center point in the left and right camera image coordinates within 1 second before and after is greater than 1 unit, and the detection frame area continues to decrease, and the area change exceeds 5%, the target is considered to be in a moving away state; Z and Z in step (5) are combined. W The smallest value is used as the distance. When the distance is less than 50 meters and there is a trend of approaching, the risk level is VI; when the distance is less than 50 meters and there is no trend of approaching, the risk level is V; when the distance is greater than 50 meters and less than 100 meters and there is a trend of approaching, the risk level is IV; when the distance is greater than 50 meters and less than 100 meters and there is no trend of approaching, the risk level is III; when the distance is greater than 100 meters and there is a trend of approaching, the risk level is II; when the distance is greater than 100 meters and there is no trend of approaching, the risk level is I. (62) The risk level is concatenated with the airspace number obtained in step (5) to represent the digital risk assessment of urban low-altitude non-cooperative drones.

2. The digital risk assessment method for urban low-altitude non-cooperative UAVs according to claim 1 is characterized in that: The step (1) specifically includes: (11) Collect relevant video data required to build a database of urban low-altitude drone operations; The video data includes flying objects in different backgrounds and weather conditions, as well as their positions and postures. Flying objects include rotary-wing drones, fixed-wing aircraft, birds, and close-up insects that may appear in the current scene. The video data also includes front, side, bottom, and top views of flying objects at different distances and positions. (12) Generate video frames; Using a fixed frame interval, video images are extracted at equal intervals to remove images with blurred targets due to camera motion, as well as images that are too far away or have too small a proportion of the image to have unclear features, thus forming a dataset for the detected targets. (13) Target marking; Use the annotation tool to annotate the detection targets in the images in the dataset and generate the x coordinates of the targets in the image coordinate system. min 、y min 、x max 、y max And the target name information xml format file, where x min 、y min 、x max 、y max They represent the coordinates x of the upper left corner of the target annotation box, with the upper left corner of the image as the origin (0, 0), the horizontal right direction as the positive direction of the x-axis, and the vertical downward direction as the positive direction of the y-axis. min 、y min , the lower right corner coordinate x max 、y max ; (14) Format conversion; Extract data from the XML file obtained in step (13), and extract the corresponding image file path information and the target frame x min 、y min 、x max 、y max The values ​​are integrated into the txt text.

3. The digital risk assessment method for urban low-altitude non-cooperative UAVs according to claim 2 is characterized in that: The step (2) specifically includes: (21) Training set and validation set division; The data set of the detected target in step (12) is divided into a training set, a validation set, and a test set to meet the needs of target feature learning; (22) Mosaic data enhancement at the input end; Use any 4 images in the dataset, randomly scale, randomly crop, and randomly arrange them for splicing, increase the detection dataset, randomly scale and add small targets, and enhance the robustness of the network; (23) Input-end adaptive anchor frame calculation; The anchor box is adaptively changed according to the target images of different sizes in the training set. The output feature maps of three scales are 13×13, 26×26, and 52×52, corresponding to 9 anchors with sizes of (10,13), (16,30), (33,23), (30,61), (62,45), (59,119), (116,90), (156,198), and (373,326). Each scale is divided into 3 anchors, of which (10,13), (16,30), and (33,23) correspond to small-scale feature maps, (30,61), (62,45), and (59,119) correspond to medium-sized feature maps, and (116,90), (156,198), and (373,326) correspond to large-scale feature layers. (24) Input-side adaptive image scaling; (241) Calculate the scaling ratio; Calculate the scaling factor of the original scaled size and the corresponding width and height of the original image, and choose the smaller of the two; (242) Calculate the scaled size; The original image width and height are multiplied by the minimum scaling factor to obtain the scaled image; (243) Calculate the gray edge filling value; The edge fill value is gray, i.e. (114, 114, 114), obtained by taking the remainder of the difference between the zoomed image and the original zoomed image using the numpy library np.mod. The np.mod method first subtracts 32 and then takes the remainder. (25) Backbone network; The Backbone network uses a Focus structure followed by a CBS structure and a CSP1_X structure, followed by a Neck network, to obtain a feature weight file based on the database constructed in step (1). (26) Target feature matching; Compare the test set divided in step (21) with the feature weight file obtained in step (25) to match the class names; (27) Target confidence analysis; Output the confidence level of the matching result obtained in step (26). The specific process is as follows: (271) Loss function; The YOLOX target detection model uses the intersection-over-union function: Among them, ρ 2 (A, B) represents the square of the Euclidean distance between the true box A and the predicted box B; c represents the diagonal length of the smallest box containing the true box and the predicted box; α represents the weight function; υ is used to measure the consistency of aspect ratio, W gt Indicates the width of the real box A, which is numerically equal to x max -x min ;h gt Indicates the height of the real box A, which is numerically equal to y max -y min ;W p Indicates the width of the prediction box B; h p Represents the height of the predicted box B; π represents pi; the range of arctan is [0, π / 2); The loss function used in the YOLOX target detection model is defined as: Among them, IoU represents the ratio of the intersection area of ​​the real box A and the predicted box B to the union area; (272)nms non-maximum suppression; Set the CIoU coefficient to be greater than 0.5, and display the candidate box with the highest confidence among those that meet the conditions. If the CIoU coefficient is less than 0.5, it will not be displayed. (273) Target feature learning evaluation; The results of steps (22) and (23) were evaluated according to the following indicators: (2731) Accuracy: the percentage of correct predictions to the total; Among them, TP represents the number of targets detected as positive in the positive class; TN represents the number of targets detected as negative in the negative class; FP represents the number of targets detected as positive in the negative class; FN represents the number of targets detected as negative in the positive class; (2732) Precision: The ratio of correctly predicted positive results to all positive results. (2733) Recall, the ratio of correctly predicted positive results to all actual positive results; (2734) F1 value, the F1 value is the arithmetic mean divided by the geometric mean, and the larger the better, that is, F1 is the weighted value of Precision and Recall; The formula is transformed into: Set the Accuracy, Precision, Recall, and F1 values ​​to no less than 90%, end the target feature learning, and obtain the trained YOLOX target detection model.

4. The digital risk assessment method for urban low-altitude non-cooperative UAVs according to claim 3 is characterized in that: The step (3) specifically includes: (31) Collect images within the field of view based on the opencv binocular camera; (32) Binocular camera parameter calibration; Use Zhang's calibration method to correct the distortion of the binocular camera, obtain the camera distortion parameters, camera intrinsic parameters, and camera extrinsic parameters, and construct the rotation and translation matrix [R, T] relative to the world coordinate system with the left camera as the origin; (33) Binocular camera stereo matching; (331) Pretreatment; Based on the relevant parameters obtained in the above step (32), the left and right camera images obtained in the above step (31) are aligned on the same plane, and the SGBM semi-global stereo matching algorithm is used to achieve stereo matching of the left and right camera images. The SGBM semi-global stereo matching algorithm uses the Sobel operator to pre-process the image. The formula is: Sobel(u,v)=2[P(u+1,v)-P(u-1,v)]+P(u+1,v-1)-P(u-1,v-1)+P(u+1,v+1)-P(u-1,v+1)where P(u,v) is the pixel value at any pixel position in the pixel coordinate system. The formula represents the horizontal Sobel algorithm, which is obtained by subtracting the values ​​of the lower right, upper left, upper right, and lower left pixels from twice the value of the adjacent pixels in the same horizontal direction. The image is processed horizontally by the Sobel operator pixel by pixel and mapped into a new image. The mapping function is: Among them, P is the pixel value of any point before image mapping, preFilterCap is a constant parameter, P NEW Represents the pixel value on the new image; (332) Cost calculation; The left and right camera images obtained after step (331) are substituted pixel by pixel into the following formula to calculate the gradient cost C AD (α,d) and C SAD (α,d); C AD (a,d)=|I L (a)-I R (a-d)| C SAD (α,d)=∑ q∈Nα |I L (a)-I R (a-d)| Where C AD (α, d) represents the absolute value of the difference between the grayscale value of the pixel at point α of the left camera and the grayscale value of the pixel at point p of the right camera at a horizontal distance d. SAD (α, d) represents the C of all pixels in the neighborhood of the pixel to be matched AD The sum of (α, d); the left image pixel to be matched is α (the default is the pixel principal point), and its neighborhood is N α , q is a point in the neighborhood; the corresponding pixel point in the right image is α-d; (333) Dynamic programming; Determine the loss function: Get the disparity map: Where D represents the disparity map; E(D) represents the energy function corresponding to the disparity map; p, q represent a pixel in the image; Np represents the neighboring pixel of pixel p; C(p, D p ) indicates that the current pixel disparity is D p When , the cost (loss) of the pixel point; P1 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is equal to 1 pixel; P2 is a penalty coefficient, which is applicable when the disparity value between pixel point p and neighboring pixel point q is greater than 1 pixel; I[.] function means that if the function parameter is true, it returns a value of 1, otherwise it returns a value of 0, and P 2> P1 ensures that the disparity map changes smoothly. If the loss function only has In one term, the local optimum is the global optimum; in the loss term, q∈N, the optimal disparity of the current pixel is obtained by the optimal disparity of the surrounding pixels, which is determined by the path cost aggregation method. The formula is as follows: Among them, L r (p, d) represents the path aggregation cost when the disparity of pixel point p aggregated from direction r is d, and C(p, d) is the loss value of pixel point p when the disparity is d. The penalty coefficients P1 and P2 are expressed as follows: P1=8×cn×sgbmSADWindowSize×sgbmSADWindowSize P2=32×cn×sgbmSADWindowSize×sgbmSADWindowSize Among them, the parameter cn represents the mapping value of the selected area in the image, and SADWindowSize represents the size of the SAD window, which is an odd number in the range of 3×3 to 21×21. If the parameters cn and SADWindowSize are fixed, the penalty coefficients P1 and P2 represent two fixed values. (334) post-processing; (3341) uniqueness test; When the lowest cost within the disparity window is (1 + uniquenessRatio / 100) times the second lowest cost, the disparity value corresponding to the lowest cost is the disparity of the pixel point. Otherwise, the disparity of the pixel point is 0 to ensure the uniqueness of the match. UniquenessRatio is a constant parameter. (3342) Left and right consistency check; Take the left image as the reference image, get the reference image disparity dispL[x], and calculate the corresponding right image disparity value dispR[xd], where d represents the disparity; by finding the minimum matching cost among the disp[x] data values, the minimum matching cost value is the correct difference; (3353) Detect connected regions; A threshold is set and all pixel points are compared with the threshold. The size comparison is used to determine whether there are any mismatched points. A detected pixel point has at least one point that meets the connectivity requirement around it. After the detection is completed, the adjacent points around the point are set as the starting points for detection and determination. The points that meet the connectivity requirement around the adjacent points are found. If the number of detected points exceeds the threshold, the disparity value of the area is set to the correct disparity value. Otherwise, it will be determined as a noise point and removed. (335) Target ranging; (3351) Parallax method to find the three-dimensional coordinates of a spatial point; Point A is a point in the spatial coordinate system. Taking the left camera C1 as the world coordinate system, the coordinates of point A under the left camera C1 are A = (X, Y, Z, 1), and the coordinates under the right camera C2 are A = (Xb, Y, Z, 1), where b represents the baseline, i.e., the distance between the projection centers of the left and right cameras, f represents the focal length of the left camera, and u0 and v0 represent the intrinsic parameters of the left camera. After correction, the mapping matching point of point A in the left and right images is A. l =(u1,v1,1) T and A r =(u2,v2,1) T Let parallax d = u 1- u2, according to the camera imaging model and triangle principle, is obtained: Thus, the first depth information of the target is obtained.

5. The digital risk assessment method for urban low-altitude non-cooperative UAVs according to claim 4 is characterized in that: The step (4) specifically includes: (41) Using the YOLOX target detection model trained in step (2) to detect the binocular image obtained in step (3), obtain the rectangular outline of the drone target in the left and right images, and obtain the pixel coordinates of the center point of the left and right images of the drone; (42) Target ranging; The least squares method is used to obtain the three-dimensional coordinates of a spatial point; Using the rotation and translation matrices [R, T] of the left camera relative to the world coordinate system obtained in step (32) above, and the corresponding matching points of the target object in the known left and right images, the three-dimensional coordinates of the spatial point are calculated using the following formula: Among them, [u1 v11] T is the pixel coordinate in the left image coordinate system, [u2 v21] T is the pixel coordinate in the right image coordinate system, [X W Y W Z W 1] T is the world coordinate of the projected object of the left and right images, M1 and M2 are the calibration results of the parameter matrices of the left and right cameras respectively, [R1, T1] and [R2, T2] are the rotation and translation vectors of the left and right camera coordinate systems relative to the world coordinate system, and Z in the formula is replaced by C1 ,Z C2 After elimination, we can get the following four linear equations: Convert the formula into matrix form: AP=b in: P=[X W Y W Z W ] T The least square method is used to solve the unknown quantity (X W Y W Z W ) That is, the spatial coordinate value of the spatial point in the world coordinate system is obtained using the following formula: P=(A T A) -1 A T b Thus, the second depth information of the target is obtained.

Citation Information

Patent Citations

  • Unmanned aerial vehicle risk assessment method and system for urban environment

    CN113361862A

  • Unmanned aerial vehicle low-altitude safety early warning and monitoring method and system based on digital twinning

    CN113867391A