A method for automatically extracting precipitation data from precipitation self-recording paper images

CN117542034BActive Publication Date: 2026-09-01NANJING UNIV OF AERONAUTICS & ASTRONAUTICS +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311447744.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2026-09-01
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

[0005]发明目的:针对现有水文观测中对于降水自记仪器自动绘制的降水迹线图无法准确的识别降水量等问题,本发明提供一种降水自记纸图片降水量数据自动提取方法

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117542034B_ABST
    Figure CN117542034B_ABST
Patent Text Reader

Abstract

This invention discloses an automatic method for extracting precipitation data from precipitation recorder images, belonging to the field of hydrological processing technology. First, based on the color and positional characteristics of typical precipitation tracks, the effective precipitation image information added by the precipitation recorder on the precipitation recorder is extracted. Then, a suitable recognition direction is selected based on the local direction of the precipitation track to mark the boundary of the precipitation track. Next, based on the monotonicity and continuity of the precipitation track, jagged edges and gaps are corrected, and the center position of the corrected precipitation track is calculated. The top, bottom, left, and right edges of the table are detected and determined using a probe group, and the table lines of the table area containing the precipitation track are reconstructed. Finally, for each pixel of the precipitation track, the time represented by the pixel is calculated using its position on the horizontal axis of the table, and the precipitation represented by the pixel is calculated using its position on the vertical axis of the table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hydrological data and image processing, specifically based on image processing technology, and particularly a method for automatically extracting precipitation data from precipitation self-recording paper images. Background Technology

[0002] Hydrological data is crucial for flood and drought disaster prevention, water resource management, and water conservancy project construction. Since the 1840s, my country has used standard rain gauges to accumulate precipitation data. From the founding of the People's Republic of China until the 1990s, with the widespread application of siphon-type self-recording rain gauges, precipitation observation at hydrological stations shifted from manual, segmented observation to continuous self-recording by rain gauges. Daily precipitation changes were recorded on standardized precipitation recording paper, resulting in a large volume of hydrological archives. These records reflect the temporal variation of precipitation in specific regions and are of significant value in the analysis of hydrological spatiotemporal patterns. Currently, a large amount of precipitation recording data is preserved in the form of daily precipitation results and image records after hydrological data compilation and scanning of the recording paper. In in-depth hydrological analysis applications during extreme weather events such as rainstorms and typhoons, the process data of each precipitation event is particularly important. However, the process precipitation data contained in these precipitation recording paper images is difficult to directly read and apply. How to convert unstructured image data into directly usable digital data is an urgent problem to be solved.

[0003] Currently, most precipitation log image data extraction relies on manual reading. However, due to the massive volume of hydrological archives and the diverse granularity requirements for data reading across different applications, manual reading is inefficient. Furthermore, the actual conditions of precipitation log images are complex, lacking strong uniformity. For example, a single precipitation log often records precipitation data from multiple days repeatedly; precipitation tracks may be too faint or partially missing due to instrument malfunctions; and precipitation tracks may be contaminated by ink blots, human annotations, or instrument adjustments. Therefore, it is necessary to utilize information technology to develop an efficient and accurate automated extraction method to read process rainfall data from precipitation log images.

[0004] A search revealed very few publicly available methods for automatically extracting precipitation data from rain gauge self-recording images that are practically applicable. Xiong Chuansheng, Ai Ping, Yuan Dingbo, and others proposed a rain gauge self-recording data acquisition method (CN 111523382A), which first identifies and locates the table area of ​​the precipitation self-recording image, uses the non-table lines of this area as precipitation tracks, and then determines the precipitation data for the current time based on the vertical position of the precipitation tracks. However, this method cannot effectively handle relatively complex precipitation self-recording images. Summary of the Invention

[0005] Purpose of the invention: To address the problem that existing hydrological observations cannot accurately identify precipitation amounts from precipitation trace maps automatically drawn by precipitation recording instruments, this invention provides a method for automatically extracting precipitation data from precipitation recording paper images.

[0006] Technical Solution: A method for automatically extracting precipitation data from precipitation recording paper images. The method is applied to image information added by a precipitation recording instrument on precipitation recording paper, and also includes calculating precipitation at various time points in the monitored area based on identified precipitation tracks. The steps include:

[0007] S1. Precipitation Track Recognition: First, precipitation track pixels are identified based on the color characteristics of typical precipitation tracks, including the identification of suspected precipitation track pixels whose color changes due to overlap with table lines and markers. Then, interference from factors such as pollution in the image is eliminated based on spatial neighborhood features to further identify precipitation tracks. Finally, the precipitation record paper image is binarized to display only black precipitation tracks.

[0008] S2. Precipitation Track Extraction: Delete invalid track portions unrelated to precipitation amount from the precipitation track. Determine the identification direction based on the local direction of the precipitation track and mark the boundary of the precipitation track. Then, repair jagged edges and gaps in the precipitation track based on its monotonicity and continuity. Finally, calculate the center position of the repaired precipitation track.

[0009] S3. Table line restoration: By adding probe groups at the edge of the table, the top, bottom, left and right edges of the table are detected and determined; based on the uniform distribution of horizontal and vertical table lines in the precipitation record paper, the table lines of the table area where the precipitation traces are located are reconstructed.

[0010] S4. Precipitation Calculation: For each pixel of the precipitation trace, calculate the time represented by the pixel using its position on the horizontal axis of the table, and calculate the amount of precipitation represented by the pixel using its position on the vertical axis of the table.

[0011] Furthermore, step S1 is detailed as follows:

[0012] S11. Based on the precipitation recording paper image drawn by the precipitation recording instrument, collect pixel points and determine the color difference value between different colors to identify precipitation traces, including obtaining the RGB color range value of precipitation traces by collecting precipitation traces of different shades.

[0013] S12. Compare the RGB values ​​of some pixels in the precipitation trace with the pixels that overlap with the grid lines of the table or the ink marks of the precipitation recording instrument with the range values ​​obtained in step S11. This also includes determining the range of the difference between any two of the R, G, and B values ​​based on the trace color, and then determining the pixels that are suspected precipitation traces based on this. Then, determine whether the pixels that are suspected precipitation traces are precipitation traces based on the spatial domain.

[0014] S13. Binarize the precipitation record paper image, where the precipitation traces are black and other elements are white;

[0015] S14. Construct a rectangular window that runs horizontally through the trace area. Let the window traverse the entire trace area from bottom to top. Calculate the number of projected pixels of the precipitation data trace in the horizontal direction within the window area during each traversal. If the number of projected pixels is greater than a specified threshold and there are other precipitation traces above it, then it is determined that there are invalid horizontal data lines within the window.

[0016] S15. Delete invalid precipitation tracks, but retain the intersection of the horizontal precipitation track and the target precipitation track. Traverse the pixels along the lower edge of the horizontal precipitation track from left to right in a rectangular window, and explore vertically from bottom to top within twice the window height above the pixel to see if there are enough black pixels. If there are enough black pixels, determine that the pixel is the intersection of the horizontal precipitation track and the normal precipitation track, and retain the horizontal data line part at that position. If there are not enough black pixels, delete the black pixels on the horizontal data line at the current position.

[0017] S16. Scan the precipitation trace from left to right. If the vertical position of the precipitation trace pixel drops by more than 1 / 3 of the maximum height of the precipitation trace, it is suspected to be the position of the fold line. Based on this position, select the fold line before this position and project it in the horizontal direction. If the projection length is greater than the threshold, it means that the precipitation trace has correctly risen to the highest point, that is, the suspected position is indeed the position of the fold line.

[0018] S17. Divide each fold line into two segments: upper and lower. Find the bifurcation points between the upper and lower precipitation traces and the fold line, and delete the fold lines between the bifurcation points to retain more precipitation traces.

[0019] Furthermore, step S2 specifically includes:

[0020] S21. Identify precipitation tracks. For track segments that tend to be vertical, use a horizontal identification method to identify the boundaries; for track segments that tend to be horizontal, use a vertical identification method to identify the boundaries.

[0021] S22. Based on the identified precipitation trace boundary, repair the boundary according to the monotonicity and continuity of the precipitation trace. This includes repairing the case where the vertical position of the subsequent pixel in the precipitation trace boundary is lower than that of the preceding pixel based on the monotonicity of the precipitation trace segment, and repairing the blanks in the precipitation trace based on the continuity of the precipitation trace.

[0022] S23. Based on the upper and lower boundaries of the extracted and restored precipitation traces, calculate the center position of the precipitation traces from both longitudinal and transverse directions, according to the horizontal and vertical inclination of the precipitation traces.

[0023] Further, the specific calculation of step S22 is as follows:

[0024] Regarding a certain precipitation trace boundary as the function y=f(x) in the rectangular coordinate system, for any two adjacent points x1 and x2 within the domain of the function, if x1<x2 and y=f(x) is undefined within the interval (x1,x2), that is, it does not conform to the property of function continuity, so repair is required;

[0025] First calculate the difference between f(x2) and f(x1) and the difference between x2 and x1:

[0026]

[0027] Form two right-angle sides of a right triangle with Δx and Δy, and calculate the slope according to trigonometric functions:

[0028]

[0029] Calculate the variation of f(x) with the change of x according to the slope, add the variation Δf(x) of f(x) to f(x1) at the starting point to obtain the final f(x), and keep f(x1) and f(x2) at the starting point and end point unchanged:

[0030]

[0031] Further, step S3 specifically includes:

[0032] S31, select n probe base positions on the upper and lower boundaries of the table, and use m probes near each probe base position to detect the coordinates of the upper and lower edges of the table line;

[0033] When obtaining the upper edge coordinate of the table, scan downward along the positive x-direction. If the scanned pixel is a background pixel of the image, continue detecting downward, and stop detecting until a pixel whose value is not within the RGB value range of background pixels is found; by comparing the coordinate values at the detection end positions of m probes, the maximum x-axis coordinate value is taken as the upper edge x-coordinate of the table line in this interval; on the contrary, when obtaining the lower edge coordinate of the table, scan upward along the negative x-axis direction, and stop detecting until a pixel whose value is not within the RGB value range of background pixels is scanned; by comparing the coordinate values at the detection end positions of m probes, the minimum x-axis coordinate value is taken as the lower edge x-coordinate of the table line in this interval;

[0034] S32, select n probe base positions on the left and right boundaries of the table, and obtain the left and right boundaries of the table according to the method of step S31;

[0035] S33. Based on the detected top, bottom, left and right boundary lines of the table, and based on the uniform distribution of horizontal and vertical table lines in the precipitation record paper, the table lines of the table area where the precipitation traces are located are reconstructed.

[0036] Furthermore, the calculation in step S4 is as follows:

[0037] Determine the number of pixels (count) on the horizontal axis every n minutes. n The starting position x on the horizontal axis is determined by the starting point of the i-th precipitation trace. left Calculate the position of the j-th minute on the horizontal axis:

[0038] x j =x left +count n ×j

[0039] Find the starting point y of the current table's vertical line. floor With the endpoint y top Iterate through the current table's vertical lines. If the current position is at the y-axis... now If there is a pixel with a precipitation trace, then record the time t corresponding to that pixel, denoted as:

[0040] t = t start +n×j

[0041] Among them, s tart Practice has begun for recording precipitation.

[0042] Since the vertical coordinates of each pixel in the table represent precipitation ranging from -0.5 to 10.5, the precipitation trace pixels can be analyzed based on their vertical coordinates (y, y). now Calculate the precipitation information data corresponding to time information t. t The calculation formula is as follows:

[0043]

[0044] Beneficial effects: The method proposed in this invention can extract precipitation data very efficiently and accurately, and can be promoted and applied nationwide. Furthermore, this method can be applied to the extraction of water level auto-recording image data within the hydrological industry, and the extracted results can provide important data support for the inversion analysis of historical major floods and typical typhoon water conditions. Attached Figure Description

[0045] Figure 1 This is a flowchart illustrating the method described in this invention;

[0046] Figure 2 It is a precipitation auto-recording map drawn by a precipitation auto-recording instrument;

[0047] Figure 3This is a schematic diagram of the results of precipitation track identification;

[0048] Figure 4 This is the result of the deletion of wireless precipitation tracks;

[0049] Figure 5 It is the result of the fold line positioning process;

[0050] Figure 6 This is the result of deleting the dashed line;

[0051] Figure 7 This is a schematic diagram of step S21, which involves detecting the tilt direction of precipitation tracks to identify boundaries.

[0052] Figure 8 This is a diagram showing the center of the precipitation trail;

[0053] Figure 9 shows the detection results of the upper and lower boundary lines of the table, where Figure 9(a) shows the detection results of the upper boundary line of the table and Figure 9(b) shows the detection results of the lower boundary line of the table. Detailed Implementation

[0054] To illustrate the technical solutions disclosed in this invention in detail, further description is provided below with reference to the accompanying drawings.

[0055] Firstly, as Figure 2 The image shown is a precipitation auto-recording map drawn by a precipitation auto-recording instrument, which is also a relatively common precipitation auto-recording method. Figure 2 It can be known that:

[0056] Precipitation logs drawn by precipitation instruments often contain multiple precipitation tracks recorded on the same logging paper. For example, as shown in curve (a), because the precipitation track is horizontal on sunny days, the same logging paper is often reused for further recording. Current technology does not document methods for accurately determining the vertical position of the target precipitation track, thus making it impossible to extract precipitation data. Heavy rain can also cause multiple folds in the logging paper, such as... Figure 2 As shown in curve (b); there are also some instances where a vertical trace is artificially created when the instrument ends recording, such as... Figure 2 As shown in curve (c), this makes it impossible for existing methods to determine the location of precipitation tracks, thus preventing the extraction of precipitation data. Furthermore, heavy rain can cause very steep precipitation tracks on the precipitation log, such as... Figure 2 As shown in curve (d), this results in a large longitudinal span of the precipitation track, making it difficult to determine the longitudinal center position of the precipitation track using existing methods, thus making it difficult to accurately read the data.

[0057] To address the aforementioned problems, this invention provides an automatic method for extracting precipitation data from precipitation record images, which can automatically extract precipitation data from relatively complex precipitation record images. Figure 1 The diagram shown is a flowchart of the automatic extraction method for precipitation data from precipitation self-recording paper images proposed in this invention.

[0058] The process of automatically extracting precipitation data from self-recorded precipitation images according to the present invention includes precipitation trace recognition, precipitation trace extraction, table line restoration, and precipitation calculation.

[0059] S1. Precipitation trail recognition: First, precipitation trail pixels are identified based on the color features of typical precipitation trails, including the identification of suspected precipitation trail pixels whose color changes due to overlap with table lines and markers. Then, interference from factors such as pollution in the image is eliminated based on spatial neighborhood features to further identify precipitation trails. Finally, the precipitation record paper image is binarized to display only black precipitation trails.

[0060] S2. Precipitation trace restoration: Delete invalid trace parts that are irrelevant to precipitation amount, that is, only retain the precipitation trace parts needed to read precipitation data, and calculate the center position of the precipitation trace (which has a certain width).

[0061] The appropriate identification direction is selected based on the local direction of the precipitation track (whether it tends to be horizontal or vertical) to mark the boundary of the precipitation track; based on the monotonicity and continuity of the precipitation track, problems such as jaggedness and gaps in the precipitation track are repaired; the center position of the precipitation track after repair is calculated.

[0062] S3. Table line restoration, which restores the table lines in the precipitation record paper table area.

[0063] By adding probe groups at multiple locations on the top, bottom, left, and right edges of the table, the top, bottom, left, and right edges of the table are detected and determined; based on the uniform distribution of horizontal and vertical table lines in the precipitation record paper, the table lines of the table area where the precipitation traces are located are reconstructed.

[0064] S4. Precipitation calculation: For each pixel of the precipitation trace, calculate the time represented by the pixel using its position on the horizontal axis of the table, and calculate the amount of precipitation represented by the pixel using its position on the vertical axis of the table.

[0065] Specifically, the steps of this method are as follows:

[0066] S1, Precipitation Track Recognition

[0067] S11, extracting precipitation traces based on typical colors. Since the purple (or blue) ink used by precipitation self-recording instruments is uniform, 1000 pixel points are first sampled based on precipitation traces of different depths to obtain the RGB color range of the pixel points. Taking purple precipitation traces as an example, its RGB color range is |R value - G value|>20, 24<R value<220, and B value>32.

[0068] S12, further extracting precipitation traces based on spatial neighborhoods. Some pixel points in the precipitation traces overlap with pixels overlapping table grid lines or pencil handwriting, so their colors are not within the RGB color range of typical precipitation traces, resulting in discontinuous extracted precipitation traces.

[0069] S121, extracting suspected precipitation trace pixels according to color: if the RGB color of the pixel satisfies that the B value is the minimum among R, G, and B values, G value - B value<20, R value - B value<20, 24<R value<190 and B value>32, or the absolute value of G value - B value≤8, 200<R value<220 and B value>32, the pixel is determined as a suspected precipitation trace pixel.

[0070] S122, checking whether there is a precipitation data trace point in the 3*3 spatial neighborhood centered on the current suspected precipitation data trace pixel point. If yes, mark this suspected precipitation trace pixel as a precipitation trace pixel. Repeat this step until the set of precipitation trace pixels no longer changes.

[0071] S13, binarizing the precipitation autographic paper image, with the precipitation traces being black and other elements being white, to form Figure 3 the result shown in .

[0072] S14, searching for invalid precipitation traces. Construct a rectangular window that penetrates the trace area from left to right and has a height of 24 pixels, and let the window traverse the entire trace area from bottom to top. Calculate the number of projection pixels of the precipitation data trace in the window area in the horizontal direction during each traversal. If the number of pixel projections is greater than the specified threshold, and there are still other precipitation traces above it (that is, a large number of black pixels can be detected), it can be determined that there is a horizontal invalid data line in the window.

[0073] S15. Delete Invalid Precipitation Tracks: After identifying all horizontal precipitation tracks, they need to be deleted. It's crucial not to delete the intersections of horizontal precipitation tracks and target precipitation tracks, as this will break the target precipitation data track. Use a rectangular window with a height of 16 and a width of 8 to traverse the pixels along the lower edge of the horizontal precipitation track from left to right. Vertically explore from bottom to top within twice the window height above each pixel to see if there are enough black pixels. If enough black pixels exist, determine that the pixel is at the intersection of a horizontal precipitation track and a normal precipitation track, and retain the horizontal data line portion at that location. If there are not enough black pixels, delete the black pixels on the current horizontal data line. Figure 4 The results are shown after removing invalid precipitation traces.

[0074] S16. Find the fold line: such as Figure 5 As shown, scanning the precipitation trace from left to right, if the vertical position of the precipitation trace pixels drops by 360 pixels, it is suspected to be the location of a zigzag line. Based on this position, select the zigzag line before this position (i.e., 12 pixels to the left of this position) and project it horizontally. If the projected length is greater than the threshold, it means that the precipitation trace has correctly risen to the highest point, and the suspected position is indeed the location of the zigzag line.

[0075] S17: Delete the zigzag lines. Divide each zigzag line into upper and lower segments. Find the bifurcation points between the upper and lower precipitation tracks and the zigzag lines, and delete the zigzag lines between these bifurcation points to retain more precipitation tracks. The precipitation tracks after deleting the zigzag lines are as follows: Figure 6 As shown.

[0076] S2, Extraction of precipitation tracks

[0077] S21. Precipitation Track Boundary Identification: The slope of precipitation tracks often changes continuously. For track segments that tend towards the vertical direction, lateral identification is more effective in identifying the boundary; for track segments that tend towards the horizontal direction, longitudinal identification is more suitable. For example... Figure 7 As shown, the method of the present invention can automatically adjust the recognition direction according to the tilt direction of the trace segment within the rectangular detection frame, thereby better identifying the boundary of precipitation trace.

[0078] S22. Precipitation Track Restoration: Based on the identified precipitation track boundaries, the boundaries are restored according to the monotonicity and continuity of the precipitation tracks. Taking the restoration of horizontally inclined precipitation tracks as an example, firstly, based on the monotonically rising nature of the precipitation track segments, the vertical position of subsequent pixels in the precipitation track boundary is restored when it is lower than that of the preceding pixel. Based on the continuity of the precipitation track, gaps in the precipitation track are restored. Starting from the previous track pixel, passing through the gap area, and ending at the next track pixel, a linear smoothing method is used for processing.

[0079] Taking a certain precipitation trace boundary as the function y=f(x) in a rectangular coordinate system, for any two adjacent points x1 and x2 within the domain of the function, if x1<x2 and y=f(x) is undefined in the interval (x1, x2), that is, it does not conform to the property of continuity of a function, so it needs to be repaired.

[0080] First calculate the difference between f(x2) and f(x1) and the difference between x2 and x1:

[0081]

[0082] Form two right-angle sides of a right triangle with Δx and Δy, and calculate the slope according to the trigonometric function:

[0083]

[0084] Calculate the change amount of f(x) varying with x according to the slope, add the change amount Δf(x) of f(x) to the starting point f(x1) to obtain the final f(x), and keep f(x1) and f(x2) at the starting point and end point unchanged:

[0085]

[0086] S23, Calculation of the center position of the precipitation trace. According to the extracted and repaired upper and lower boundaries of the precipitation trace, and based on the horizontal and vertical tendencies of the precipitation trace, the center position of the precipitation trace is calculated from the longitudinal direction and the transverse direction, such as Figure 8 shown in.

[0087] S3, Table line restoration

[0088] S31, Acquisition of upper and lower boundaries of the table: as shown in FIG. 9, n basic probe positions are selected on the upper and lower boundaries of the table, and 6 probes are used near each basic probe position to detect the coordinates of the upper and lower edges of the table line. When acquiring the upper edge coordinate of the table, scan downward along the positive direction of x-axis. If the scanned pixel is a background pixel of the image, continue to detect downward, and stop detection until a pixel whose value is not within the RGB value range of the background pixel is found. By comparing the coordinate values at the end positions detected by the 6 probes, the maximum x-axis coordinate value is taken as the upper edge x-coordinate of the table line in this interval. Conversely, when acquiring the lower edge coordinate of the table, scan upward along the negative direction of the x-axis, and stop detection until a pixel whose value is not within the RGB value range of the background pixel is scanned. By comparing the coordinate values at the end positions detected by the 6 probes, the minimum x-axis coordinate value is taken as the lower edge x-coordinate of the table line in this interval.

[0089] S32, Acquisition of left and right boundaries of the table. For the acquisition method of left and right boundaries of the table, n basic probe positions need to be selected on the left and right boundaries of the table, and the specific steps are the same as S21.

[0090] S33. Table line reconstruction. Based on the detected top, bottom, left, and right boundary lines of the table, and based on the uniform distribution of horizontal and vertical table lines in the precipitation log, the table lines of the table area where the precipitation traces are located are reconstructed.

[0091] S4. Precipitation Calculation

[0092] Determine the number of pixels (count) on the horizontal axis every 5 minutes. n (Where n=5), the starting position x on the horizontal axis is determined by the starting point of the i-th precipitation trace. left Calculate the position of the j-th minute on the horizontal axis:

[0093] x j =x left +count n ×j

[0094] Find the starting point yfloor and ending point ytop of the current table's vertical line. Traverse the current table's vertical lines. If there is a precipitation trace pixel at the current vertical line position ynow, record the time t corresponding to that pixel, denoted as:

[0095] t = t start Since the total height of the vertical lines in the table is fixed and divided into 11 equal parts (readings from -0.5 to 10.5), the precipitation information data corresponding to the time information t can be calculated. t The calculation formula is as follows:

[0096]

[0097] In conclusion, this invention employs the aforementioned method for automatically extracting precipitation data from self-recorded precipitation images. It successfully extracted precipitation data from 51,888 images across 25 stations, processing one image every 43 seconds on average and extracting 288 sets of data, achieving a success rate of 96.74%. Analysis results show that, except for rare cases involving widespread pollution or instrument malfunctions causing severe errors in precipitation traces, the proposed method can automatically extract precipitation data. A comparison of 91,242 daily rainfall data points from 25 stations (including instances where multiple days' data were recorded on a single precipitation record sheet) with existing daily compiled data revealed that 93.1% of the data had an identification error within 1.0 mm, and 97.3% had an identification error within 5.0 mm. These results demonstrate that the proposed method can extract precipitation data very efficiently and accurately, and can be widely applied nationwide. Furthermore, this method can be adapted for extracting process data from self-recorded water level images within the hydrological industry, providing crucial data support for the inversion analysis of historical major floods and typical typhoon water conditions.

Claims

1. A method for automatically extracting precipitation data from precipitation log images, the method being applied to image information added by a precipitation log instrument on precipitation logs, and further including calculating precipitation at various time points in the monitored area based on identified precipitation tracks, characterized in that the steps include... include: S1. Precipitation Track Recognition: First, precipitation track pixels are identified based on the color characteristics of typical precipitation tracks, including the identification of suspected precipitation track pixels whose color changes due to overlap with table lines and markers. Then, interference from factors such as pollution in the image is eliminated based on spatial neighborhood features to further identify precipitation tracks. Finally, the precipitation record paper image is binarized to display only black precipitation tracks. S2. Precipitation Track Extraction: Delete invalid track parts that are unrelated to precipitation amount, determine the recognition direction based on the local direction of the precipitation track, mark the boundary of the precipitation track, and then repair the jagged edges and blanks in the precipitation track based on the monotonicity and continuity of the precipitation track. Furthermore, the center position of the precipitation trace after the repair was completed was calculated; Step S2 specifically includes: S21. Identify precipitation tracks. For track segments that tend to be vertical, use a horizontal identification method to identify the boundaries; for track segments that tend to be horizontal, use a vertical identification method to identify the boundaries. S22. Based on the identified precipitation trace boundary, repair the boundary according to the monotonicity and continuity of the precipitation trace. This includes repairing the case where the vertical position of the subsequent pixel in the precipitation trace boundary is lower than that of the preceding pixel based on the monotonicity of the precipitation trace segment, and repairing the blanks in the precipitation trace based on the continuity of the precipitation trace. S23. Based on the upper and lower boundaries of the extracted and restored precipitation traces, and according to the horizontal and vertical inclination of the precipitation traces, calculate the center position of the precipitation traces from the longitudinal and transverse directions. S3. Table line restoration: By adding probe groups at the edge of the table, the top, bottom, left and right edges of the table are detected and determined; based on the uniform distribution of horizontal and vertical table lines in the precipitation record paper, the table lines of the table area where the precipitation traces are located are reconstructed. S4. Precipitation Calculation: For each pixel of the precipitation trace, calculate the time represented by the pixel using its position on the horizontal axis of the table, and calculate the amount of precipitation represented by the pixel using its position on the vertical axis of the table.

2. The method for automatically extracting precipitation data from precipitation self-recording paper images according to claim 1, characterized in that: Step S1 is as follows: S11. Based on the precipitation recording paper image drawn by the precipitation recording instrument, collect pixel points and determine the color difference value between different colors to identify precipitation traces, including obtaining the RGB color range value of precipitation traces by collecting precipitation traces of different shades. S12. Compare the RGB values ​​of some pixels in the precipitation trace with the pixels that overlap with the grid lines of the table or the ink marks of the precipitation recording instrument with the range values ​​obtained in step S11. This also includes determining the range of the difference between any two of the R, G, and B values ​​based on the trace color, and then determining the pixels that are suspected precipitation traces based on this. Then, determine whether the pixels that are suspected precipitation traces are precipitation traces based on the spatial domain. S13. Binarize the precipitation record paper image, where the precipitation traces are black and other elements are white; S14. Construct a rectangular window that runs horizontally through the trace area, and let the window traverse the entire trace area from bottom to top. Calculate the number of projected pixels of the precipitation data trace in the horizontal direction within the window area during each traversal. If the number of pixel projections is greater than the specified threshold, and there are other precipitation traces above them, then it is determined that there are horizontal invalid data lines in the window. S15. Delete invalid precipitation tracks, but retain the intersection of the horizontal precipitation track and the target precipitation track. Traverse the pixels along the lower edge of the horizontal precipitation track from left to right in a rectangular window, and explore vertically from bottom to top within twice the window height above the pixel to see if there are enough black pixels. If there are enough black pixels, determine that the pixel is the intersection of the horizontal precipitation track and the normal precipitation track, and retain the horizontal data line part at that position. If there are not enough black pixels, delete the black pixels on the horizontal data line at the current position. S16. Scan the precipitation trace from left to right. If the vertical position of the precipitation trace pixel drops by more than 1 / 3 of the maximum height of the precipitation trace, it is suspected to be a zigzag line position. Based on this position, select the fold line before this position and project it in the horizontal direction. If the projected length is greater than the threshold, it means that the precipitation trace has correctly risen to the highest point, that is, the suspected position is indeed the location of the fold line. S17. Divide each fold line into two segments: upper and lower. Find the bifurcation points between the upper and lower precipitation traces and the fold line, and delete the fold lines between the bifurcation points to retain more precipitation traces.

3. The method for automatically extracting precipitation data from precipitation self-recording paper images according to claim 1, characterized in that: The specific calculations for step S22 are as follows: If we consider the boundary of a certain precipitation track as a function y = f (x) in a rectangular coordinate system, for any two adjacent points x1 and x2 within the domain of the function, if x1 < x2, and y = f (x) is undefined in the interval (x1, x2), then it does not conform to the property that the function has continuity and needs to be corrected. First, calculate the difference between f(x2) and f(x1), and the difference between x2 and x1: Will and Find the two legs that form a right triangle, and calculate the slope using trigonometric functions: Calculate the change of f(x) with x based on the slope, add the change Δf(x) to the starting point f(x1) to obtain the final f(x), while f(x1) and f(x2) remain unchanged at the starting and ending points: 。 4. The method for automatically extracting precipitation data from precipitation self-recording paper images according to claim 1, characterized in that: Step S3 specifically includes: S31. Select n probe base positions at the upper and lower boundaries of the table, and use m probes near each probe base position to detect the coordinates of the upper and lower edges of the table lines; When obtaining the top edge coordinates of the table, scan downwards along the positive x-axis. If the scanned pixel is a background pixel of the image, continue probing downwards until a pixel value is found that is not within the RGB value range of the background pixel, then stop probing. By comparing the coordinates at the end of the m probe probes, the largest x-axis coordinate is taken as the top edge x-coordinate of the table line for that interval. Conversely, when obtaining the bottom edge coordinates of the table, scan upwards along the negative x-axis until a pixel value is found that is not within the RGB value range of the background pixel, then stop probing. By comparing the coordinates at the end of the m probe probes, the smallest x-axis coordinate is taken as the bottom edge x-coordinate of the table line for that interval. S32. Select n probe base positions on the left and right boundaries of the table, and obtain the left and right boundaries of the table according to the method in step S31. S33. Based on the detected top, bottom, left and right boundary lines of the table, and based on the uniform distribution of horizontal and vertical table lines in the precipitation record paper, the table lines of the table area where the precipitation traces are located are reconstructed.

5. The method for automatically extracting precipitation data from precipitation self-recording paper images according to claim 1, characterized in that: The calculation for step S4 is as follows: Determine the number of pixels per n minutes on the horizontal axis. count n The starting position of the i-th precipitation trace on the horizontal axis is determined by the starting point of the i-th precipitation trace on the horizontal axis. x left Calculate the position of the j-th minute on the horizontal axis: Find the starting point of the current table's vertical line. y floor and the finish line y top Iterate through the current table's vertical lines, and if the current position is a vertical line position... y now If there is a pixel with a precipitation trace, then record the time t corresponding to that pixel, denoted as: in, Practice has begun for recording precipitation. Since the vertical coordinates of each pixel in the table represent precipitation ranging from -0.5 to 10.5, it is possible to determine the precipitation amount based on the vertical coordinates of the precipitation trace pixels. y now Calculate the precipitation information corresponding to time t. data t The calculation formula is as follows: 。

Citation Information

Patent Citations

  • Pluviometer self-recording paper data acquisition method

    CN111523382A