A pressure gauge reading measurement method and system
Patent Information
- Application Number
- CN202611047745.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-07-15
AI Technical Summary
[0003]采用单一的识别方法在实验室洁净环境下可实现较高的识别精度,但在地下泵房等实际工业场景中,受潮湿水雾、表盘污损、金属反光及机械震动等复杂因素影响,导致压力表的表盘无法被正确地识别,进而导致识别方法输出的识别结果失真
[0014] The present invention achieves the following beneficial effects: by identifying the pressure gauge to output the first predicted range and image confidence of the pressure gauge, and determining the second predicted range of the pressure gauge, and then processing the fusion weight based on the relative difference between the first and second predicted ranges and the image confidence, the maximum range value of the pressure gauge is finally determined. This realizes multimodal complementary fusion of image recognition and geometric scale, solves the problem that a single recognition method cannot adapt to different water environments, and improves the recognition accuracy in complex water environments.
Smart Images

Figure CN122574429B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water treatment, and more particularly to a method and system for measuring pressure gauge readings. Background Technology
[0002] In water management scenarios, the accuracy and continuity of pressure gauge readings directly determine the safe operation level of the water supply system. For intelligent pressure gauge reading recognition, existing technologies have evolved through multiple generations. Early methods employed traditional image processing based on Hough transform, manually extracting pointer and scale information through feature design. Later, deep learning models using image recognition were developed for pressure gauge reading recognition.
[0003] While a single identification method can achieve high accuracy in a clean laboratory environment, in real-world industrial settings such as underground pump rooms, complex factors such as humidity, dial contamination, metal reflection, and mechanical vibration can cause pressure gauge dials to be incorrectly identified, leading to distorted identification results. Existing water systems using a single identification method struggle to adapt to interference under different operating conditions, resulting in low identification accuracy. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention discloses a pressure gauge reading measurement method applied to pressure gauges in complex water environments. The method includes: Step S1, identifying the pressure gauge reading to determine a first predicted range and outputting an image confidence score, and identifying the pressure gauge scale to determine a second predicted range; Step S2, processing to obtain the relative difference between the first and second predicted ranges, and processing based on the relative difference and the image confidence score to obtain a fusion weight; Step S3, processing based on the first predicted range, the second predicted range, and the fusion weight to obtain the maximum range value of the pressure gauge; Step S4, identifying the angle ratio between the pressure gauge pointer and the pressure gauge scale, and outputting an optimal real-time reading based on the angle ratio and the maximum range value.
[0005] Preferably, step S1 includes: step S11, acquiring a real-time dial image of the pressure gauge, recognizing the real-time dial image using a preset optical recognition model to output a reading list and the image confidence score, and performing semantic segmentation on the real-time dial image using a preset semantic segmentation model, combining the semantic segmentation result with a preset scale distribution rule to output the scale set of the real-time dial image as the second predicted range, and outputting a geometric confidence score; step S12, determining whether the maximum reading in the reading list matches the standard range in the preset standard range set: if yes, then the matching maximum reading is used as the first predicted range; if no, then the maximum reading is subtracted from each standard range in the standard range set, and the standard range with the smallest difference from the maximum reading is used as the first predicted range.
[0006] Preferably, when performing step S12, if the maximum reading does not match the standard range, the following steps are used to obtain the first predicted range: Step A1, calculate the tolerance range of each standard range, and determine whether the range error between the maximum reading and each standard range is greater than the tolerance range: if yes, discard the corresponding standard range; if no, retain the corresponding standard range in the temporary range set; after all standard ranges have been determined, proceed to step A2; Step A2, determine whether the temporary range set is empty: if yes, do not output the first predicted range, and output the image confidence as 0; if no, use the standard range with the smallest range error in the temporary range set as the first predicted range.
[0007] Preferably, when performing step S11, if the image confidence is less than a preset image confidence threshold, the following steps are used for image enhancement: Step B1, each scale in the scale set is matched with the corresponding reading in the reading list, the difference between the scale and the reading at the same position is calculated and it is determined whether the difference is greater than a preset deviation threshold: if yes, the position information of the corresponding scale on the real-time dial image is obtained, and then proceed to step B2; if no, the corresponding reading is retained, and the reading list is constructed after all readings are determined, the reading list and the image confidence are output, and then proceed to step S12; Step B2, the corresponding position of the real-time dial image is enhanced according to the position information, the optical recognition model re-recognizes the enhanced real-time dial image, re-outputs the reading list and the image confidence, and then proceeds to step S12.
[0008] Preferably, when performing step S11, if the geometric confidence is less than a preset geometric confidence threshold, the following steps are used for image enhancement: Step C1, obtain the pixel coordinates of each reading in the reading list on the real-time dial image; Step C2, determine the detection side length based on the dial diameter in the real-time dial image, and divide the detection area of the corresponding reading according to the detection side length with each pixel coordinate as the center; Step C3, process and obtain the segmentation sensitivity parameter according to the preset benchmark segmentation threshold, the preset enhancement coefficient and the image confidence; Step C4, adjust the segmentation standard of the semantic segmentation model based on the segmentation sensitivity parameter, and the semantic segmentation model re-segments the real-time dial image based on the adjusted segmentation standard. The result of the re-segmentation is combined with the preset scale distribution law to output a new scale set as the second prediction range, and output a new geometric confidence, and then proceed to step S12.
[0009] Preferably, step S4 includes: step S41, acquiring the real-time dial image, and using a preset key point recognition model to recognize the real-time dial image to output the first coordinate of the scale start point, the second coordinate of the scale end point, and the third coordinate of the pointer tip; step S42, calculating the total angle between the first coordinate and the second coordinate based on the preset center point coordinate, and calculating the reading angle between the first coordinate and the third coordinate based on the center point coordinate; step S43, multiplying the ratio of the reading angle to the total angle by the maximum range value to output the original real-time reading; step S44, determining the gain matrix based on the image confidence and the geometric confidence, filtering the original real-time reading based on the gain matrix, and outputting the optimal real-time reading.
[0010] Preferably, the measurement cycle of the pressure gauge reading measurement method is preset; in each measurement cycle, the state vector containing the optimal real-time reading is updated, and the corresponding error covariance matrix is updated in each measurement cycle; step S44 includes: step S441, processing the state vector of the previous measurement cycle and the preset state transition matrix to obtain the state prediction vector of the current measurement cycle, and processing the error prediction matrix of the current measurement cycle based on the error covariance matrix, the state transition matrix, and the preset process noise covariance matrix of the previous measurement cycle; step S442, processing the image confidence and the geometric confidence to obtain the comprehensive confidence. Step S443: Adjust the preset observation noise covariance matrix according to the comprehensive confidence level; the comprehensive confidence level is negatively correlated with the observation noise covariance matrix; Step S444: Process the error prediction matrix, the preset observation matrix, and the adjusted observation noise covariance matrix to obtain the gain matrix; Step S444: Process the state prediction vector, the gain matrix, the original real-time reading, and the observation matrix to obtain the state vector of the current measurement period, output the optimal real-time reading of the current measurement period, and process the gain matrix, the observation matrix, the error prediction matrix, and the preset identity matrix to obtain the error covariance matrix of the current measurement period.
[0011] Preferably, after obtaining the overall confidence level, step S442 first determines whether the overall confidence level of the current measurement cycle and the overall confidence level of the previous preset number of measurement cycles are both less than a preset confidence level threshold: if yes, the optimal real-time reading in the state vector of the previous measurement cycle is directly output; if no, the preset observation noise covariance matrix is adjusted according to the overall confidence level, and then the process proceeds to step S443.
[0012] Preferably, a reference range value is determined based on multiple historical maximum range values. When performing step S1, after determining the first predicted range and the second predicted range, the following steps are used for range verification: Step D1, the difference between the first predicted range and the reference range value is calculated to output a first error value, and the difference between the second predicted range and the reference range value is calculated to output a second error value; Step D2, the first error value and the second error value are compared with preset change thresholds: when the first error value is greater than the change threshold, the first predicted range is not output, the image confidence is output as 0, and then the process proceeds to step S3, using the second predicted range as the maximum range value; when the first error value is not greater than the change threshold, the first predicted range and the image confidence are output; when the second error value is greater than the change threshold, the second predicted range is not output, the geometric confidence is output as 0, and then the process proceeds to step S3, using the first predicted range as the maximum range value; and when the second error value is not greater than the change threshold, the second predicted range is output.
[0013] This invention discloses a pressure gauge reading measurement system, applied to the pressure gauge reading measurement method. The pressure gauge reading measurement system includes: an identification module, used to identify the pressure gauge reading to determine a first predicted range of the pressure gauge and output an image confidence score, and to identify the scale of the pressure gauge to determine a second predicted range of the pressure gauge; a weight processing module, connected to the identification module, used to process and obtain the relative difference between the first predicted range and the second predicted range, and to process and obtain a fusion weight based on the relative difference and the image confidence score; a range determination module, connected to the identification module and the weight processing module, used to process and obtain the maximum range value of the pressure gauge based on the first predicted range, the second predicted range, and the fusion weight; and a reading output module, connected to the identification module and the range determination module, used to identify the angle ratio between the pointer and the scale of the pressure gauge, and to output an optimal real-time reading based on the angle ratio and the maximum range value.
[0014] The present invention achieves the following beneficial effects: by identifying the pressure gauge to output the first predicted range and image confidence of the pressure gauge, and determining the second predicted range of the pressure gauge, and then processing the fusion weight based on the relative difference between the first and second predicted ranges and the image confidence, the maximum range value of the pressure gauge is finally determined. This realizes multimodal complementary fusion of image recognition and geometric scale, solves the problem that a single recognition method cannot adapt to different water environments, and improves the recognition accuracy in complex water environments. Attached Figure Description
[0015] Figure 1 This is a schematic flowchart of the pressure gauge reading measurement method of the present invention; Figure 2 This is a schematic diagram of the process for identifying the first and second prediction ranges in this invention. Figure 3 This is a schematic diagram of the process for determining the first prediction range in this invention; Figure 4 This is a schematic diagram of the process for image enhancement in this invention when the image confidence level is low; Figure 5 This is a schematic diagram of the image enhancement process for low geometric confidence in this invention; Figure 6 This is a schematic diagram of the process for determining the optimal real-time reading in this invention; Figure 7 This is a schematic diagram of the process for filtering real-time readings in this invention; Figure 8 This is a schematic diagram of the process for verifying the first and second prediction ranges in this invention. Figure 9 This is a schematic diagram of the pressure gauge reading measurement system of the present invention; Figure 10 This is a schematic diagram of the pressure gauge reading identification and closed-loop verification process of the present invention.
[0016] In the attached diagram: 1. Identification module, 2. Weight processing module, 3. Range determination module, 4. Reading output module. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0019] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.
[0020] This invention discloses a method for measuring pressure gauge readings, applicable to pressure gauges in complex water environments, such as... Figure 1As shown, the process includes: Step S1, identifying the pressure gauge reading to determine the first predicted range of the pressure gauge and outputting the image confidence score, and identifying the pressure gauge scale to determine the second predicted range of the pressure gauge; Step S2, processing to obtain the relative difference between the first and second predicted ranges, and processing to obtain the fusion weight based on the relative difference and the image confidence score; Step S3, processing to obtain the maximum range value of the pressure gauge based on the first predicted range, the second predicted range, and the fusion weight; Step S4, identifying the angle ratio between the pressure gauge pointer and the pressure gauge scale, and outputting the optimal real-time reading based on the angle ratio and the maximum range value.
[0021] Specifically, pressure gauges in water systems utilize flat-section Bourdon tubes. The Bourdon tube is bent into a C-shape or spiral, with one end fixed and connected to the water pressure, while the other end is free and closed. When pressurized water enters the tube, the flat tube tends to expand and round under pressure, forcing the free end to extend outward and generate displacement. This displacement drives an amplification mechanism composed of a connecting rod and a sector gear, which rotates the pointer on the pressure gauge surface, indicating the pressure value on the dial. The greater the pressure, the greater the deformation and the greater the pointer deflection angle.
[0022] This application designs a pressure gauge reading measurement method for industrial pressure gauges with uniform scale distribution and standardized range.
[0023] In step S2, the relative difference is calculated using the following formula:
[0024] in, The degree of relative difference; This is the first predictive range; This is the second prediction range.
[0025] In step S2, the fusion weights are calculated using the following formula:
[0026] in, For weighting; The preset sensitivity coefficient; The degree of relative difference; Image confidence level.
[0027] When the image confidence is set to 0, the fusion weight is directly output as 1, and the second prediction range is used as the maximum range value.
[0028] Step S3 uses the following formula to calculate the maximum range value:
[0029] in, This is the maximum range value; For fusion weights; This is the second prediction range; This is the first prediction range.
[0030] When both image confidence and geometric confidence are extremely low or zero, the overall confidence is triggered to be less than the confidence threshold. After a preset number of measurement cycles, the most recent optimal real-time reading is output and fed back to the staff for intervention.
[0031] In a preferred embodiment of the present invention, such as Figure 2 As shown, step S1 includes: step S11, acquiring a real-time dial image of the pressure gauge, using a preset optical recognition model to identify the real-time dial image to output a reading list and image confidence score, and using a preset semantic segmentation model to perform semantic segmentation on the real-time dial image, combining the semantic segmentation result with a preset scale distribution rule to output the scale set of the real-time dial image as the second predicted range, and outputting the geometric confidence score; step S12, determining whether the maximum reading in the reading list matches the standard range in the preset standard range set: if yes, then the matching maximum reading is used as the first predicted range; if no, then the maximum reading is subtracted from each standard range in the standard range set, and the standard range with the smallest difference from the maximum reading is used as the first predicted range.
[0032] Specifically, a high-resolution RGB (Red Green Blue) camera is used to continuously acquire real-time dial images of the pressure gauge, which are then input into an optical recognition model to extract a reading list, and into a semantic segmentation model to obtain a second predicted range.
[0033] On the one hand, the optical recognition model uses the PaddlePaddle-based OCR (Optical Character Recognition) engine to recognize the real-time dial image. The output numbers on the pressure gauge are used as the raw readings. The raw readings are cleaned, for example, by replacing commas with dots, removing spaces and unit symbols. Then, the cleaned raw readings are converted into floating-point numbers to obtain real-time readings that can be processed later, forming a reading list.
[0034] On the other hand, the semantic segmentation model identifies the real-time dial image and accurately segments the hands and scale lines. Based on the segmentation results, a polar coordinate system is established with the center of the dial as the origin, and the angular distribution of all valid scale lines is calculated. By counting the total number of scale lines and using the preset scale distribution pattern as prior knowledge, the second predicted range is inferred and output.
[0035] Furthermore, the maximum reading in the original readings is matched with the standard range in the preset standard range set, and the matched maximum reading is taken as the first predicted range.
[0036] In one embodiment, the standard range set is represented as: {1.0, 1.6, 25.0}.
[0037] The standard range set can be expanded automatically based on actual working conditions and pressure gauge range setting standards.
[0038] In a preferred embodiment of the present invention, such as Figure 3 As shown, when executing step S12, if the maximum reading does not match the standard range, the following steps are used to obtain the first predicted range: Step A1, calculate the tolerance range of each standard range and determine whether the range error between the maximum reading and each standard range is greater than the tolerance range: if yes, discard the corresponding standard range; if no, retain the corresponding standard range in the temporary range set; after all standard ranges have been determined, proceed to step A2; Step A2, determine whether the temporary range set is empty: if yes, do not output the first predicted range and output the image confidence as 0; if no, use the standard range with the smallest range error in the temporary range set as the first predicted range.
[0039] Specifically, the range error between the maximum reading and its closest standard range is calculated, and the allowable tolerance range of the closest standard range is calculated. If the range error is not greater than the tolerance range, the standard range is used as the first predicted range. If the range error is greater than the tolerance range, the difference between the maximum reading and other standard ranges is calculated, and the tolerance ranges are compared. The standard range with the smallest range error is used as the first predicted range.
[0040] If the range error between the maximum reading and all standard ranges is greater than the tolerance range, the optical recognition model cannot output the first predicted range and forces the image confidence to 0.
[0041] The fault tolerance range is calculated using the following formula:
[0042] in, This is the fault tolerance range; The value is for the standard range.
[0043] In a preferred embodiment of the present invention, when performing step S11, if the image confidence level is less than a preset image confidence level threshold, such as... Figure 4 As shown, the image enhancement is performed using the following steps: Step B1, each scale in the scale set is matched with the corresponding reading in the reading list. The difference between the scale and the reading at the same position is calculated, and it is determined whether the difference is greater than a preset deviation threshold. If yes, the position information of the corresponding scale on the real-time dial image is obtained, and then the process proceeds to step B2. If no, the corresponding reading is retained, and a reading list is constructed after all readings are determined. The reading list and image confidence score are output, and then the process proceeds to step S12. Step B2, the corresponding position of the real-time dial image is enhanced according to the position information. The optical recognition model re-recognizes the enhanced real-time dial image, re-outputs the reading list and image confidence score, and then the process proceeds to step S12.
[0044] Specifically, the semantic segmentation model performs semantic segmentation on the real-time dial image to obtain a complete set of scale lines, and calculates the theoretical angle between adjacent main scale lines and the total number of scale divisions corresponding to the second predicted range. When the image confidence score output by the optical recognition model is less than a preset image confidence threshold, the reading list is verified.
[0045] If the readings in the reading list contradict the scale in the second predicted range calculated based on geometric distribution in terms of quantity, arithmetic progression, or numerical range, the optical recognition model will determine that a systematic misidentification caused by dirt or reflection has occurred. The scale output by the semantic segmentation model is used to locate the corresponding local pixel block of the digital region in the real-time dial image. This region is adaptively enhanced, including contrast stretching and deblurring. Then, the optical recognition model performs a second recognition on the enhanced region. If the second recognition still fails, the second predicted range is directly used as the standard, and the reading list obtained in this recognition is marked as abnormal for maintenance and traceability.
[0046] In a preferred embodiment of the present invention, when performing step S11, if the geometric confidence level is less than a preset geometric confidence threshold, such as Figure 5As shown, image enhancement is performed using the following steps: Step C1, obtain the pixel coordinates of each reading in the reading list on the real-time dial image; Step C2, determine the detection side length based on the dial diameter in the real-time dial image, and divide the detection area of the corresponding reading according to the detection side length with each pixel coordinate as the center; Step C3, process the image according to the preset baseline segmentation threshold, preset enhancement coefficient and image confidence to obtain the segmentation sensitivity parameter; Step C4, adjust the segmentation standard of the semantic segmentation model based on the segmentation sensitivity parameter, and the semantic segmentation model re-segments the real-time dial image based on the adjusted segmentation standard. The result of the re-segmentation is combined with the preset scale distribution law to output a new scale set as the second prediction range, and output a new geometric confidence, and then proceed to step S12.
[0047] Specifically, when the geometric confidence level is less than a preset geometric confidence threshold, a detection region is formed by dividing a square window using the pixel coordinates of the readings in the reading list output by the optical recognition model on the real-time dial image as the center and the detection side length. Within the detection region, the semantic segmentation model uses an enhanced segmentation sensitivity parameter for secondary recognition.
[0048] The detection side length is determined using the following formula:
[0049] in, To detect the side length; The number of pixels is the diameter of the dial.
[0050] The segmentation sensitivity parameter is determined using the following formula:
[0051] in, This refers to the segmentation sensitivity parameter; The preset baseline segmentation threshold; This is the preset enhancement coefficient; Image confidence level.
[0052] Furthermore, after the semantic segmentation model completes inference on the real-time dial image, it outputs a probability map with the same size as the original image, where each pixel value represents the probability of belonging to a tick mark. Before adjustment, the semantic segmentation model binarizes the entire probability map based on a baseline segmentation threshold, generating a basic tick mark binary mask. After adjusting the baseline segmentation threshold using the above formula to obtain the segmentation sensitivity parameter, it re-binarizes the same probability map using the segmentation sensitivity parameter to generate a local repair mask. Finally, it replaces the corresponding area of the basic tick mark binary mask with the local repair mask, outputting the binary masks for all tick marks. All tick marks are then obtained from the binary masks to form a tick mark set, and the semantic segmentation model simultaneously outputs the geometric confidence score.
[0053] In addition, after obtaining the image confidence and geometric confidence in step S11, threshold comparisons are performed on them respectively.
[0054] When the image confidence is less than the preset image confidence threshold and the geometric confidence is not less than the preset geometric confidence threshold, steps B1 and B2 are performed; when the image confidence is not less than the preset image confidence threshold and the geometric confidence is less than the preset geometric confidence threshold, steps C1 to C4 are performed; when the image confidence is not less than the preset image confidence threshold and the geometric confidence is not less than the preset geometric confidence threshold, the process directly proceeds to step S12; when the image confidence is less than the preset image confidence threshold and the geometric confidence is also less than the preset geometric confidence threshold, both the first and second prediction ranges are discarded, the optimal real-time reading of the previous measurement cycle is output, and this identification is marked as abnormal.
[0055] In a preferred embodiment of the present invention, step S1, when determining the second prediction range, also outputs the corresponding geometric confidence level; such as Figure 6 As shown, step S4 includes: step S41, acquiring a real-time dial image, and using a preset key point recognition model to recognize the real-time dial image to output the first coordinate of the scale start point, the second coordinate of the scale end point, and the third coordinate of the pointer tip; step S42, calculating the total angle between the first and second coordinates based on the preset center point coordinates, and calculating the reading angle between the first and third coordinates based on the center point coordinates; step S43, multiplying the ratio of the reading angle to the total angle by the maximum range value to output the original real-time reading; step S44, determining the gain matrix based on image confidence and geometric confidence, filtering the original real-time reading based on the gain matrix, and outputting the optimal real-time reading.
[0056] Specifically, the key point recognition model is used to identify the starting point, ending point, and pointer vertex of the scale.
[0057] Furthermore, the keypoint recognition model sends the identified first, second, and third coordinates, along with the preset center point coordinates, to a preset angle calculation unit. The angle calculation unit establishes a polar coordinate system based on the center point coordinates, calculates the original angles between the first, second, and third coordinates and the center point coordinates using the arctangent function, and maps all original angles to [0, 2]. Within the range of ], the total included angle is then calculated based on the original angles of the first and second coordinates, and the reading included angle is calculated based on the first and third coordinates.
[0058] When identifying pointer vertices, the key point recognition model also outputs key point confidence. When the key point confidence is less than the preset key point confidence threshold, it outputs the optimal real-time reading of the previous measurement cycle to prevent reading fluctuations caused by pointer detection anomalies.
[0059] Furthermore, the raw real-time readings are calculated using the following formula:
[0060] in, This represents the raw real-time reading for the k-th measurement cycle; The angle between the readings in the k-th measurement cycle; The total included angle in the k-th measurement cycle; This represents the maximum range value in the k-th measurement cycle.
[0061] In a preferred embodiment of the present invention, a measurement period is preset; a state vector containing the optimal real-time reading is updated in each measurement period, and the corresponding error covariance matrix is updated in each measurement period; such as Figure 7As shown, step S44 includes: Step S441, processing the state vector of the current measurement period based on the state vector of the previous measurement period and the preset state transition matrix to obtain the state prediction vector of the current measurement period, and processing the error prediction matrix of the current measurement period based on the error covariance matrix, the state transition matrix, and the preset process noise covariance matrix of the previous measurement period; Step S442, processing the image confidence and geometric confidence to obtain the comprehensive confidence, and adjusting the preset observation noise covariance matrix based on the comprehensive confidence; the comprehensive confidence is negatively correlated with the observation noise covariance matrix; Step S443, processing the gain matrix based on the error prediction matrix, the preset observation matrix, and the adjusted observation noise covariance matrix; Step S444, processing the state vector of the current measurement period based on the state prediction vector, the gain matrix, the original real-time reading, and the observation matrix, outputting the optimal real-time reading of the current measurement period, and processing the error covariance matrix of the current measurement period based on the gain matrix, the observation matrix, the error prediction matrix, and the preset identity matrix.
[0062] Specifically, the state vector includes the optimal real-time reading and the rate of change of the optimal real-time reading, and the state vector is:
[0063] in, This is the state vector for the k-th measurement cycle; This represents the optimal real-time reading for the k-th measurement cycle; Let be the rate of change during the k-th measurement period.
[0064] The rate of change is used to represent the trend of change of the optimal real-time reading within a continuous measurement period.
[0065] The state prediction vector is calculated using the following formula:
[0066] in, This is the state prediction vector for the kth measurement cycle; The state transition matrix is a preset value. This is the state vector for the (k-1)th measurement cycle.
[0067] Specifically, the state transition matrix is used to represent the trend of state vector change within two adjacent measurement periods.
[0068] In one embodiment, a 2×2 matrix is used for representation:
[0069] in, This is the preset sampling interval between two adjacent measurement cycles.
[0070] The sampling interval is used to represent the time between two adjacent sampling periods.
[0071] The error prediction matrix is calculated using the following formula:
[0072] in, Let be the error prediction matrix for the k-th measurement period; Let be the error covariance matrix for the (k-1)th measurement period; This is the transpose of the state transition matrix; This is the preset process noise covariance matrix.
[0073] Specifically, before measurement, the process noise intensity coefficient is statistically calculated and calibrated based on the best historical real-time readings, and the process noise covariance matrix is set according to the noise intensity coefficient and the sampling interval.
[0074] In one embodiment, the process noise covariance matrix is represented as:
[0075] Furthermore, a comprehensive confidence score is obtained by calculating the arithmetic mean of the image confidence score and the geometric confidence score, which represents the reliability of recognizing the real-time dial image within the current measurement period. The observation noise covariance matrix is adjusted based on the comprehensive confidence score; the higher the comprehensive confidence score, the lower the observation noise covariance matrix is adjusted.
[0076] In one embodiment, the gain matrix is the Kalman filter matrix; The Kalman filter matrix is calculated using the following formula:
[0077] in, Let K be the Kalman filter matrix for the k-th measurement period; This is the transpose of the preset observation matrix; This is a preset observation matrix; Let be the observation noise covariance matrix for the k-th measurement period.
[0078] In one embodiment, the observation matrix is represented as:
[0079] Furthermore, the system prediction value is obtained through the observation matrix and the state prediction vector. The raw real-time readings are filtered using a Kalman filter matrix, and the state vector for the current measurement period is calculated using the following formula:
[0080] in, The residual is the difference between the original real-time reading and the system prediction, used to represent the deviation between the original real-time reading and the system prediction.
[0081] Specifically, the Kalman filter matrix acts as a feedback regulator. When the actual operating conditions cause instantaneous interference to the pressure gauge, such as reflection or vibration, it can easily lead to abnormalities in the original real-time reading. The Kalman filter matrix reduces the gain on the original real-time reading and relies more on the system prediction value based on historical data. This achieves smooth suppression and automatic correction of abnormalities in the original real-time reading, forming an adaptive verification capability for the continuity of the reading and ensuring the temporal stability of the output value.
[0082] In a preferred embodiment of the present invention, after obtaining the overall confidence level in step S442, it is first determined whether the overall confidence level of the current measurement cycle and the overall confidence level of the previous consecutive preset number of measurement cycles are both less than a preset confidence level threshold: if so, the optimal real-time reading in the state vector of the previous measurement cycle is directly output; if not, the preset observation noise covariance matrix is adjusted according to the overall confidence level, and then the process proceeds to step S443.
[0083] Specifically, when the overall confidence level is consistently lower than the preset confidence level threshold within a continuous measurement period, such as when the overall confidence level of three consecutive frames is less than 70%, the water system determines that the identified real-time dial image is unreliable. It then outputs the optimal real-time reading of the previous measurement period and saves the continuous real-time dial images and the corresponding overall confidence levels as anomaly records, which are then sent to the staff of the water management system for intervention.
[0084] In a preferred embodiment of the present invention, a reference range value is determined based on multiple historical maximum range values; during step S1, after determining the first predicted range and the second predicted range, as follows: Figure 8As shown, the range verification is performed using the following steps: Step D1, the difference between the first predicted range and the reference range value is calculated to output a first error value, and the difference between the second predicted range and the reference range value is calculated to output a second error value; Step D2, the first error value and the second error value are compared with preset change thresholds respectively: when the first error value is greater than the change threshold, the first predicted range is not output, the image confidence is output as 0, and then the process proceeds to step S3, where the second predicted range is used as the maximum range value; when the first error value is not greater than the change threshold, the first predicted range and the image confidence are output; when the second error value is greater than the change threshold, the second predicted range is not output, the geometric confidence is output as 0, and then the process proceeds to step S3, where the first predicted range is used as the maximum range value; and when the second error value is not greater than the change threshold, the second predicted range is output.
[0085] Specifically, the historical maximum range values are stored in a dynamically updated range queue, and the median or mean of the maximum range values in this range queue is used as the reference range value.
[0086] After determining the first and second prediction ranges, the difference between each prediction range and the baseline range value is calculated, and the difference is compared with the preset change threshold.
[0087] Specifically, the change threshold is half of the smallest non-zero difference in the standard range set. For example, if the smallest value in a standard range set is 1 and the second smallest value is 1.6, then the change threshold is half of the difference between 1.6 and 1, which is 0.3.
[0088] If a difference is greater than the change threshold, the corresponding first or second prediction range will be removed, even if the corresponding image confidence or geometric confidence is high.
[0089] If both the first and second prediction ranges within a measurement cycle are removed, then the image confidence and geometric confidence are set to 0, and the optimal real-time reading of the previous measurement cycle is directly output.
[0090] If the image confidence and geometric confidence are both output as 0 for multiple consecutive measurement cycles, an alert will be triggered to set the maximum range value to the default range or request manual intervention.
[0091] This invention discloses a pressure gauge reading measurement system, applied to the aforementioned pressure gauge reading measurement method; such as Figure 9As shown, the pressure gauge reading measurement system includes: an identification module 1, used to identify the pressure gauge reading to determine the first predicted range of the pressure gauge and output image confidence, and to identify the pressure gauge scale to determine the second predicted range of the pressure gauge; a weight processing module 2, connected to the identification module 1, used to process and obtain the relative difference between the first and second predicted ranges, and to obtain a fusion weight based on the relative difference and image confidence; a range determination module 3, connected to the identification module 1 and the weight processing module 2, used to process and obtain the maximum range value of the pressure gauge based on the first predicted range, the second predicted range, and the fusion weight; and a reading output module 4, connected to the identification module 1 and the range determination module 3, used to identify the angle ratio between the pressure gauge pointer and the pressure gauge scale, and to output the optimal real-time reading based on the angle ratio and the maximum range value.
[0092] Specifically, this invention selects a pressure gauge actually deployed in a water pumping station as the research object. This scenario encompasses typical industrial environmental characteristics such as humidity, vibration, uneven lighting, and the ease with which the equipment surface is contaminated with scale and oil. A test sample set was compiled, collecting images covering different time periods and various lighting conditions, including normal lighting, low lighting, strong reflection, and varying degrees of digital dial contamination, to ensure the data fully represents the complex on-site conditions. To verify the measurement accuracy of the overall solution, the first 300 images were selected chronologically as the system parameter optimization set to optimize image preprocessing parameters and key point post-processing logic; the subsequent 200 images served as the test set to evaluate reading accuracy. All test images were accompanied by real readings synchronously acquired by a high-precision digital pressure gauge as a benchmark.
[0093] The present invention was used to evaluate the accuracy of pressure gauge readings on a test sample set. Based on MAE (Mean Absolute Error), RMSE (Root Mean Squared Error), and reading pass rate as core evaluation indicators, the evaluation results showed that the mean absolute error was 0.015, the root mean square error was 0.020, and the reading pass rate was 94.17%, which meets the industrial-grade stability requirements.
[0094] In one embodiment, such as Figure 10As shown, the following steps are used to perform complete pressure gauge reading recognition and closed-loop verification: Step G1, continuously acquire real-time dial images of pressure gauges in complex water environments using an RGB camera; Step G2, use a preset OCR model to recognize the readings of the real-time dial images, output a reading list as the first predicted range and image confidence, and use a preset semantic segmentation model to segment the real-time dial images, and output a scale set as the second predicted range and geometric confidence based on a preset scale distribution rule; Step G3, process to obtain the relative difference between the first and second predicted ranges, combine the preset sensitivity coefficient, relative difference, and image confidence to obtain the fusion weight, process the first and second predicted ranges simultaneously according to the fusion weight, and output the maximum range value; Step G4: The real-time dial image is identified using a preset key point recognition model. The total angle between the scale start point and the scale end point, and the reading angle between the scale start point and the pointer tip are output. The original real-time reading is obtained by combining the total angle, the reading angle, and the maximum range value. Step G5: The gain matrix is constructed by processing the state vector and the error covariance matrix of the previous measurement cycle. The gain matrix is adjusted using the comprehensive confidence obtained by processing the image confidence and geometric confidence of the current measurement cycle. Step G6: Kalman filtering is performed on the original real-time reading according to the adjusted gain matrix. The optimal real-time reading of the current measurement cycle is output. The error covariance matrix is updated using the adjusted gain matrix for use in the next measurement cycle, forming a closed-loop verification.
[0095] The above description is merely a preferred embodiment of the present invention and does not limit the implementation and protection scope of the present invention. Those skilled in the art should realize that any equivalent substitutions and obvious changes made based on the description and illustrations of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for measuring pressure gauge readings, applied to pressure gauges in complex water environments, characterized in that, include: Step S1: Identify the reading of the pressure gauge to determine the first predicted range of the pressure gauge and output the image confidence level; and identify the scale of the pressure gauge to determine the second predicted range of the pressure gauge. Step S2: Process to obtain the relative difference between the first prediction range and the second prediction range, and process to obtain the fusion weight based on the relative difference and the image confidence. Step S3: The maximum range value of the pressure gauge is obtained by processing the first predicted range, the second predicted range, and the fusion weight. Step S4: Identify the angle ratio between the pointer and the scale of the pressure gauge, and output the optimal real-time reading based on the angle ratio and the maximum range value. The reference range value is determined based on multiple historical maximum range values. Step S1 further includes outputting the corresponding geometric confidence level when outputting the second prediction range; When performing step S1, after determining the first predicted range and the second predicted range, the following steps are used to perform range verification: Step D1: Subtract the first predicted range from the reference range value to output a first error value, and subtract the second predicted range from the reference range value to output a second error value; Step D2: Compare the first error value and the second error value with preset change thresholds respectively. When the first error value is greater than the change threshold, the first prediction range is not output, the image confidence is output as 0, and then the process proceeds to step S3, where the second prediction range is used as the maximum range value. When the first error value is not greater than the change threshold, the first prediction range and the image confidence level are output. When the second error value is greater than the change threshold, the second predicted range is not output, the geometric confidence is output as 0, and then the process proceeds to step S3, where the first predicted range is used as the maximum range value. as well as When the second error value is not greater than the change threshold, the second prediction range is output.
2. The pressure gauge reading measurement method according to claim 1, characterized in that, Step S1 includes: Step S11: Obtain the real-time dial image of the pressure gauge, use a preset optical recognition model to identify the real-time dial image to output a reading list and the image confidence score, and use a preset semantic segmentation model to perform semantic segmentation on the real-time dial image. Combine the semantic segmentation result with a preset scale distribution law to output the scale set of the real-time dial image as the second predicted range, and output the geometric confidence score. Step S12: Determine whether the maximum reading in the reading list matches the standard range in the preset standard range set. If so, the maximum reading that matches is taken as the first prediction range; If not, the maximum reading is subtracted from each standard range in the standard range set, and the standard range with the smallest difference from the maximum reading is selected as the first predicted range.
3. The pressure gauge reading measurement method according to claim 2, characterized in that, When performing step S12, if the maximum reading does not match the standard range, the following steps are used to obtain the first predicted range: Step A1: Calculate the tolerance range for each of the standard ranges, and determine whether the range error between the maximum reading and each of the standard ranges is greater than the tolerance range. If so, then discard the corresponding standard range. If not, the corresponding standard range is retained in the temporary range set; After all the standard ranges have been determined, proceed to step A2; Step A2, determine whether the temporary range set is empty: If so, the first prediction range will not be output, and the image confidence level will be output as 0. If not, then the standard range with the smallest range error in the temporary range set is used as the first predicted range.
4. The pressure gauge reading measurement method according to claim 2, characterized in that, When performing step S11, if the image confidence level is less than a preset image confidence threshold, the following steps are used for image enhancement: Step B1: Match the position of each scale in the scale set with the corresponding reading in the reading list, subtract the reading from the scale at the same position, and determine whether the difference is greater than a preset deviation threshold. If so, obtain the position information of the corresponding scale on the real-time dial image, and then proceed to step B2; If not, retain the corresponding reading, and construct the reading list after all readings are determined, output the reading list and the image confidence score, and then proceed to step S12; Step B2: Enhance the corresponding position of the real-time dial image according to the location information. The optical recognition model re-recognizes the enhanced real-time dial image and re-outputs the reading list and the image confidence score. Then, proceed to step S12.
5. The pressure gauge reading measurement method according to claim 2, characterized in that, When performing step S11, if the geometric confidence level is less than a preset geometric confidence threshold, the following steps are used for image enhancement: Step C1: Obtain the pixel coordinates of each reading in the reading list on the real-time dial image; Step C2: Determine the detection side length based on the dial diameter in the real-time dial image, and divide the detection area of the corresponding reading according to the detection side length, with each pixel coordinate as the center. Step C3: Obtain the segmentation sensitivity parameter by processing the image based on the preset baseline segmentation threshold, the preset enhancement coefficient, and the image confidence level. Step C4: Adjust the segmentation criteria of the semantic segmentation model based on the segmentation sensitivity parameter. The semantic segmentation model re-segments the real-time dial image based on the adjusted segmentation criteria. Combine the result of the re-segmentation with the preset scale distribution law to output a new scale set as the second prediction range and output a new geometric confidence score. Then proceed to step S12.
6. The pressure gauge reading measurement method according to claim 2, characterized in that, Step S4 includes: Step S41: Obtain the real-time dial image, and use a preset key point recognition model to recognize the real-time dial image to output the first coordinate of the starting point of the scale, the second coordinate of the ending point of the scale, and the third coordinate of the pointer tip; Step S42: Calculate the total angle between the first coordinate and the second coordinate based on the preset center point coordinates, and calculate the reading angle between the first coordinate and the third coordinate based on the center point coordinates; Step S43: Multiply the ratio of the reading angle to the total angle by the maximum range value to output the original real-time reading; Step S44: Determine the gain matrix based on the image confidence and the geometric confidence, filter the original real-time reading based on the gain matrix, and output the optimal real-time reading.
7. The pressure gauge reading measurement method according to claim 6, characterized in that, The measurement cycle of the pressure gauge reading measurement method is preset; In each measurement cycle, a state vector containing the optimal real-time reading is updated, as well as the corresponding error covariance matrix updated in each measurement cycle; Step S44 includes: Step S441: Process the state vector of the current measurement cycle according to the state vector of the previous measurement cycle and the preset state transition matrix to obtain the state prediction vector of the current measurement cycle, and process the error prediction matrix of the current measurement cycle according to the error covariance matrix, the state transition matrix and the preset process noise covariance matrix of the previous measurement cycle. Step S442: Obtain a comprehensive confidence score by processing the image confidence score and the geometric confidence score, and adjust the preset observation noise covariance matrix according to the comprehensive confidence score; The overall confidence level is negatively correlated with the observation noise covariance matrix; Step S443: The gain matrix is obtained by processing the error prediction matrix, the preset observation matrix, and the adjusted observation noise covariance matrix. Step S444: Based on the state prediction vector, the gain matrix, the original real-time reading, and the observation matrix, the state vector for the current measurement period is obtained; the optimal real-time reading for the current measurement period is output; and... The error covariance matrix for the current measurement period is obtained by processing the gain matrix, the observation matrix, the error prediction matrix, and the preset identity matrix.
8. The pressure gauge reading measurement method according to claim 7, characterized in that, After obtaining the overall confidence level, step S442 first determines whether the overall confidence level of the current measurement period and the overall confidence level of the previous preset number of measurement periods are both less than a preset confidence level threshold. If so, the optimal real-time reading in the state vector of the previous measurement cycle is directly output; If not, the preset observation noise covariance matrix is adjusted according to the comprehensive confidence level, and then the process proceeds to step S443.
9. A pressure gauge reading measurement system, characterized in that, Applied to the pressure gauge reading measurement method as described in any one of claims 1-8; The pressure gauge reading measurement system includes: The identification module is used to identify the reading of the pressure gauge to determine the first predicted range of the pressure gauge and output the image confidence level, and to identify the scale of the pressure gauge to determine the second predicted range of the pressure gauge. A weight processing module, connected to the recognition module, is used to process and obtain the relative difference between the first prediction range and the second prediction range, and to obtain the fusion weight based on the relative difference and the image confidence. The range determination module, connected to the identification module and the weight processing module, is used to obtain the maximum range value of the pressure gauge based on the first predicted range, the second predicted range, and the fusion weight processing. The reading output module, connected to the identification module and the range determination module, is used to identify the angle ratio between the pointer and the scale of the pressure gauge, and output the optimal real-time reading based on the angle ratio and the maximum range value.
Citation Information
Patent Citations
Pointer type instrument intelligent reading method and system based on image segmentation
CN119181085A
Fine tuning instrument reading method and system based on multi-center dynamic fusion and adaptive correction
CN122265639A