Rapid sky and ground line detection method based on image edge gradient distribution
By improving median filtering and adaptive edge extraction algorithms, and combining them with ground feature background characteristics, the system can quickly detect and identify the skyline and ground horizon, solving the problem of high false alarm rate in infrared detection and achieving high-precision and high-real-time skyline and ground horizon detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF REMOTE SENSING EQUIP
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-08
AI Technical Summary
Existing infrared detection technologies suffer from a high false alarm rate due to the presence of ground targets, making it difficult to effectively distinguish between the horizon and the skyline.
A method based on image edge gradient distribution is adopted. By improving median filtering to remove noise, adaptively selecting edge thresholds, and combining ground feature background characteristics to extract the sky-ground boundary point, a sky-ground boundary line is formed.
It effectively reduced the false alarm rate, improved the accuracy and real-time performance of ground and satellite line detection, and reduced the computational load.
Smart Images

Figure CN121998910A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of photoelectric detection technology, and in particular to a fast method for detecting the horizon line based on the gradient distribution of image edges. Background Technology
[0002] Infrared detection of weak targets presents significant challenges due to the long distance and the target's indistinctness. When there are ground features such as mountains and buildings in the detection field of view, the detection threshold is set low to detect weak targets. As a result, tree branches, cables, and other background features are detected as false alarms, leading to a high probability of false alarms.
[0003] Traditional methods for removing false alarms use candidate target trajectories. If the trajectories cannot be correlated or their coordinates are fixed, they are considered false targets and removed. However, when dealing with ground features, although the ground features themselves are stationary, the movement of the detector causes relative motion to these stationary targets, rendering the false alarm removal method ineffective. Furthermore, some moving targets in the ground feature background can also interfere with detection.
[0004] Therefore, there is an urgent need for a detection method for weak aerial targets at long distances using infrared technology, which can solve the problem of high false alarm rates caused by the detection of ground targets due to their presence. Summary of the Invention
[0005] This specification provides a fast top-to-bottom line detection method based on image edge gradient distribution, which solves the problem of high false alarm rate in existing technologies when ground objects are detected due to their presence.
[0006] Firstly, this specification provides a fast top-to-bottom line detection method based on image edge gradient distribution, including:
[0007] An improved median filter is applied to the image to be recognized to remove Gaussian white noise introduced by detector imaging;
[0008] By using an improved Sobel edge extraction algorithm, edge thresholds are adaptively selected to extract the edges and textures of the image;
[0009] Based on the image edges and texture structure, the boundary between sky and earth is extracted by utilizing the edge gradient distribution and combining the characteristics of the ground object background edge distribution.
[0010] Connect all the points where heaven and earth meet to form the boundary line between heaven and earth.
[0011] Secondly, this specification provides a fast top-to-bottom line detection device based on image edge gradient distribution, comprising: a noise removal module, an edge extraction module, a boundary point extraction module, and a boundary line determination module; wherein:
[0012] The noise removal module is used to perform improved median filtering on the image to be recognized, removing Gaussian white noise introduced by detector imaging.
[0013] The edge extraction module is used to adaptively select an edge threshold and extract the edges and textures of the image using an improved Sobel edge extraction algorithm.
[0014] The boundary point extraction module is used to extract the boundary point between the sky and the ground based on the image edge and texture structure, utilizing the edge gradient distribution and combining the characteristics of the ground background edge distribution.
[0015] The boundary line determination module is used to connect all the heaven and earth boundary points to form the heaven and earth boundary line.
[0016] Thirdly, this specification also provides a computer-readable storage medium storing a computer program that can be invoked by a processor to perform the steps of a fast top-to-bottom line detection method based on image edge gradient distribution.
[0017] The beneficial effects of this invention are as follows:
[0018] This specification discloses a fast sky-ground boundary detection method based on image edge gradient distribution. The method employs an improved median filter on the image to be identified to remove salt-and-pepper noise introduced by the detector imaging; it uses an improved edge extraction algorithm to extract the image edges; and it extracts the sky-ground boundary based on the image edges and edge gradient distribution. This solves the problem of high false alarm rates in existing technologies due to the detection of ground objects. The method utilizes an improved median filter to remove image noise, eliminating its impact on edge extraction; it uses an improved edge extraction algorithm to achieve stable extraction of image edges and textures; it leverages the texture distribution characteristics of aerial drones and clouds to identify whether a point is a sky-ground boundary, achieving robust sky-ground boundary extraction; and it combines image edge gradient information with the edge characteristics of the ground background to achieve rapid detection and recognition of the sky-ground boundary, improving real-time performance and accuracy. This method significantly reduces computational load and improves the accuracy and real-time performance of sky-ground boundary detection. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:
[0020] Figure 1 This is a schematic diagram of a fast top-to-bottom line detection method based on image edge gradient distribution provided in the embodiments of this specification;
[0021] Figure 2 This is a schematic diagram of a fast top-to-bottom line detection method based on image edge gradient distribution provided in the embodiments of this specification;
[0022] Figure 3 This is a schematic diagram of an improved median filtering process provided in the embodiments of this specification;
[0023] Figure 4 This is a schematic diagram of the original image before edge extraction provided in the embodiments of this specification;
[0024] Figure 5 This is a schematic diagram of an edge and texture structure image provided in the embodiments of this specification;
[0025] Figure 6 This is a schematic diagram of a boundary line determination process provided in the embodiments of this specification;
[0026] Figure 7 This is a schematic diagram illustrating the result of determining the boundary line when a ship is present, as provided in the embodiments of this specification.
[0027] Figure 8 This is a schematic diagram illustrating the result of determining the boundary line when a bridge exists, as provided in the embodiments of this specification.
[0028] Figure 9 This is a schematic diagram illustrating the result of determining the boundary line when a dock exists, as provided in the embodiments of this specification. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments in this specification, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this application without creative effort are within the scope of protection of this document.
[0030] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings. Specific Implementation Example 1:
[0032] This embodiment provides a fast top-to-bottom line detection method based on image edge gradient distribution. See [link to relevant documentation]. Figures 1-9 ;
[0033] First, it should be noted that the sky-ground boundary detection algorithm in this embodiment, when the sky-ground boundary is not a straight line, can calculate the sky-ground boundary point for each column of the image point by point, and then connect the sky-ground boundary points to achieve accurate sky-ground boundary line determination. When there is interference from drones, clouds, etc. in the air, it can utilize the distribution characteristics of ground objects to eliminate these aerial interferences and achieve accurate sky-ground boundary line detection.
[0034] like Figure 1 , Figure 2 As shown, the method provided in this embodiment includes the following steps:
[0035] Step 102: Perform improved median filtering on the image to be recognized to remove Gaussian white noise introduced by detector imaging;
[0036] It should be noted that traditional median filtering algorithms do not consider whether the filtered area contains bad pixels; they directly use a sorting method to replace the grayscale of the center pixel, resulting in blurring of the entire frame. To remove Gaussian noise while preserving the original edges and textures of the image, an improved median filtering algorithm is used.
[0037] Specifically, such as Figure 3 As shown, one possible implementation of step 102 is as follows:
[0038] S21. Determine whether the 3*3 cross filter area satisfies that the center pixel is higher or lower than the eight neighboring pixels by more than 20 gray levels. If it is satisfied, it is considered Gaussian noise. Use the median filtering method to replace the center pixel value with the sorted median pixel gray level.
[0039] S22. If the center pixel does not meet the condition that all of its pixels are higher or lower than 20 gray levels of its eight neighboring pixels, then the center pixel is considered not to be Gaussian noise and is retained.
[0040] Step 104: Using the improved Sobel edge extraction algorithm, adaptively select the edge threshold to extract the edges and textures of the image;
[0041] Specifically, the improved Sobel edge extraction algorithm includes the following processing methods:
[0042] Gradient difference is performed on the image, and if the difference is greater than a given edge threshold, the point is considered an edge point.
[0043] The edge threshold is selected adaptively, and the selection methods include:
[0044] Calculate the grayscale mean of the image and the difference between each pixel and the grayscale mean. First, take the absolute value of the difference, then sum all the absolute values, and finally calculate the mean of the absolute differences. Use half of this mean as the edge threshold of the image frame.
[0045] The extraction of image edges and textures includes:
[0046] Starting from the top left corner of the image to be identified after median filtering, the edge structure operator is used to convolve with the image to calculate the gradient value of the pixel. If the gradient value is greater than the edge threshold, the gray value is set to 255; otherwise, the gray value is set to 0.
[0047] Traverse the entire frame image to obtain the edges and textures of that frame image.
[0048] The formula for calculating edge structure is:
[0049] Lx=∑I(i-1,j+1)+2*I(i,j+1)+I(i+1,j+1)-∑I(i-1,j-1)-2*I(i,j-1)-I(i+1,j-1);
[0050] Ly=∑I(i-1,j-1)+2*I(i-1,j)+I(i-1,j+1)-∑I(i+1,j-1)-2*I(i+1,j)-I(i+1,j+1);
[0051] Where Lx is the formula for calculating azimuth edges, and Ly is the formula for calculating pitch edges. I(i,j) is the pixel gray value at coordinate (i,j) in the image.
[0052] Specific examples:
[0053] The gradient threshold used for edge detection is obtained adaptively, and the calculation method is as follows:
[0054] (1) Calculate the mean gray value of the image:
[0055] (2) Subtract the mean gray level of each pixel in the image and take the absolute value:
[0056]
[0057] (3) Calculate the mean of the sum of the differences, where w is the image width and h is the image height:
[0058]
[0059] (4) Use half the mean of the sum of the differences as the threshold for finding the edge.
[0060] Step 106: Based on the image edges and texture structure, and utilizing the edge gradient distribution combined with the characteristics of the ground object background edge distribution, extract the sky-ground boundary point;
[0061] Specifically, such as Figure 6 As shown, one possible implementation of step 106 is as follows:
[0062] S61. Starting from the first pixel of each column at the edge of the image, determine whether the gray value of the pixel is greater than 0. If it is greater than 0, start from the second pixel of the column and continuously determine 15 pixels. If there are 10 pixels greater than 0, determine the second pixel of the column as the boundary between the top and bottom of the column.
[0063] S62. If there are no 10 pixels greater than 0, repeat the judgment starting from the second pixel in the column until the dividing point between the top and bottom is found.
[0064] S63. If, after reaching the last pixel of the image column, there is still no pixel that meets the requirements, then it is determined that the column has no top-to-bottom boundary.
[0065] Furthermore, considering the potential interference from drones or strong cloud edges in the air, when a suspected boundary point between the sky and the ground is found, the number of consecutive 0 pixel values is counted from the boundary point downwards. If the number of 0 values exceeds 10 pixels, the boundary point between the sky and the ground found in this column is considered to be an error point. The boundary point obtained in this column is then removed, and a new boundary point is obtained until the bottom edge of the image is reached.
[0066] If no dividing point is found, it is assumed that there is no dividing point between the top and bottom edges of the column, and the bottom edge of the column image is taken as the dividing point between the top and bottom edges.
[0067] Step 108: Connect all the points where heaven and earth meet to form the boundary line between heaven and earth.
[0068] By finding all the points where the sky and earth meet, and connecting these points, we can obtain the sky-earth boundary line for the entire frame. The boundary line obtained using this method is composed of all the boundary points, and therefore is a curve that can fit well with non-flat terrain such as mountains and forests.
[0069] Furthermore, this embodiment also provides a simulation test result:
[0070] Figure 4 The original image before edge extraction. Figure 5 For edge and texture structure images, Figure 7 The result is obtained when the boundary line is present. Figure 8 The result is obtained when a bridge exists. Figure 9 The result is obtained when a dock exists; it can be seen that the method provided in this embodiment is effective and improves the accuracy and real-time performance of the boundary line detection.
[0071] In summary, this embodiment employs improved median filtering on the image to be identified, removing salt-and-pepper noise introduced by detector imaging; it uses an improved edge extraction algorithm to extract the image edges; and it extracts the sky-ground boundary line based on the image edges and edge gradient distribution. This solves the problem of high false alarm rates in existing technologies where ground objects are detected due to their presence. This method utilizes an improved median filtering procedure to remove image noise, eliminating its impact on edge extraction; it uses an improved edge extraction algorithm to achieve stable extraction of image edges and textures; it leverages the texture distribution characteristics of aerial drones and clouds to identify whether a point is a sky-ground boundary, achieving robust extraction of the sky-ground boundary line; and it combines image edge gradient information with the edge characteristics of the ground background to achieve rapid detection and recognition of the sky-ground boundary line, improving real-time performance and accuracy. This method significantly reduces computational load and improves the accuracy and real-time performance of sky-ground boundary line detection. Specific Implementation Example 2:
[0073] This embodiment provides a fast skyline detection method based on image edge gradient distribution, which solves the problem of high false alarm rate in existing technologies when detecting weak aerial targets at long distances using infrared technology, due to the presence of ground targets, which are also detected.
[0074] The first step is to use an improved median filtering algorithm to filter the infrared image and remove infrared image noise.
[0075] Median filtering is effective against Gaussian noise and bad pixels in infrared images;
[0076] Traditional median filtering algorithms don't consider whether the filtered area contains bad pixels; they directly use a sorting method to replace the grayscale of the center pixel, causing blurring of the entire frame. To remove Gaussian noise while preserving the original edges and textures, an improved median filtering algorithm is used. During the filtering process, it first checks if the center pixel in the 3x3 filtering area meets the condition that it is either all pixels higher or lower than its eight neighboring pixels by more than 20 gray levels. If it does, it's considered Gaussian noise, and the median filtering method replaces the center pixel value. If it doesn't meet this condition, the center pixel is considered not Gaussian noise and is retained.
[0077] The second step involves using an improved edge filtering algorithm to extract the edges and textures of the image.
[0078] To quickly calculate image edges, the Sobel edge detection operator is used. The Sobel edge detection operator is as follows: the left image shows the edge gradient in the x-direction, and the right image shows the edge gradient in the y-direction. Gradient difference is performed, and if the difference is greater than a given threshold, the point is considered an edge point. The selection of the threshold is crucial. To adaptively select the threshold, the average grayscale value of the image and the difference between each pixel and the average grayscale value are calculated. Half of the sum of the absolute values of these differences is used as the threshold for that frame.
[0079] The gradient threshold used for edge detection is obtained adaptively, and the calculation method is as follows:
[0080] (1) Calculate the mean gray value of the image:
[0081] (2) Subtract the mean gray level of each pixel in the image and take the absolute value:
[0082]
[0083] (3) Calculate the mean of the sum of the differences, where w is the image width and h is the image height:
[0084]
[0085] (4) Use half the mean of the sum of the differences as the threshold for finding the edge.
[0086] (5) The edge structure operator is as follows, which can realize the extraction of horizontal and vertical textures:
[0087]
[0088] The third step is to determine the sky-ground boundary based on the edge distribution characteristics of the image edges and the ground background.
[0089] After calculating the edges and texture structure of the image, as well as the edges of ground features and the background, the gradient changes of each column are used to find the boundary points of each column. The strategy for finding the boundary points is as follows: starting from the first pixel of each column in the edge map, it is determined whether the grayscale value of the pixel is greater than 0. If it is greater than 0, then starting from the second pixel of that column, 15 pixels are continuously checked. If 10 pixels are greater than 0, then the second pixel of that column is considered to be the boundary point of that column. If the requirement of 10 pixels is not met, then the above steps are repeated starting from the second pixel of that column until the boundary point is found. If no pixel meeting the requirement is found by reaching the last pixel of that column, then the column is considered to have no boundary point.
[0090] Considering the potential interference from drones or strong cloud edges, once a suspected horizon line boundary is found, the number of consecutive 0 pixels is counted downwards from that point. If more than 10 pixels are 0, the horizon line boundary for that column is considered erroneous and is discarded. The boundary line extraction algorithm is then reapplied to find the boundary line again, continuing until the bottom edge of the image is reached. If no boundary line is found, the column is considered to have no horizon line boundary, and the bottom edge of that column is taken as the horizon line boundary.
[0091] Step 4: Connect all the points where heaven and earth meet to form the boundary line between heaven and earth.
[0092] By finding all the points where the sky and earth meet, and connecting these points, we can obtain the sky-earth boundary line for the entire frame. The boundary line obtained using this method is composed of all the boundary points, and therefore is a curve that can fit well with non-flat terrain such as mountains and forests.
[0093] In summary, this embodiment employs improved median filtering on the image to be identified, removing salt-and-pepper noise introduced by detector imaging; it uses an improved edge extraction algorithm to extract the image edges; and it extracts the sky-ground boundary line based on the image edges and edge gradient distribution. This solves the problem of high false alarm rates in existing technologies where ground objects are detected due to their presence. This method utilizes an improved median filtering procedure to remove image noise, eliminating its impact on edge extraction; it uses an improved edge extraction algorithm to achieve stable extraction of image edges and textures; it leverages the texture distribution characteristics of aerial drones and clouds to identify whether a point is a sky-ground boundary, achieving robust extraction of the sky-ground boundary line; and it combines image edge gradient information with the edge characteristics of the ground background to achieve rapid detection and recognition of the sky-ground boundary line, improving real-time performance and accuracy. This method significantly reduces computational load and improves the accuracy and real-time performance of sky-ground boundary line detection. Specific Implementation Example 3:
[0095] This embodiment provides a fast top-to-bottom line detection device based on image edge gradient distribution, including: a noise removal module, an edge extraction module, a boundary point extraction module, and a boundary line determination module; wherein:
[0096] The noise removal module is used to perform improved median filtering on the image to be recognized, removing Gaussian white noise introduced by detector imaging.
[0097] The edge extraction module is used to adaptively select an edge threshold and extract the edges and textures of the image using an improved Sobel edge extraction algorithm.
[0098] The boundary point extraction module is used to extract the boundary point between the sky and the ground based on the image edge and texture structure, utilizing the edge gradient distribution and combining the characteristics of the ground background edge distribution.
[0099] The boundary line determination module is used to connect all the heaven and earth boundary points to form the heaven and earth boundary line.
[0100] Optionally, the noise removal module is used for:
[0101] Determine if the 3x3 cross-filtered region satisfies the condition that the center pixel is either higher or lower than the eight neighboring pixels by more than 20 gray levels. If it is, it is considered Gaussian noise, and the median filtering method is used to replace the center pixel value with the sorted median pixel gray level.
[0102] If the center pixel does not meet the condition that all of its pixels are 20 gray levels higher or lower than its eight neighboring pixels, then the center pixel is considered not to be Gaussian noise and is retained.
[0103] Optionally, the improved Sobel edge extraction algorithm may include the following processing methods:
[0104] Gradient difference is performed on the image, and if the difference is greater than a given edge threshold, the point is considered an edge point.
[0105] Optionally, the edge threshold is selected adaptively, and the selection methods include:
[0106] Calculate the grayscale mean of the image and the difference between each pixel and the grayscale mean. First, take the absolute value of the difference, then sum all the absolute values, and finally calculate the mean of the absolute differences. Use half of this mean as the edge threshold of the image frame.
[0107] Optionally, the extraction of image edges and textures includes:
[0108] Starting from the top left corner of the image to be identified after median filtering, the edge structure operator is used to convolve with the image to calculate the gradient value of the pixel. If the gradient value is greater than the edge threshold, the gray value is set to 255; otherwise, the gray value is set to 0.
[0109] Traverse the entire frame image to obtain the edges and textures of that frame image.
[0110] Optionally, the edge structure operator is:
[0111] Lx=∑I(i-1,j+1)+2*I(i,j+1)+I(i+1,j+1)-∑I(i-1,j-1)-2*I(i,j-1)-I(i+1,j-1)
[0112] Ly=∑I(i-1,j-1)+2*I(i-1,j)+I(i-1,j+1)-∑I(i+1,j-1)-2*I(i+1,j)-I(i+1,j+1)
[0113] Where Lx is the formula for calculating azimuth edges, Ly is the formula for calculating pitch edges, and I(i,j) is the pixel gray value at coordinate (i,j) in the image.
[0114] Optionally, the boundary point extraction module is specifically used for:
[0115] Starting from the first pixel of each column at the edge of the image, determine whether the gray value of the pixel is greater than 0. If it is greater than 0, start from the second pixel of the column and continuously determine 15 pixels. If there are 10 pixels greater than 0, then determine the second pixel of the column as the boundary between the top and bottom of the column.
[0116] If there are not 10 pixels greater than 0, the judgment is repeated starting from the second pixel in the column until the dividing point between the top and bottom is found.
[0117] If, after reaching the last pixel of a column in the image, there is still no pixel that meets the requirements, then it is determined that the column has no top-to-bottom boundary.
[0118] Optionally, the boundary point extraction module is further specifically used for:
[0119] Considering the potential interference from drones or strong cloud edges in the air, when a suspected boundary between the sky and the ground is found, the number of consecutive 0 pixel values is counted from the boundary downwards. If the number of 0 pixels exceeds 10, the boundary point found in this column is considered to be an error point. The boundary point obtained in this column is then removed, and the boundary point is re-observed until the bottom edge of the image is reached.
[0120] If no dividing point is found, it is assumed that there is no dividing point between the top and bottom edges of the column, and the bottom edge of the column image is taken as the dividing point between the top and bottom edges.
[0121] In summary, this embodiment employs improved median filtering on the image to be identified, removing salt-and-pepper noise introduced by detector imaging; it uses an improved edge extraction algorithm to extract the image edges; and it extracts the sky-ground boundary line based on the image edges and edge gradient distribution. This solves the problem of high false alarm rates in existing technologies where ground objects are detected due to their presence. This method utilizes an improved median filtering procedure to remove image noise, eliminating its impact on edge extraction; it uses an improved edge extraction algorithm to achieve stable extraction of image edges and textures; it leverages the texture distribution characteristics of aerial drones and clouds to identify whether a point is a sky-ground boundary, achieving robust extraction of the sky-ground boundary line; and it combines image edge gradient information with the edge characteristics of the ground background to achieve rapid detection and recognition of the sky-ground boundary line, improving real-time performance and accuracy. This method significantly reduces computational load and improves the accuracy and real-time performance of sky-ground boundary line detection.
[0122] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A fast top-to-bottom line detection method based on image edge gradient distribution, characterized in that, include: An improved median filter is applied to the image to be recognized to remove Gaussian white noise introduced by detector imaging; By using an improved Sobel edge extraction algorithm, edge thresholds are adaptively selected to extract the edges and textures of the image; Based on the image edges and texture structure, the boundary between sky and earth is extracted by utilizing the edge gradient distribution and combining the characteristics of the ground object background edge distribution. Connect all the points where heaven and earth meet to form the boundary line between heaven and earth.
2. The method according to claim 1, characterized in that, The improved median filtering of the image to be identified, which removes Gaussian white noise introduced by detector imaging, includes: Determine if the 3x3 cross-filtered region satisfies the condition that the center pixel is either higher or lower than the eight neighboring pixels by more than 20 gray levels. If it is, it is considered Gaussian noise, and the median filtering method is used to replace the center pixel value with the sorted median pixel gray level. If the center pixel does not meet the condition that all of its pixels are 20 gray levels higher or lower than its eight neighboring pixels, then the center pixel is considered not to be Gaussian noise and is retained.
3. The method according to claim 2, characterized in that, The improved Sobel edge extraction algorithm includes the following processing methods: Gradient difference is performed on the image, and if the difference is greater than a given edge threshold, the point is considered an edge point.
4. The method according to claim 3, characterized in that, The edge threshold is selected adaptively, and the selection methods include: Calculate the grayscale mean of the image and the difference between each pixel and the grayscale mean. First, take the absolute value of the difference, then sum all the absolute values, and finally calculate the mean of the absolute differences. Use half of this mean as the edge threshold of the image frame.
5. The method according to claim 4, characterized in that, The extraction of image edges and textures includes: Starting from the top left corner of the image to be identified after median filtering, the edge structure operator is used to convolve with the image to calculate the gradient value of the pixel. If the gradient value is greater than the edge threshold, the gray value is set to 255; otherwise, the gray value is set to 0. Traverse the entire frame image to obtain the edges and textures of that frame image.
6. The method according to claim 5, characterized in that, The edge structure operator is: Lx=∑I(i-1,j+1)+2*I(i,j+1)+I(i+1,j+1)-∑I(i-1,j-1)-2*I(i,j-1)-I(i+1,j-1) Ly=∑I(i-1,j-1)+2*I(i-1,j)+I(i-1,j+1)-∑I(i+1,j-1)-2*I(i+1,j)-I(i+1,j+1) Where Lx is the formula for calculating azimuth edges, Ly is the formula for calculating pitch edges, and I(i,j) is the pixel gray value at coordinate (i,j) in the image.
7. The method according to claim 6, characterized in that, The step of extracting the horizon boundary point based on image edges and texture structure, utilizing edge gradient distribution, and combining the characteristics of ground feature background edge distribution includes: Starting from the first pixel of each column at the edge of the image, determine whether the gray value of the pixel is greater than 0. If it is greater than 0, start from the second pixel of the column and continuously determine 15 pixels. If there are 10 pixels greater than 0, then determine the second pixel of the column as the boundary between the top and bottom of the column. If there are not 10 pixels greater than 0, the judgment is repeated starting from the second pixel in the column until the dividing point between the top and bottom is found. If, after reaching the last pixel of a column in the image, there is still no pixel that meets the requirements, then it is determined that the column has no top-to-bottom boundary.
8. The method according to claim 7, characterized in that, The method of extracting the horizon boundary based on image edges and texture structure, utilizing edge gradient distribution, and combining the characteristics of ground feature background edge distribution, further includes: Considering the potential interference from drones or strong cloud edges in the air, when a suspected boundary between the sky and the ground is found, the number of consecutive 0 pixel values is counted from the boundary downwards. If the number of 0 pixels exceeds 10, the boundary point found in this column is considered to be an error point. The boundary point obtained in this column is then removed, and the boundary point is re-observed until the bottom edge of the image is reached. If no dividing point is found, it is assumed that there is no dividing point between the top and bottom edges of the column, and the bottom edge of the column image is taken as the dividing point between the top and bottom edges.
9. A fast top-to-bottom line detection device based on image edge gradient distribution, applied to the method of any one of claims 1 to 8, characterized in that, include: The module includes a noise removal module, an edge extraction module, a boundary point extraction module, and a boundary line determination module; among which: The noise removal module is used to perform improved median filtering on the image to be recognized, removing Gaussian white noise introduced by detector imaging. The edge extraction module is used to adaptively select an edge threshold and extract the edges and textures of the image using an improved Sobel edge extraction algorithm. The boundary point extraction module is used to extract the boundary point between the sky and the ground based on the image edge and texture structure, utilizing the edge gradient distribution and combining the characteristics of the ground background edge distribution. The boundary line determination module is used to connect all the heaven and earth boundary points to form the heaven and earth boundary line.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be invoked by a processor to perform the steps of the fast top-to-bottom line detection method based on image edge gradient distribution as described in claim 1.