Route guidance method for UAV remote sensing mapping based on image processing
By optimizing the LSD algorithm and using clustering and chain code encoding to adjust the angle threshold, the problem of inaccurate straight line detection of the traditional LSD algorithm in complex environments is solved, and the accuracy and robustness of UAV mapping routes are improved.
Patent Information
- Application Number
- CN202510941098.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-07-09
AI Technical Summary
The traditional LSD algorithm has reduced robustness in line detection due to the fixed angle threshold, and cannot accurately detect straight lines in complex environments, affecting the accuracy of UAV mapping routes.
By obtaining new edge points in drone aerial images, using clustering algorithms to filter out outliers, combining chain code encoding and angle coefficient to adjust the angle threshold, optimizing the LSD algorithm for line detection, obtaining the reference line and slope, and adjusting the drone's route.
The accuracy of straight line detection in UAV mapping routes is improved, the deviation of the travel direction is reduced, and the robustness of the LSD algorithm is enhanced.
Smart Images

Figure CN120472332B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to an image processing-based UAV remote sensing mapping route guidance method. Background Art
[0002] During drone surveying and mapping operations, in order to monitor the route and adjust the direction of travel in real time, computer vision technology is used for image processing and analysis to assist drones in autonomous navigation, thereby improving the efficiency of drone surveying and mapping work.
[0003] Currently, when adjusting the route, it is necessary to make adjustments based on the route traveled by the drone mapping, which involves the straight line detection algorithm. The traditional LSD algorithm is usually used for straight line detection. However, during the straight line detection process, the corresponding angle threshold of the traditional LSD algorithm is usually a preset fixed parameter. When the gradient direction changes of the pixel points in the image are complex and highly random, the fixed angle threshold leads to a decrease in the robustness of the LSD algorithm, that is, the response sensitivity to the pixel points forming the straight line is reduced, making the detected straight line less accurate. Summary of the Invention
[0004] The present invention provides an image processing-based UAV remote sensing mapping route guidance method to solve the existing problems.
[0005] The UAV remote sensing mapping route guidance method based on image processing of the present invention adopts the following technical solutions:
[0006] One embodiment of the present invention provides a method for guiding a route using remote sensing mapping of an unmanned aerial vehicle (UAV) based on image processing, the method comprising the following steps:
[0007] Use the camera carried by the UAV to continuously obtain UAV aerial images and corresponding ground feature and road images at different times;
[0008] Obtain edge pixel points in the terrain image, construct a matrix region, and filter out edge pixel points in the terrain image based on the grayscale value difference between the pixels in the matrix region to obtain several new edge points.
[0009] Obtain the gradient directions of all new edge points, cluster the new edge points based on the gradient directions and the coordinates of the new edge points, obtain several clusters and outliers, obtain chain code codes corresponding to several shortest paths passing through any outlier points, wherein the chain code codes include the direction symbols of the new edges in multiple clusters and the direction symbols of several outliers; obtain the alignment coefficient of the outliers based on the distance between the outliers and the new edge points in the clusters and the difference in the direction symbols; fuse the distance between the clusters with the alignment coefficient of the outliers to obtain the angular coefficient of the outliers; use the angular coefficient to adjust the preset angular threshold to obtain a new angular threshold for the outliers, and perform straight line detection on the terrain and road image based on the new angular threshold to obtain a reference straight line and a corresponding reference slope;
[0010] The deflection angle of the UAV mapping route is obtained according to the difference in the reference slope of the reference straight line at different times.
[0011] Furthermore, the method of continuously acquiring drone aerial images and corresponding ground feature and road images at different times using a camera carried by the drone for surveying and mapping includes the following specific methods:
[0012] First, the camera onboard the UAV is used to continuously collect RGB images of the area flown over at different times during the remote sensing mapping operation, which are recorded as UAV aerial images.
[0013] Then, the UAV aerial image in RGB format is converted into the UAV aerial image in HSV format, and the images corresponding to the hue channel and saturation channel in the UAV aerial image in HSV format are obtained, which are recorded as the hue channel image and the saturation channel image respectively; the segmentation threshold of the hue channel image is obtained by using the Otsu method, and the grayscale value of the pixel points with hue less than the segmentation threshold in the hue channel image is set to 1, and the grayscale value of the pixel points with hue greater than the segmentation threshold is set to 0, and the obtained binary image is recorded as the hue binary image; the hue binary image is multiplied with the saturation channel image, and the obtained image is recorded as the ground feature road image.
[0014] Furthermore, the method of obtaining edge pixels in the terrain feature road image, constructing a matrix region, and filtering out edge pixels in the terrain feature road image based on grayscale value differences between pixels in the matrix region to obtain a plurality of new edge points includes the following specific methods:
[0015] First, the Canny edge detection algorithm is used to obtain edge pixel points in the ground object road image;
[0016] Then, build The matrix of size is recorded as the matrix area, and any edge pixel point is taken as the center of the matrix area, where is a preset hyperparameter; obtain the number of pixels in the matrix area; obtain the necessity of screening any edge pixels. The specific calculation method is:
[0017]
[0018] in, Indicates the necessity of filtering edge pixels; Indicates the grayscale value of edge pixels; Indicates the first pixel outside the edge pixel in the matrix area. Gray value of each pixel; Indicates the number of pixels in the matrix area; represents an exponential function with a natural constant as its base;
[0019] Finally, the edge pixel points whose screening necessity is greater than a preset necessity threshold are screened out, and the remaining edge pixel points after screening out are recorded as new edge points.
[0020] Furthermore, the method of obtaining the gradient directions of all new edge points, clustering the new edge points based on the gradient directions and the coordinates of the new edge points, and obtaining a number of clusters and outliers includes the following specific methods:
[0021] First, the Sobel operator is used to obtain the gradient direction of any new edge point in the road image;
[0022] Then, the vector formed by the coordinates of any new edge point in the terrain road image and the gradient direction is recorded as the distance parameter of the edge pixel point. According to the Euclidean distance between the corresponding distance parameters of the new edge points, the edge pixels in the saturation channel component image are clustered in combination with the DBSCAN clustering algorithm to obtain several clusters and several outlier new edge points. The outlier new edge points are recorded as outliers.
[0023] Furthermore, the specific method for obtaining the chain code corresponding to the shortest paths passing through any outlier is as follows:
[0024] The average value of the search direction of all new edge points in any cluster is obtained and recorded as the directional feature of the corresponding cluster. According to the difference in directional features, similar clusters of any cluster are obtained. Any cluster is recorded as the first cluster, and the similar clusters of the first cluster are recorded as the second cluster. The edge pixels in the first cluster and the second cluster are recorded as the first pixel and the second pixel respectively. The 8-neighborhood chain code is used to obtain the shortest path starting from the first pixel and passing through any outlier point to the second pixel point, as well as the corresponding chain code code, and the chain code codes of several shortest paths corresponding to any outlier point are obtained.
[0025] Furthermore, the specific method for obtaining the similar clusters is:
[0026] The linear normalization method is used to normalize the directional features of all clusters, and the normalized directional features are recorded as normalized directional features. When the absolute value of the difference between the normalized directional features is less than the directional feature threshold, Among the two clusters, one cluster is called a similar cluster of the other cluster, where are the preset hyperparameters.
[0027] Furthermore, the alignment coefficient of the outlier point is obtained according to the distance between the outlier point and the new edge point in the cluster and the difference in the direction symbol, including the specific method of:
[0028] First, obtain a direction symbol corresponding to each pixel point in the chain code. The direction symbol is a number from 0 to 7. The new edge point of the first cluster to the new edge point of the second cluster will pass through the same outlier point multiple times.
[0029] Then, get the Euclidean distance between the cluster center of the first cluster and the cluster center of the second cluster , obtain the Euclidean distance between the outlier and the new edge point in the cluster, obtain the absolute value of the difference between the direction symbol of the outlier and other new edge points in the chain code as the direction difference parameter, and obtain the alignment coefficient of the outlier in the first cluster and the second cluster. The specific calculation method is:
[0030]
[0031] in, Indicates the alignment coefficient of the outlier points in the first cluster and the second cluster; Indicates the The standard deviation of all direction symbols in the chain code; Indicates in The outliers in the chain code are The Euclidean distance between the new edge points; Indicates in The outliers in the chain code are Directional difference parameter between edge pixels; Indicates in The number of new edge points in the chain code; Indicates obtaining the minimum value; Represents an exponential function with a natural constant as its base.
[0032] Furthermore, the distance between clusters and the alignment coefficient of the outlier are fused to obtain the angular coefficient of the outlier, including the specific method of:
[0033] First, obtain the maximum value of the alignment coefficient of any outlier in all first clusters and the corresponding second clusters, which is recorded as the first value; obtain the Euclidean distance between the cluster centers of the first cluster and the second cluster when the alignment coefficient of the outlier in the first cluster and the second cluster is the maximum, which is recorded as the second value;
[0034] Then, the ratio of the first value to the second value is recorded as the angular coefficient of the outlier.
[0035] Furthermore, the method of adjusting the preset angle threshold using the angle coefficient to obtain a new angle threshold for the outlier, and performing straight line detection on the ground feature road image in combination with the new angle threshold to obtain a reference straight line and a corresponding reference slope includes the following specific methods:
[0036] First, the specific calculation method of the new angle threshold of the outlier point is:
[0037]
[0038] in, Indicates the new angle threshold of the target pixel; Indicates the angular coefficient of the target pixel; Indicates the preset angle threshold; Represents the Sigmoid normalization function;
[0039] Then, the new angle threshold of the discrete points is combined with the LSD algorithm to detect the new edge points in the ground object road image to obtain several straight lines;
[0040] Finally, the longest straight line in the feature road image is recorded as the reference straight line, and the slope of the reference straight line is recorded as the reference slope.
[0041] Furthermore, the deflection angle of the UAV mapping route is obtained according to the difference in the reference slope of the reference straight line at different times, including the specific method of:
[0042] First, get the The base slope at the moment The absolute value of the difference between the reference slopes at the moment is recorded as the third value. The angle corresponding to the third value is obtained by using the inverse tangent function and recorded as the deflection angle of the UAV mapping;
[0043] Then, the deflection angle of the UAV is used to adjust the forward direction of the UAV so that the absolute value of the difference between the current and previous reference slopes is always less than ,in Preset hyperparameters.
[0044] The beneficial effects of the technical solution of the present invention are: by obtaining clusters and outliers formed by new edge points, and according to the paths formed by the outliers and the new edge points in each cluster, the alignment coefficient obtained reflects the possibility that the outliers can be used as alignment points in the straight line detection process, avoiding the influence caused by too many outliers in the detection process of the straight line corresponding to the route, resulting in deviation in the estimated direction in the straight line detection process, improving the tolerance for outliers in the straight line detection process, and making the outliers whose gradient direction and estimated direction differ within the new angle threshold participate in the straight line detection as alignment points, thereby improving the accuracy of the straight line detection results of the UAV mapping route, and further reducing the offset angle of the UAV mapping direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 This is a flowchart of the steps of the UAV remote sensing mapping route guidance method based on image processing of the present invention. DETAILED DESCRIPTION
[0047] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effectiveness of the image processing-based UAV remote sensing mapping route guidance method proposed by the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0049] The specific scheme of the UAV remote sensing mapping route guidance method based on image processing provided by the present invention is described in detail below with reference to the accompanying drawings.
[0050] See also Figure 1 , which shows a flowchart of a method for guiding a route by remote sensing mapping of a drone based on image processing according to an embodiment of the present invention. The method comprises the following steps:
[0051] Step S001: Use the camera carried by the UAV surveying and mapping to obtain the UAV aerial image, and segment the UAV aerial image to obtain the corresponding ground feature and road image.
[0052] Specifically, in order to implement the UAV remote sensing mapping route guidance method based on image processing proposed in this embodiment, it is first necessary to collect UAV aerial images and ground object and road images. The specific process is as follows:
[0053] Firstly, the camera carried by the UAV is used to continuously collect RGB images of the area flown at different times during the remote sensing mapping operation, which are recorded as UAV aerial images; and the Gaussian filtering algorithm is used to filter and reduce noise on the collected UAV aerial images.
[0054] It should be noted that the Gaussian filtering algorithm is an existing algorithm, so this embodiment does not specifically limit it; in addition, the drone aerial image captured by the camera is an RGB image.
[0055] Then, the UAV aerial image in RGB format is converted into the UAV aerial image in HSV format, and the images corresponding to the hue channel and saturation channel in the UAV aerial image in HSV format are obtained, which are recorded as the hue channel image and the saturation channel image respectively; the segmentation threshold of the hue channel image is obtained by using the Otsu method, and the grayscale value of the pixel points with hue less than the segmentation threshold in the hue channel image is set to 1, and the grayscale value of the pixel points with hue greater than the segmentation threshold is set to 0, and the obtained binary image is recorded as the hue binary image; the hue binary image is multiplied with the saturation channel image, and the obtained image is recorded as the ground feature road image.
[0056] So far, the ground feature road image is obtained through the above method.
[0057] Step S002: filtering out edge pixels in the road image based on the grayscale value difference between pixels in a local area to obtain new edge points.
[0058] First, the Canny edge detection algorithm is used to obtain edge pixel points in the ground object road image.
[0059] It should be noted that the Chinese name of the Canny edge detection algorithm is the Canny edge detection algorithm. Since the Canny edge detection algorithm is an existing edge detection algorithm, it will not be described in detail in this embodiment.
[0060] Then, build The matrix of size is recorded as the matrix area, and any edge pixel point is taken as the center of the matrix area, where is a preset hyperparameter; obtain the number of pixels in the matrix area; obtain the necessity of screening any edge pixels based on the grayscale value difference of the pixels in the matrix area. The specific calculation method is:
[0061]
[0062] in, Indicates the necessity of filtering edge pixels; Indicates the grayscale value of edge pixels; Indicates the first pixel outside the edge pixel in the matrix area. Gray value of each pixel; Indicates the number of pixels in the matrix area; Represents an exponential function with a natural constant as its base.
[0063] It should be noted that the hyperparameters are preset based on experience is 5, which can be adjusted according to actual conditions and is not specifically limited in this embodiment; It should be an odd number greater than or equal to 3 by default.
[0064] It should be noted that the necessity of edge point screening reflects the difference between the grayscale value of the edge pixel point in the image and the average grayscale value of the neighborhood pixel points within the matrix area. The smaller the difference, the closer the grayscale value of the edge pixel point in the matrix area is to that of all the pixels in the neighborhood, the smaller the possibility that the pixel point belongs to the area passed by the drone, and the greater the necessity of screening the edge pixel point.
[0065] It should be noted that, according to the necessity of screening, the edge pixels of the saturation channel component image in the area where the drone has not flown are screened out to obtain the edge pixels of the area where the drone has flown, so as to facilitate the further use of the LSD algorithm to perform straight line detection on the edge pixels, avoiding the interference of too many edge pixels on the LSD algorithm, and at the same time reducing the computational complexity of the LSD algorithm in the straight line detection process by screening out some edge pixels.
[0066] Finally, the edge pixel points whose screening necessity is greater than a preset necessity threshold are screened out, and the remaining edge pixel points after screening out are recorded as new edge points.
[0067] It should be noted that the necessity threshold is preset to 0.8 based on experience and can be adjusted according to actual conditions. This embodiment does not impose any specific limitation.
[0068] At this point, new edge points are obtained through the above method.
[0069] Step S003: Cluster the new edge points, obtain the alignment coefficient of the outlier points based on the path formed by the new edge points in the cluster, adjust the angle threshold based on the alignment coefficient, use the adjusted angle threshold to perform straight line detection, and obtain the baseline slope of the baseline line.
[0070] It should be noted that when drone mapping is conducting remote sensing mapping operations, it is necessary to obtain the drone mapping route to adjust the drone mapping direction. When obtaining the drone mapping route, due to the complex changes in the gradient direction of the corresponding pixel points in the drone aerial image of the traffic road area of the drone mapping, the existing traditional LSD algorithm is prone to being affected by noise points during the region growing process when performing straight line detection, resulting in the region growing process being terminated prematurely, which may cause the pixel points that originally belonged to a straight line to be not detected due to the interruption of region growing, and ultimately lead to deviations in the straight line detected by the LSD algorithm, which further causes the drone mapping route to be offset. Therefore, it is necessary to optimize the LSD algorithm for the process of straight line detection of the drone mapping route to obtain a more accurate route.
[0071] Specifically, in step (1), first, use the Sobel operator to obtain the gradient direction of any new edge point in the ground feature road image .
[0072] Then, the vector formed by the coordinates of any new edge point in the terrain road image and the gradient direction is recorded as the distance parameter of the edge pixel point. According to the Euclidean distance between the corresponding distance parameters of the new edge points, the edge pixels in the saturation channel component image are clustered in combination with the DBSCAN clustering algorithm to obtain several clusters and several outlier new edge points. The outlier new edge points are recorded as outliers.
[0073] It should be noted that the Chinese name of the DBSCAN clustering algorithm is density-based clustering algorithm. The DBSCAN clustering algorithm is an existing clustering algorithm, so this embodiment will not be described in detail.
[0074] Step (2): First, obtain the average value of the search direction of all new edge points in any cluster, record it as the directional feature of the corresponding cluster, use the linear normalization method to normalize the directional features of all clusters, record the normalized directional features as the normalized directional features, and when the absolute value of the difference between the normalized directional features is less than the directional feature threshold Among the two clusters, one cluster is called a similar cluster of the other cluster, where is a preset hyperparameter; any cluster is recorded as the first cluster, the similar cluster of the first cluster is recorded as the second cluster, the edge pixels in the first cluster and the second cluster are recorded as the first pixel and the second pixel respectively, and the 8-neighborhood chain code is used to obtain the shortest path starting from the first pixel and passing through any outlier to the second pixel and the corresponding chain code code, and the chain code code of several shortest paths corresponding to any outlier is obtained, and a direction symbol corresponding to each pixel in the chain code is obtained. The direction symbol is a number from 0 to 7, and the new edge point of the first cluster to the new edge point of the second cluster will pass through the same outlier multiple times.
[0075] It should be noted that the hyperparameters are preset based on experience It is 0.2, which can be adjusted according to actual conditions and is not specifically limited in this embodiment.
[0076] It should be noted that the outliers are noise points in the drone aerial images that affect the LSD algorithm. Since the difference between the gradient direction of the outliers and the estimated direction obtained by the LSD algorithm is too large, the LSD algorithm will encounter the problem of premature cutoff of region growing. Therefore, this embodiment will analyze the possibility that the outliers and other new edge points can form a straight line as the alignment coefficient of the outliers, and use the alignment coefficient to use the outliers as alignment points in the LSD algorithm to perform straight line detection on the forward route of the drone mapping.
[0077] Then, get the Euclidean distance between the cluster center of the first cluster and the cluster center of the second cluster , get the Euclidean distance between the outlier and the new edge point in the cluster, get the absolute value of the difference between the direction symbol of the outlier and other new edge points in the chain code as the direction difference parameter, and get the alignment coefficient of the outlier in the first cluster and the second cluster:
[0078]
[0079] in, Indicates the alignment coefficient of the outlier points in the first cluster and the second cluster; Indicates the The standard deviation of all direction symbols in the chain code; Indicates in The outliers in the chain code are The Euclidean distance between the new edge points; Indicates in The outliers in the chain code are Directional difference parameter between edge pixels; Indicates in The number of new edge points in the chain code; Indicates obtaining the minimum value; Represents an exponential function with a natural constant as its base.
[0080] It should be noted that when the LSD algorithm detects a straight line on a route, it uses pixels with similar gradient directions as alignment points, i.e., new edge points in the cluster. The estimated direction of the straight line is obtained based on the number of alignment points to further detect the straight line. Since the gradient direction of the outliers is quite different from that of the alignment points, this embodiment uses chain code encoding to obtain the degree to which the outliers can participate in forming a straight line, i.e., the alignment coefficient of the outliers. The larger the alignment coefficient of the outliers, the greater the degree to which the outliers can participate in forming a straight line, i.e., the greater the possibility that the outliers can serve as alignment points when forming a straight line. In the chain code encoding, the Euclidean distance between the outlier point and the new edge point in the cluster is used as the weight of the corresponding direction difference parameter. The closer the distance between the outlier point and the new edge point, the smaller the corresponding direction difference parameter. This means that although the gradient direction of the outlier point is different from that in the cluster, the path direction difference between the outlier point and the new edge point in the shortest path is small, reflecting that the greater the probability that the outlier point and the corresponding shortest path can form a straight line, the smaller the direction difference factor and the larger the alignment coefficient of the outlier point; for the standard deviation of all direction symbols in the chain code encoding where the outlier point is located , which reflects the directional change characteristics of the shortest path corresponding to the chain code encoding. The smaller the standard deviation of all directional symbols, the less the directional change of the corresponding shortest path. That is, the closer the shortest path corresponding to the outlier point is to a straight line, the larger the alignment coefficient of the outlier point.
[0081] Finally, the angular coefficient of the outlier is obtained according to the alignment coefficient and the Euclidean distance between the cluster centers of the clusters. The specific calculation method is:
[0082]
[0083] in, The angular coefficient representing the outlier point; Indicates that the outlier point is The alignment coefficients of the first and second clusters; Indicates obtaining the maximum value; It indicates the Euclidean distance between the cluster centers of the first cluster and the second cluster when the alignment coefficient of the outliers under the first cluster and the second cluster is the largest.
[0084] It should be noted that the size of the angle coefficient reflects the possibility that the outlier can be used as an alignment point in the LSD algorithm. The larger the angle coefficient, the more likely the outlier is to be used as an alignment point to participate in the region growing process of the LSD algorithm, so that the region growing process will not terminate prematurely when encountering an outlier, reducing the impact of the outlier on the region growing process; Among them, the larger the alignment coefficient and the angle coefficient, the more likely the outlier is to be used as an alignment point; at the same time, the smaller the distance between the clusters, the fewer the number of outliers in the corresponding shortest path between the first cluster and the second cluster, the smaller the impact of multiple outliers, and the more reliable the angle coefficient corresponding to the outlier.
[0085] Step (3): First, the angle coefficient is used to adjust the angle threshold parameter corresponding to the outlier encountered by the LSD algorithm during the region growing process. The adjusted angle threshold parameter is recorded as the new angle threshold of the outlier. The specific calculation method of the new angle threshold of the outlier is:
[0086]
[0087] in, Indicates the new angle threshold of the target pixel; Indicates the angular coefficient of the target pixel; Indicates the preset angle threshold; Represents the Sigmoid normalization function.
[0088] It should be noted that the angle threshold of the LSD algorithm is usually preset to 22.5°, so this embodiment also presets the angle threshold The angle is 22.5°, which can be adjusted according to actual conditions and is not specifically limited in this embodiment.
[0089] It should be noted that since the angle threshold parameters of the traditional LSD algorithm are usually preset fixed parameters, when the gradient direction changes of pixel points in the image are complex and highly random, the fixed angle threshold leads to low robustness of the LSD algorithm, making the detected straight lines inaccurate. Therefore, the angle coefficient is used to adaptively change the angle threshold corresponding to each outlier point in the image during the line detection process of the LSD algorithm, so that the outliers whose difference between the gradient direction and the estimated direction of the LSD algorithm is within the new angle threshold are used as alignment points of the LSD algorithm, avoiding premature termination of the region growing process of the LSD algorithm, improving the robustness and accuracy of the LSD algorithm in the line detection process, and more accurately obtaining the straight line corresponding to the UAV mapping route.
[0090] Then, the new angle threshold of the discrete points is combined and the LSD algorithm is used to perform straight line detection on the new edge points in the ground object road image to obtain several straight lines.
[0091] Finally, the longest straight line in the feature road image is recorded as the reference straight line, and the slope of the reference straight line is recorded as the reference slope.
[0092] It should be noted that the reference straight line and reference slope correspond to the drone aerial images continuously collected during the navigation process of the drone surveying and mapping at any moment, and each moment corresponds to a reference straight line and reference slope.
[0093] It should be noted that the reference straight line is the edge straight line of the area where the drone has navigated in the drone aerial image, and the reference slope reflects the distribution direction of the navigation area in the image.
[0094] So far, the reference straight line and reference slope are obtained through the above method.
[0095] Step S004: obtaining the deflection angle of the UAV mapping route according to the difference in the reference slope of the reference straight line at different times.
[0096] Specifically, first, obtain the The base slope at the moment The absolute value of the difference in the baseline slope at the moment is recorded as the third value. The angle corresponding to the third value is obtained by using the inverse tangent function and recorded as the deflection angle of the UAV mapping.
[0097] Then, the deflection angle of the UAV is used to adjust the forward direction of the UAV so that the difference between the baseline slope at the current moment and the previous moment during the forward process of the UAV is , is always less than ,in To preset the hyperparameter, it is preset to 20° based on experience and can be adjusted according to actual conditions.
[0098] At this point, this embodiment is completed.
[0099] It should be noted that the The model is only used to represent negative correlation and constrain the output of the model to be in In the specific implementation, it can be replaced by other models with the same purpose. This embodiment is only based on The model is described as an example without any specific limitation. is the input to the model.
[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for guiding the route of UAV remote sensing mapping based on image processing, characterized in that: The method comprises the following steps: Use the camera carried by the UAV to continuously obtain UAV aerial images and corresponding ground feature and road images at different times; Obtain edge pixel points in the terrain image, construct a matrix region, and filter out edge pixel points in the terrain image based on the grayscale value difference between the pixels in the matrix region to obtain several new edge points. Obtain the gradient directions of all new edge points, cluster the new edge points based on the gradient directions and the coordinates of the new edge points, obtain several clusters and outliers, obtain chain code codes corresponding to several shortest paths passing through any outlier points, wherein the chain code codes include the direction symbols of the new edges in multiple clusters and the direction symbols of several outliers; obtain the alignment coefficient of the outliers based on the distance between the outliers and the new edge points in the clusters and the difference in the direction symbols; fuse the distance between the clusters with the alignment coefficient of the outliers to obtain the angular coefficient of the outliers; use the angular coefficient to adjust the preset angular threshold to obtain a new angular threshold for the outliers, and perform straight line detection on the terrain and road image based on the new angular threshold to obtain a reference straight line and a corresponding reference slope; Among them, the method for obtaining the alignment coefficient of the outliers is: Get a direction symbol corresponding to each pixel point in the chain code. The direction symbol is a number from 0 to 7. The new edge point of the first cluster to the new edge point of the second cluster will pass through the same outlier point multiple times. Then, get the Euclidean distance between the cluster center of the first cluster and the cluster center of the second cluster , obtain the Euclidean distance between the outlier and the new edge point in the cluster, obtain the absolute value of the difference between the direction symbol of the outlier and other new edge points in the chain code as the direction difference parameter, and obtain the alignment coefficient of the outlier in the first cluster and the second cluster. The specific calculation method is: in, Indicates the alignment coefficient of the outlier points in the first cluster and the second cluster; Indicates the The standard deviation of all direction symbols in the chain code; Indicates in The outliers in the chain code are The Euclidean distance between the new edge points; Indicates in The outliers in the chain code are Directional difference parameter between edge pixels; Indicates in The number of new edge points in the chain code; Indicates obtaining the minimum value; represents an exponential function with a natural constant as its base; The deflection angle of the UAV mapping route is obtained according to the difference in the reference slope of the reference straight line at different times.
2. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The method of continuously acquiring drone aerial images and corresponding ground feature and road images at different times using the camera carried by the drone for surveying and mapping includes the following specific methods: First, the camera onboard the UAV is used to continuously collect RGB images of the area flown over at different times during the remote sensing mapping operation, which are recorded as UAV aerial images. Then, the RGB format UAV aerial image is converted into the HSV format UAV aerial image, and the images corresponding to the hue channel and saturation channel in the HSV format UAV aerial image are obtained, which are recorded as the hue channel image and the saturation channel image respectively; The segmentation threshold of the hue channel image is obtained using the Otsu method. The grayscale value of the pixels whose hue is less than the segmentation threshold in the hue channel image is set to 1, and the grayscale value of the pixels whose hue is greater than the segmentation threshold is set to 0. The obtained binary image is recorded as the hue binary image; the hue binary image is multiplied with the saturation channel image, and the obtained image is recorded as the ground feature road image.
3. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The method of obtaining edge pixel points in the terrain object road image, constructing a matrix region, and filtering out edge pixel points in the terrain object road image according to the grayscale value difference between the pixel points in the matrix region to obtain a plurality of new edge points includes the following specific methods: First, the Canny edge detection algorithm is used to obtain edge pixel points in the ground object road image; Then, build The matrix of size is recorded as the matrix area, and any edge pixel point is taken as the center of the matrix area, where is a preset hyperparameter; obtain the number of pixels in the matrix area; obtain the necessity of screening any edge pixels. The specific calculation method is: in, Indicates the necessity of filtering edge pixels; Indicates the grayscale value of edge pixels; Indicates the first pixel outside the edge pixel in the matrix area. Gray value of each pixel; Indicates the number of pixels in the matrix area; represents an exponential function with a natural constant as its base; Finally, the edge pixel points whose screening necessity is greater than a preset necessity threshold are screened out, and the remaining edge pixel points after screening out are recorded as new edge points.
4. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The method of obtaining the gradient directions of all new edge points, clustering the new edge points based on the gradient directions and the coordinates of the new edge points, and obtaining a number of clusters and outliers includes the following specific methods: First, the Sobel operator is used to obtain the gradient direction of any new edge point in the ground object road image; Then, the vector formed by the coordinates of any new edge point in the terrain road image and the gradient direction is recorded as the distance parameter of the edge pixel point. According to the Euclidean distance between the corresponding distance parameters of the new edge points, the edge pixels in the saturation channel component image are clustered in combination with the DBSCAN clustering algorithm to obtain several clusters and several outlier new edge points. The outlier new edge points are recorded as outliers.
5. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The specific method for obtaining the chain code corresponding to the shortest paths passing through any outlier is as follows: The average value of the search direction of all new edge points in any cluster is obtained and recorded as the directional feature of the corresponding cluster. According to the difference in directional features, similar clusters of any cluster are obtained. Any cluster is recorded as the first cluster, and the similar clusters of the first cluster are recorded as the second cluster. The edge pixels in the first cluster and the second cluster are recorded as the first pixel and the second pixel respectively. The 8-neighborhood chain code is used to obtain the shortest path starting from the first pixel and passing through any outlier point to the second pixel point, as well as the corresponding chain code code, and the chain code codes of several shortest paths corresponding to any outlier point are obtained.
6. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 5, characterized in that: The specific method for obtaining the similar clusters is: The linear normalization method is used to normalize the directional features of all clusters, and the normalized directional features are recorded as normalized directional features. When the absolute value of the difference between the normalized directional features is less than the directional feature threshold, Among the two clusters, one cluster is called a similar cluster of the other cluster, where are the preset hyperparameters.
7. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The method of fusing the distance between clusters and the alignment coefficient of the outlier to obtain the angular coefficient of the outlier includes: First, obtain the maximum value of the alignment coefficient of any outlier in all first clusters and the corresponding second clusters, which is recorded as the first value; obtain the Euclidean distance between the cluster centers of the first cluster and the second cluster when the alignment coefficient of the outlier in the first cluster and the second cluster is the maximum, which is recorded as the second value; Then, the ratio of the first value to the second value is recorded as the angular coefficient of the outlier.
8. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The method of adjusting the preset angle threshold using the angle coefficient to obtain a new angle threshold for the outlier point, and performing straight line detection on the ground feature road image in combination with the new angle threshold to obtain a reference straight line and a corresponding reference slope includes the following specific methods: First, the specific calculation method of the new angle threshold of the outlier point is: in, Indicates the new angle threshold of the target pixel; Indicates the angular coefficient of the target pixel; Indicates the preset angle threshold; Represents the Sigmoid normalization function; Then, the new angle threshold of the discrete points is combined with the LSD algorithm to detect the new edge points in the ground object road image to obtain several straight lines; Finally, the longest straight line in the feature road image is recorded as the reference straight line, and the slope of the reference straight line is recorded as the reference slope.
9. The method for guiding a route by remote sensing mapping of an unmanned aerial vehicle based on image processing according to claim 1, characterized in that: The specific method for obtaining the deflection angle of the UAV mapping route according to the difference in the reference slope of the reference straight line at different times is as follows: First, get the The base slope at the moment The absolute value of the difference between the reference slopes at the moment is recorded as the third value. The angle corresponding to the third value is obtained by using the inverse tangent function and recorded as the deflection angle of the UAV mapping; Then, the deflection angle of the UAV is used to adjust the forward direction of the UAV so that the absolute value of the difference between the current and previous reference slopes is always less than ,in is the preset hyperparameter.
Citation Information
Patent Citations
Binocular road identifying and detecting method based on pavement characteristics
CN106407924A
AGV driving optimization method and system based on artificial intelligence and two-dimensional code navigation
CN113361292A