Pipeline pressure detection method and equipment for agricultural irrigation system

Through visual detection algorithm, the liquid level and scale lines of the U-tube pressure gauge are automatically identified and reconstructed, which solves the problems of poor ageing and low accuracy of U-tube pressure gauge readings in agricultural irrigation systems, and realizes the automation and accuracy of U-tube pressure gauge readings.

CN119880249APending Publication Date: 2025-04-25JIANGSU ACAD OF AGRI SCI +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510093282.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

现有农业灌溉系统中U型管压力计读数时效性差,准确度低,且传统算法无法完全适配U型管压力计,导致读数效率低、精准性不足。

Method used

The visual detection algorithm is used to automatically identify and reconstruct the liquid level and scale position of the U-tube pressure gauge through Fourier Merlin transformation, HSV color space conversion, gradient map processing and edge feature analysis, and automatically read the scale value based on the liquid level information.

Benefits of technology

The timeliness and accuracy of U-tube pressure gauge readings are improved, and the automation and accuracy of U-tube pressure gauge readings are realized, solving the problems of poor timeliness and low accuracy in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119880249A_ABST
    Figure CN119880249A_ABST
Patent Text Reader

Abstract

The invention relates to a pipeline pressure detection method and equipment for an agricultural irrigation system. The invention relates to the pipeline pressure detection method and equipment for the agricultural irrigation system. The purpose of the invention is to solve the problems of poor timeliness and low accuracy of reading of a U-shaped pipe pressure gauge in an existing agricultural irrigation system. The method comprises the following steps: S1, obtaining a vertical RGB picture of the U-shaped tube pressure gauge; s2, obtaining a gradient map of the final liquid level map; s3, cutting a scale line gradient map; s4, dividing the scale value into a left part and a right part; step S5, obtaining the screened scale lines; s6, reconstruction is carried out through the scale line spacing and the number, and a scale line set is obtained; s7, obtaining a final left and right scale line set; s8, judging whether the long scale marks are complete or not; and S9, reading a scale line liquid level ordinate based on the gradient map of the liquid level map obtained in the step S2 and the final left and right scale line set obtained in the step S8. The method is applied to the field of pipeline pressure detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and equipment for detecting pipeline pressure in an agricultural irrigation system. Background Art

[0002] The agricultural irrigation system transports water to the irrigation area of ​​farmland through pipes. The pipe irrigation system is efficient, resource-saving, and highly adaptable, and is one of the important directions for the development of modern agriculture. Agricultural irrigation pipes are exposed to the outside and the pipelines are widely distributed. Once the pipes leak, it will lead to crop losses and waste of water resources. In addition, the water output is directly affected by the water pressure in the pipes. The pressure in the pipes is an important indicator for directly evaluating the water output. Therefore, the pressure data in the pipes has become an important indicator to ensure agricultural production.

[0003] The U-tube manometer measures the specific pressure value and displays it on the dial by balancing the gravity of the liquid column or the weight of the weight with the measured pipeline pressure. It can be used to read the pressure in the pipeline. It has the advantages of low cost and simple structure.

[0004] The agricultural irrigation system needs to use a pressure gauge at intervals to detect the pressure of each section of the pipeline to determine whether the water output of each irrigation area meets the demand and whether there is a leak in the pipeline. However, reading the U-tube pressure gauge and judging whether there is a leak in the pipeline currently requires manual inspections in the irrigation area, which is time-consuming, inefficient, and wastes manpower and material resources. Therefore, how to accurately read the scale value changes of the U-tube pressure gauge in real time has become an urgent problem to be solved in the industry.

[0005] At present, the traditional algorithm for reading the dial value is mainly calculated by the percentage of the connected domain of the dial where the pointer is located. This method requires the first and last scale values ​​to completely correspond to the range. However, the start and end scales of the U-tube pressure gauge do not match the range, and there is no pointer, only liquid level information, and no pointer with obvious morphological characteristics. Therefore, the scope of application of this method is limited, and it cannot fully adapt to the readings of the U-tube pressure gauge. There is a lot of room for improvement in the judgment of scale value information. The application of artificial intelligence detection algorithms has the problem of high computing cost and deployment cost, and the accuracy of detection also has a certain room for improvement. Summary of the invention

[0006] The purpose of the present invention is to solve the problem of poor timeliness and low accuracy of readings of U-tube pressure gauges in existing agricultural irrigation systems, and to propose a method and device for detecting pipeline pressure in an agricultural irrigation system.

[0007] A method for detecting pipeline pressure in an agricultural irrigation system. The specific process is as follows:

[0008] Step S1, taking a photo of the U-tube pressure gauge, and cropping the U-tube pressure gauge area in the photo; performing Fourier-Mellin transform on the cropped U-tube pressure gauge area photo to obtain a vertical RGB photo of the U-tube pressure gauge;

[0009] The x-axis is horizontal to the scale line, and the y-axis is vertical to the scale line.

[0010] Step S2, converting the vertical RGB image of the U-tube manometer obtained in step S1 into an image of the U-tube manometer in the HSV color space;

[0011] Set the liquid level gradient threshold; set all pixels in the U-tube image that are smaller than the liquid level gradient threshold to 0 and regard them as the background image, and regard the remaining pixels as the liquid level map, and extract the liquid level map;

[0012] The liquid level map is processed by the sobel operator to obtain the gradient map of the liquid level map;

[0013] The obtained gradient map of the liquid level map is suppressed and expanded in sequence along the y direction to obtain an image after the expansion operation, and the image after the expansion operation is the gradient map of the liquid level map;

[0014] Step S3, using the Sobel operator to process the vertical RGB image of the U-tube pressure gauge obtained in step S1 to obtain an RGB gradient image, and then binarizing the RGB gradient image to change all pixel values ​​that are not 0 to 1 to obtain a binary image;

[0015] Traverse each column of pixels in the binary image, count the number of pixels in each column whose pixel values ​​change from 0 to 1 and from 1 to 0, determine the position and length information of the scale line in the image, and crop the scale line gradient map;

[0016] Step S4, suppressing, dilating, and regularizing the scale line gradient image obtained in step S3 in the y direction in sequence to obtain a regularized image, denoising the regularized image, and dividing the scale value of the denoised image into two parts, a left part and a right part;

[0017] Step S5, filtering the connected domains of the left and right parts obtained in step S4 to obtain filtered scale lines;

[0018] Step S6, based on the filtered scale lines obtained in step S5, reconstructing by scale line spacing and numbering to obtain a scale line set;

[0019] Step S7, verifying the scale mark set obtained in step S6 to obtain a final left and right scale mark set;

[0020] Step S8, based on the result of step S7, verify the number of long scale lines by the mantissa method, and determine whether the long scale lines meet the requirements. If they meet the requirements, they are retained and step S9 is executed; otherwise, an alarm is issued to prompt that the scale lines are missing;

[0021] Step S9, based on the gradient map of the liquid level map obtained in step S2 and the final left and right scale line sets retained in step S8, read the scale line liquid level ordinates.

[0022] A pipeline pressure detection device for an agricultural irrigation system comprises a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a pipeline pressure detection method for an agricultural irrigation system.

[0023] The beneficial effects of the present invention are:

[0024] The main purpose of the present invention is to read the value from the U-tube pressure gauge through a visual detection algorithm. In order to achieve this function and solve the problem in the technical background, the present invention proposes to use the difference in gradient information of different colors in different color spaces, analyze and screen the connected domain and edge feature information, and determine the position of the liquid level and scale value. Then, by checking and reconstructing the left and right scale line information, all scale line position information is finally restored, and finally combined with the liquid level information, the U-tube pressure gauge reading is automatically read and displayed, which improves the timeliness and accuracy of the U-tube pressure gauge reading, and solves the problem of poor timeliness and low accuracy of the U-tube pressure gauge reading in the existing agricultural irrigation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of the method for detecting the reading of a U-tube pressure gauge in an agricultural irrigation system according to the present invention;

[0026] Figure 2a It is a gradient map used by the present invention to extract scale line information;

[0027] Figure 2b It is a gradient map used for extracting liquid level information in the present invention;

[0028] Figure 3 It is a schematic diagram of the reading detection result of the U-tube pressure gauge used in the agricultural irrigation system of the present invention. DETAILED DESCRIPTION

[0029] Specific implementation method 1: The specific process of the pipeline pressure detection method of an agricultural irrigation system in this implementation method is as follows:

[0030] Step S1, taking a picture of the U-tube pressure gauge, and cropping the U-tube pressure gauge area in the picture; performing Fourier-Mellin transform (rotation processing) on ​​the cropped U-tube pressure gauge area picture to obtain a vertical RGB picture of the U-tube pressure gauge;

[0031] The x-axis is horizontal to the scale line, and the y-axis is vertical to the scale line.

[0032] The coordinates of the cropped image in the original image as well as the width and height of the image can be customized. This solution directly takes the original size of the input image as input;

[0033] Step S2, converting the vertical RGB image of the U-tube manometer obtained in step S1 into an image of the U-tube manometer in the HSV color space;

[0034] Set the liquid level gradient threshold (the liquid of the pressure gauge used in the U-tube of this embodiment is red, and the liquid level gradient threshold is set to 150 by taking advantage of the fact that red has a larger pixel value in the HSV gradient map); set all pixels in the U-tube image that are smaller than the liquid level gradient threshold to 0, regard them as the background image, and regard the remaining pixels as the liquid level map, and extract the liquid level map;

[0035] The liquid level map is processed by the sobel operator to obtain the gradient map of the liquid level map;

[0036] The obtained gradient map of the liquid level map is suppressed and expanded in sequence along the y direction to obtain an image after the expansion operation, and the image after the expansion operation is the gradient map of the liquid level map;

[0037] Step S3, using the Sobel operator to process the vertical RGB image of the U-tube pressure gauge obtained in step S1 to obtain an RGB gradient image, and then binarizing the RGB gradient image to change all pixel values ​​that are not 0 to 1 to obtain a binary image;

[0038] Traverse each column of pixels in the binary image, count the number of pixels in each column whose pixel values ​​change from 0 to 1 and from 1 to 0, determine the position and length information of the scale line in the image, and crop the scale line gradient map;

[0039] Step S4, suppressing, dilating (using a 3x3 convolution kernel to dilate the image and unifying the pixels in the y direction to 3 pixels wide) and regularizing (regularizing the image pixels to within the range of (0, 255)) the scale line gradient image obtained in step S3 in the y direction in turn to obtain a regularized image, denoising the regularized image (removing highlight areas with a value greater than 200 pixels to remove the light spots caused by the reflection of the dial glass), and dividing the scale value of the denoised image into left and right parts (dividing the scale value into left and right parts by the midpoint of the x-axis of the scale line gradient image);

[0040] Step S5, filtering the connected domains of the left and right parts obtained in step S4 to obtain filtered scale lines;

[0041] Step S6, based on the filtered scale lines obtained in step S5, reconstructing by scale line spacing and numbering to obtain a scale line set;

[0042] Step S7, verifying the scale mark set obtained in step S6 to obtain a final left and right scale mark set;

[0043] Step S8, based on the result of step S7, verify the number of long scale lines by the mantissa method, and determine whether the long scale lines meet the requirements. If they meet the requirements, they are retained and step S9 is executed; otherwise, an alarm is issued to prompt that the scale lines are missing;

[0044] Step S9, based on the gradient map of the liquid level map obtained in step S2 and the final left and right scale line sets retained in step S8, read the scale line liquid level ordinates.

[0045] Specific implementation method 2: This implementation method is different from the specific implementation method 1 in that in step S1, the cropped U-tube pressure gauge area image is subjected to Fourier-Mellin transform to obtain a vertical RGB image of the U-tube pressure gauge; the specific process is:

[0046] The center line of the scale line of the U-tube manometer is adjusted to be perpendicular to the horizontal plane to obtain a vertical RGB image of the U-tube manometer.

[0047] The other steps and parameters are the same as those in the first embodiment.

[0048] Specific implementation method three: This implementation method is different from specific implementation method one or two in that the gradient map of the liquid level map obtained in step S2 is suppressed and expanded in the y direction in sequence to obtain an image after the expansion operation, and the image after the expansion operation is the gradient map of the liquid level map; the specific process is:

[0049] Step S21, suppress the obtained gradient map in the y direction in sequence to obtain a suppressed gradient map; the specific process is:

[0050] 1) Get each continuous area in the first column of the gradient map;

[0051] Determine the number of rows occupied by each continuous area in the first column;

[0052] If the continuous area occupies only one row, the continuous area is retained;

[0053] If the continuous area occupies 2 rows, if the pixel values ​​of the two rows are the same, take the upper row of the two rows as the position of the continuous area, and delete the lower row of the two rows; if the pixel values ​​of the two rows are different, take the row with the larger pixel value as the position of the continuous area, and delete the row with the smaller pixel value;

[0054] If the continuous area occupies more than 2 rows, determine whether the continuous area occupies an odd row or an even row. If it is an odd row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the middle row of the odd row, and delete the rows other than the middle row; if it is an even row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the next row of the middle row of the even row, and delete the rows other than the next row of the middle row;

[0055] 2) Get each continuous area in the second column of the gradient map;

[0056] Determine the number of rows occupied by each continuous area in the second column;

[0057] If the continuous area occupies only one row, the continuous area is retained;

[0058] If the continuous area occupies 2 rows, if the pixel values ​​of the two rows are the same, take the upper row of the two rows as the position of the continuous area, and delete the lower row of the two rows; if the pixel values ​​of the two rows are different, take the row with the larger pixel value as the position of the continuous area, and delete the row with the smaller pixel value;

[0059] If the continuous area occupies more than 2 rows, determine whether the continuous area occupies an odd row or an even row. If it is an odd row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the middle row of the odd row, and delete the rows other than the middle row; if it is an even row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the next row of the middle row of the even row, and delete the rows other than the next row of the middle row;

[0060] 3) Repeat step 2) until all continuous regions in all columns in the gradient map are determined;

[0061] Step S22, dilate the suppressed gradient map using a 3x3 convolution kernel to obtain an image after the dilation operation (unify the pixels in the liquid level map to a length of 3 pixels along the y direction), and the image after the dilation operation is the gradient map of the liquid level map.

[0062] The other steps and parameters are the same as those in the first or second embodiment.

[0063] Specific implementation method 4: This implementation method is different from any one of specific implementation methods 1 to 3 in that, in step S3, the vertical RGB image of the U-tube pressure gauge obtained in step S1 is processed using the Sobel operator to obtain an RGB gradient image, and then the RGB gradient image is binarized to convert all scale values ​​that are not 0 to 1 to obtain a binary image;

[0064] Traverse each column of pixels in the binary image, count the number of pixels in each column whose pixel values ​​change from 0 to 1 and from 1 to 0, determine the position and length information of the scale line in the image, and crop the scale line gradient map;

[0065] The specific process is:

[0066] Step S31:

[0067] The vertical RGB image of the U-tube pressure gauge obtained in step S1 is processed using the Sobel operator to obtain an RGB gradient image, and then the RGB gradient image is binarized to convert all scale values ​​that are not 0 to 1 to obtain a binary image;

[0068] The binary image is reduced in dimension (reduced to a 1-row 200-column vector) to obtain a binary image after dimension reduction;

[0069] The number of pixels in each column of the binary image after dimensionality reduction that change from 0 to 1 and from 1 to 0 is accumulated to obtain the number of pixel jumps in each column. The expression is:

[0070]

[0071] Where count[j] is the count of the jth column; col is the number of image column vectors, and row is the number of image row vectors; p (i,j) represents the pixel value of the pixel in the i-th row and j-th column of the image; p (i+1,j) Represents the pixel value of the pixel in the i+1th row and jth column of the image;

[0072] The number of pixel jumps in each column is stored in the image count, where the number of rows in count is 1 and the number of columns is col. (The value of each pixel in the image count is the number of pixel jumps in each column, and a pixel information matrix is ​​reduced to a row vector count that stores the jump information).

[0073] The jump is the pixel value changing from 0 to 1 or from 1 to 0;

[0074] Since the gradient values ​​of the scale lines and background image pixels vary significantly, when scanning each column of pixels from top to bottom along the y-axis, the pixel values ​​of each column containing the scale lines will jump frequently, while the pixel values ​​of the column not containing the scale lines will rarely change suddenly.

[0075] Step S32:

[0076] 1) Set the threshold of the number of pixels in the connected domain, and set the pixel values ​​in the image count that are less than the threshold to 0;

[0077] Because the number of upper and lower edges of the scale lines in this implementation is 200 in total, the threshold is set to 140;

[0078] 2) Calculate F through connected domain analysis c Get the connected domain set in the image count; the expression is:

[0079] CN {c1,c2,......,c n =F c (count)

[0080] Among them, C N is the set of all connected domains obtained after the connected domain analysis; c1 represents the first connected domain, c2 represents the second connected domain, and c n is the nth connected domain; c n Contains {x l_n , x r_n , x n}, x l_n is the x-axis coordinate of the leftmost pixel in the nth connected domain, x r_n is the x-axis coordinate of the rightmost pixel in the nth connected domain, x n is the number of pixels in the nth connected domain;

[0081] 3) Select the connected domain set C N The connected domains with the first and second largest number of pixels in the image are taken as the connected domain S N ; The expression is:

[0082] S N {s1,s2}=Max 1,2 (C N )

[0083] Among them, Max 1,2 To find the connected domain set C N The connected domains with the top two pixel numbers in S N is the connected domain set where the scale line is located; s1 is the connected domain set C N The connected domain with the largest number of pixels in the s2 is the connected domain set C N The connected domain with the second largest number of pixels;

[0084] 4) The x-axis coordinate x of the leftmost pixel of the connected domain s1 l_1 and the rightmost pixel x-coordinate r_1 Get the length of the scale line of the connected domain s1; the expression is:

[0085] The length of the scale line of the connected domain s1 is length = X r_1 -X l_1

[0086] The x-axis coordinate x of the leftmost pixel in the connected domain s2 l_2 and the rightmost pixel x-coordinate r_2 Get the length of the scale line of the connected domain s2; the expression is:

[0087] The length of the scale line of the connected domain s2 is length = Xr_2 -X l_2

[0088] 5) Select the x-axis coordinates of the leftmost pixels in the connected domain s1 and the connected domain s2, as well as the x-axis coordinates of the rightmost pixels in the connected domain s1 and the connected domain s2;

[0089] Subtract 20 pixels from the leftmost x-axis coordinate as the starting position of the scale line image;

[0090] The rightmost x-axis coordinate plus 20 pixels is used as the end position of the scale line image.

[0091] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0092] Specific implementation method 5: This implementation method is different from any one of specific implementation methods 1 to 4 in that, in step S5, the connected domains of the left and right parts obtained in step S4 are filtered to obtain the filtered scale lines; the scale lines are filtered by analyzing the geometric features such as the straightness of the connected domain;

[0093] The specific process is:

[0094] Step S51, using straightness to screen and remove the miscellaneous lines from the scale lines of the left and right parts of the denoised image obtained in step S4; the specific process is:

[0095] Keep the scale lines that meet the following connected domain judgment conditions:

[0096]

[0097] Among them, p m_n represents the number of pixels in the mth connected domain (there are many connected domains on the left and right, and many pixels in each connected domain); x m_lt Indicates the horizontal coordinate of the upper left corner pixel of the minimum circumscribed rectangle of the mth connected domain, x m_rb Indicates the horizontal coordinate of the lower right corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_lt Indicates the ordinate of the upper left corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_rb represents the vertical coordinate of the lower right corner pixel of the minimum circumscribed rectangle of the mth connected domain; x m_rt Indicates the horizontal coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the mth connected domain, x m_lb Indicates the horizontal coordinate of the lower left corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_rt Indicates the upper right corner pixel y coordinate of the minimum circumscribed rectangle of the mth connected domain m_lb Represents the lower left corner pixel ordinate of the minimum circumscribed rectangle of the mth connected domain;

[0098] threshold represents the fill threshold;

[0099] Calculate the ratio of the number of pixels in the connected domain to the area of ​​the connected domain, and calculate the filling degree of the pixel point in the line segment. Threshold is the filling degree threshold. The closer to a straight line, the higher the filling degree; the closer to a curve, the lower the filling degree. Therefore, in this implementation, the threshold is set to 0.6, retaining straight lines with higher filling degrees and excluding miscellaneous lines with larger curvatures in the scale line image.

[0100] Step S52, using the length of the scale lines to filter out the scale lines on the left and right sides after the miscellaneous lines are removed in step S51; the specific process is:

[0101] Keep tick marks that meet the following conditions:

[0102] |x m_lt -x m_rt |+|x m_lb -x m_rb |>length

[0103] Among them, length indicates the length of the left or right scale line;

[0104] The lengths of the left and right scale lines obtained in step S3 are used to filter out the connected domains whose width on the left is greater than half of the width of the left scale line and whose width on the right is greater than half of the width of the right scale line, and to eliminate the shorter miscellaneous lines.

[0105] Step S53, using the weighted least square method to screen and remove the miscellaneous lines from the scale lines on the left and right sides after the miscellaneous lines are removed in step S52; the specific process is:

[0106] Based on all the scale lines after removing the clutter lines in step S52, the least square method is used to fit the straight line where the centroid of the connected domain is located, and the clutter lines far from the fitted straight line are deleted. Since the straight line fitting process is easily disturbed by noise points, in order to avoid this problem, the centroid of the fitted straight line is given a weight, and the closer the centroid is to the fitted straight line, the greater the weight.

[0107]

[0108] |x m_q -intercept|<length

[0109] Among them, x m_q Represents the centroid point p of the mth scale line m_q The x-coordinate of the scale; N represents the total number of scale lines; λ m represents weight; y m_q Represents the centroid point p of the mth scale line m_q The y coordinate of the fitted line; slope represents the slope of the fitted line, and intercept represents the intercept of the fitted line;

[0110] Calculate the distance of all centroids of all connected domains on the left and right minus the intercept, delete the scale lines whose absolute value of the distance is greater than the length of the left and right scale lines, and thus delete the miscellaneous lines located in the center of the dial. Finally, the set of left and right scale lines is obtained;

[0111] Step S54, using the scale line interval to screen and remove the miscellaneous lines from the scale lines on the left and right parts after the miscellaneous lines are removed in step S53; the specific process is:

[0112] Keep tick marks that meet the following conditions:

[0113]

[0114] Among them, y m-1_rt Indicates the y coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the m-1th connected domain, m-1_lb The y represents the lower left corner pixel ordinate of the minimum circumscribed rectangle of the m-1th connected domain; m_rt Indicates the y coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the m-1th connected domain, m_lb It represents the vertical coordinate of the lower left corner pixel of the minimum circumscribed rectangle of the mth connected domain; pitch_mean represents the average distance between scale lines;

[0115] Calculate the distance between all scale lines and the centroid of the previous scale line, and calculate the mean pitch_mean. Set the interval threshold between scale lines to 0.65 pitch_mean, and delete the connected domains with intervals less than 0.65 times the mean, thereby removing possible miscellaneous lines between scale lines;

[0116] This step uses straightness analysis, scale line length analysis, scale line interval analysis, and weighted least squares method to filter out the left and right scale lines and eliminate the miscellaneous lines.

[0117] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0118] Specific implementation method 6: This implementation method is different from the specific implementation methods 1 to 5 in that in step S6, the scale lines after screening obtained in step S5 are reconstructed by scale line spacing and numbering to obtain a scale line set; the specific process is:

[0119] Number the tick marks on the left and right sides, calculate the average value mean1 of the intervals between the tick marks on the left and right sides, delete the tick marks and tick mark numbers with intervals greater than 0.7mean1 and less than 1.3mean1, and calculate the average value mean2 of the intervals between the tick marks on the left and right sides again;

[0120] If the left scale lines are numbered continuously, it is considered that the connected domains on the left all meet the scale line interval conditions and do not need to be rebuilt;

[0121] If the right scale lines are numbered continuously, it is considered that the right connected domains all meet the scale line interval conditions and do not need to be rebuilt;

[0122] If the left scale lines are discontinuous, it is considered that there is a situation where the scale line interval is not met on the left side. The scale lines above and below the deleted scale lines are found through the missing numbers, and the spacing between the upper and lower adjacent scale lines is calculated. The deleted part is divided into several slices using spacing / mean2 (the result of slice is rounded). If slice is equal to 1, there is no mistaken deletion. If slice is greater than 1, then slice-1 scale lines are added with spacing / slice as the spacing;

[0123] If the scale lines on the right are discontinuous, it is considered that there is a situation on the right side that does not meet the scale line spacing. The scale lines above and below the deleted scale lines are found through the missing numbers, and the spacing between the upper and lower adjacent scale lines is calculated. Spacing / mean2 is used to calculate how many slices the deleted part is divided into (the result of slice is rounded off). If slice is equal to 1, there is no accidental deletion. If slice is greater than 1, then slice-1 scale lines are added with spacing / slice as the spacing.

[0124] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.

[0125] Specific implementation method 7: This implementation method is different from any one of specific implementation methods 1 to 6 in that in step S7, the scale mark set obtained in step S6 is verified to obtain the final left and right scale mark set; the specific process is:

[0126] Perform left-right cross validation on the tick marks to fill in the tick marks that may be lost on the left and right sides. The specific process is as follows:

[0127] From top to bottom, the left and right scale line sets P L {p l_1 ,...,p l_m ,...,p l_M}、P R {p r_1 ,...,p r_n ,...,p r_N}Perform cross-validation and fill in the mistakenly deleted tick marks;

[0128] in,

[0129] p l_mRepresents the mth tick mark in the left tick mark set, which contains the coordinates p of the centroid of the tick mark l_m_q , the coordinates of the upper left corner of the minimum enclosing rectangle p l_m_lt , the coordinates of the upper right corner of the minimum enclosing rectangle p l_m_rt , that is, p l_m {p l_m_q , p l_m_lt , p l_m_rt};

[0130] p r_n Represents the mth tick mark in the right tick mark set, which contains the coordinates of the centroid of the tick mark p r_n_q , the coordinates of the upper left corner of the minimum enclosing rectangle p r_n_lt , the coordinates of the upper right corner of the minimum enclosing rectangle p r_n_rt , that is, p r_n {p r_n_q ,p r_n_lt ,p r_n_rt};

[0131] The cross validation formula is as follows:

[0132] θ-3°<arctan(f k (p l_m_q ,p r_n_q ))<θ+3°,min{d(p l_m_q ,p r_n_q )}

[0133]

[0134] f k () represents the slope function; d() represents the calculation of the Euclidean distance between two points; θ represents the slope;

[0135] p l_m_q (x1,y1) represents the centroid point p of the scale line l_m_q The horizontal and vertical coordinates of r_n_q (x2,y2) represents the centroid point p of the scale line r_n_q The horizontal and vertical coordinates of

[0136] Traverse the left tick mark p l_m , find the distance p l_m_q The coordinates of the nearest right tick mark centroid point p r_n_q ;

[0137] Calculate p l_m_q and p r_n_q The slope between two points determines whether the slope is within θ±3°. The size of θ is determined by the slopes of the scale lines on both sides. In order to make the formula more robust, a margin of 3° is added.

[0138] If the slope is within θ±3°, the left and right scale lines are considered to meet the cross-validation requirements;

[0139] If the slope is not within θ±3° and there are scale lines that do not meet the cross-validation requirements, it means that there are missing scale lines. The scale lines are filled by calculating the spacing between scale values. The formula is as follows:

[0140]

[0141] y l ,y r Respectively represents the vertical coordinates of the left and right scale lines, length l 、length r Respectively represent the length of the left and right scale lines;

[0142] l up , l down Respectively represent the distance between the left scale line and the upper and lower scale lines, r up 、r down Respectively represent the distance between the right scale line and the upper and lower scale lines;

[0143] pitch1 is the average distance between the left scale lines, and pitch2 is the average distance between the right scale lines;

[0144] y r =y l , length r =length l Indicates filling the scale line on the right (if Fill in the space between the current tick mark and the previous tick mark on the right. Fill between the current tick mark and the next tick mark on the right);

[0145] y l =y r , length l =length r Indicates filling the scale line on the left (if Fill in the space between the current tick mark and the previous tick mark on the left. Fills the space between the current tick mark and the next tick mark on the left).

[0146] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0147] Specific implementation eight: This implementation is different from any one of specific implementations one to seven in that, in step S8, the number of long scale lines is verified by the mantissa method based on the result of step S7 to determine whether the long scale lines meet the requirements. If they meet the requirements, they are retained and step S9 is executed; otherwise, an alarm is issued to indicate that the scale lines are missing. The specific process is as follows:

[0148] The left scale lines in the result of step S7 are numbered in order from top to bottom; then they are sorted in descending order by length, and the 11 longest scale lines are selected as long scale lines; the numbers of the 11 long scale lines are recorded, and a remainder operation is performed on the numbers; if the types of remainders are less than three and the number of times the most frequently occurring mantissa is greater than 8, then it is considered that the long scale line meets the requirements and is retained; otherwise, an alarm is issued to prompt that the scale line is missing;

[0149] Take the first long scale line numbered 5 as an example. If there are no missing scale lines, the remaining long scale lines are numbered 15, 25, 35, ..., 105, all with a last digit of 5; if any scale line is missing between the first and second long scale lines, the second long scale line is numbered 14, and the last digits of the long scale lines thereafter are all 4; if any scale line is missing between the first and second long scale lines, and two scale lines are missing between the fifth and sixth scale lines, the sixth scale line is numbered 52, and the last digits of the scale lines thereafter are all 2; there are two types of remainders above (4, 2), if the last digit with the highest frequency is 2 and the number of 2 is 9 times, it meets the requirements;

[0150] The right scale lines in the result of step S7 are numbered in order from top to bottom; then they are sorted from largest to smallest in length, and the 11 longest scale lines are selected as long scale lines; the numbers of the 11 long scale lines are recorded, and a remainder operation is performed on the numbers; if the types of remainders are less than three and the number of times the most frequently occurring mantissa is greater than 8, then it is considered that the long scale line meets the requirements and is retained; otherwise, an alarm is issued to prompt that the scale line is missing;

[0151] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0152] Specific implementation method 9: This implementation method is different from the specific implementation methods 1 to 87 in that, in step S9, based on the gradient map of the liquid level map obtained in step S2 and the final left and right scale line set retained in step S8, the scale line liquid level ordinate is read; the specific process is:

[0153] The starting point of the x-coordinate for the left liquid level search is 0, and the end point is the leftmost coordinate of the scale line; read the vertical coordinate of the liquid level, traverse the pixels of the gradient map of each row of the liquid level map, record each pixel point that is not 0, and accumulate the number of each row; the y-coordinate of the row with the largest number is the vertical coordinate of the left liquid level;

[0154] The starting point for searching the right liquid level is the x-coordinate of the rightmost scale line, and the end point is the rightmost pixel of the image; read the vertical coordinate of the liquid level, traverse the pixels of the gradient map of each row of the liquid level map, record each pixel point that is not 0, and accumulate the number of each row; the y-coordinate of the row with the largest number is the vertical coordinate of the right liquid level;

[0155] Compare the liquid level ordinate with the ordinates of all long scale lines, find out the long scale line number k under the liquid level ordinate (numbered from top to bottom, small at the top and large at the bottom, the first line is numbered 0), and obtain the left and right liquid level readings Left_reading and Right_reading;

[0156] The left and right liquid level readings Left_reading and Right_reading are:

[0157]

[0158] in,

[0159] long_scaly represents the number of long scale lines on the dial, which is 11 in this implementation;

[0160] Division indicates how many segments the long scale lines are divided into, which is 10 in this implementation.

[0161] left_scaly_mark is the ordinate of the liquid level on the left, and right_scaly_mark is the ordinate of the liquid level on the right;

[0162] left[k] represents the coordinate of the k-th long scale line on the left, and right[k] represents the coordinate of the k-th long scale line on the right;

[0163] difference_left[k] represents the difference in y coordinates between the kth long scale line on the left and the k-1th long scale line;

[0164] difference_right[k] represents the difference in y coordinates between the kth long tick line on the right and the k-1th long tick line.

[0165] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.

[0166] Specific embodiment 10: This embodiment is a pipeline pressure detection device for an agricultural irrigation system, the device includes a processor and a memory. It should be understood that including any device including a processor and a memory described in the present invention, the device may also include other units and modules that perform display, interaction, processing, control, etc. and other functions through signals or instructions;

[0167] At least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the pipeline pressure detection method of the agricultural irrigation system.

[0168] The present invention may also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. A pipeline pressure detection method for an agricultural irrigation system, characterized in that: The specific process of the method is: Step S1, taking a picture of the U-tube pressure gauge, and cropping the U-tube pressure gauge area in the picture; performing Fourier-Mellin transform on the cropped U-tube pressure gauge area picture to obtain a vertical RGB picture of the U-tube pressure gauge; The x-axis is horizontal to the scale line, and the y-axis is vertical to the scale line. Step S2, converting the vertical RGB image of the U-tube manometer obtained in step S1 into an image of the U-tube manometer in the HSV color space; Set the liquid level gradient threshold; set all pixels in the U-tube image that are smaller than the liquid level gradient threshold to 0 and regard them as the background image, and regard the remaining pixels as the liquid level map, and extract the liquid level map; The liquid level map is processed by the sobel operator to obtain the gradient map of the liquid level map; The obtained gradient map of the liquid level map is suppressed and expanded in sequence along the y direction to obtain an image after the expansion operation, and the image after the expansion operation is the gradient map of the liquid level map; Step S3, using the Sobel operator to process the vertical RGB image of the U-tube pressure gauge obtained in step S1 to obtain an RGB gradient image, and then binarizing the RGB gradient image to change all pixel values ​​that are not 0 to 1 to obtain a binary image; Traverse each column of pixels in the binary image, count the number of pixels in each column whose pixel values ​​change from 0 to 1 and from 1 to 0, determine the position and length information of the scale line in the image, and crop the scale line gradient map; Step S4, suppressing, expanding, and regularizing the scale line gradient image obtained in step S3 in the y direction in sequence to obtain a regularized image, denoising the regularized image, and dividing the scale value of the denoised image into two parts, a left part and a right part; Step S5, filtering the connected domains of the left and right parts obtained in step S4 to obtain filtered scale lines; Step S6, based on the scale lines obtained in step S5, reconstructing the scale lines by scale line spacing and numbering to obtain a scale line set; Step S7, verifying the scale mark set obtained in step S6 to obtain a final left and right scale mark set; Step S8, based on the result of step S7, verify the number of long scale lines by the mantissa method, and determine whether the long scale lines meet the requirements. If they meet the requirements, they are retained and step S9 is executed; otherwise, an alarm is issued to prompt that the scale lines are missing; Step S9, based on the gradient map of the liquid level map obtained in step S2 and the final left and right scale line sets retained in step S8, read the scale line liquid level ordinates.

2. The pipeline pressure detection method of an agricultural irrigation system according to claim 1, characterized in that: In step S1, the cropped U-tube pressure gauge area image is subjected to Fourier-Mellin transform to obtain a vertical RGB image of the U-tube pressure gauge; the specific process is: The center line of the scale line of the U-tube manometer is adjusted to be perpendicular to the horizontal plane to obtain a vertical RGB image of the U-tube manometer.

3. The pipeline pressure detection method of an agricultural irrigation system according to claim 2, characterized in that: In step S2, the gradient map of the obtained liquid level map is suppressed and expanded in the y direction in sequence to obtain an image after the expansion operation, and the image after the expansion operation is the gradient map of the liquid level map; the specific process is: Step S21, suppressing the obtained gradient map in the y direction in sequence to obtain a suppressed gradient map; the specific process is: 1) Get each continuous area in the first column of the gradient map; Determine the number of rows occupied by each continuous area in the first column; If the continuous area occupies only one row, the continuous area is retained; If the continuous area occupies 2 rows, if the pixel values ​​of the two rows are the same, take the upper row of the two rows as the position of the continuous area, and delete the lower row of the two rows; if the pixel values ​​of the two rows are different, take the row with the larger pixel value as the position of the continuous area, and delete the row with the smaller pixel value; If the continuous area occupies more than 2 rows, determine whether the continuous area occupies an odd row or an even row. If it is an odd row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the middle row of the odd row, and delete the rows other than the middle row; if it is an even row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the next row of the middle row of the even row, and delete the rows other than the next row of the middle row; 2) Get each continuous area in the second column of the gradient map; Determine the number of rows occupied by each continuous area in the second column; If the continuous area occupies only one row, the continuous area is retained; If the continuous area occupies 2 rows, if the pixel values ​​of the two rows are the same, take the upper row of the two rows as the position of the continuous area, and delete the lower row of the two rows; if the pixel values ​​of the two rows are different, take the row with the larger pixel value as the position of the continuous area, and delete the row with the smaller pixel value; If the continuous area occupies more than 2 rows, determine whether the continuous area occupies an odd row or an even row. If it is an odd row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the middle row of the odd row, and delete the rows other than the middle row; if it is an even row, take the maximum value of all pixel values ​​in the continuous area as the pixel value of the next row of the middle row of the even row, and delete the rows other than the next row of the middle row; 3) Repeat step 2) until all continuous regions in all columns in the gradient map are determined; Step S22: Perform a dilation operation on the suppressed gradient image using a 3x3 convolution kernel to obtain an image after the dilation operation, where the image after the dilation operation is a gradient image of the liquid level map.

4. The pipeline pressure detection method of an agricultural irrigation system according to claim 3, characterized in that: In step S3, the vertical RGB image of the U-tube pressure gauge obtained in step S1 is processed using a sobel operator to obtain an RGB gradient image, and then the RGB gradient image is binarized to convert all scale values ​​that are not 0 to 1 to obtain a binary image; Traverse each column of pixels in the binary image, count the number of pixels in each column whose pixel values ​​change from 0 to 1 and from 1 to 0, determine the position and length information of the scale line in the image, and crop the scale line gradient map; The specific process is: Step S31: The vertical RGB image of the U-tube pressure gauge obtained in step S1 is processed using the Sobel operator to obtain an RGB gradient image, and then the RGB gradient image is binarized to convert all scale values ​​that are not 0 to 1 to obtain a binary image; Perform dimensionality reduction on the binary image to obtain a binary image after dimensionality reduction; The number of pixels in each column of the binary image after dimensionality reduction that change from 0 to 1 and from 1 to 0 is accumulated to obtain the number of pixel jumps in each column. The expression is: Where count[j] is the count of the jth column; col is the number of image column vectors, and row is the number of image row vectors; p (i,j) represents the pixel value of the pixel in the i-th row and j-th column of the image; p (i+1,j) Represents the pixel value of the pixel in the i+1th row and jth column of the image; The number of pixel jumps in each column is stored in the image count, where the number of rows in count is 1 and the number of columns is col; The jump is the pixel value changing from 0 to 1 or from 1 to 0; Step S32: 1) Set the threshold of the number of pixels in the connected domain, and set the pixel values ​​in the image count that are less than the threshold to 0; 2) Calculate F through connected domain analysis c Get the connected domain set in the image count; the expression is: C N {c1,c2,......,c n }=F c (count) Among them, C N is the set of all connected domains obtained after the connected domain analysis; c1 represents the first connected domain, c2 represents the second connected domain, and c n is the nth connected domain; c n Contains {x l_n , x r_n , x n }, x l_n is the x-axis coordinate of the leftmost pixel in the nth connected domain, x r_n is the x-axis coordinate of the rightmost pixel in the nth connected domain, x n is the number of pixels in the nth connected domain; 3) Select the connected domain set C N The connected domains with the first and second largest number of pixels in the image are taken as the connected domain S N ; The expression is: S N {s1,s2}=Max 1,2 (C N ) Among them, Max 1,2 To find the connected domain set C N The connected domains with the top two pixel numbers in S N is the connected domain set where the scale line is located; s1 is the connected domain set C N The connected domain with the largest number of pixels in the s2 is the connected domain set C N The connected domain with the second largest number of pixels; 4) The x-axis coordinate x of the leftmost pixel of the connected domain s1 l_1 and the rightmost pixel x-coordinate r_1 Get the length of the scale line of the connected domain s1; the expression is: The length of the scale line of the connected domain s1 is length = X r_1 -X l_1 The x-axis coordinate x of the leftmost pixel in the connected domain s2 l_2 and the rightmost pixel x-coordinate r_2 Get the length of the scale line of the connected domain s2; the expression is: The length of the scale line of the connected domain s2 is length = X r_2 -X l_2 5) Select the x-axis coordinates of the leftmost pixels in the connected domain s1 and the connected domain s2, as well as the x-axis coordinates of the rightmost pixels in the connected domain s1 and the connected domain s2; Subtract 20 pixels from the leftmost x-axis coordinate as the starting position of the scale line image; The rightmost x-axis coordinate plus 20 pixels is used as the end position of the scale line image.

5. The pipeline pressure detection method of an agricultural irrigation system according to claim 4, characterized in that: In step S5, the connected domains of the left and right parts obtained in step S4 are filtered to obtain the filtered scale lines; the specific process is: Step S51, using straightness to screen and remove the miscellaneous lines from the scale lines of the left and right parts of the denoised image obtained in step S4; the specific process is: Keep the scale lines that meet the following connected domain judgment conditions: Among them, p m_n represents the number of pixels in the mth connected domain; x m_lt Indicates the horizontal coordinate of the upper left corner pixel of the minimum circumscribed rectangle of the mth connected domain, x m_rb Indicates the horizontal coordinate of the lower right corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_lt Indicates the ordinate of the upper left corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_rb represents the vertical coordinate of the lower right corner pixel of the minimum circumscribed rectangle of the mth connected domain; x m_rt Indicates the horizontal coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the mth connected domain, x m_lb Indicates the horizontal coordinate of the lower left corner pixel of the minimum circumscribed rectangle of the mth connected domain, y m_rt Indicates the upper right corner pixel y coordinate of the minimum circumscribed rectangle of the mth connected domain m_lb Represents the lower left corner pixel ordinate of the minimum circumscribed rectangle of the mth connected domain; threshold represents the fill threshold; Step S52, using the length of the scale lines to filter out the scale lines on the left and right sides after the miscellaneous lines are removed in step S51; the specific process is: Keep tick marks that meet the following conditions: |x m_lt -x m_rt |+|x m_lb -x m_rb |>length Among them, length indicates the length of the left or right scale line; Step S53, using the weighted least square method to screen and remove the miscellaneous lines from the scale lines on the left and right sides after the miscellaneous lines are removed in step S52; the specific process is: |x m_q -intercept|<length Among them, x m_q Represents the centroid point p of the mth scale line m_q The x-coordinate of the scale; N represents the total number of scale lines; λ m represents weight; y m_q Represents the centroid point p of the mth scale line m_q The y coordinate of the fitted line; slope represents the slope of the fitted line, and intercept represents the intercept of the fitted line; Calculate the distance between all centroid points of all connected domains on the left and right minus the intercept, and delete the scale lines whose absolute value of the distance is greater than the length of the left and right scale lines; Step S54, using the scale line interval to screen and remove the miscellaneous lines from the scale lines on the left and right parts after the miscellaneous lines are removed in step S53; the specific process is: Keep tick marks that meet the following conditions: Among them, y m-1_rt Indicates the y coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the m-1th connected domain, m-1_lb The y represents the lower left corner pixel ordinate of the minimum circumscribed rectangle of the m-1th connected domain; m_rt Indicates the y coordinate of the upper right corner pixel of the minimum circumscribed rectangle of the m-1th connected domain, m_lb It represents the vertical coordinate of the lower left corner pixel of the minimum circumscribed rectangle of the mth connected domain; pitch_mean represents the average distance between scale lines.

6. The method for detecting pipeline pressure of an agricultural irrigation system according to claim 5, characterized in that: In step S6, the scale lines obtained in step S5 are reconstructed by scale line spacing and numbering to obtain a scale line set. The specific process is as follows: Number the tick marks on the left and right sides, calculate the average value mean1 of the intervals between the tick marks on the left and right sides, delete the tick marks and tick mark numbers with intervals greater than 0.7mean1 and less than 1.3mean1, and calculate the average value mean2 of the intervals between the tick marks on the left and right sides again; If the left scale lines are numbered continuously, it is considered that the connected domains on the left all meet the scale line interval conditions and do not need to be rebuilt; If the right scale lines are numbered continuously, it is considered that the right connected domains all meet the scale line interval conditions and do not need to be rebuilt; If the left scale lines are discontinuous, it is considered that there is a situation where the scale line interval on the left side does not meet the requirement. The scale lines above and below the deleted scale lines are found through the missing numbers, and the spacing between the upper and lower adjacent scale lines is calculated. The deleted part is divided into several slices using spacing / mean2. If slice is equal to 1, there is no mistaken deletion. If slice is greater than 1, slice-1 scale lines are added with spacing / slice as the spacing. If the scale lines on the right are discontinuous, it is considered that there is a situation on the right side that does not meet the scale line spacing. The scale lines above and below the deleted scale lines are found through the missing numbers, and the spacing between the upper and lower adjacent scale lines is calculated. The deleted part is divided into several slices using spacing / mean2. If slice is equal to 1, there is no accidental deletion. If slice is greater than 1, then slice-1 scale lines are added with spacing / slice as the spacing.

7. The method for detecting pipeline pressure of an agricultural irrigation system according to claim 6, characterized in that: In step S7, the scale mark set obtained in step S6 is verified to obtain the final left and right scale mark set; the specific process is: From top to bottom, the left and right scale line sets P L {p l_1 ,...,p l_m ,...,p l_M }、P R {p r_1 ,...,p r_n ,...,p r_N }Perform cross-validation and fill in the mistakenly deleted tick marks; in, p l_m Represents the mth tick mark in the left tick mark set, which contains the coordinates p of the centroid of the tick mark l_m_q , the coordinates of the upper left corner of the minimum enclosing rectangle p l_m_lt , the coordinates of the upper right corner of the minimum enclosing rectangle p l_m_rt , that is, p l_m {p l_m_q , p l_m_lt , p l_m_rt }; p r_n Represents the mth tick mark in the right tick mark set, which contains the coordinates of the centroid of the tick mark p r_n_q , the coordinates of the upper left corner of the minimum enclosing rectangle p r_n_lt , the coordinates of the upper right corner of the minimum enclosing rectangle p r_n_rt , that is, p r_n {p r_n_q ,p r_n_lt ,p r_n_rt }; The cross validation formula is as follows: θ-3°<arctan(f k (p l_m_q ,p r_n_q ))<θ+3°,min{d(p l_m_q ,p r_n_q )} f k ( ) represents the slope function; d( ) represents the calculation of the Euclidean distance between two points; θ represents the slope; p l_m_q (x1,y1) represents the centroid point p of the scale line l_m_q The horizontal and vertical coordinates of r_n_q (x2,y2) represents the centroid point p of the scale line r_n_q The horizontal and vertical coordinates of Traverse the left tick mark p l_m , find the distance p l_m_q The coordinates of the nearest right tick mark centroid point p r_n_q ; Calculate p l_m_q and p r_n_q The slope between two points, determine whether the slope is within θ±3°; If the slope is within θ±3°, the left and right scale lines are considered to meet the cross-validation requirements; If the slope is not within θ±3° and there are scale lines that do not meet the cross-validation requirements, it means that there are missing scale lines. The scale lines are filled by calculating the spacing between scale values. The formula is as follows: y l ,y r Respectively represent the vertical coordinates of the left and right scale lines, Length l , Length r Respectively represent the length of the left and right scale lines; l up , l down Respectively represent the distance between the left scale line and the upper and lower scale lines, r up 、r down Respectively represent the distance between the right scale line and the upper and lower scale lines; pitch1 is the average distance between the left scale lines, and pitch2 is the average distance between the right scale lines; y r =y l , length r =length l Indicates filling the tick mark on the right; y l =y r , length l =length r Indicates filling the tick mark on the left.

8. The method for detecting pipeline pressure of an agricultural irrigation system according to claim 7, characterized in that: In step S8, the number of long scale lines is verified by the mantissa method based on the result of step S7 to determine whether the long scale lines meet the requirements. If they meet the requirements, they are retained and step S9 is executed; otherwise, an alarm is issued to indicate that the scale lines are missing; The specific process is: The left scale lines in the result of step S7 are numbered in order from top to bottom; then they are sorted in descending order by length, and the 11 longest scale lines are selected as long scale lines; the numbers of the 11 long scale lines are recorded, and a remainder operation is performed on the numbers; if the types of remainders are less than three and the number of times the most frequently occurring mantissa is greater than 8, then it is considered that the long scale line meets the requirements and is retained; otherwise, an alarm is issued to prompt that the scale line is missing; The right scale lines in the result of step S7 are numbered in order from top to bottom; then they are sorted by length from large to small, and the 11 longest scale lines are selected as long scale lines; the numbers of these 11 long scale lines are recorded, and the numbers are calculated by remainder; if there are less than three types of remainders and the number of times the most frequently occurring mantissa is greater than 8, then it is considered that the long scale lines meet the requirements and are retained; otherwise, an alarm is issued to indicate that the scale lines are missing.

9. A pipeline pressure detection method for an agricultural irrigation system according to claim 8, characterized in that: In the step S9, based on the gradient map of the liquid level map obtained in step S2 and the final set of left and right scale lines retained in step S8, the vertical coordinates of the scale line liquid levels are read; The specific process is: The starting point of the x-coordinate for the left liquid level search is 0, and the end point is the leftmost coordinate of the scale line; read the vertical coordinate of the liquid level, traverse the pixels of the gradient map of each row of the liquid level map, record each pixel point that is not 0, and accumulate the number of each row; the y-coordinate of the row with the largest number is the vertical coordinate of the left liquid level; The starting point for searching the right liquid level is the x-coordinate of the rightmost scale line, and the end point is the rightmost pixel of the image; read the vertical coordinate of the liquid level, traverse the pixels of the gradient map of each row of the liquid level map, record each pixel point that is not 0, and accumulate the number of each row; the y-coordinate of the row with the largest number is the vertical coordinate of the right liquid level; Compare the liquid level ordinate with the ordinates of all long scale lines, find out the long scale line number k under the liquid level ordinate, and obtain the left and right liquid level readings Left_reading and Right_reading; The left and right liquid level readings Left_reading and Right_reading are: in, long_scaly indicates the number of long scale lines on the dial; Division indicates how many segments the long scale lines are divided into; left_scaly_mark is the ordinate of the liquid level on the left, and right_scaly_mark is the ordinate of the liquid level on the right; left[k] represents the coordinate of the k-th long scale line on the left, and right[k] represents the coordinate of the k-th long scale line on the right; difference_left[k] represents the difference in y coordinates between the kth long scale line on the left and the k-1th long scale line; difference_right[k] represents the difference in y coordinates between the kth long tick line on the right and the k-1th long tick line.

10. A pipeline pressure detection device for an agricultural irrigation system, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a pipeline pressure detection method for an agricultural irrigation system as described in any one of claims 1 to 9.