Reservoir rainwater condition and image segmentation-based solid water gauge target recognition method
Patent Information
- Application Number
- CN202611006945.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]但上述现有技术中,多依赖对水尺与水面交界线位置的边缘检测或对水尺表面数字符号的模板匹配识别来推算水位高度,该类方法在理想成像条件下虽可取得一定效果,但在实际水库户外场景中,水面因风浪、降雨、光线反射等因素常呈现不规则的纹理与亮度分布,导致水面边界模糊或产生虚假边缘,使得边缘检测算法难以准确定位真实水陆分界线;同时,水尺表面的数字或刻度字符易受泥沙附着、藻类滋生、剥落褪色以及雨滴遮挡等污染与磨损,造成字符残缺或对比度下降,从而严重降低数字识别的召回率与准确率;整体鲁棒性与环境适应性明显不足,难以满足长期无人值守自动化监测的可靠性要求
本发明通过构建动态更新的饱和度阈值机制,有效克服了常规方法中因光照时变与气象条件差异导致固定阈值失配的缺陷,显著提升了模型对复杂户外环境光照变化的自适应能力;同时,采用区块化平均饱和度统计与绝对值差值筛选策略,利用局部像素均值对孤立噪声的平滑特性,消除了小雨滴、微小污渍等局部干扰对区域判别的影响,并能够精准剔除水面反光、绿藻附着及水尺白色底纹等非目标区域,大幅提高了水尺彩色条纹区域提取的纯净度与准确率,相较于传统依赖边缘检测或单一色彩分割的方案,其对模糊边界与混杂背景的区分能力更强;此外,该方案在像素-物理高度转换环节引入基于图像缩放因子的实时修正机制,确保长期连续监测中水位推算结果的一致性与稳定性,解决了常规方案中因设备老化导致标定参数失效而必须频繁人工复核的技术难题,从而在野外非受控环境下实现了高鲁棒性、高精度的实体水尺水位自动识别。
Smart Images

Figure CN122990189A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of graphic attribute analysis technology, specifically to a method for identifying entity water level targets based on reservoir rainfall and water conditions and image segmentation. Background Technology
[0002] A water level gauge, also known as a colored striped gauge, has distinct colored stripes on its surface, typically using a single or two-color combination with a white background. In physical water level gauge target recognition methods, the monitoring image can be cropped and segmented to estimate the water level height based on the segmented image information. By removing a large area of irrelevant background surrounding the water level gauge in the original image, the computational scope and data volume of subsequent image processing are effectively reduced, significantly decreasing the computational resource consumption and processing latency of the algorithm at the pixel level, thereby improving the overall response efficiency of the water level recognition system. At the same time, after cropping and segmentation, the proportion of the main area of the water level gauge in the image is greatly increased, allowing subsequent color analysis, texture statistics, and feature extraction operations to be performed within a locally focused target area.
[0003] In the prior art, Chinese invention patent CN105046212A discloses an automatic waterline scale recognition method. This technology includes: obtaining a standard sample image based on a captured image of a ship's waterline; identifying the water surface boundary line in the standard sample image; obtaining a waterline numeral image containing the waterline numerals above the water surface boundary line; obtaining target images by capturing images inside the four edges of each waterline numeral based on the waterline numeral image; scaling the target image to the same size as the template sample image; and calculating a matching evaluation value between each target image and the template sample image, where the template sample image corresponding to the highest matching evaluation value is the recognized waterline scale. This technical solution can accurately and quickly automatically identify waterline scales even when the waterline scale is unclear.
[0004] However, the aforementioned existing technologies mostly rely on edge detection at the boundary between the water gauge and the water surface or template matching recognition of the digital symbols on the water gauge surface to estimate the water level. While such methods can achieve certain results under ideal imaging conditions, in actual outdoor reservoir scenarios, the water surface often exhibits irregular textures and brightness distributions due to factors such as wind, waves, rainfall, and light reflection, resulting in blurred water surface boundaries or false edges. This makes it difficult for edge detection algorithms to accurately locate the true water-land boundary. At the same time, the digital or scale characters on the water gauge surface are easily contaminated and worn by silt, algae growth, peeling and fading, and raindrop obstruction, causing character defects or decreased contrast, which seriously reduces the recall and accuracy of digital recognition. Overall, the robustness and environmental adaptability are significantly insufficient, making it difficult to meet the reliability requirements of long-term unattended automated monitoring.
[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a method for identifying physical water level gauge targets based on reservoir rainfall and water conditions and image segmentation, in order to solve the problems mentioned in the background art. This invention eliminates the influence of local interference such as raindrops and tiny stains on region discrimination, and can accurately remove non-target areas such as water surface reflections, green algae attachments, and the white background of the water level gauge (i.e., monochrome striped bars). It significantly improves the purity and accuracy of extracting the colored striped regions of the water level gauge, and has a stronger ability to distinguish blurred boundaries and mixed backgrounds. It overcomes the defect of fixed threshold mismatch caused by time-varying illumination and differences in meteorological conditions during water level gauge identification.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for identifying entity water level gauge targets based on reservoir rainfall and water level data and image segmentation includes: S1. Construct an image stripe bar clipping model, collect monitoring images of physical stripe bars in reservoir rainfall and water level monitoring, input the monitoring images of physical stripe bars into the image stripe bar clipping model, and obtain the clipped image of the stripe bars. S2. Based on the cropped image of the striped pillar, collect the saturation value of each pixel, divide the cropped image of the striped pillar into multiple independent regions, each independent region has a side length of N pixels, calculate the average saturation value in each independent region, and at the same time, according to the actual stripe color on the physical striped pillar, collect the saturation of the colored stripes at regular intervals, which is used as the saturation threshold for the time period between the current time and the next time the saturation of the colored stripes is collected. S3. Calculate the regional saturation difference between the average saturation value and the saturation threshold in each independent region, set the saturation difference threshold, compare the saturation difference of each region with the saturation difference threshold, and establish a striped region saturation difference filtering mechanism. The striped region saturation difference filtering mechanism is used to delete the corresponding regions with larger regional saturation difference values and retain the corresponding regions with smaller regional saturation difference values. S4. Calculate the number of pixels in each column for the retained independent area, obtain the average value of the pixel column, and generate the actual exposure height of the solid striped column in the reservoir by converting the average value of the pixel column.
[0008] Furthermore, the image stripe column cropping model includes a deep convolutional feature extraction network, a region generation network, and a bounding box regression classification network: The feature extraction network extracts multi-scale spatial semantic feature maps from the input physical striped bar monitoring image through multi-layer convolution and downsampling operations. The region generation network is used to lay out multi-scale anchor boxes on the feature map and predict the foreground confidence of the presence of striped pillars in each anchor box, thus completing the initial screening of candidate regions. The bounding box regression classification network is used to further refine the location and re-evaluate the confidence of candidate regions, and outputs the coordinate parameters of the rectangle that accurately surrounds the striped bar. Based on the rectangular coordinate parameters, a cropped image with the striped bar as the core and containing a small amount of adjacent environment is cropped from the original monitoring image.
[0009] Furthermore, it also includes the training process of the image stripe bar cropping model: constructing a labeled dataset, obtaining monitoring images of physical stripe bars covering different water levels, times and weather conditions, manually labeling the tight bounding rectangle of the physical stripe bars in each image, and dividing the images and labeling pairs into training samples and validation samples. Training samples are input into the feature extraction network, region generation network, and bounding box regression classification network in batches. Predicted bounding boxes are obtained through forward propagation. The regression loss between the predicted boxes and the labeled boxes, as well as the classification loss of the foreground confidence, are jointly calculated. The network weights are iteratively updated through error backpropagation until the intersection-union ratio (IUU) of the cropped data on the validation set converges and the loss value stabilizes.
[0010] Furthermore, the formula used to calculate the average saturation value within each independent region is as follows: in: The average saturation value of the r-th region is calculated, representing the overall color intensity of the corresponding region; r is the index number of the independent region, used to identify each square block after division; M represents the total number of pixels contained in a single independent region, determined by the side length N; i is the position index of the pixel within the independent region r; Let be the saturation value of the i-th pixel within the region numbered r. Taken from the saturation channel after image conversion; The formula for calculating the total number of pixels M contained in a single independent region is: .
[0011] Furthermore, it also includes a mechanism for arranging the position indices i of pixels within an independent region r: Each independent region is expanded from the top left corner into a one-dimensional sequence using a raster scan in a row-first order. First, the leftmost pixel of the first row is extracted and designated as the first element of the sequence. Then, subsequent pixels are extracted sequentially from left to right along the row direction. After completing a row, the process moves to the leftmost pixel of the next row and continues to the right, progressing row by row until the last pixel in the bottom right corner of the region is reached. The length of the resulting sequence is equal to the total number of pixels in the region. ; In the one-dimensional sequence, index The index corresponds to the first pixel in the top left corner of the independent region. Each corresponding to the last pixel in the bottom right corner of the independent region Represents the first in a one-dimensional sequence The value of each pixel in the saturation channel.
[0012] Furthermore, the saturation threshold acquisition process in S2 is as follows: At each preset acquisition time, the current monitoring image of the physical striped bar is acquired. The cropped image is extracted using the trained striped bar cropping model. Then, based on the known geometric position and color distribution of the colored stripes on the physical striped bar, multiple reference sampling blocks containing only colored stripe areas and excluding white areas and background are delineated in the cropped image. The saturation values of all pixels within these sampling blocks are acquired, and their overall arithmetic mean is calculated as the saturation threshold for this update. ; The time interval for collecting the saturation of the colored stripes is preset or dynamically adjusted based on time-series data closely related to changes in illumination, including intraday time and weather type.
[0013] Furthermore, the formula used to calculate the regional saturation difference in S3 is as follows: in: The saturation difference of the r-th independent region is used to quantify the degree of deviation between the overall color of that region and the color of the target stripe. This is the saturation threshold.
[0014] Furthermore, the logic for comparing the saturation difference value of each region with the saturation difference threshold is as follows: For the r-th independent region, when When a region is identified as a candidate region for stripes, it indicates that the average saturation of the corresponding region is highly consistent with the dynamic stripe reference saturation threshold, and the difference is within the tolerance range, so the corresponding region is retained. For the r-th independent region, when When a region is identified as a non-stripe candidate region, it indicates that the overall saturation of the corresponding region deviates from the stripe reference saturation threshold and falls into the color category of water surface, green algae, white achromatic area, or sidewall environment, and the corresponding region is deleted. in The saturation difference threshold is based on the positive sample area of colored stripes and the negative sample area such as water surface and green algae labeled under multiple environmental conditions. The saturation difference of each area is calculated and its distribution is statistically analyzed. The critical value that can maximize the separation of positive and negative samples is selected as the saturation difference threshold, with the statistical mean of the positive sample difference distribution plus three times the standard deviation as the benchmark.
[0015] Furthermore, in step S4, all the selected and retained independent regions are merged into a stripe mask. The continuous span of the effective pixels within the mask is counted column by column along the vertical direction of the image to form a column pixel height sequence. The average value of the column pixel height sequence is calculated to obtain a representative pixel column average value. Based on the spatial resolution equivalent calibrated in advance using the ratio of the actual physical size of the stripe fixed interval to the corresponding image pixel length, and combined with the image scaling factor, real-time correction is performed to convert the average vertical pixel count into the actual exposure height of the physical stripe column above the water surface.
[0016] Furthermore, the formula used to convert the average vertical pixel count into the actual exposure height of the colored striped markers above the water surface is as follows: in: This represents the actual exposed height of the solid striped column above the water surface. K is the pixel-to-actual-height conversion coefficient, which is obtained through pre-calibration and reflects the physical size of a single pixel under the current imaging conditions. The average value of the pixel column; The actual exposed height of the solid striped column above the water surface is used to calculate the current water level.
[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention effectively overcomes the shortcomings of conventional methods caused by fixed threshold mismatch due to time-varying illumination and differences in meteorological conditions by constructing a dynamically updated saturation threshold mechanism, significantly improving the model's adaptability to complex outdoor lighting changes. Simultaneously, by employing a block-based average saturation statistics and absolute value difference filtering strategy, it utilizes the smoothing properties of local pixel mean on isolated noise to eliminate the influence of local interference such as raindrops and tiny stains on region discrimination. It can also accurately remove non-target areas such as water surface reflections, algae attachments, and white background patterns on water gauges, greatly improving the purity and accuracy of extracting colored stripe regions from water gauges. Compared to traditional schemes relying on edge detection or single-color segmentation, it has a stronger ability to distinguish blurred boundaries and mixed backgrounds. Furthermore, this scheme introduces a real-time correction mechanism based on image scaling factors in the pixel-to-physical height conversion stage, ensuring the consistency and stability of water level estimation results during long-term continuous monitoring. This solves the technical problem of frequent manual verification due to calibration parameter failure caused by equipment aging in conventional schemes, thus achieving highly robust and high-precision automatic identification of physical water gauge levels in uncontrolled outdoor environments. Attached Figure Description
[0018] Figure 1 This is a flowchart of the entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0020] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0021] Example: Please see Figure 1 The present invention provides the following technical solutions: A method for recognizing physical water gauges based on reservoir rainfall and image segmentation is proposed. This method is only used for recognizing water gauges with a surface coated with a single-color stripe. The specific steps include: S1: Construct an image stripe bar clipping model. Collect monitoring images of physical stripe bars taken by fixed cameras in the reservoir rainfall and water level monitoring system. Input the original monitoring images into the image stripe bar clipping model. After forward inference, the model outputs a clipped image that accurately surrounds the stripe bar region. This clipped image takes the water level gauge as the core, while retaining a small amount of surrounding environmental information for subsequent judgment reference and to avoid information loss due to over-cropping.
[0022] The image stripe column cropping model consists of three cooperating sub-networks: a deep convolutional feature extraction network, a region generation network, and a bounding box regression and classification network. The feature extraction network employs multiple convolutional layers and pooling downsampling operations to perform progressive feature abstraction on the input entity striped bar monitoring image, extracting multi-scale feature maps containing spatial location and semantic information, thus providing rich visual representations for subsequent target localization. The region generation network lays anchor boxes of various sizes and aspect ratios at each location in the feature map, and calculates the foreground confidence score of each anchor box for containing striped bars. Based on the score, a large number of candidate boxes are initially screened, and background regions that obviously do not contain the target are removed, thereby reducing the complexity of subsequent calculations. The bounding box regression classification network further refines the boundary positions of candidate regions retained by the region generation network, while re-evaluating the confidence of the candidate regions. The final output is a rectangle with coordinate parameters that tightly enclose the physical striped column. Based on these coordinate parameters, a cropped image is accurately extracted from the original monitoring image, centered on the striped column and including a small amount of adjacent environment on both sides and bottom of the water gauge. This provides standardized input data for subsequent fine-grained analysis of the striped region. As a core technology module in the intelligent reservoir monitoring system, this method's efficient and stable recognition capabilities not only improve the automation level of hydrological management but also provide reliable data source support for related new technologies and innovative entrepreneurial services (such as irrigation decision support based on precise water levels and value-added applications for urban flooding early warning), promoting the transformation and upgrading of traditional water conservancy monitoring towards intelligent services.
[0023] The training process for the image stripe bar cropping model is as follows: First, a dedicated labeled dataset is constructed, which extensively collects real stripe bar monitoring images taken under various weather conditions such as different water levels, different day and night times, and sunny, rainy, and cloudy days. Professional annotators manually select the real stripe bar regions in each image by drawing tight bounding rectangles to ensure that the labeled boxes closely match the boundaries of the real stripe bars. The labeled images and their corresponding rectangular coordinates are then divided into a training sample set and a validation sample set to ensure that the two sets are representative of the working conditions. During training, training samples are input into the feature extraction network, region generation network, and bounding box regression classification network in batches. The positions and confidence scores of the predicted bounding boxes are calculated sequentially through forward propagation. Then, the regression localization loss between the predicted boxes and the manually labeled boxes, as well as the foreground and background classification loss, are jointly calculated. The weighted sum of the two types of losses is used as the overall optimization objective. The gradient is calculated layer by layer through the error backpropagation algorithm, and the network weights of the entire model are iteratively updated using the optimizer, so that the model gradually learns the robust visual features of the striped pillars. After each round of training, the cross-union accuracy of the model's cropping results is evaluated on the validation set. This process is continued until the accuracy metric tends to converge and the overall loss value remains stable. At this point, a cropping model that can be deployed in a real reservoir scenario is obtained.
[0024] S2: Based on the cropped image of the striped bars, the saturation channel values in the color space are first extracted pixel by pixel to obtain the color purity information of each pixel. Then, the cropped image is divided into multiple non-overlapping square independent regions with fixed side lengths. The side length of each region is set to N pixels. The value of N needs to take into account both computational efficiency and local color representativeness. In this embodiment, the value range of N is [8, 64]. After the division is completed, for each independent region, the saturation values of all pixels in the region are counted and their arithmetic mean is calculated to characterize the overall color intensity of the region. At the same time, considering that the lighting conditions will change significantly over time and with weather changes, causing the measured saturation of the water gauge stripes to drift accordingly, the saturation values of the colored stripes under the current lighting are re-extracted based on the known true colors of the colored stripes on the physical striped bars at a preset fixed acquisition time or at a time when dynamically adjusted according to changes in lighting. The collected data is used as the saturation benchmark threshold for the entire time period from the current time to the next collection time, ensuring that the threshold used for subsequent discrimination can be updated in a timely manner with changes in ambient light, thereby enhancing the adaptability of the method to different time periods and meteorological conditions, and ensuring the accuracy and robustness of saturation discrimination. The formula used to calculate the average saturation value within each independent region is: in: The average saturation value of the r-th region is calculated, representing the overall color intensity of the corresponding region; r is the index number of the independent region, used to identify each square block after the division. The vertical height represented by The continuous changes (the water level stripes alternate periodically in color from top to bottom) together constitute the basis for judgment—if a certain vertical segment has multiple consecutive changes... area All with If it does not match, it may have reached the water surface or a contaminated section; M is the total number of pixels contained in a single independent region, which is determined by the side length N: The larger (i.e.) The larger the side length, the more samples participate in the average, and the greater the statistical value. The smaller the variance, the stronger the resistance to random noise (such as transient flying insects or sporadic water splashes); i is the position index of the pixel within the independent region r; Let be the saturation value of the i-th pixel within the region numbered r. Taken from the saturation channel after image conversion. yes The saturation value is the arithmetic mean of the pixels, so an increase in the saturation value of any pixel will linearly increase the average saturation of the entire area; The formula for calculating the total number of pixels M contained in a single independent region is: .
[0025] The arrangement mechanism of pixel position indices i within an independent region r: Each independent region is considered a regular two-dimensional pixel matrix. To facilitate the subsequent extraction and calculation of saturation values for each pixel, this two-dimensional matrix needs to be unfolded into a one-dimensional sequence according to a defined rule. The unfolding method uses a raster scan sequence starting from the top left corner and proceeding in row-major order: First, the leftmost pixel of the first row of the independent region is located and used as the first element of the entire one-dimensional sequence. Then, pixels in the row are extracted sequentially from left to right until the rightmost pixel of the row is extracted. After the current row is extracted, the process jumps to the leftmost pixel of the next row and continues to the right, progressing row by row until the last pixel in the bottom right corner of the region is reached, at which point the entire unfolding process ends. The resulting one-dimensional sequence has a length exactly equal to the total number of pixels M within the region, ensuring that each pixel is uniquely and non-repeatingly mapped to a specific position in the sequence. In the one-dimensional sequence, index The index corresponds to the first pixel in the top left corner of the independent region. Each corresponding to the last pixel in the bottom right corner of the independent region Represents the first in a one-dimensional sequence The value of each pixel in the saturation channel.
[0026] The process for obtaining the saturation threshold is as follows: At each preset acquisition time, the system automatically acquires the monitoring image of the physical striped bar at that moment. Then, it calls the pre-trained striped bar cropping model to process the image, extracting a cropped image centered on the striped bar, which serves as the standardized input for subsequent saturation analysis. Based on the actual geometric arrangement and inherent color distribution characteristics of the known colored stripes on the physical striped bar, multiple reference sampling blocks are precisely delineated in the cropped image. These sampling blocks all fall within the colored stripe region, ensuring that each sampling block contains only pure colored stripe pixels, completely avoiding white achromatic areas, the background environment on the side of the watermark, and any potential contamination, thus guaranteeing that the acquired saturation values accurately reflect the color attributes of the stripes themselves. After the reference sampling blocks are delineated, the saturation values of all pixels within these sampling blocks are acquired, and the overall arithmetic mean of all sampled values is calculated. The result is used as the updated saturation threshold for the current moment. This is used for subsequent region filtering and discrimination.
[0027] The time interval for collecting color stripe saturation data is not fixed, but rather a pre-set reference frequency based on time-series data closely related to changes in illumination, while allowing for dynamic adjustments based on actual environmental changes. This time-series data primarily includes changes in solar altitude angle over the course of the day and current weather types, such as sunny, cloudy, rainy, or foggy conditions. These factors significantly affect the light intensity and color temperature reaching the water gauge surface, causing corresponding shifts in the collected stripe saturation. By incorporating real-time or forecast meteorological service information, the pre-setting and dynamic adjustment of the collection time can be further optimized. This allows the system to trigger threshold refreshes in advance when abrupt changes in illumination are imminent (such as passing showers or the transition from dawn to dusk), ensuring that the saturation threshold is updated promptly as the illumination environment evolves. This ensures that the reference used for subsequent area discrimination always matches the current actual illumination conditions, thereby improving the method's adaptability and discrimination stability in all-weather scenarios.
[0028] S3: Calculate the absolute difference between the average saturation value within each independent region and the currently effective saturation threshold. This difference quantifies the actual deviation of the overall color of each region from the baseline stripe color. After obtaining the saturation differences of all independent regions, a reasonable saturation difference threshold is set according to actual application requirements. The value of this threshold, combined with prior statistical results, ensures effective differentiation between true colored stripe regions and various interference regions. Subsequently, the saturation difference calculated for each independent region is compared numerically with the pre-set saturation difference threshold. Based on the comparison results, a stripe region saturation difference filtering mechanism is established. Through this filtering mechanism, invalid interference components in the cropped image can be effectively purified, concentrating the remaining image regions on the true colored stripe parts, thereby improving the accuracy and reliability of subsequent water level estimation. Although this method is mainly aimed at inland reservoir scenarios, its core algorithm is highly robust to water surface reflection, wave interference and low-light environments. After adaptive parameter adjustment, it can also be extended to tidal river sections or harbors and other waters affected by tides, thus providing a high-frequency and low-cost visual perception supplement for nearshore water level monitoring and storm surge early warning decision support in marine meteorological services.
[0029] The formula used to calculate the regional saturation difference is: in: Let be the saturation difference of the r-th independent region, used to quantify the degree of deviation between the overall color of this region and the target stripe color. The closer the value is to 0, the more homologous the color of this region is to the standard stripe color in the current environment, and the probability of it belonging to a valid region approaches 1; the larger the value, the more likely the region is to belong to water surface (low saturation), green algae (scattered saturation distribution), white background (near zero saturation), or side environment (scattered saturation distribution); Saturation threshold: It is a dynamic anchor point, and They exhibit an inverse adjustment relationship. For example, when the weather changes from sunny to cloudy, the reduced light intensity will affect the actual pixel saturation of the watermark's color stripes. Overall decline, and then It also decreases synchronously. At this point, the algorithm actively collects reference sampling blocks in the current environment and updates them. (Similarly reduced), making and The difference Maintain basic stability.
[0030] The logic for comparing the saturation difference of each region with the saturation difference threshold is as follows: For the r-th independent region, when When the region is identified as a stripe candidate region, this determination indicates that the average saturation of the region is highly consistent with the currently dynamically updated stripe baseline saturation threshold, and the difference between the two is controlled within a preset tolerance range. In other words, the color characteristics of the region conform to the saturation level that a true color stripe should have. Therefore, the region is retained as a component of subsequent effective analysis. For the r-th independent region, when At that time, the region was determined to be a non-stripe candidate region. This determination result indicates that the overall saturation level of the region is significantly deviated from the normal range of the stripe reference saturation threshold. Its color characteristics are closer to the color categories of non-target categories such as water surface reflection areas, green algae attachment areas, white achromatic stripe areas, or water gauge sidewall environment areas. It cannot meet the saturation discrimination criteria for colored stripes. Therefore, the region is deleted and completely excluded from the subsequent analysis process. in The saturation difference threshold is determined based on statistical data from a large number of manually labeled positive sample areas of colored stripes collected under various environmental conditions, as well as typical negative sample areas such as water surfaces and green algae. This embodiment also provides a specific method for setting the saturation difference threshold: the saturation difference values of all positive and negative sample areas are calculated separately, and the distribution of the two types of differences is statistically analyzed. The statistical mean of the positive sample difference distribution plus three standard deviations is used as a benchmark reference point. Based on this, the critical value that maximizes the distinction between the two types of positive and negative sample distributions is selected as the final saturation difference threshold, thereby ensuring that this threshold has good distinguishing ability and generalization performance between colored stripe areas and interference areas in practical applications.
[0031] S4: Further processing is performed on the preserved independent regions. First, the number of valid pixels in each column is counted horizontally. The statistical results of all columns are then aggregated and their arithmetic mean is calculated to obtain a pixel column mean that represents the overall vertical distribution. Based on this, the pixel scale in the image is converted into the actual exposure height of a physical water gauge in the reservoir using this pixel column mean and a pre-established conversion relationship, thereby indirectly calculating the current water level.
[0032] Specifically: All independent regions retained after the aforementioned filtering steps are merged to construct a complete stripe mask image. This mask clearly marks all valid regions in the image that are determined to be colored stripes. Subsequently, the mask is scanned column by column from top to bottom along the vertical direction of the image. The continuous span of valid pixels in each column from the upper boundary to the lower boundary is counted, and the number of consecutive valid pixels in each column is recorded, thus forming a sequence of pixel heights. This sequence reflects the vertical distribution of the watermark colored stripes at different horizontal positions in the image.
[0033] The arithmetic mean of the entire sequence of pixel heights is calculated to obtain a statistically representative and interference-resistant pixel column mean. Based on this pixel column mean, a numerical conversion is performed using a spatial resolution equivalent obtained through pre-calibration experiments. This equivalent is obtained by comparing the actual physical size of the colored stripes at known fixed intervals on a physical water gauge with the pixel length they occupy in the image, thus characterizing the actual physical size of a single pixel under the current imaging conditions. Simultaneously, considering potential digital scaling or image resolution variations in the surveillance camera, an image scaling factor is introduced to correct the conversion coefficients in real time to adapt to the actual scale of the current image. This calibration and conversion process essentially falls under the basic technical category of precision visual measurement and engineering photogrammetry in surveying services other than satellite application services. By establishing a high-precision mapping relationship between image coordinates and physical spatial coordinates, it ensures the traceability and measurement accuracy of the water level estimation results. Finally, multiplying the corrected conversion coefficients by the pixel column mean converts the average number of vertical pixels in the image into the actual physical exposure height of the colored stripe markers above the water surface.
[0034] The actual physical exposure height values are continuously smoothed over time and then fed back to the reservoir rainfall and water situation analysis platform in real time. They are used in conjunction with the areal rainfall prediction grid data provided by the meteorological department. The measured water level is used to dynamically verify and correct the initial field conditions in the rainfall-runoff model, which significantly improves the accuracy and reliability of short-term flood forecasts.
[0035] In this embodiment, a method for solving the nonlinear problem caused by perspective distortion is also provided: a quadratic correction term based on imaging geometry is introduced to upgrade the linear transformation to a nonlinear mapping: when the exposure height increases and the number of pixels increases, the correction term grows faster, so that the formula no longer converts at a constant ratio, but dynamically amplifies the actual height mapping value of the high pixel range.
[0036] This processing method, which combines imaging geometry with dynamic correction factors, improves the spatial consistency of monitoring data, enabling the final output water level information to be directly incorporated into the reservoir's rainfall and water situation database. This serves as a key input parameter for other surveying and mapping geographic information services (such as updating reservoir capacity curves, verifying basic topographic data for downstream flood evolution simulation, and dynamic mapping of inundation areas based on GIS), thereby extending the data chain value of a single water level gauge identification result.
[0037] The formula used to convert the average vertical pixel count into the actual exposure height of the colored striped markers above the water surface is as follows: in: This represents the actual exposed height of the solid water gauge above the water surface. If the total installation height of the solid water gauge is known... (The total physical length from the bottom reference plane of the water gauge to the top) indicates the current reservoir water level. .therefore, and There is a strict linear negative correlation—the greater the exposure height, the lower the water level; when the exposure height approaches 0, the water level is close to or exceeds the top of the water gauge. K is the pixel-to-actual height conversion coefficient, obtained through pre-calibration. It reflects the physical size of a single pixel under the current imaging conditions, describing the actual physical length of a single pixel in the vertical direction under the current imaging conditions. The larger the K value, the larger the physical scale represented by a unit pixel; The average value of the pixel column. and There is a strict direct proportional relationship. That is, the more vertical pixels the effective stripes occupy in the image, the higher the calculated actual physical exposure height. The actual exposed height of the solid striped column above the water surface is used to calculate the current water level.
[0038] The water level data, as the core output parameter of the reservoir rainfall and water level monitoring system, can be used to construct a short-term water level rise and fall trend judgment model after being jointly analyzed with the hourly surface rainfall prediction results of the upstream reservoir area. This provides an intuitive quantitative basis for flood control scheduling decisions, thus extending this method from a single image recognition task to a key technical link supporting hydrological forecasting and joint scheduling of reservoir groups.
[0039] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0040] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0041] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0042] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for identifying entity water level gauge targets based on reservoir rainfall and water level data and image segmentation, characterized in that, include: S1. Construct an image stripe bar clipping model, collect monitoring images of physical stripe bars in reservoir rainfall and water level monitoring, input the monitoring images of physical stripe bars into the image stripe bar clipping model, and obtain the clipped image of the stripe bars. S2. Based on the cropped image of the striped pillar, collect the saturation value of each pixel, divide the cropped image of the striped pillar into multiple independent regions, each independent region has a side length of N pixels, calculate the average saturation value in each independent region, and at the same time, according to the actual stripe color on the physical striped pillar, collect the saturation of the colored stripes at regular intervals, which is used as the saturation threshold for the time period between the current time and the next time the saturation of the colored stripes is collected. S3. Calculate the regional saturation difference between the average saturation value and the saturation threshold in each independent region, set the saturation difference threshold, compare the saturation difference of each region with the saturation difference threshold, and establish a striped region saturation difference filtering mechanism. The striped region saturation difference filtering mechanism is used to delete the corresponding regions with larger regional saturation difference values and retain the corresponding regions with smaller regional saturation difference values. S4. Calculate the number of pixels in each column for the retained independent area, obtain the average value of the pixel column, and generate the actual exposure height of the solid striped column in the reservoir by converting the average value of the pixel column.
2. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 1, characterized in that: The image stripe bar cropping model includes a deep convolutional feature extraction network, a region generation network, and a bounding box regression and classification network. The feature extraction network extracts multi-scale spatial semantic feature maps from the input physical striped bar monitoring image through multi-layer convolution and downsampling operations. The region generation network is used to lay out multi-scale anchor boxes on the feature map and predict the foreground confidence of the presence of striped pillars in each anchor box, thus completing the initial screening of candidate regions. The bounding box regression classification network is used to further refine the location and re-evaluate the confidence of candidate regions, and outputs the coordinate parameters of the rectangle that accurately surrounds the striped bar. Based on the rectangular coordinate parameters, a cropped image with the striped bar as the core and containing a small amount of adjacent environment is cropped from the original monitoring image.
3. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 2, characterized in that: It also includes the training process of the image stripe bar cropping model: constructing a labeled dataset, obtaining monitoring images of physical stripe bars covering different water levels, times and weather conditions, manually labeling the tight bounding rectangle of the physical stripe bars in each image, and dividing the images and labeling pairs into training samples and validation samples. Training samples are input into the feature extraction network, region generation network, and bounding box regression classification network in batches. Predicted bounding boxes are obtained through forward propagation. The regression loss between the predicted boxes and the labeled boxes, as well as the classification loss of the foreground confidence, are jointly calculated. The network weights are iteratively updated through error backpropagation until the intersection-union ratio (IUU) of the cropped data on the validation set converges and the loss value stabilizes.
4. The entity water level gauge target recognition method based on reservoir rainfall and image segmentation according to claim 1, characterized in that: The formula used to calculate the average saturation value within each independent region is: in: The average saturation value of the r-th region is calculated, representing the overall color intensity of the corresponding region; r is the index number of the independent region, used to identify each square block after division; M represents the total number of pixels contained in a single independent region, determined by the side length N; i is the position index of the pixel within the independent region r; Let be the saturation value of the i-th pixel within the region numbered r. Taken from the saturation channel after image conversion; The formula for calculating the total number of pixels M contained in a single independent region is: .
5. The entity water level gauge target recognition method based on reservoir rainfall and image segmentation according to claim 4, characterized in that: It also includes the arrangement mechanism of pixel position indices i within an independent region r: Each independent region is expanded from the top left corner into a one-dimensional sequence using a raster scan in a row-first order. First, the leftmost pixel of the first row is extracted and designated as the first element of the sequence. Then, subsequent pixels are extracted sequentially from left to right along the row direction. After completing a row, the process moves to the leftmost pixel of the next row and continues to the right, progressing row by row until the last pixel in the bottom right corner of the region is reached. The length of the resulting sequence is equal to the total number of pixels in the region. ; In the one-dimensional sequence, index The index corresponds to the first pixel in the top left corner of the independent region. Each corresponding to the last pixel in the bottom right corner of the independent region Represents the first in a one-dimensional sequence The value of each pixel in the saturation channel.
6. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 1, characterized in that: The process for obtaining the saturation threshold in S2 is as follows: At each preset acquisition time, the current monitoring image of the physical striped bar is acquired. The cropped image is extracted using the trained striped bar cropping model. Then, based on the known geometric position and color distribution of the colored stripes on the physical striped bar, multiple reference sampling blocks containing only colored stripe areas and excluding white areas and background are delineated in the cropped image. The saturation values of all pixels within these sampling blocks are acquired, and their overall arithmetic mean is calculated as the saturation threshold for this update. ; The time interval for collecting the saturation of the colored stripes is preset or dynamically adjusted based on time-series data closely related to changes in illumination, including intraday time and weather type.
7. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 4, characterized in that: The formula used to calculate the regional saturation difference in S3 is as follows: in: The saturation difference of the r-th independent region is used to quantify the degree of deviation between the overall color of that region and the color of the target stripe. This is the saturation threshold.
8. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 7, characterized in that: The logic for comparing the saturation difference value of each region with the saturation difference threshold is as follows: For the r-th independent region, when When a region is identified as a candidate region for stripes, it indicates that the average saturation of the corresponding region is highly consistent with the dynamic stripe reference saturation threshold, and the difference is within the tolerance range, so the corresponding region is retained. For the r-th independent region, when When a region is identified as a non-stripe candidate region, it indicates that the overall saturation of the corresponding region deviates from the stripe reference saturation threshold and falls into the color category of water surface, green algae, white achromatic area, or sidewall environment, and the corresponding region is deleted. in The saturation difference threshold is based on the positive sample area of colored stripes and the negative sample area such as water surface and green algae labeled under multiple environmental conditions. The saturation difference of each area is calculated and its distribution is statistically analyzed. The critical value that can maximize the separation of positive and negative samples is selected as the saturation difference threshold, with the statistical mean of the positive sample difference distribution plus three times the standard deviation as the benchmark.
9. The entity water level gauge target recognition method based on reservoir rainfall and image segmentation according to claim 1, characterized in that: In step S4, all the selected and retained independent regions are merged into a stripe mask. The continuous span of the effective pixels in the mask is counted column by column along the vertical direction of the image to form a column pixel height sequence. The average value of the column pixel height sequence is calculated to obtain a representative pixel column average value. Based on the spatial resolution equivalent calibrated in advance using the ratio of the actual physical size of the stripe fixed interval to the corresponding image pixel length, and combined with the image scaling factor, real-time correction is performed to convert the average vertical pixel count into the actual exposure height of the physical stripe column above the water surface.
10. The entity water level gauge target recognition method based on reservoir rainfall and water level conditions and image segmentation according to claim 9, characterized in that: The formula used to convert the average vertical pixel count into the actual exposure height of the colored striped markers above the water surface is as follows: in: This represents the actual exposed height of the solid striped column above the water surface. K is the pixel-to-actual-height conversion coefficient, which is obtained through pre-calibration and reflects the physical size of a single pixel under the current imaging conditions. The average value of the pixel column; The actual exposed height of the solid striped column above the water surface is used to calculate the current water level.
Citation Information
Patent Citations
Method for automatically identifying waterline scale
CN105046212A