A vision-based method for autonomous landing runway detection of fixed-wing UAVs
By performing a series of visual processing on the runway images collected by the UAV, the autonomous landing runway detection of the fixed-wing UAV is realized, which solves the problem of insufficient reliability and accuracy of UAV autonomous navigation in the existing technology, and improves the The accuracy and real-time nature of landing enhance the adaptability and concealment in battlefield environment.
Patent Information
- Application Number
- CN202210474425.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-04-29
AI Technical Summary
Existing UAV landing systems have insufficient reliability and accuracy in autonomous navigation, especially when GPS is susceptible to interference during wartime, resulting in a complicated landing process and a high accident rate. There is a lack of equipment suitable for small and medium-sized aircraft and airports. Economical and practical autonomous landing solution.
A vision-based fixed-wing UAV autonomous landing runway detection method is used to realize the runway detection by performing grayscale processing, image cutting, adaptive histogram equalization, Gaussian filtering, edge detection and Hough transformation on the collected runway images. Accurate detection and autonomous navigation of lines.
It improves the accuracy and real-time performance of UAV autonomous landing, reduces dependence on ground auxiliary equipment, enhances adaptability and concealment in battlefield environments, and reduces accident rates.
Smart Images

Figure CN114842359B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) landing navigation, and in particular to a vision-based fixed-wing UAV autonomous landing runway detection method. Background Art
[0002] UAV landing refers to the process of positioning and navigating by airborne navigation equipment or ground auxiliary instruments, as well as flight control systems, and finally controlling the UAV to land at the landing site. UAV landing is an important stage in flight. During the UAV approach process, if the aircraft is below the altitude decision, other means other than the global positioning system (GPS) must be provided for navigation to increase the redundancy of the navigation system. Traditional approach schemes usually use instrument landing systems (ILS, Instrument Landing System) as ground-based guidance equipment. However, this scheme requires expensive airborne and ground-based equipment and is difficult to be widely used in landing scenarios of small and medium-sized aircraft and small and medium-sized airports. Relevant statistics show that the number of failures during the recovery of UAVs accounts for more than 80% of the total number of failures in the execution of the mission. Therefore, it is an urgent task to study a reliable UAV landing navigation system. Although the United States has developed advanced UAVs such as the Global Hawk, Predator, X-45C and X-47B, they still lack reliable autonomous landing capabilities. At present, U.S. military drones can rely on GPS to complete semi-autonomous landings, but face the problem of GPS being easily interfered with during wartime. As drones currently lack practical and accurate autonomous navigation equipment, most drones still rely on ground remote control landing. Landing is complex to operate, there are many ground interference factors, and the accident rate is high.
[0003] In the military, some fighters that can achieve autonomous landing will be highly valued by the military. These fighters can adapt to various environments and have good maneuverability. In addition, aircraft that can land autonomously also reduce their dependence on ground auxiliary equipment. In the specific combat process, even if the base of the fighter is destroyed, the fighter can still land effectively.
[0004] The methods for drones to land autonomously are divided into carrying accurate, stable and reliable navigation systems and flight control systems on drones. At present, computer vision as a passive information source is gaining more and more attention, and more and more scholars are beginning to study how to use computer vision technology to perform autonomous and accurate navigation on carriers. In recent years, computer vision has been widely studied and achieved certain success in the fields of intelligent vehicles, robots, micro-aircraft and autonomous landing of drones. Visual navigation has the advantages of low cost, simple equipment, large amount of information, full autonomy, low requirements for landing field conditions and complete passivity. It can better meet the requirements of autonomous landing of man-machine in battlefield environments and improve the adaptability, intelligence and concealment of drone landing. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a vision-based fixed-wing UAV autonomous landing runway detection method.
[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0007] A vision-based fixed-wing UAV autonomous landing runway detection method comprises the following steps:
[0008] S1, grayscale processing is performed on the collected runway image;
[0009] S2, establishing a static mask to perform image segmentation on the runway image processed in step S1;
[0010] S3, performing image enhancement processing on the runway image obtained in step S2 using an adaptive histogram equalization method;
[0011] S4, using a Gaussian filtering method to smooth and blur the runway image processed in step S3;
[0012] S5, using the Sobel operator to perform edge detection on the runway image processed in step S4;
[0013] S6, determining whether the runway line is detected in the previous runway image frame;
[0014] If yes, a dynamic mask is created based on the runway line detected in the previous runway image to perform image segmentation on the runway image processed in step S5;
[0015] Otherwise, no image cutting is performed;
[0016] S7, using the Hough transform method to perform straight line detection on the runway image obtained in step S6;
[0017] S8. Perform spatial filtering on the straight line detected in step S7 to obtain a runway line detection result.
[0018] Optionally, in step S2, a static mask is established to perform image segmentation on the runway image processed in step S1, specifically:
[0019] First, create an image mask with the same size as the runway image to be processed and all pixel values are 0;
[0020] Then select multiple pixel points to draw a polygon on the created image mask, and fill the pixel value in the polygon area with 255 to create a static mask;
[0021] Finally, the established static mask is subjected to a bitwise AND operation with pixels corresponding to the runway image to be processed to obtain the runway image after image segmentation.
[0022] Optionally, in step S3, an adaptive histogram equalization method is used to perform image enhancement processing on the runway image obtained in step S2, specifically:
[0023] First, the runway image obtained in step S2 is divided into pixel blocks of a set size, and a histogram equalization process is performed on each pixel block;
[0024] Then the transformation functions between adjacent pixel blocks are smoothly interpolated to obtain the runway image after image enhancement;
[0025] The transformation function is expressed as:
[0026]
[0027] Among them, s is the gray value of the corresponding position obtained by the runway image transformation, r is the original gray value of the runway image, L is the number of gray levels of the runway image, and p r (x) is the probability density function of the original gray value r.
[0028] Optionally, in step S6, a dynamic mask is established according to the runway line detected in the previous runway image frame, specifically:
[0029] Calculate the coordinates of the intersection of the left runway line and the right runway line detected in the previous runway image, determine the upper boundary offset according to the prior information, and shift the ordinate of the intersection coordinate upward by the determined upper boundary offset to obtain the dynamic upper boundary;
[0030] Calculate the coordinates of the intersections of the start runway line detected in the previous runway image with the left runway line and the right runway line, and determine the lower boundary offset according to the prior information, and offset the ordinates of the intersections of the start runway line with the left runway line and the right runway line downward by the lower boundary offset determined, to obtain the dynamic lower boundary;
[0031] Determine the left boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the left runway line to the left by the determined left boundary offset to obtain the dynamic left boundary;
[0032] Determine the right boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the right runway line to the right by the right boundary offset determined to obtain the dynamic right boundary;
[0033] A dynamic mask is established according to the image range determined by the dynamic upper boundary, the dynamic lower boundary, the dynamic left boundary and the dynamic right boundary.
[0034] Optionally, in step S8, spatial filtering is performed on the straight line detected in step S7 to obtain a runway line detection result, specifically:
[0035] The slopes and intercepts of the straight lines with slopes greater than 0 and less than 0 detected in step S7 and the coordinates of the points on the straight lines are saved in the left runway line list and the right runway line list respectively;
[0036] Use slope constraints and line length constraints to filter the straight lines in the left runway line list and the right runway line list;
[0037] Pair the straight lines in the filtered left runway line list and right runway line list with line segments;
[0038] The median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection result.
[0039] Optionally, the use of slope constraints and line length constraints to filter the straight lines in the left runway line list and the right runway line list is specifically as follows:
[0040] Determine whether the slope of the straight line in the left runway line list and the right runway line list exceeds the set slope threshold range; if so, delete the straight line; otherwise, keep the straight line;
[0041] Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list;
[0042] Determine whether the horizontal coordinate or the vertical coordinate of the intersection coordinate exceeds the threshold range of the horizontal and vertical coordinates of the runway image; if so, delete the two straight lines corresponding to the intersection coordinate; otherwise, retain the two straight lines corresponding to the intersection coordinate;
[0043] Determine whether the ordinate of the intersection coordinate is greater than the ordinate of the line segment formed by two points on the two straight lines corresponding to the intersection coordinate; if so, keep the two straight lines corresponding to the intersection coordinate; otherwise, delete the two straight lines corresponding to the intersection coordinate;
[0044] Calculate the line segment lengths of each line according to the coordinates of the points on the lines in the left runway line list and the right runway line list;
[0045] Determine whether the line segment length is greater than the set line segment length threshold; if so, retain the straight line corresponding to the line segment length; otherwise, delete the straight line corresponding to the line segment length.
[0046] Optionally, the line segment pairing of the straight lines in the filtered left runway line list and the filtered right runway line list is specifically as follows:
[0047] Traverse the lines in the filtered left runway line list, and calculate the difference in ordinate between the midpoint of the line segment of the selected line and the midpoint of the line segment of the line in the right runway line list;
[0048] Determine whether the vertical coordinate difference is less than the set vertical coordinate threshold; if so, keep the selected straight line and the line segment pairing of the straight lines in the right runway line list; otherwise, continue to traverse the straight lines in the filtered left runway line list;
[0049] Determine whether the horizontal coordinate of the midpoint of the line segment of the selected straight line is less than the horizontal coordinate of the midpoint of the line segment of the straight line in the paired right runway line list; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list;
[0050] Calculate the angle between the selected line and the line in the right runway line list;
[0051] Determine whether the angle is greater than the set angle threshold; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list.
[0052] Optionally, the median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection result, specifically:
[0053] Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list;
[0054] The horizontal coordinates and vertical coordinates of the intersection coordinates are saved in the horizontal coordinate list and the vertical coordinate list respectively, and the median values of the horizontal coordinate list and the vertical coordinate list are calculated respectively;
[0055] The distances between the intersection points and the median coordinate points are calculated respectively, and the two straight lines corresponding to the intersection points with the smallest distance are selected to obtain the runway line detection results.
[0056] Optionally, the method further includes performing time filtering on the runway line detection results.
[0057] Optionally, the time filtering of the runway line detection result is specifically:
[0058] Determine whether the left runway line and the right runway line are detected in the current frame runway image;
[0059] If yes, save the slope and intercept of the left runway line and the right runway line in the runway line detection result into global variables;
[0060] Otherwise, get the slope and intercept of the left and right runway lines stored in the global variables.
[0061] The present invention has the following beneficial effects:
[0062] The present invention grayscales the collected runway image; establishes a static mask to perform image cutting on the runway image; uses an adaptive histogram equalization method to perform image enhancement on the runway image; uses a Gaussian filtering method to smooth and blur the runway image; uses a Sobel operator to perform edge detection on the runway image; establishes a dynamic mask based on the runway line detection result of the previous runway image; uses a Hough transform method to perform straight line detection on the runway image; and performs spatial filtering on the detected straight line to obtain the runway line detection result. The present invention can improve the accuracy and real-time performance of autonomous landing runway detection of unmanned aerial vehicles, thereby realizing autonomous and precise navigation of autonomous landing of unmanned aerial vehicles based on computer vision. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 The present invention is a flowchart of a method for autonomous landing runway detection of a fixed-wing UAV based on vision according to an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0065] In order to solve the main technical problems of visual navigation during the autonomous landing of fixed-wing UAVs, the present invention takes a real UAV runway as the research object, relies on visual navigation technology to identify and detect the runway, and determines the position of the UAV relative to the runway coordinate system based on the detection results, so as to determine the landing direction of the fixed-wing UAV. At the same time, according to the landing requirements of the UAV, the landing runway is determined and the landing position of the UAV is adjusted, finally realizing the autonomous landing of the fixed-wing UAV based on vision.
[0066] The technical idea adopted by the present invention is to first grayscale the image of the camera to convert the three RGB channels into a single channel, thereby reducing the amount of calculation. Then, the grayscale image is enhanced to improve the clarity of the runway line. Then, Gaussian filtering is used to smooth and blur the image. Then, the sobel operator is used to calculate the approximate gradient of the image grayscale function to achieve edge detection. If the initialization has been completed, it means that the runway line has been detected before and the corresponding dynamic mask has been generated. In this case, the runway edge is only detected within the range of the last dynamic mask. If the runway line has not been detected before, the runway edge is detected within the range of the entire image. After the runway edge is detected, a straight line can be extracted according to the edge, but the extracted straight line has a lot of interference, and the runway line needs to be further filtered and decided by spatial filtering and temporal filtering until the real runway line is obtained. Finally, it is necessary to determine the range of the dynamic mask according to the real runway line to prepare for the runway line detection of the next frame.
[0067] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting an autonomous landing runway of a fixed-wing UAV based on vision, comprising the following steps:
[0068] S1, grayscale processing is performed on the collected runway image;
[0069] In an optional embodiment of the present invention, the runway image collected by the present invention is an RGB color image. Therefore, when the runway image is grayed, the grayed-out process is performed by weighted averaging of three RGB channels, and the weights are set to R:G:B=6:3:1.
[0070] The present invention first performs grayscale processing on the collected runway image, which can greatly reduce the calculation amount of the program and improve the real-time performance of image processing.
[0071] S2, establishing a static mask to perform image segmentation on the runway image processed in step S1;
[0072] In an optional embodiment of the present invention, during the runway image recognition process, there may be relatively fixed interference around the runway. To solve this problem, the present invention performs image segmentation on the runway image processed in step S1 by establishing a static mask, specifically:
[0073] First, create an image mask with the same size as the runway image to be processed and all pixel values are 0;
[0074] Then select multiple pixel points to draw a polygon on the created image mask, and fill the pixel value in the polygon area with 255 to create a static mask;
[0075] Finally, the established static mask is subjected to a bitwise AND operation with pixels corresponding to the runway image to be processed to obtain the runway image after image segmentation.
[0076] The static mask established by the present invention is to define a fixed area around the runway of the runway image, in which the original image is displayed, and the pixel value outside the area is 0, that is, all black, so that the runway is detected only in the defined area each time, thereby improving the detection efficiency.
[0077] S3, performing image enhancement processing on the runway image obtained in step S2 using an adaptive histogram equalization method;
[0078] In an optional embodiment of the present invention, in step S3, an adaptive histogram equalization method is used to perform image enhancement processing on the runway image obtained in step S2, specifically:
[0079] First, the runway image obtained in step S2 is divided into pixel blocks of a set size, and a histogram equalization process is performed on each pixel block;
[0080] Then the transformation functions between adjacent pixel blocks are smoothly interpolated to obtain the runway image after image enhancement;
[0081] The transformation function is expressed as:
[0082]
[0083] Among them, s is the gray value of the corresponding position obtained by the runway image transformation, r is the original gray value of the runway image, L is the number of gray levels of the runway image, and p r (x) is the probability density function of the original gray value r.
[0084] Specifically, the distribution of the dark image histogram is concentrated at the lower grayscale end, while the distribution of the bright image histogram is biased towards the higher grayscale end. If the grayscale histogram of an image almost covers the entire grayscale value range, and except for the number of individual grayscale values that are more prominent, the entire grayscale value is approximately uniformly distributed, then this image has a larger grayscale dynamic range and higher contrast, and the image details are richer. Therefore, a transformation function can be obtained based on the histogram information of the input image, and the grayscale histogram distribution of the input image can be approximately uniformly distributed by using this transformation function, thereby achieving histogram equalization.
[0085] Assuming that the image to be processed is a grayscale image, r represents the grayscale of the image to be processed, and its value range is [0, L-1]. Then r = 0 represents black, and r = L-1 represents white. The histogram equalization process corresponds to a transformation T, which is expressed as
[0086] s=T(r),0≤r≤L-1
[0087] That is to say, for a certain grayscale value of the input image, the grayscale value of the corresponding position obtained by transformation is s, where the transformation T satisfies the following conditions:
[0088] (1) T(r) is strictly monotonically increasing on [0, L-1];
[0089] (2) When 0≤r≤L-1, 0≤T(r)≤L-1;
[0090] Condition (1) requires that T(r) increases monotonically, so that the input grayscale value corresponds to the output grayscale value one by one, and the relative size relationship between the pixel grayscale values remains unchanged, which can avoid problems during the inverse transformation; Condition (2) ensures that the grayscale range of the output image is the same as that of the input image. The image actually processed is an integer grayscale value, so all results must be rounded to the nearest integer value.
[0091] First, for the continuous form, the grayscale value of a grayscale image can be regarded as a random variable in the interval [0, L-1], so the grayscale value can be represented by a probability density function. Assume that p r (r) and p s (s) represent the probability density functions of random variables r and s, respectively, p r (r) and the transformation T are known, and T(r) is continuously differentiable in the domain of definition, then the probability density function of s after the transformation can be obtained by the following formula
[0092]
[0093] Therefore, the probability density function of the output image grayscale s is obtained by the probability density function of the input image grayscale r and the transformation T(r). An important transformation function in image processing is constructed as follows:
[0094]
[0095] In order to find the probability density function p of the transformed random variable s s (s), then
[0096]
[0097] You can get:
[0098]
[0099] Therefore, after the transformation, p s (s) is uniformly distributed, that is to say, the random variable s obtained by transforming the probability density function of the image gray value through T(r) obeys uniform distribution.
[0100] For the discrete form, the derivation process is similar to the continuous form, except that the summation operation is used instead of the integral operation, and the discrete expression is as follows
[0101]
[0102] Where MN is the total number of image pixels, n k The grayscale is r k The number of pixels, L is the number of possible gray levels of the image.
[0103] The image after global equalization can only be approximately uniformly distributed. The dynamic range of the equalized image is expanded, but its essence is to expand the quantization interval, while the quantization level is reduced. Therefore, the original pixels with different grayscales may become the same after processing. An area of the same grayscale is formed, and there are obvious boundaries between the areas, resulting in pseudo contours. Another potential problem of global histogram equalization is that it may amplify the noise in the dark area.
[0104] It should be noted that if the original image has a high contrast, equalization will cause the grayscale to blend and the contrast to decrease. In an image with a mild whitening, equalization will merge some pixel grayscales, thereby increasing the contrast. If an equalized image is equalized again, the image will not change.
[0105] Although global histogram equalization is very effective, for some images, different equalization methods are used in different areas, that is, the image is divided into M×M pixel blocks and histogram equalization is performed on each sub-block separately. This may produce better results, but a block effect will occur, that is, the brightness is discontinuous at the boundary of the block.
[0106] One way to eliminate the artificial blocking effect is to use a moving window, that is, to recalculate the histogram for all M×M blocks centered on each pixel. Although this method is slow, because each pixel needs to be recalculated M times. 2 This is a nonlinear neighborhood operation, but it can be accelerated by updating only the corresponding entries in the histogram for pixels entering and leaving the block (in the raster scan of the image). Note that this operation is a nonlinear neighborhood operation.
[0107] Therefore, the present invention adopts an adaptive histogram equalization method, firstly divides the image into non-overlapping blocks, equalizes each block, and then smoothly interpolates the conversion function between blocks; for a given pixel (i, j), its weight value is calculated according to the horizontal and vertical position (s, t) of the block. The given pixel is a mapping result obtained by mixing its four adjacent values in the lookup table.
[0108] S4, using a Gaussian filtering method to smooth and blur the runway image processed in step S3;
[0109] In an optional embodiment of the present invention, the present invention uses Gaussian filtering to smooth and blur the image, thereby achieving noise reduction of the image. Gaussian filtering is to obtain the value of each pixel on the image by weighted average of the value of itself and other pixel points in the field, that is, to scan each pixel in the image with a convolution kernel, dot-wise multiply each pixel value in the field with the weight value of the corresponding position and then sum them.
[0110] The Gaussian convolution kernel comes from a two-dimensional Gaussian function, which is a two-dimensional normal distribution density function. The mean is 0 and the variance is δ 2 The two-dimensional Gaussian function is as follows
[0111]
[0112] The Gaussian convolution kernel is a discretized representation of a continuous two-dimensional Gaussian function. Therefore, a Gaussian template of any size can be obtained by establishing a (2k+1)×(2k+1) matrix M, and the element value at the (i, j) position can be determined as follows:
[0113]
[0114] If a 3×3 window in the image is A and the pixel to be filtered is e, then after Gaussian filtering, the brightness value of pixel e is
[0115]
[0116] Where * is the convolution symbol and sum represents the sum of all elements in the matrix. The choice of Gaussian convolution kernel size will affect the performance of the detector. The larger the size, the lower the sensitivity of the detector to noise, but the positioning error of edge detection will also increase slightly.
[0117] When σ takes different values, the shape of the two-dimensional Gaussian function will be very different. If σ is too small, the weights of all pixels that deviate from the center will be reduced, which is equivalent to the weighted sum response basically not considering the role of the pixels in the domain. In this way, the filtering operation degenerates into a point operation of the image and cannot play the role of smoothing noise. On the contrary, if σ is too large and the domain is relatively small, the Gaussian template in the domain will degenerate into an average template. Therefore, only when σ takes an appropriate value can a good estimate of the pixel value be obtained.
[0118] S5, using the Sobel operator to perform edge detection on the runway image processed in step S4;
[0119] In an optional embodiment of the present invention, the calculation process of the Sobel operator is:
[0120] 1) Take the derivative in both the x and y directions. In the horizontal direction, the image is matched with an odd-sized kernel G x For example, when the kernel size is 3, the kernel G x The calculation result is
[0121]
[0122] For example:
[0123]
[0124] Then the gradient vector of point p5 in the x direction is:
[0125] p5 x =(p7-p1)+2*(p8-p2)+(p9-p3)
[0126] In the vertical direction, the image is convolved with an odd-sized kernel. For example, when the kernel size is 3, the kernel G y The calculation result is
[0127]
[0128] For example:
[0129]
[0130] Then the gradient vector of point p5 in the y direction is:
[0131] p5 y =(p7-p1)+2*(p8-p2)+(p9-p3)
[0132] 2) At each point in the image, combine the above two results to find the approximate gradient
[0133]
[0134] The direction of the gradient at this point can be found by taking the inverse tangent of the ratio of these two values
[0135]
[0136] If Gx and Gy calculated by step 1) are large, then G calculated by step 2) is also large, which means that the gradient of point p5 is large, and point p5 is likely to be a boundary point.
[0137] S6, determining whether the runway line is detected in the previous runway image frame;
[0138] If yes, a dynamic mask is created based on the runway line detected in the previous runway image to perform image segmentation on the runway image processed in step S5;
[0139] Otherwise, no image cutting is performed;
[0140] In an optional embodiment of the present invention, the present invention creates a dynamic mask based on the runway line detected in the previous runway image to perform image segmentation on the runway image, which can reduce most interference, detect the runway line more accurately, and improve the detection speed.
[0141] In step S6, a dynamic mask is established according to the runway line detected in the previous runway image frame, specifically:
[0142] Calculate the coordinates of the intersection of the left runway line and the right runway line detected in the previous runway image, determine the upper boundary offset according to the prior information, and shift the ordinate of the intersection coordinate upward by the determined upper boundary offset to obtain the dynamic upper boundary;
[0143] Calculate the coordinates of the intersections of the start runway line detected in the previous runway image with the left runway line and the right runway line, and determine the lower boundary offset according to the prior information, and offset the ordinates of the intersections of the start runway line with the left runway line and the right runway line downward by the lower boundary offset determined, to obtain the dynamic lower boundary;
[0144] Determine the left boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the left runway line to the left by the determined left boundary offset to obtain the dynamic left boundary;
[0145] Determine the right boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the right runway line to the right by the right boundary offset determined to obtain the dynamic right boundary;
[0146] A dynamic mask is established according to the image range determined by the dynamic upper boundary, the dynamic lower boundary, the dynamic left boundary and the dynamic right boundary.
[0147] S7, using the Hough transform method to perform straight line detection on the runway image obtained in step S6;
[0148] In an optional embodiment of the present invention, the present invention uses the Hough transform method to extract features from the runway image obtained in step S6, and obtains a set that conforms to the specific shape as the result of the Hough transform by calculating the local maximum of the cumulative results in a parameter space.
[0149] Before using Hough line transform, the image must first be processed for edge detection, that is, the direct input of Hough transform is an edge binary image. In the program, the sobel operator is first extracted from the image to obtain a binary image, and then Hough line extraction is performed.
[0150] A straight line can be represented by two variables in the two-dimensional space of an image. There are two cases: in the rectangular coordinate system, it can be represented by the parameters slope and intercept (k, b); in the polar coordinate system, it can be represented by the parameters polar diameter and polar angle (r, θ).
[0151] For Hough transform, we use the second method to represent the straight line, so the expression of the straight line is
[0152]
[0153] Simplifying, we get:
[0154] r=x cosθ+y sinθ
[0155] In general, for a point (x0, y0), a family of straight lines passing through this point can be uniformly defined as:
[0156] r θ =x0cosθ+y0sinθ
[0157] This means that each pair (r,θ) represents a straight line passing through the point (x0,y0). For a given point (x0,y0), we draw all the straight lines passing through it in the polar coordinate plane, and we will get a sine curve.
[0158] We can perform the above operation on all points on the image. If the curves obtained after the above operation on two different points intersect in the plane θ-r, it means that they pass through the same straight line. The coordinates of the intersection point represent the parameter pair θ-r or the straight line in the plane composed of the point (x1, y1) and the point (x2, y2). Therefore, a straight line can be detected by finding the number of curves intersecting at a point in the plane θ-r. The more straight lines intersect at a point, the more points the straight line represented by the intersection point is composed of. Therefore, the threshold of the points on the straight line can be set to define how many straight lines intersect at a point to consider a straight line detected.
[0159] In specific calculations, the parameter space can be regarded as a discrete space, and a two-dimensional accumulation array A(θ,r) is established. The range of the first dimension is the possible range of ρ in the image coordinate space, and the range of the second dimension is the possible range of r in the image coordinate space. Initially, A(θ,r) is initialized to 0, and then for each foreground point (x i ,y i ), bring each discrete value θ in the parameter space into r θ=x0cosθ+y0sinθ, and thus the corresponding r value can be calculated. For each pair of (θ, r) calculated, the corresponding array element A(θ, r) is increased by 1. After all the calculations are completed, the maximum peak of A(θ, r) is found in the voting results of the parameter space. The corresponding θ0, r0 are the parameters of the straight line equation with the largest number of collinear points in the original image. Next, we can continue to look for the parameter values of the second peak and the third peak, which correspond to the straight lines with slightly fewer collinear points in the original image.
[0160] S8. Perform spatial filtering on the straight line detected in step S7 to obtain a runway line detection result.
[0161] In an optional embodiment of the present invention, in step S8, spatial filtering is performed on the straight line detected in step S7 to obtain a runway line detection result, specifically:
[0162] The slopes and intercepts of the straight lines with slopes greater than 0 and less than 0 detected in step S7 and the coordinates of the points on the straight lines are saved in the left runway line list and the right runway line list respectively;
[0163] Use slope constraints and line length constraints to filter the straight lines in the left runway line list and the right runway line list;
[0164] Pair the straight lines in the filtered left runway line list and right runway line list with line segments;
[0165] The median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection result.
[0166] The slope constraint and line length constraint are used to filter the straight lines in the left runway line list and the right runway line list, specifically:
[0167] Determine whether the slope of the straight line in the left runway line list and the right runway line list exceeds the set slope threshold range; if so, delete the straight line; otherwise, keep the straight line;
[0168] Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list;
[0169] Determine whether the horizontal coordinate or the vertical coordinate of the intersection coordinate exceeds the threshold range of the horizontal and vertical coordinates of the runway image; if so, delete the two straight lines corresponding to the intersection coordinate; otherwise, retain the two straight lines corresponding to the intersection coordinate;
[0170] Determine whether the ordinate of the intersection coordinate is greater than the ordinate of the line segment formed by two points on the two straight lines corresponding to the intersection coordinate; if so, keep the two straight lines corresponding to the intersection coordinate; otherwise, delete the two straight lines corresponding to the intersection coordinate;
[0171] Calculate the line segment lengths of each line according to the coordinates of the points on the lines in the left runway line list and the right runway line list;
[0172] Determine whether the line segment length is greater than the set line segment length threshold; if so, retain the straight line corresponding to the line segment length; otherwise, delete the straight line corresponding to the line segment length.
[0173] The line segments in the filtered left runway line list and the filtered right runway line list are paired as follows:
[0174] Traverse the lines in the filtered left runway line list, and calculate the difference in ordinate between the midpoint of the line segment of the selected line and the midpoint of the line segment of the line in the right runway line list;
[0175] Determine whether the vertical coordinate difference is less than the set vertical coordinate threshold; if so, keep the selected straight line and the line segment pairing of the straight lines in the right runway line list; otherwise, continue to traverse the straight lines in the filtered left runway line list;
[0176] Determine whether the horizontal coordinate of the midpoint of the line segment of the selected straight line is less than the horizontal coordinate of the midpoint of the line segment of the straight line in the paired right runway line list; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list;
[0177] Calculate the angle between the selected line and the line in the right runway line list;
[0178] Determine whether the angle is greater than the set angle threshold; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list.
[0179] The median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection results, which are as follows:
[0180] Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list;
[0181] The horizontal coordinates and vertical coordinates of the intersection coordinates are saved in the horizontal coordinate list and the vertical coordinate list respectively, and the median values of the horizontal coordinate list and the vertical coordinate list are calculated respectively;
[0182] The distances between the intersection points and the median coordinate points are calculated respectively, and the two straight lines corresponding to the intersection points with the smallest distance are selected to obtain the runway line detection results.
[0183] Specifically, since the coordinates of the points on the runway line detected by the Hough transform are the pixel coordinates on the mask, the coordinates of the points on the runway need to be restored to the original image, that is, the horizontal coordinates of the points on the straight line are added to the horizontal coordinates of the upper left corner point of the mask, and the vertical coordinates of the points on the straight line are added to the vertical coordinates of the upper left corner point of the mask.
[0184] The runway line is filtered by slope constraint and line length constraint. From the perspective of the runway, the slope of the runway line is kept within a certain range, and the detected runway line length also meets certain conditions. These two constraints can filter out some line segments that do not meet the requirements.
[0185] For the determination of the runway line, the line segments with slope less than 0 and slope greater than 0 are divided into two categories, and then the slopes and intercepts of the lines with slope less than 0 and greater than 0 and the coordinates of the points on the lines are stored in two list variables, respectively. After that, the line information in the two lists needs to be further filtered. First, the intersection of the left and right runway lines is calculated based on the line slope and intercept information in the lists of the left and right lines. Since this intersection is generally within the image and the intersection is above the line segment formed by the points on the runway, some line segments that do not meet the requirements can be filtered out according to these conditions. In addition, since the ordinates of the midpoints of the line segments on the left runway line and the midpoints of the line segments on the right runway line cannot differ too much, and the coordinates of the midpoint of the left line segment must be on the left side of the horizontal coordinates of the midpoint of the right line segment, and the angle between the candidate left and right runway sidelines must be greater than a certain threshold, the point line segments on the left and right runway lines can be paired according to these conditions, and the paired results can be stored in the list variables.
[0186] After the line segments on the left and right runways are successfully paired, further decisions need to be made to select the true left and right runway lines. First, the coordinates of the intersection of any two line segments on the left and right runway lines are calculated based on the slope and intercept of the line segments of the left and right runway lines. Then, the horizontal and vertical coordinates of the intersection are stored in two lists respectively, and the median of the contents in the two lists is calculated, which is equivalent to finding the median of the horizontal and vertical coordinates of the intersection. Then, the intersection point closest to the median intersection point can be found among the intersection points of the line segments, so that the filtered line segments can be further obtained.
[0187] In an optional embodiment of the present invention, the detection method of the present invention further includes performing time filtering on the runway line detection result. The time filtering on the runway line detection result is specifically:
[0188] Determine whether the left runway line and the right runway line are detected in the current frame runway image;
[0189] If yes, save the slope and intercept of the left runway line and the right runway line in the runway line detection result into global variables;
[0190] Otherwise, get the slope and intercept of the left and right runway lines stored in the global variables.
[0191] When the left and right runway lines are detected, the slope and intercept information of the runway lines are stored in global variables. When the left and right runway lines are not detected next time, the runway line information detected last time is used. At the same time, an accumulator can be set to count the number of consecutive frames that have not been detected. That is, when the left and right runway lines are not detected for many consecutive frames, the time filtering information is not used.
[0192] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0193] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0194] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0195] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0196] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A vision-based fixed-wing UAV autonomous landing runway detection method, characterized in that: The following steps are involved: S1, grayscale processing is performed on the collected runway image; S2, establish a static mask to perform image segmentation on the runway image processed in step S1, specifically: First, create an image mask with the same size as the runway image to be processed and all pixel values are 0; Then select multiple pixel points to draw a polygon on the created image mask, and fill the pixel value in the polygon area with 255 to create a static mask; Finally, the established static mask and the pixels corresponding to the runway image to be processed are subjected to a bitwise AND operation to obtain the runway image after image segmentation; S3, performing image enhancement processing on the runway image obtained in step S2 using an adaptive histogram equalization method; S4, using a Gaussian filtering method to smooth and blur the runway image processed in step S3; S5, using the Sobel operator to perform edge detection on the runway image processed in step S4; S6, determining whether the runway line is detected in the previous runway image frame; If yes, a dynamic mask is established based on the runway line detected in the previous runway image to perform image segmentation on the runway image processed in step S5; wherein the dynamic mask is established based on the runway line detected in the previous runway image, specifically: Calculate the coordinates of the intersection of the left runway line and the right runway line detected in the previous runway image, determine the upper boundary offset according to the prior information, and shift the ordinate of the intersection coordinate upward by the determined upper boundary offset to obtain the dynamic upper boundary; Calculate the coordinates of the intersections of the start runway line detected in the previous runway image with the left runway line and the right runway line, and determine the lower boundary offset according to the prior information, and offset the ordinates of the intersections of the start runway line with the left runway line and the right runway line downward by the lower boundary offset determined, to obtain the dynamic lower boundary; Determine the left boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the left runway line to the left by the determined left boundary offset to obtain the dynamic left boundary; Determine the right boundary offset according to the prior information, and shift the horizontal coordinate of the intersection point of the starting runway line and the right runway line to the right by the right boundary offset determined to obtain the dynamic right boundary; A dynamic mask is established according to an image range determined by a dynamic upper boundary, a dynamic lower boundary, a dynamic left boundary, and a dynamic right boundary; Otherwise, no image cutting is performed; S7, using the Hough transform method to perform straight line detection on the runway image obtained in step S6; S8. Perform spatial filtering on the straight line detected in step S7 to obtain a runway line detection result.
2. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 1 is characterized in that: In step S3, an adaptive histogram equalization method is used to perform image enhancement processing on the runway image obtained in step S2, specifically: First, the runway image obtained in step S2 is divided into pixel blocks of a set size, and a histogram equalization process is performed on each pixel block; Then the transformation functions between adjacent pixel blocks are smoothly interpolated to obtain the runway image after image enhancement; The transformation function is expressed as: in, s is the gray value of the corresponding position obtained by transforming the runway image, r is the original grayscale value of the runway image, L is the number of gray levels of the runway image, p r ( x ) is the original gray value r The probability density function of .
3. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 1 is characterized in that: In step S8, spatial filtering is performed on the straight line detected in step S7 to obtain the runway line detection result, which is specifically: The slopes and intercepts of the straight lines with slopes greater than 0 and less than 0 detected in step S7 and the coordinates of the points on the straight lines are saved in the left runway line list and the right runway line list respectively; Use slope constraints and line length constraints to filter the straight lines in the left runway line list and the right runway line list; Pair the straight lines in the filtered left runway line list and right runway line list with line segments; The median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection result.
4. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 3 is characterized in that: The slope constraint and the line length constraint are used to filter the straight lines in the left runway line list and the right runway line list, specifically: Determine whether the slope of the straight line in the left runway line list and the right runway line list exceeds the set slope threshold range; if so, delete the straight line; otherwise, keep the straight line; Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list; Determine whether the horizontal coordinate or the vertical coordinate of the intersection coordinate exceeds the threshold range of the horizontal and vertical coordinates of the runway image; if so, delete the two straight lines corresponding to the intersection coordinate; otherwise, retain the two straight lines corresponding to the intersection coordinate; Determine whether the ordinate of the intersection coordinate is greater than the ordinate of the line segment formed by two points on the two straight lines corresponding to the intersection coordinate; if so, keep the two straight lines corresponding to the intersection coordinate; otherwise, delete the two straight lines corresponding to the intersection coordinate; Calculate the line segment lengths of each line according to the coordinates of the points on the lines in the left runway line list and the right runway line list; Determine whether the line segment length is greater than the set line segment length threshold; if so, retain the straight line corresponding to the line segment length; otherwise, delete the straight line corresponding to the line segment length.
5. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 3 is characterized in that: The line segment pairing of the straight lines in the filtered left runway line list and the filtered right runway line list is specifically as follows: Traverse the lines in the filtered left runway line list, and calculate the difference in ordinate between the midpoint of the line segment of the selected line and the midpoint of the line segment of the line in the right runway line list; Determine whether the vertical coordinate difference is less than the set vertical coordinate threshold; if so, keep the selected straight line and the line segment pairing of the straight lines in the right runway line list; otherwise, continue to traverse the straight lines in the filtered left runway line list; Determine whether the horizontal coordinate of the midpoint of the line segment of the selected straight line is less than the horizontal coordinate of the midpoint of the line segment of the straight line in the paired right runway line list; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list; Calculate the angle between the selected line and the line in the right runway line list; Determine whether the angle is greater than the set angle threshold; if so, keep the line segment pairing of the selected straight line and the straight line in the right runway line list; otherwise, delete the line segment pairing of the selected straight line and the straight line in the right runway line list.
6. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 3 is characterized in that: The median constraint is used to filter the straight lines in the paired left runway line list and the right runway line list to obtain the runway line detection result, which is specifically: Calculate the coordinates of the intersection of the two straight lines according to the slopes and intercepts of the straight lines in the left runway line list and the right runway line list; The horizontal coordinates and vertical coordinates of the intersection coordinates are saved in the horizontal coordinate list and the vertical coordinate list respectively, and the median values of the horizontal coordinate list and the vertical coordinate list are calculated respectively; The distances between the intersection points and the median coordinate points are calculated respectively, and the two straight lines corresponding to the intersection points with the smallest distance are selected to obtain the runway line detection results.
7. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 1, characterized in that: It also includes time filtering of runway line detection results.
8. The method for autonomous landing runway detection of fixed-wing UAV based on vision according to claim 7 is characterized in that: The time filtering of the runway line detection result is specifically as follows: Determine whether the left runway line and the right runway line are detected in the current frame runway image; If yes, save the slope and intercept of the left runway line and the right runway line in the runway line detection result into global variables; Otherwise, get the slope and intercept of the left and right runway lines stored in the global variables.
