Water level identification method, device, electronic device and storage medium

By performing grayscale feature analysis and scale period identification on the water gauge image, the problem of inaccurate water level recognition in the existing technology is solved, and high-accuracy water level recognition under complex backgrounds is achieved.

CN118038470BActive Publication Date: 2024-08-27NANTONG HAISAI FUTURE DIGITAL TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410170794.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-06
Publication Date
2024-08-27
Estimated Expiration
2044-02-06

AI Technical Summary

Technical Problem

The existing technology cannot effectively identify the water gauge scale lines and corresponding values ​​when dealing with complex backgrounds, such as water ripple interference and uneven lighting, resulting in inaccurate recognition of the water gauge water level.

Method used

By processing the collected water gauge images, the grayscale features of the image are determined, and the scale period is obtained based on the grayscale feature analysis, and the water level scale is finally determined to improve the recognition accuracy.

Benefits of technology

The accuracy of water level identification is improved and the accuracy of water gauge readings can be ensured under complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118038470B
    Figure CN118038470B
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for water gauge and water level recognition, wherein the method comprises: acquiring an original water gauge image corresponding to a target water gauge, and determining a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image; determining image grayscale features based on the water gauge image to be analyzed, and determining the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features; and determining the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles. Based on the above technical solution, the image grayscale features corresponding to the image are obtained by processing the collected water gauge image, and the corresponding number of water gauge scale cycles are obtained by analyzing the image grayscale features, and then the water level scale of the water gauge is determined, thereby improving the accuracy of water gauge and water level recognition, and achieving the technical effect of improving the accuracy of water level recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water level monitoring, and in particular to a water gauge water level identification method, device, electronic equipment and storage medium. Background Art

[0002] In many fields such as hydrological monitoring, waterway management, operation of water conservancy facilities and ship navigation safety, it is crucial to accurately obtain real-time water level information. The traditional method of reading water gauges is to identify the water level scale of the water gauge through manual visual observation or image recognition.

[0003] However, although the existing image recognition solutions can improve the data collection accuracy and automation level to a certain extent, it is technically difficult to effectively identify the water level scale lines and corresponding values ​​when dealing with complex backgrounds such as water ripple interference and uneven lighting, and the accuracy of the water level readings cannot be guaranteed. Summary of the invention

[0004] The present invention provides a water gauge water level recognition method, device, electronic device and storage medium. The method processes the collected water gauge image and determines the corresponding image grayscale features, and analyzes the image grayscale features to obtain the corresponding scale period, and then determines the water level scale of the target water gauge according to the scale period, so as to solve the problem of inaccurate water gauge water level recognition in the prior art, and achieves the technical effect of improving the accuracy of water level recognition.

[0005] According to one aspect of the present invention, a water level identification method of a water gauge is provided, the method comprising:

[0006] Acquire an original water gauge image corresponding to a target water gauge, and determine a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image;

[0007] Determine an image grayscale feature based on the water gauge image to be analyzed, and determine the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale feature;

[0008] A water level scale corresponding to the target water gauge is determined based on the water gauge scale cycle number.

[0009] According to another aspect of the present invention, a water gauge water level identification device is provided, the device comprising:

[0010] A water gauge image processing module is used to obtain an original water gauge image corresponding to a target water gauge, and determine a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image;

[0011] A water gauge scale period determination module, used to determine the image grayscale features based on the water gauge image to be analyzed, and determine the number of water gauge scale periods corresponding to the target water gauge according to the image grayscale features;

[0012] The water level scale determination module is used to determine the water level scale corresponding to the target water level based on the number of water level scale cycles.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the water gauge water level identification method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the water gauge water level identification method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention obtains the original water gauge image corresponding to the target water gauge, and determines the water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image, and then determines the image grayscale features based on the water gauge image to be analyzed, and determines the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features, and finally determines the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles. Based on the above technical solution, the image grayscale features corresponding to the image are obtained by processing the collected water gauge image, and the image grayscale features are analyzed to obtain the corresponding number of water gauge scale cycles, and then the water level scale of the water gauge is determined, thereby improving the accuracy of water level recognition of the water gauge, and achieving the technical effect of improving the accuracy of water level recognition.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 It is a flow chart of a water level identification method of a water gauge provided by an embodiment of the present invention;

[0022] Figure 2 It is a flow chart of a water level identification method of a water gauge provided by an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of an original water gauge image provided by an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of a masked water ruler image provided by an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of a minimum rotated bounding box corresponding to a maximum connected domain provided by an embodiment of the present invention;

[0026] Figure 6 is a schematic diagram of a water gauge image to be processed provided by an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of the recognition result of the number of water gauge scale periods provided by an embodiment of the present invention;

[0028] Figure 8 It is a structural block diagram of a water gauge water level identification device provided by an embodiment of the present invention;

[0029] Fig. 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] Figure 1 It is a flow chart of a water gauge water level recognition method provided by an embodiment of the present invention. This embodiment can be applied to determining the corresponding image grayscale features according to the water gauge image corresponding to the target water gauge, and determining the corresponding water gauge scale period according to the grayscale image features, and finally determining the water level scale of the target water gauge according to the water gauge scale period. The method can be executed by a water gauge water level recognition device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device, which can be a terminal device or a server device, etc.

[0034] like Figure 1 As shown, the method includes:

[0035] S110, acquiring an original water gauge image corresponding to a target water gauge, and determining a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image.

[0036] The target water gauge may be a water gauge that needs to be identified. The original water gauge image may be understood as an original image corresponding to the target water gauge obtained by taking an image acquisition device. The water gauge image to be analyzed may be a water gauge image obtained by processing the original image.

[0037] Specifically, the original water gauge image corresponding to the target device may be acquired by an image acquisition device arranged near the target water gauge, and after the original water gauge image is acquired, the original water gauge image is processed to obtain the water gauge image to be analyzed, for example, the original water gauge image may be segmented, and then the image background in the original water gauge image may be removed to avoid the influence of the image background on the water gauge recognition result. Alternatively, when the target water gauge needs to be recognized, the original water gauge image corresponding to the target water gauge is acquired from the image database, and the image database may be a pre-set database for storing water gauge images corresponding to each water gauge, for example, the water gauge position corresponding to the target water gauge may be acquired, and the original water gauge image corresponding to the target water gauge may be matched from the image database based on the water gauge position.

[0038] On the basis of the above technical solution, the method of determining the water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image includes: processing the original water gauge image based on a water gauge image segmentation model to determine a mask water gauge image corresponding to the original water gauge image; performing a connected domain analysis on the mask water gauge image to determine the maximum connected domain corresponding to the mask water gauge image; and determining the water gauge image to be analyzed based on the maximum connected domain and the original water gauge image.

[0039] The water gauge image segmentation model is a pre-trained neural network model. The masked water gauge image can be understood as a mask image corresponding to the original image extracted by the water gauge image segmentation model. Connected domain analysis can be an image analysis method for finding areas in an image with the same pixel value and adjacent positions. The maximum connected domain can be understood as the connected domain with the largest number of pixels in the masked water gauge image.

[0040] Specifically, a water gauge image segmentation model can be pre-trained, and the water gauge image segmentation model can be a neural network model based on ISNet or UNet. In the process of training the water gauge image segmentation model, historical water gauge images can be collected, and the pixels associated with the water gauge in the water gauge image are marked as 1, and other pixels are marked as 0, so as to obtain a final training set. The model is trained based on the training set to obtain the water gauge image segmentation model. It should be noted that during the training process, the performance of the final model can be improved through data enhancement methods such as random folding, rotation, scaling, and random occlusion. After obtaining the original water-scale image, the original water-scale image can be input into the water-scale image segmentation model to obtain a mask water-scale image output by the water-scale image segmentation model. A connected domain analysis algorithm is executed on the obtained mask water-scale image, such as the findContours function in the OpenCV library, to obtain at least one connected domain corresponding to the mask water-scale image, and to perform statistics on the area or number of pixels of all connected domains, to screen out the connected domain with the largest area, and to use it as the maximum connected domain corresponding to the mask water-scale image, and then determine the water-scale image to be analyzed based on the maximum connected domain and the original water-scale image.

[0041] On the basis of the above technical solution, the method of determining the water-rule image to be analyzed based on the maximum connected domain and the original water-rule image includes: determining the minimum rotated bounding box corresponding to the maximum connected domain, and segmenting the original water-rule image according to the minimum rotated bounding box and a preset pixel width to determine the water-rule image to be processed; and gray-scaling the water-rule image to be processed to determine the water-rule image to be analyzed.

[0042] The minimum rotation bounding box may be a three-dimensional cuboid used to describe the boundary and shape of the target water gauge. The preset pixel width may be understood as a preset pixel width value for standardizing the image, for example, the preset pixel width may be 32. Grayscale processing may be a process of converting a color image into a grayscale image, for example, the corresponding grayscale value may be obtained by calculating the weighted average of the red, green, and blue channel components of each pixel of the RGB color image.

[0043] Specifically, feature analysis and geometric operations are performed on the determined maximum connected domain, and the minimum rotation bounding box that can completely surround the maximum connected domain with the minimum volume is calculated. The calculated minimum rotation bounding box is combined with a preset pixel width to perform accurate image cropping or segmentation on the original water gauge image, thereby obtaining the water gauge image to be processed, and finally the water gauge image to be processed is grayed to determine the water gauge image to be analyzed. Exemplarily, the covariance matrix corresponding to the maximum connected domain is first calculated, and then the eigenvalues ​​and corresponding eigenvectors of the matrix are solved, and then the obtained eigenvectors are arranged from large to small according to the eigenvalues, and they are used as new coordinate axis bases to construct a rotation matrix, and based on the rotated coordinate system, the maximum and minimum coordinate values ​​of the maximum connected domain on the three main axes are calculated, so as to obtain the size (length, width, height) of the minimum rotation bounding box, and determine its center position (origin), and then after obtaining the minimum rotation bounding box corresponding to the maximum connected domain, the original water gauge image can be segmented based on the preset pixel width and the minimum rotation bounding box to obtain a standardized water gauge image to be processed.

[0044] S120, determining image grayscale features based on the water gauge image to be analyzed, and determining the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features.

[0045] Among them, the image grayscale features can be understood as quantitative features extracted from the grayscale image to describe the image properties or content, such as grayscale histograms, grayscale intensity features, etc. The number of water ruler scale cycles can be the number of two identical unit cycles on the water ruler. Taking the E-type water ruler as an example, the appearance of two E's in the same direction can be regarded as a cycle. Correspondingly, the number of water ruler scale cycles can be understood as the number of times two E's in the same direction appear.

[0046] Specifically, the corresponding image grayscale features are determined by the water gauge image to be analyzed, and the image grayscale features are analyzed to determine the number of water gauge scale cycles corresponding to the target water gauge. It should be noted that since the original water gauge image is often collected from the water gauge image of the target water gauge above the water surface, the number of water gauge scale cycles can represent the number of cycles above the water surface. Exemplarily, the grayscale histogram is calculated to analyze the grayscale distribution of the image, find the grayscale interval representing the scale line, and apply the grayscale co-occurrence matrix (GLCM) or other texture analysis methods to identify the repetitive pattern and periodic characteristics of the scale line, and then obtain the number of water gauge scale cycles corresponding to the target water gauge.

[0047] On the basis of the above technical solution, the method of determining the image grayscale features based on the water gauge image to be analyzed includes: determining the pixel grayscale value corresponding to the preset pixel position based on the water gauge image to be analyzed; and determining the image grayscale features corresponding to the water gauge image to be analyzed according to the pixel grayscale value.

[0048] The preset pixel position may be pre-set pixel position information, for example, the pixel in the second half of each pixel row of the water gauge image to be analyzed. The pixel gray value may be understood as the grayscale information corresponding to the pixel point in the water gauge image to be analyzed.

[0049] Specifically, a pixel grayscale value corresponding to a preset pixel position is obtained from the water-scale image to be analyzed according to the preset pixel position, and the image grayscale feature corresponding to the water-scale image to be analyzed is determined according to the obtained pixel grayscale value. For example, the pixel grayscale value of the second half pixel of each pixel row in the water-scale image to be analyzed may be obtained. Taking the pixel width of the water-scale image to be analyzed as 32 as an example, it is necessary to obtain the pixel grayscale values ​​of the 16th to 32nd pixels of each pixel row, and then determine the intensity signal corresponding to each pixel row according to the pixel grayscale value, and determine the image grayscale feature corresponding to the water-scale image to be analyzed according to all the intensity signals.

[0050] On the basis of the above technical solution, the method of determining the number of water ruler scale periods corresponding to the target water ruler according to the image grayscale features includes: determining the characteristic period corresponding to the image grayscale features based on the image grayscale features and a preset period analysis algorithm; determining a period correlation coefficient sequence based on the characteristic period and the image grayscale features, and determining the number of water ruler scale periods based on the period correlation coefficient sequence and the characteristic period.

[0051] The preset periodic analysis algorithm may be an algorithm for periodic analysis of image grayscale features, such as the LombScargle algorithm. The characteristic period may be the number of periods represented by the distance between adjacent scale lines in the water gauge image on the grayscale image, such as the number of pixel columns corresponding to one period. The periodic correlation coefficient sequence is used to represent the correlation coefficient between data of two adjacent periods, and the correlation coefficient may be the Pearson correlation coefficient.

[0052] Specifically, based on the extracted grayscale features, the LombScargle algorithm is used to analyze the grayscale features of the image, determine the corresponding characteristic period, and then calculate the correlation coefficient of the grayscale features at the corresponding positions of the current period and the next period to form a periodic correlation coefficient sequence. The periodic correlation coefficient sequence reflects the degree of correlation between the grayscale features of the image and the periodic changes. Then, the periodic correlation coefficient sequence is analyzed to find the peak point of the correlation coefficient or the significant change point. Combined with the characteristic periodic information, the position that is most likely to represent the actual scale interval of the water gauge is judged, and the number of water gauge scale cycles is determined according to the final position.

[0053] On the basis of the above technical solution, the method of determining the number of water gauge scale periods based on the periodic correlation coefficient sequence and the characteristic period includes: determining a correlation threshold based on the periodic correlation coefficient sequence, and determining a starting subscript and an ending subscript from the periodic correlation coefficient sequence according to the correlation threshold; determining the number of water gauge scale periods based on the starting subscript, the ending subscript and the characteristic period.

[0054] The correlation threshold may be a correlation coefficient value used to select a target position from the period correlation coefficient sequence. The starting subscript may be the subscript value of the first data in the period correlation coefficient sequence that is greater than the correlation threshold, and correspondingly, the ending subscript may be understood as the subscript value of the last data in the period correlation coefficient sequence that is greater than the correlation threshold.

[0055] Specifically, in order to adapt to the influence of different weather and lighting conditions, the correlation threshold can be determined according to the periodic correlation coefficient sequence. For example, all data greater than 0 in the periodic correlation coefficient sequence can be summed, and the average value of the correlation coefficient is determined according to the summation result. The average value is used as the final correlation threshold, and the starting subscript and the ending subscript are determined from the periodic correlation coefficient sequence based on the correlation threshold, and then the number of water gauge scale cycles is determined based on the starting subscript and the ending subscript, that is, the number of cycles of the target water gauge located on the water level.

[0056] S130. Determine a water level scale corresponding to the target water level based on the water level scale cycle number.

[0057] Specifically, the water level scale corresponding to the target water gauge can be determined according to the water gauge scale cycle number using a preset water gauge scale calculation method. For example, the water level scale corresponding to the target water gauge can be determined by subtracting the length of the water gauge scale cycle number from the preset water gauge length.

[0058] On the basis of the above technical solution, the method of determining the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles includes: obtaining the water gauge standard length and water gauge cycle length corresponding to the target water gauge; and determining the water level scale value based on the number of water gauge scale cycles, the water gauge standard length and the water gauge cycle length.

[0059] Among them, the standard length of the water gauge can be understood as the water gauge length corresponding to the target water gauge. Correspondingly, the water gauge period length can be understood as the period length corresponding to the target water gauge. Taking the E-type water gauge as an example, the length between two E's can be regarded as a period length.

[0060] Specifically, the standard length of the water gauge and the water gauge period length corresponding to the target water gauge are obtained, and then the water level scale value is determined based on the number of water gauge scale periods, the standard length of the water gauge and the water gauge period length. It should be noted that water gauges of different specifications correspond to different specifications, so it is necessary to determine the corresponding standard length of the water gauge and the water gauge period length according to the specifications of the target water gauge to ensure the correct calculation of the water level scale value. Exemplarily, the length value of the water gauge located on the water surface can be determined based on the number of water gauge scale periods and the water gauge period length, and then the water level scale value corresponding to the target water gauge can be obtained by subtracting the length value of the water gauge located on the water surface from the standard length of the water gauge.

[0061] The technical solution of the embodiment of the present invention obtains the original water gauge image corresponding to the target water gauge, and determines the water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image, and then determines the image grayscale features based on the water gauge image to be analyzed, and determines the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features, and finally determines the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles. Based on the above technical solution, the image grayscale features corresponding to the image are obtained by processing the collected water gauge image, and the image grayscale features are analyzed to obtain the corresponding number of water gauge scale cycles, and then the water level scale of the water gauge is determined, thereby improving the accuracy of water level recognition of the water gauge, and achieving the technical effect of improving the accuracy of water level recognition.

[0062] Embodiment 2

[0063] Figure 2 A flow chart of a water gauge water level identification method provided in an embodiment of the present invention. Based on the above embodiment, this embodiment further optimizes the above water gauge water level identification method. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or corresponding to the above embodiment are not repeated here.

[0064] Determine the masked water gauge image: Specifically, by collecting historical water gauge images, and using the manual labeling method to label the water gauge pixels in the historical water gauge images as 1 and other pixels as 0, a training set of the model is formed. The model to be trained is trained based on the training set to obtain a water gauge image segmentation model, and the original water gauge image is input into the water gauge image segmentation model to obtain a masked water gauge image corresponding to the original water gauge image. The original water gauge image is as follows: Figure 3 As shown, the mask water ruler image is Figure 4 It should be noted that data enhancement methods such as random folding, rotation, scaling, random occlusion, etc. can be used during the training process, and the neural network model of the structure can be selected according to the needs, for example, it can be an ISNet neural network or a UNet neural network.

[0065] Determine the water-rule image to be analyzed: Specifically, the connected domain analysis method is used for the masked water-rule image, and only the connected domain with the largest area is retained. This can filter out some noise results predicted by the segmentation model, and after obtaining the largest connected domain, determine the minimum rotated bounding box corresponding to the largest connected domain, such as Figure 5 As shown, that is, the rotated rectangle with the smallest area that can enclose the connected domain, the length and width of this rotated rectangle are recorded as ori_height and ori_width respectively. However, since the minimum rotated bounding box has a rotation angle, in order to obtain a standardized result for further analysis, the minimum rotated bounding box can be perspectively transformed according to the preset pixel width and projected onto a regular rectangle without a rotation angle. The width and height of this regular rectangle are width = 32, height = floor ((ori_height / ori_width)*32), and the floor is rounded down. Then, the water gauge image to be processed can be obtained, as shown in Figure 6 As shown, the water gauge image to be processed is grayed out to obtain the water gauge image to be analyzed.

[0066] Determine the number of water gauge scale cycles: Specifically, after obtaining the water gauge image to be analyzed, the corresponding pixel grayscale value can be extracted from the water gauge image to be analyzed based on the preset pixel position, and then the image grayscale feature corresponding to the water gauge image to be analyzed can be determined based on the pixel grayscale value. The grayscale value of the second half of each row of the grayscale image can be summed up and recorded as the intensity signal of this pixel row, and finally an intensity feature with a length of height is obtained. That is, feature[j] = ∑ i≥16 gray_img[i,j]; where j=0,1,2,…,height-1. It should be noted that only the grayscale values ​​of the second half of each row are considered to prevent irregular signals such as numbers on the left side of the image from affecting the algorithm's search for signal cycles. Then, the LombScargle algorithm is used to perform periodic analysis on the image grayscale features to obtain a characteristic period corresponding to the image grayscale features, which is recorded as P. Then, based on the characteristic period P and the image grayscale features, an autocorrelation analysis is performed to determine the starting point and horizontal plane of the water gauge, that is, the starting point and end point of the periodic signal, by determining the Pearson correlation sequence based on the period:

[0067] correlation[i]=pearson_function(feature[i:i+P],feature[i+P:i+2P]);

[0068] Where pearson_function is the Pearson correlation function, i=0,1,…,height-2P.

[0069] After determining the periodic correlation coefficient sequence, in order to ensure that the start and end points of the periodic signal can still be screened out under different weather and lighting conditions, all data greater than 0 in the periodic correlation coefficient sequence can be summed, and the average value of the correlation coefficient can be determined based on the summation result. The average value is used as the final correlation threshold T, and the starting subscript and the ending subscript are determined from the periodic correlation coefficient sequence based on the correlation threshold. Then, with T as the threshold, search for the subscript value of the first value greater than T in the correlation and the subscript value of the last value greater than T, which are recorded as start_index and last_index respectively. Finally, last_index = last_index + 2P, and the positioning result is as follows: Figure 7 As shown. That is, start_index is the start index of the periodic signal, and last_index is the end index of the periodic signal. The number of water gauge scale periods is (last_index–start_index) / P.

[0070] Determine the scale value of the water gauge: Specifically, the length of the water gauge on the water surface is determined based on the scale period number and the water gauge period length. Then, the water level scale value corresponding to the target water gauge can be obtained by subtracting the length of the water gauge on the water surface from the standard length of the water gauge. That is, the actual length of the water gauge on the horizontal surface is:

[0071] on_water_length=(last_index–start_index) / P*two_E_length;wherein, two_E_length is the standard length of the two E's of the E-type water gauge, that is, the actual length of one cycle, usually 10cm, which is determined by the water gauge specifications. The final scale of the water gauge is the actual total length of the water gauge minus the length of the water gauge on the horizontal plane.

[0072] The technical solution of the embodiment of the present invention obtains the original water gauge image corresponding to the target water gauge, and determines the water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image, and then determines the image grayscale features based on the water gauge image to be analyzed, and determines the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features, and finally determines the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles. Based on the above technical solution, the image grayscale features corresponding to the image are obtained by processing the collected water gauge image, and the image grayscale features are analyzed to obtain the corresponding number of water gauge scale cycles, and then the water level scale of the water gauge is determined, thereby improving the accuracy of water level recognition of the water gauge, and achieving the technical effect of improving the accuracy of water level recognition.

[0073] Embodiment 3

[0074] Figure 8The structure block diagram of a water level identification device provided by an embodiment of the present invention. Figure 8 As shown, the device includes: a water gauge image processing module 810, a water gauge scale period determination module 820 and a water level scale determination module 830.

[0075] The water gauge image processing module 810 is used to obtain an original water gauge image corresponding to a target water gauge, and determine a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image;

[0076] A water gauge scale period determination module 820 is used to determine the image grayscale features based on the water gauge image to be analyzed, and determine the number of water gauge scale periods corresponding to the target water gauge according to the image grayscale features;

[0077] The water level scale determination module 830 is used to determine the water level scale corresponding to the target water level based on the water level scale cycle number.

[0078] On the basis of the above technical solution, the water gauge image processing module is used to process the original water gauge image based on the water gauge image segmentation model to determine the mask water gauge image corresponding to the original water gauge image, wherein the water gauge image segmentation model is a pre-trained neural network model; perform connected domain analysis on the mask water gauge image to determine the maximum connected domain corresponding to the mask water gauge image; and determine the water gauge image to be analyzed based on the maximum connected domain and the original water gauge image.

[0079] On the basis of the above technical solution, the water gauge image processing module is used to determine the minimum rotated bounding box corresponding to the maximum connected domain, and to segment the original water gauge image according to the minimum rotated bounding box and the preset pixel width to determine the water gauge image to be processed; and to grayscale the water gauge image to be processed to determine the water gauge image to be analyzed.

[0080] On the basis of the above technical solution, the water gauge scale period determination module is used to determine the pixel grayscale value corresponding to the preset pixel position based on the water gauge image to be analyzed; and determine the image grayscale feature corresponding to the water gauge image to be analyzed according to the grayscale pixel value.

[0081] On the basis of the above technical solution, the water ruler scale period determination module is used to determine the characteristic period corresponding to the image grayscale feature based on the image grayscale feature and a preset period analysis algorithm; determine the period correlation coefficient sequence based on the characteristic period and the image grayscale feature, and determine the number of water ruler scale periods based on the period correlation coefficient sequence and the characteristic period.

[0082] On the basis of the above technical solution, the water gauge scale period determination module is used to determine the correlation threshold based on the periodic correlation coefficient sequence, and determine the starting subscript and the ending subscript from the periodic correlation coefficient sequence according to the correlation threshold; and determine the number of water gauge scale periods based on the starting subscript, the ending subscript and the characteristic period.

[0083] Based on the above technical solution, the water level scale determination module is used to obtain the water level standard length and water level cycle length corresponding to the target water level; and determine the water level scale value based on the water level scale cycle number, the water level standard length and the water level cycle length.

[0084] The technical solution of the embodiment of the present invention obtains the original water gauge image corresponding to the target water gauge, and determines the water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image, and then determines the image grayscale features based on the water gauge image to be analyzed, and determines the number of water gauge scale cycles corresponding to the target water gauge according to the image grayscale features, and finally determines the water level scale corresponding to the target water gauge based on the number of water gauge scale cycles. Based on the above technical solution, the image grayscale features corresponding to the image are obtained by processing the collected water gauge image, and the image grayscale features are analyzed to obtain the corresponding number of water gauge scale cycles, and then the water level scale of the water gauge is determined, thereby improving the accuracy of water level recognition of the water gauge, and achieving the technical effect of improving the accuracy of water level recognition.

[0085] The water gauge water level identification device provided in the embodiment of the present invention can execute the water gauge water level identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0086] Embodiment 4

[0087] Fig. 9 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0088] like Fig. 9As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0089] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0090] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as method XXX.

[0091] In some embodiments, method XXX may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of method XXX described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform method XXX in any other appropriate manner (e.g., by means of firmware).

[0092] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0093] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0094] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0095] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0096] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0097] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0098] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0099] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A water level identification method for a water gauge, It is characterized in that include: Acquire an original water gauge image corresponding to a target water gauge, and determine a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image; Determine the image grayscale features based on the water gauge image to be analyzed, and determine the water gauge scale period number corresponding to the target water gauge according to the image grayscale features; wherein the water gauge scale period number is the number of times two E's in the same direction appear on the E-type water gauge; Determining a water level scale value corresponding to the target water gauge based on the water gauge scale cycle number; The step of determining the number of water ruler scale cycles corresponding to the target water ruler according to the image grayscale feature comprises: Determine a characteristic period corresponding to the image grayscale feature based on the image grayscale feature and a preset period analysis algorithm; Determine a periodic correlation coefficient sequence based on the characteristic period and the image grayscale feature, and determine the number of water ruler scale periods based on the periodic correlation coefficient sequence and the characteristic period; The step of determining the number of water gauge scale periods based on the period correlation coefficient sequence and the characteristic period comprises: Determining a correlation threshold based on the periodic correlation coefficient sequence, and determining a start subscript and an end subscript from the periodic correlation coefficient sequence according to the correlation threshold; Determine the number of water gauge scale periods based on the start subscript, the end subscript and the characteristic period; The step of determining the water level scale value corresponding to the target water level gauge based on the water level gauge scale cycle number includes: Acquire the standard length of the water gauge and the water gauge cycle length corresponding to the target water gauge; The water level scale value is determined based on the number of water gauge scale cycles, the standard length of the water gauge and the length of the water gauge cycle.

2. The method according to claim 1, It is characterized in that The step of determining the to-be-analyzed water gauge image corresponding to the target water gauge based on the original water gauge image comprises: Processing the original water gauge image based on a water gauge image segmentation model to determine a mask water gauge image corresponding to the original water gauge image, wherein the water gauge image segmentation model is a pre-trained neural network model; Performing a connected domain analysis on the masked water gauge image to determine the maximum connected domain corresponding to the masked water gauge image; The water gauge image to be analyzed is determined based on the maximum connected domain and the original water gauge image.

3. The method according to claim 2, It is characterized in that The step of determining the water gauge image to be analyzed based on the maximum connected domain and the original water gauge image comprises: Determine a minimum rotation bounding box corresponding to the maximum connected domain, and segment the original water gauge image according to the minimum rotation bounding box and a preset pixel width to determine a water gauge image to be processed; Grayscale processing is performed on the water gauge image to be processed to determine the water gauge image to be analyzed.

4. The method according to claim 1, It is characterized in that The step of determining the image grayscale feature based on the water gauge image to be analyzed includes: Determine the pixel grayscale value corresponding to the preset pixel position based on the water gauge image to be analyzed; The image grayscale features corresponding to the water gauge image to be analyzed are determined according to the pixel grayscale values.

5. A water level identification device for a water gauge, It is characterized in that include: A water gauge image processing module is used to obtain an original water gauge image corresponding to a target water gauge, and determine a water gauge image to be analyzed corresponding to the target water gauge based on the original water gauge image; A water gauge scale period determination module is used to determine the image grayscale features based on the water gauge image to be analyzed, and determine the number of water gauge scale periods corresponding to the target water gauge according to the image grayscale features; wherein the number of water gauge scale periods is the number of times two E's in the same direction appear on the E-type water gauge; A water level scale determination module, used to determine a water level scale value corresponding to the target water level based on the water level scale cycle number; The water ruler scale period determination module is used to determine the characteristic period corresponding to the image grayscale feature based on the image grayscale feature and a preset period analysis algorithm; determine the period correlation coefficient sequence based on the characteristic period and the image grayscale feature, and determine the number of water ruler scale periods based on the period correlation coefficient sequence and the characteristic period; The water gauge scale period determination module is used to determine a correlation threshold based on the period correlation coefficient sequence, and determine a starting subscript and an ending subscript from the period correlation coefficient sequence according to the correlation threshold; and determine the number of water gauge scale periods based on the starting subscript, the ending subscript and the characteristic period; The water level scale determination module is used to obtain the water level gauge standard length and water level gauge cycle length corresponding to the target water level; and determine the water level scale value based on the water level gauge scale cycle number, the water level gauge standard length and the water level gauge cycle length.

6. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the water gauge water level identification method according to any one of claims 1 to 4.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the water gauge water level identification method according to any one of claims 1 to 4 when executed.

Citation Information

Patent Citations

  • Ship water gauge marking identification method and device, computer equipment and storage medium

    CN110717924A

  • Water level monitoring method and device

    CN111220235A

  • Water gauge scale automatic reading method and system and electronic equipment

    CN115546793A

  • Water gauge water level identification method and system based on morphological image processing

    CN116071692A

  • System for detecting invasion on water and method for the same

    JP2018152106A