Unmanned aerial vehicle based image collection method for irrigation canal system
By segmenting the grayscale image of the irrigation canal system into canal surface and non-canal surface regions, corner point and waterline features are obtained, and the robustness index is used to determine the stitching region. This solves the problem of computational redundancy in traditional image stitching methods and realizes efficient acquisition of irrigation canal system engineering images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YELLOW RIVER INST OF HYDRAULIC RES YELLOW RIVER CONSERVANCY COMMISSION
- Filing Date
- 2023-11-22
- Publication Date
- 2026-06-26
Smart Images

Figure CN117575898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs). Background Technology
[0002] Irrigation canals are a major water conservancy facility in modern agriculture, playing a vital role in agricultural development. To improve irrigation efficiency and water resource utilization, monitoring the use of irrigation canal systems is crucial. Due to the long distances of irrigation canals, aerial photography using drones is necessary for monitoring. However, because drones have limited shooting range, image stitching of aerial photographs is required to achieve comprehensive monitoring of the canal system.
[0003] Traditional image stitching methods achieve image stitching by detecting and matching feature points. This can easily lead to excessively large overlapping areas between the two images to be stitched, resulting in high computational redundancy, slow processing speed, and consumption of a large amount of computing resources. Ultimately, a large number of image stitchings result in long acquisition times for the overall image of the canal system, high computational costs, and affect the real-time performance of monitoring. Summary of the Invention
[0004] To address the technical problem of traditional image stitching methods resulting in excessive overlap between two images, leading to prolonged acquisition times for overall canal system images and impacting real-time monitoring, this invention aims to provide an image acquisition method for irrigation canal systems based on unmanned aerial vehicles (UAVs). The specific technical solution adopted is as follows:
[0005] Obtain a grayscale image of the irrigation canal system in the irrigation area; segment the grayscale image of the canal system to obtain the canal surface region and the non-canal surface region; obtain the corner points of the non-canal surface region and the canal surface region;
[0006] The corner uniformity factor of the pixel is obtained based on the distribution characteristics of the corner points within a preset neighborhood of the pixel in the non-channel area; the regional feature intensity of the preset area is obtained based on the difference characteristics of the corner uniformity factor in the preset area in the non-channel area; the region is traversed starting from the splicing edge of the grayscale image of the channel system, and the robustness index of the non-channel traversed region in the traversed range is obtained based on the number of corner points in the non-channel area within the traversed range and the regional feature intensity.
[0007] The waterline marks in the channel surface area are obtained. The waterline mark integrity is obtained based on the length characteristics of the waterline marks in the channel surface area within the traversal range and the size of the grayscale image of the channel system. The color distance difference of the channel surface area within the traversal range is obtained based on the number of pixels at both ends of the waterline marks in the channel surface area within the traversal range and the distance characteristics between the pixels on the waterline marks and the corner points of the channel surface area. The robustness index of the channel surface traversal area is obtained based on the waterline mark integrity and the color distance difference of the area.
[0008] The canal system traversal robustness index is obtained based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region, and the image stitching region is determined.
[0009] Further, the step of segmenting the grayscale image of the canal system to obtain the canal surface region and the non-canal surface region includes:
[0010] Edge contours in the grayscale image of the canal system are obtained by edge detection using the Canny operator, and the canal surface region and non-canal surface region are obtained by segmentation based on the edge contours using a convolutional neural network.
[0011] Further, the step of obtaining the corner uniformity factor of a pixel based on the distribution characteristics of corner points within a preset neighborhood of the pixel in the non-channel area includes:
[0012] For each pixel in the non-channel area, calculate the average Euclidean distance between each corner point and a preset number of other corner points within a preset neighborhood of the pixel to obtain the mean distance representation value of the corner points; calculate the sum of the variance of the mean distance representation value and a preset minimum positive number to obtain the distance difference representation value of the corner points.
[0013] The cumulative Euclidean distance between the pixel and each corner point within a preset neighborhood is calculated to obtain the center distance characterization value; the cumulative vertical distance between each corner point and the nearest boundary of the preset neighborhood of the pixel is calculated to obtain the boundary distance characterization value; the ratio of the maximum and minimum values between the center distance characterization value and the boundary distance characterization value is calculated to obtain the corner point distribution characterization value.
[0014] Calculate the product of the distance difference characterization value and the corner distribution characterization value to obtain the corner discrete characterization value; calculate the ratio of the number of corners in the preset neighborhood range of the pixel to the corner discrete characterization value to obtain the corner uniformity factor of the pixel.
[0015] Further, the step of obtaining the regional feature intensity of the preset region based on the difference characteristics of the corner point uniformity factor within the preset region of the non-channel surface region includes:
[0016] Calculate the average value of the corner uniformity factor of all pixels in the preset area within the non-channel surface area to obtain the local uniformity index; calculate the square of the difference between the corner uniformity factor and the local uniformity index of each pixel in the preset area to obtain the uniformity difference value; calculate the ratio of the local uniformity index to the uniformity difference value of each pixel in the preset area and sum them up to obtain the regional feature intensity of the non-channel surface area.
[0017] Further, the step of obtaining the robustness index of the non-channel surface traversal region within the traversal range based on the number of corner points in the non-channel surface region within the traversal range and the region feature strength includes:
[0018] Calculate the sum of the regional feature intensities of all preset regions within the traversal range of the non-channel surface region to obtain the non-channel surface traversal region feature intensity; calculate and normalize the product of the number of corner points within the traversal range of the non-channel surface region and the non-channel surface traversal region feature intensity to obtain the robustness index of the non-channel surface traversal region within the traversal range.
[0019] Further, the step of obtaining the watermark integrity based on the length characteristics of the watermark in the traversed area and the size of the grayscale image of the canal system includes:
[0020] The watermarks are obtained by using the Hough transform algorithm; the integrity of the watermarks is obtained by calculating the ratio of the total length of the traversed watermarks to the width of the watermarks in the grayscale image of the canal system parallel to the direction of the watermarks.
[0021] Further, the step of obtaining the color distance difference of the channel surface region within the traversal range based on the number of pixels at both ends of the waterline mark in the traversal range and the distance between the pixels on the waterline mark and the corner points of the channel surface region includes:
[0022] Calculate the ratio of the number of pixels above the waterline mark in the channel surface region within the traversal range to the total number of pixels in the channel surface region within the traversal range to obtain the channel surface color ratio; calculate the sum of the distances between each pixel in the waterline mark and the preset number of second nearest neighbor corner points above the waterline mark in the channel surface region to obtain the region mark distance; calculate the cumulative value of the region mark distances of all pixels of the waterline mark within the traversal range to obtain the traversal region mark distance.
[0023] The color distance difference of the channel surface region within the traversal range is obtained by calculating the product of the color ratio of the channel surface within the traversal range and the trace distance of the traversal region.
[0024] Furthermore, the step of obtaining the robustness index of the canal surface traversal region based on the watermark integrity and the regional color distance difference includes:
[0025] The ratio of the watermark integrity to the color distance difference of the region is calculated and normalized to obtain the robustness index of the channel surface traversal region.
[0026] Further, the step of obtaining the canal system traversal robustness index and determining the image stitching region based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region includes:
[0027] The sum of the robustness index of the non-channel surface traversal region and the robustness index of the channel surface traversal region is calculated to obtain the channel system traversal robustness index.
[0028] When the robustness index of the canal system traversal does not exceed the traversal threshold, traversal continues; when the robustness index of the canal system traversal exceeds the traversal threshold, traversal stops, and the position where traversal stops is the starting position of the next adjacent grayscale image of the canal system; the overlapping part of the grayscale image of the canal system and the next adjacent grayscale image of the canal system is used as the stitching area.
[0029] Furthermore, the step of obtaining the corner points of the non-channel surface region and the channel surface region includes:
[0030] The corner points of the non-channel surface region and the channel surface region are obtained respectively using the Harris corner detection algorithm.
[0031] The present invention has the following beneficial effects:
[0032] In this embodiment of the invention, because the feature differences between the channel surface area and both ends of the channel are significant, the grayscale image of the channel system is segmented to obtain the channel surface area and non-channel surface area, improving computational efficiency and the reliability of feature analysis. Since image stitching mainly relies on feature point matching, obtaining the corner points of the non-channel surface area and the channel surface area facilitates subsequent robustness analysis of features in different areas. Areas with uniform and abundant corner point distribution during image stitching are more conducive to feature point matching and stitching; therefore, a corner point uniformity factor is obtained to characterize the quantity and distribution characteristics of corner points. Regional feature intensity can characterize the overall number and uniformity of corner points in that area. Furthermore, the robustness of the stitched area features of the non-channel surface area can be characterized by the non-channel surface traversal region robustness index. Because the features below the waterline mark in the channel surface area are more pronounced, the waterline mark is obtained and its length characteristics are analyzed to obtain the waterline mark integrity, which is then used to characterize the region's feature robustness. Calculating the color distance difference of the channel surface area can characterize the robustness of the stitched area features of the channel surface area; the robustness index of the channel surface traversal region can characterize the robustness of the channel surface area features within the traversal range. Ultimately, the overall feature robustness of the traversal range can be determined based on the canal system traversal robustness index, which in turn allows for adaptive determination of the image stitching range. This reduces computational redundancy in image stitching, improves stitching efficiency while ensuring stitching quality, and enhances the efficiency of acquiring a complete canal system image. Attached Figure Description
[0033] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 A flowchart illustrating an image acquisition method for irrigation canal systems based on unmanned aerial vehicles (UAVs) according to an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the structure of a grayscale image of a channel system provided in an embodiment of the present invention. Detailed Implementation
[0036] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a UAV-based image acquisition method for irrigation canal systems according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0037] Unless otherwise defined, 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 pertains.
[0038] The following description, in conjunction with the accompanying drawings, details a specific scheme for an image acquisition method for irrigation canal systems based on unmanned aerial vehicles (UAVs) provided by this invention.
[0039] Please see Figure 1 The diagram illustrates a flowchart of an image acquisition method for irrigation canal systems based on unmanned aerial vehicles (UAVs) according to an embodiment of the present invention. The method includes the following steps:
[0040] Step S1: Obtain a grayscale image of the irrigation canal system in the irrigation area; segment the grayscale image of the irrigation canal system to obtain the canal surface area and the non-canal surface area; obtain the corner points of the non-canal surface area and the canal surface area.
[0041] In this embodiment of the invention, the implementation scenario involves the acquisition and stitching of a panoramic image of an irrigation canal area. First, aerial photography is taken using a drone, starting from the canal's initial area and proceeding parallel to its direction of development. The images include the canal and the irrigation areas at both ends. The images are then processed using a color balance algorithm to reduce noise and enhance image detail and clarity. It should be noted that the color balance algorithm is existing technology, and the specific processing steps will not be elaborated upon. The denoised image is then converted to a grayscale image to obtain a grayscale image of the irrigation canal system.
[0042] Traditional image stitching involves matching feature points in an image, resulting in excessive computational redundancy and long processing time. Therefore, this invention improves the feature point matching process during image stitching by analyzing the robustness of image features to determine the size of the stitching area and the aerial shooting location, thereby reducing computational load and improving stitching efficiency.
[0043] First, because the grayscale image of the canal system includes both waterway and non-waterway portions, and the features of the two differ significantly, the grayscale image is segmented to obtain the canal surface region and the non-canal surface region in order to improve analysis efficiency. Preferably, in one embodiment of the present invention, edge detection is performed using the Canny operator to obtain the edge contours in the grayscale image of the canal system, and the edge contours include the water surface contours and waterway contours. A convolutional neural network is then used to segment the canal surface region and the non-canal surface region based on the edge contours. It should be noted that the Canny operator and convolutional neural network are existing technologies, and the specific calculation and analysis steps will not be elaborated further. The canal surface region refers to the brick-concrete structure in the waterway that does not contain water flow areas, and the non-canal surface region refers to the irrigation areas at both ends of the image, such as... Figure 2 A schematic diagram of the structure of a grayscale image of a canal system is shown.
[0044] Furthermore, since image stitching primarily involves matching by detecting feature points, with corner points being the main feature points, it is necessary to obtain the corner points of both the non-channel surface region and the channel surface region. Preferably, the Harris corner detection algorithm is used to obtain the corner points of both regions. It should be noted that Harris corner detection is an existing technology, and the specific steps will not be elaborated further. After obtaining the corner points of different regions, subsequent steps can analyze the feature intensity of different regions.
[0045] Step S2: Obtain the corner uniformity factor of the pixel based on the distribution characteristics of the corner points within the preset neighborhood of the pixel in the non-channel area; obtain the regional feature intensity of the preset area based on the difference characteristics of the corner uniformity factor in the preset area within the non-channel area; start the region traversal from the splicing edge of the channel grayscale image; obtain the robustness index of the non-channel traversal region within the traversal range based on the number of corner points and the regional feature intensity of the non-channel area within the traversal range.
[0046] In the process of image stitching, if a certain region has a large number of corner points and they are evenly distributed, it is more conducive to stitching two images together and the stitching effect is better. Therefore, the number and uniformity of corner points in the region can be analyzed. Thus, the corner point uniformity factor of the pixel is obtained based on the distribution characteristics of corner points in the preset neighborhood of the pixel in the non-channel area.
[0047] Preferably, in one embodiment of the present invention, obtaining the corner uniformity factor includes: for each pixel in the non-channel area, calculating the average Euclidean distance between each corner and a preset number of other corners within a preset neighborhood of the pixel, to obtain a mean distance representation value for the corner; this mean distance representation value can represent the distance between each corner and its neighboring corners. The variance of this mean distance representation value is calculated and summed with a preset minimum positive number to obtain a distance difference representation value for the corner; the smaller the variance, the closer the mean distance representation values of each corner are, and the more uniform the distribution of corners within the preset neighborhood of the pixel; the larger the variance, the greater the difference in mean distance representation values between different corners, and the existence of multiple corner clusters; therefore, the smaller the distance difference representation value, the more uniform the distribution among the corners. It should be noted that in this embodiment of the invention, the preset neighborhood range is a 5*5 window area centered on the pixel. If the pixel is at the edge of the image and does not meet the window size, it is not considered. The preset number of nearest neighbors is 6, that is, the 6 other corner points closest to the corner point. The preset minimum positive value is 0.1, which is to avoid the case where the variance is zero. The implementer can determine it according to the implementation scenario.
[0048] Further, the cumulative Euclidean distance between the pixel and each corner point within a preset neighborhood is calculated to obtain the center distance representation value; the cumulative perpendicular distance between each corner point and the nearest boundary of the preset neighborhood of the pixel is calculated to obtain the boundary distance representation value; the ratio of the maximum and minimum values of the center distance representation value and the boundary distance representation value is calculated to obtain the corner distribution representation value. If the distribution of all corner points within the preset neighborhood of the pixel is relatively uniform, with some corner points close to the center pixel and some corner points close to the boundary of the preset neighborhood, the sum of the distances of all corner points from the pixel should be similar to the sum of the distances from the boundary, and the corner distribution representation value is close to 1. If the distribution of all corner points within the preset neighborhood of the pixel is relatively concentrated, for example, if they are close to the pixel, the center distance representation value is much smaller than the boundary distance representation value, and thus the corner distribution representation value is greater than 1. Therefore, the closer the corner distribution value is to 1, the more uniform the corner distribution is within the preset neighborhood of the pixel; when the corner distribution value is greater than 1, the corner distribution is more concentrated in a certain area within the preset neighborhood of the pixel.
[0049] The product of the distance difference representation value and the corner distribution representation value is calculated to obtain the discrete corner representation value. Both the distance difference representation value and the corner distribution representation value reflect the uniformity of the corner distribution. The smaller the values of both, the more uniform the distribution. Therefore, the closer the discrete corner representation value is to 0, the more uniform the distribution of corners within the preset neighborhood of the pixel, which is more conducive to image stitching. The ratio of the number of corners within the preset neighborhood of the pixel to the discrete corner representation value is calculated to obtain the corner uniformity factor of the pixel. The more corners there are, the more uniform the corner distribution, and the smaller the discrete corner representation value, the larger the corner uniformity factor. Therefore, the larger the corner uniformity factor of the pixel, the more corners there are in the neighborhood and the more uniform their distribution, resulting in higher feature robustness for stitching and making it more conducive to stitching. The specific formula for obtaining the corner uniformity factor includes:
[0050]
[0051] In the formula, L represents the corner uniformity factor of a pixel, X represents the number of corner points within a preset neighborhood of the pixel, a represents a preset minimum positive value, H represents the variance of the mean distance representation value of the corner points within a preset neighborhood of the pixel, and (a+H) represents the distance difference representation value; G max G represents the maximum value between the center distance representation value and the boundary distance representation value. min This represents the minimum value between the center distance representation value and the boundary distance representation value. This represents the characteristic value of corner point distribution;
[0052] This represents the discrete characterization value of the corner point.
[0053] After obtaining the corner uniformity factor of pixels in the non-channel area, the feature robustness of the stitched region can be analyzed based on the corner uniformity factor of all pixels in a certain region. Therefore, the regional feature intensity of the preset region is obtained based on the difference characteristics of the corner uniformity factor in the preset region of the non-channel area.
[0054] Preferably, in one embodiment of the present invention, obtaining the regional feature intensity includes: firstly, based on... Figure 2 As shown, the drone takes pictures from left to right. The stitching edge with the next adjacent grayscale image of the canal system is on the right. Determining the stitching range requires traversing from right to left. The traversal can only stop when the feature robustness of the stitching area is high enough. Therefore, the preset area of the non-canal surface area is in this embodiment of the invention. Figure 2 The vertical column of pixels in the channel surface area of the Central Africa region; implementers can determine other preset areas according to the implementation scenario.
[0055] Further, the average corner uniformity factor of all pixels within a preset region outside the channel surface is calculated to obtain the local uniformity index. A larger local uniformity index indicates a higher overall corner uniformity factor within the preset region, resulting in a higher overall number of corners and a more uniform distribution. The square of the difference between the corner uniformity factor and the local uniformity index for each pixel within the preset region is calculated to obtain the uniformity difference value. A larger uniformity difference value indicates a greater difference between the corner uniformity factor and the local uniformity index for that pixel, suggesting a higher or lower average corner uniformity factor. A lower value is unfavorable for image stitching. The ratio of the local uniformity index to the uniformity difference value for each pixel within the preset region is calculated and summed to obtain the regional feature strength of the non-channel surface region. A higher regional feature strength indicates a higher overall number of corners within the preset region, a more uniform distribution, and less variation in the distribution of corners around each pixel. A lower regional feature strength indicates a smaller overall number of corners within the preset region and greater variation in the distribution of corners around each pixel. A higher regional feature strength indicates higher feature robustness for stitching. The formulas for obtaining the intensity of regional features specifically include:
[0056]
[0057] In the formula, A represents the regional feature intensity of the preset region, I represents the number of pixels in the preset region, and U represents the local uniformity index of the preset region; L i Represents the corner uniformity factor of the i-th pixel; (L i -U) 2 This indicates the difference in uniformity.
[0058] After obtaining the regional feature strength of the preset area of the non-channel surface region, the traversal can be started from the splicing edge to determine the feature robustness of the non-channel surface traversal area of the splicing area. Therefore, the robustness index of the non-channel surface traversal area of the traversal range is obtained based on the number of corner points and the regional feature strength of the non-channel surface region within the traversal range.
[0059] Preferably, in one embodiment of the present invention, obtaining the robustness index of the non-channel surface traversal region includes: traversing from the stitching edge of the channel grayscale image, calculating the sum of the regional feature intensities of all preset regions within the traversal range of the non-channel surface region, and obtaining the feature intensity of the non-channel surface traversal region; the feature intensity of the non-channel surface traversal region represents the sum of the feature intensities of all preset regions traversed. The larger the value, the higher the feature robustness of the non-channel surface traversal region, and the more beneficial it is for image stitching. The product of the number of corner points within the traversal range of the non-channel surface region and the feature intensity of the non-channel surface traversal region is calculated and normalized to obtain the robustness index of the non-channel surface traversal region within the traversal range; the more corner points within the traversal range of the non-channel surface region, the more beneficial it is for feature point matching during image stitching. Therefore, the higher the robustness index of the non-channel surface traversal region, the higher the feature intensity of that range, and the more beneficial it is for image stitching.
[0060] After the feature intensity analysis of the non-channel surface region of the grayscale image of the canal system is completed, the feature intensity analysis of the channel surface region is required. Once the feature intensity of both the non-channel surface region and the channel surface region meets the stitching requirements, the image can be stitched together.
[0061] Step S3: Obtain watermarks in the channel surface area; obtain watermark integrity based on the length characteristics of the watermarks in the traversed channel surface area and the size of the channel grayscale image; obtain the color distance difference of the traversed channel surface area based on the number of pixels at both ends of the watermarks in the traversed channel surface area and the distance characteristics between the pixels on the watermarks and the corners of the channel surface area; obtain the robustness index of the traversed channel surface area based on the watermark integrity and the color distance difference of the area.
[0062] The prolonged erosion of water in a canal results in a darker color in the eroded areas compared to the uneroded white brick areas, often appearing as dark green or dark black, with more prominent feature points. The boundary clearly distinguishing the eroded and uneroded areas of the canal surface is called the waterline. When the water flow is low, the dark area below the waterline is larger and more prominent, making it easier to match feature points during image stitching. Conversely, the white brick areas in the canal surface have fewer feature points; only the seams between the bricks are easily detectable, and most corner points are concentrated in these seam areas. Therefore, the robustness of the feature can be reflected by the area characteristics and pixel proportion characteristics of the region below the waterline. First, the waterline in the canal surface area is obtained, and the integrity of the waterline is determined based on the length characteristics of the waterline in the traversed area and the size of the canal system grayscale image.
[0063] Preferably, in one embodiment of the present invention, obtaining the watermark integrity includes: obtaining the parametric equation of the watermark edge contour through the Hough transform algorithm, and performing a Cartesian coordinate transformation on the parametric equation to obtain the length of the watermark; it should be noted that the Hough transform is prior art, and the specific steps will not be described in detail. Starting from the stitching edge of the canal grayscale image, the watermark integrity is obtained by traversing the entire image and calculating the ratio of the total length of the traversed watermarks to the width of the watermarks in the canal grayscale image. Due to sunlight or the surface structure of the canal, the watermarks may appear discontinuous, and the dark area below the watermark may not have obvious features; the longer the total length of the watermark, the greater the watermark integrity, which means that the feature robustness of the area is higher.
[0064] Furthermore, after obtaining the waterline mark and its integrity, the robustness of the channel surface region can be analyzed based on the area difference characteristics at both ends of the waterline mark and the distance characteristics between the pixels on the waterline mark and the corner points. Therefore, the color distance difference of the channel surface region within the traversal range can be obtained based on the number of pixels at both ends of the waterline mark in the traversal range and the distance characteristics between the pixels on the waterline mark and the corner points of the channel surface region.
[0065] Preferably, in one embodiment of the present invention, obtaining the color distance difference of the channel surface region includes: starting from the splicing edge of the grayscale image of the channel system, traversing the area above the waterline mark in the traversed range, calculating the ratio of the number of pixels in the area above the waterline mark in the traversed range to the total number of pixels in the channel surface region within the traversed range, and obtaining the channel surface color ratio; the larger the channel surface color ratio, the larger the area above the waterline mark, and the fewer the feature points of the bricks above the waterline mark, and the worse the feature robustness of the channel surface region; the smaller the channel surface color ratio, the larger the area of the dark black area below the waterline mark, the more feature points, and the better the feature robustness of the channel surface region. The distance between each pixel in the waterline mark and a predetermined number of corner points above the waterline mark within the channel surface area is calculated to obtain the region mark distance. Since the corner points of the channel surface area are mostly brick seams and brick vertices, the closer the distance between a pixel in the waterline mark and the corner point above the waterline mark, the smaller the area of the bricks above the waterline mark and the larger the area of the dark area below the waterline mark, thus resulting in stronger feature robustness of the traversed area. In this embodiment, the predetermined number of second nearest neighbors is 4, which is the sum of the distances between each pixel in the waterline mark and its four nearest upper corner points. The cumulative value of the region mark distances of all pixels in the waterline mark within the traversed range is calculated to obtain the traversed region mark distance. A larger traversed region mark distance means a larger area above the waterline mark, resulting in poorer feature robustness of the channel surface area within the traversed range; a smaller traversed region mark distance means a smaller area above the waterline mark, resulting in better feature robustness of the channel surface area within the traversed range.
[0066] Furthermore, the product of the channel surface color ratio and the trace distance of the traversed area is calculated to obtain the color distance difference of the channel surface area within the traversed range. The smaller the color distance difference, the stronger the feature robustness of the channel surface area within the traversed range, which is more beneficial for feature point matching in image stitching. The specific formula for obtaining the color distance difference of the channel surface area includes:
[0067]
[0068] In the formula, T represents the color distance difference of the channel surface region, Q represents the number of pixels above the waterline mark in the traversed channel surface region, and W represents the total number of pixels in the traversed channel surface region. Indicates the color ratio of the canal surface; N represents the number of pixels of the waterline mark in the traversed canal surface area, and D... n This represents the distance of the region at the nth pixel on the watermark. This indicates the trace distance of the traversed region.
[0069] After obtaining the chromatic distance difference of the canal surface region, which characterizes the robustness of the canal surface region, the robustness index of the canal surface traversal region can be obtained based on the watermark integrity and the chromatic distance difference. Preferably, in one embodiment of the present invention, obtaining the robustness index of the canal surface traversal region includes: calculating and normalizing the ratio of watermark integrity to chromatic distance difference to obtain the robustness index of the canal surface traversal region. When the watermark integrity is greater and the chromatic distance difference is smaller, the robustness index of the canal surface traversal region is greater, which means that the feature region of the region is more obvious and more conducive to image stitching.
[0070] Thus, the robustness index of the canal surface traversal region within the traversal range has been obtained. The splicing region can then be analyzed based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region.
[0071] Step S4: Obtain the canal system traversal robustness index and determine the image stitching region based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region.
[0072] The robustness index of the non-channel traversal region and the robustness index of the channel traversal region are calculated to obtain the channel system traversal robustness index. When both the robustness index of the non-channel traversal region and the robustness index of the channel traversal region are larger, it means that the channel system traversal robustness index is larger, the feature robustness of the traversal region is stronger, and it is more conducive to image stitching.
[0073] When the robustness index of the canal system traversal does not exceed the preset traversal threshold, traversal continues; when the robustness index exceeds the preset traversal threshold, traversal stops, and the stopping position is the starting position of the next adjacent grayscale image of the canal system. The overlapping part of the grayscale image of the canal system and the next adjacent grayscale image of the canal system is used as the stitching area, which can be subsequently stitched together using existing image stitching algorithms. It should be noted that in this embodiment of the invention, the preset traversal threshold is 1.8, and the implementer can determine it according to the implementation scenario. Figure 2 The robust region length is the range traversed from right to left from the stitching edge. When the robustness index of the canal system traversal within this range exceeds a preset traversal threshold, traversal can stop. This means that the feature robustness of the traversed region at this point is sufficient for stitching, and the next image captured by the drone can start from this point. The overlapping areas of the two images can be stitched together. This stitching method ensures the reliability of feature point matching during the stitching process, improves stitching accuracy, and reduces unnecessary feature point analysis and stitching in certain areas, thus reducing computational redundancy and the number of aerial shots.
[0074] In summary, this invention provides a method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs). The grayscale image of the canal system is segmented to obtain canal surface regions and non-canal surface regions. A corner uniformity factor is obtained based on the corner distribution characteristics in the non-canal surface regions, and a regional feature intensity is obtained based on the difference characteristics of the corner uniformity factor. A robustness index for non-canal surface traversal regions is obtained based on the number of corners and the regional feature intensity. Watermark integrity is obtained based on the length characteristics of watermarks, and color distance difference in the canal surface regions is obtained based on the distribution and distance characteristics of pixels. Finally, a robustness index for canal surface traversal regions is obtained based on the watermark integrity and the regional color distance difference. Ultimately, this invention can adaptively determine the image stitching range based on the canal system traversal robustness index, improving stitching efficiency while ensuring stitching quality, and thus improving the efficiency of acquiring a complete canal system image.
[0075] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0076] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for image acquisition of irrigation canal systems based on unmanned aerial vehicles (UAVs), characterized in that, The method includes the following steps: Obtain a grayscale image of the irrigation canal system in the irrigation area; segment the grayscale image of the canal system to obtain the canal surface region and the non-canal surface region; obtain the corner points of the non-canal surface region and the canal surface region; The corner uniformity factor of the pixel is obtained based on the distribution characteristics of the corner points within a preset neighborhood of the pixel in the non-channel area; the regional feature intensity of the preset area is obtained based on the difference characteristics of the corner uniformity factor in the preset area in the non-channel area; the region is traversed starting from the splicing edge of the grayscale image of the channel system, and the robustness index of the non-channel traversed region in the traversed range is obtained based on the number of corner points in the non-channel area within the traversed range and the regional feature intensity. The waterline marks in the channel surface area are obtained. The waterline mark integrity is obtained based on the length characteristics of the waterline marks in the channel surface area within the traversal range and the size of the grayscale image of the channel system. The color distance difference of the channel surface area within the traversal range is obtained based on the number of pixels at both ends of the waterline marks in the channel surface area within the traversal range and the distance characteristics between the pixels on the waterline marks and the corner points of the channel surface area. The robustness index of the channel surface traversal area is obtained based on the waterline mark integrity and the color distance difference of the area. The canal system traversal robustness index is obtained based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region, and the image stitching region is determined.
2. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of segmenting the grayscale image of the canal system to obtain the canal surface region and the non-canal surface region includes: Edge contours in the grayscale image of the canal system are obtained by edge detection using the Canny operator, and the canal surface region and non-canal surface region are obtained by segmentation based on the edge contours using a convolutional neural network.
3. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the corner uniformity factor of a pixel based on the distribution characteristics of corner points within a preset neighborhood of the pixel in the non-channel area includes: For each pixel in the non-channel area, calculate the average Euclidean distance between each corner point and a preset number of other corner points within a preset neighborhood of the pixel to obtain the mean distance representation value of the corner points; calculate the sum of the variance of the mean distance representation value and a preset minimum positive number to obtain the distance difference representation value of the corner points. The cumulative Euclidean distance between the pixel and each corner point within a preset neighborhood is calculated to obtain the center distance characterization value; the cumulative vertical distance between each corner point and the nearest boundary of the preset neighborhood of the pixel is calculated to obtain the boundary distance characterization value; the ratio of the maximum and minimum values between the center distance characterization value and the boundary distance characterization value is calculated to obtain the corner point distribution characterization value. Calculate the product of the distance difference characterization value and the corner distribution characterization value to obtain the corner discrete characterization value; calculate the ratio of the number of corners in the preset neighborhood range of the pixel to the corner discrete characterization value to obtain the corner uniformity factor of the pixel.
4. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the regional feature intensity of the preset region based on the difference characteristics of the corner uniformity factor in the preset region within the non-channel surface region includes: Calculate the average value of the corner uniformity factor of all pixels in the preset area within the non-channel surface area to obtain the local uniformity index; calculate the square of the difference between the corner uniformity factor and the local uniformity index of each pixel in the preset area to obtain the uniformity difference value; calculate the ratio of the local uniformity index to the uniformity difference value of each pixel in the preset area and sum them up to obtain the regional feature intensity of the non-channel surface area.
5. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the robustness index of the non-channel surface traversal region within the traversal range based on the number of corner points in the non-channel surface region within the traversal range and the region feature strength includes: Calculate the sum of the regional feature intensities of all preset regions within the traversal range of the non-channel surface region to obtain the non-channel surface traversal region feature intensity; calculate and normalize the product of the number of corner points within the traversal range of the non-channel surface region and the non-channel surface traversal region feature intensity to obtain the robustness index of the non-channel surface traversal region within the traversal range.
6. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining watermarks in the canal surface area and determining the watermark integrity based on the length characteristics of the watermarks in the traversed canal surface area and the size of the canal grayscale image includes: The watermarks are obtained by using the Hough transform algorithm; the integrity of the watermarks is obtained by calculating the ratio of the total length of the traversed watermarks to the width of the watermarks in the grayscale image of the canal system parallel to the direction of the watermarks.
7. The method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the color distance difference of the channel surface region within the traversal range based on the number of pixels at both ends of the waterline mark in the traversal range and the distance between the pixels on the waterline mark and the corner points of the channel surface region includes: Calculate the ratio of the number of pixels above the waterline mark in the channel surface region within the traversal range to the total number of pixels in the channel surface region within the traversal range to obtain the channel surface color ratio; calculate the sum of the distances between each pixel in the waterline mark and the preset number of second nearest neighbor corner points above the waterline mark in the channel surface region to obtain the region mark distance; calculate the cumulative value of the region mark distances of all pixels of the waterline mark within the traversal range to obtain the traversal region mark distance. The color distance difference of the channel surface region within the traversal range is obtained by calculating the product of the color ratio of the channel surface within the traversal range and the trace distance of the traversal region.
8. The method for image acquisition of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the robustness index of the canal surface traversal region based on the watermark integrity and the regional color distance difference includes: The ratio of the watermark integrity to the color distance difference of the region is calculated and normalized to obtain the robustness index of the channel surface traversal region.
9. A method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the canal system traversal robustness index and determining the image stitching region based on the robustness index of the non-canal surface traversal region and the robustness index of the canal surface traversal region includes: The sum of the robustness index of the non-channel surface traversal region and the robustness index of the channel surface traversal region is calculated to obtain the channel system traversal robustness index. When the robustness index of the canal system traversal does not exceed the traversal threshold, traversal continues; when the robustness index of the canal system traversal exceeds the traversal threshold, traversal stops, and the position where traversal stops is the starting position of the next adjacent grayscale image of the canal system; the overlapping part of the grayscale image of the canal system and the next adjacent grayscale image of the canal system is used as the stitching area.
10. A method for acquiring images of irrigation canal systems based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The step of obtaining the corner points of the non-channel surface region and the channel surface region includes: The corner points of the non-channel surface region and the channel surface region are obtained respectively using the Harris corner detection algorithm.