Automatic reading method and system for mechanical water meter
Through deep learning technology, the rotation correction and recognition of water meter pictures is solved, and the problems of diverse installation environments and variable text directions of mechanical water meter are realized, efficient automatic meter reading is achieved, and recognition accuracy and management efficiency are improved.
Patent Information
- Application Number
- CN202510455020.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-08-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing automatic reading methods for mechanical water meters are low in the face of diverse installation environments and changing directions of water meter texts, making it difficult to achieve efficient automatic reading.
The water meter picture is collected through the camera, and the reference image with a text direction of 0° is extracted from the background database. Deep learning technology is used to analyze the hidden difference of text direction sensitive features, determine the expected rotation angle of the picture, and then perform rotation correction, and use the text detection and recognition model to obtain the meter reading reading.
It improves the accuracy of automatic identification of water meter readings, realizes automation and rapid meter reading in complex environments, reduces manual intervention, and improves the accuracy and efficiency of water bill metering.
Smart Images

Figure CN120411944A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of automatic meter reading, and more specifically, to a method and system for automatically identifying mechanical water meters. Background Art
[0002] As a traditional water flow measurement device, mechanical water meters are widely used in various fields such as residential areas, industrial areas, and public facilities to accurately record water consumption. Traditionally, the recording of water meter readings relies on manual on-site inspection and manual recording. This method is not only time-consuming and laborious, but also prone to reading errors due to human factors, affecting the accuracy and efficiency of water fee measurement. With the rapid development of intelligent and automated technologies, how to achieve automated and remote reading of mechanical water meter readings has become a key issue in improving water resource management efficiency and reducing operating costs.
[0003] In recent years, the rapid development of image processing technology and artificial intelligence technology has provided new solutions for the automatic recognition of mechanical water meter readings. By using image acquisition devices such as cameras to obtain water meter images and then using advanced image processing algorithms for analysis, it is theoretically possible to achieve automatic, fast, and accurate reading of water meter readings. However, in practical applications, the installation environment of mechanical water meters is diverse, and the image quality of the water meter surface may vary due to factors such as light, stains, and viewing angles. In addition, the numbers and characters on the water meter dial may show different directions (such as horizontal, vertical, or inclined) due to different water meter models and installation directions, which all pose challenges to automatic reading.
[0004] Currently, some existing water meter reading recognition methods based on image processing often have better effects on water meter images under specific conditions or standard installation directions, and are not very adaptable to the complex situation of variable water meter text directions. Especially when the water meter text direction is not known in advance, directly performing text detection and recognition is likely to lead to a decrease in recognition accuracy.
[0005] Therefore, an optimized method and system for automatically identifying mechanical water meters are expected. Summary of the Invention
[0006] To solve the above technical problems, this application is proposed. Embodiments of this application provide a method and system for automatic recognition of mechanical water meters. It uses a camera to collect pictures of mechanical water meters, and at the same time extracts a reference mechanical water meter image with a mechanical water meter text direction of 0° from the background database. By introducing image processing technology based on deep learning, it performs implicit difference analysis based on text direction-sensitive features on both to determine the expected rotation angle of the collected mechanical water meter picture, and then realizes automatic correction of the mechanical water meter picture, so as to facilitate text detection and recognition based on the rotation-corrected mechanical water meter picture, and realize automatic recognition of water meter readings. In this way, it can effectively cope with complex situations such as diverse water meter installation environments and variable water meter text directions, and improve the accuracy of automatic recognition of water meter readings.
[0007] Correspondingly, according to one aspect of this application, a method for automatic recognition of mechanical water meters is provided, which includes:
[0008] Obtain a picture of a mechanical water meter collected by a camera;
[0009] Extract a reference mechanical water meter image from the background database, where the mechanical water meter text direction in the reference mechanical water meter image is 0°;
[0010] Based on the comparative analysis between the reference mechanical water meter image and the mechanical water meter picture, determine the expected rotation angle of the mechanical water meter picture, where determining the expected rotation angle of the mechanical water meter picture includes: performing implicit difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture;
[0011] Based on the expected rotation angle, rotate the mechanical water meter picture to obtain a rotated mechanical water meter picture;
[0012] Input the rotated mechanical water meter picture into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain a meter reading;
[0013] Transmit the meter reading to the background monitoring center through a communication module.
[0014] According to another aspect of this application, an automatic mechanical water meter reading system is provided, which includes:
[0015] A mechanical water meter picture acquisition module for obtaining a picture of a mechanical water meter collected by a camera;
[0016] A reference water meter image extraction module for extracting a reference mechanical water meter image from the background database, where the mechanical water meter text direction in the reference mechanical water meter image is 0°;
[0017] A rotation angle comparison and analysis module, configured to determine an expected rotation angle of the mechanical water meter picture based on a comparison and analysis between the reference mechanical water meter image and the mechanical water meter picture. Determining the expected rotation angle of the mechanical water meter picture includes: performing a hidden difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture. The hidden difference analysis based on text direction-sensitive features is performed by obtaining a reference feature coding map of the mechanical water meter text direction and a detected feature coding map of the mechanical water meter text direction, and performing text direction image feature enhancement and feature difference calculation based on global semantic guidance;
[0018] A rotation correction module, configured to rotate the mechanical water meter picture based on the expected rotation angle to obtain a rotated mechanical water meter picture;
[0019] A text recognition module, configured to input the rotated mechanical water meter picture into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain a meter reading;
[0020] A data transmission module, configured to transmit the meter reading to a background monitoring center through a communication module.
[0021] Compared with the prior art, the mechanical water meter automatic reading method and system provided by the present application use a camera to collect a mechanical water meter picture, and at the same time extract a reference mechanical water meter image with a mechanical water meter text direction of 0° from a background database. By introducing an image processing technology based on deep learning, a hidden difference analysis based on text direction-sensitive features is performed on the two to determine the expected rotation angle of the collected mechanical water meter picture, and then automatic correction of the mechanical water meter picture is realized, so as to facilitate text detection and recognition based on the rotated and corrected mechanical water meter picture, and realize automatic reading of the water meter reading. In this way, complex situations such as diverse water meter installation environments and variable water meter text directions can be effectively addressed, and the accuracy of automatic recognition of water meter readings can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] By describing the embodiments of the present application in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present application will become more apparent. The drawings are used to provide a further understanding of the embodiments of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application, and do not constitute a limitation to the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0023] Figure 1 FIG. is a flowchart of a mechanical water meter automatic reading method according to an embodiment of the present application.
[0024] Figure 2Schematic diagram of data flow of the automatic reading method for mechanical water meters according to an embodiment of the present application.
[0025] Figure 3 Flowchart of step S3 in the automatic reading method for mechanical water meters according to an embodiment of the present application.
[0026] Figure 4 Flowchart of step S32 in the automatic reading method for mechanical water meters according to an embodiment of the present application.
[0027] Figure 5 Block diagram of the automatic reading system for mechanical water meters according to an embodiment of the present application. Detailed implementation manners
[0028] Next, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all embodiments of the present application. It should be understood that the present application is not limited by the exemplary embodiments described herein.
[0029] Figure 1 Flowchart of the automatic reading method for mechanical water meters according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the automatic reading method for mechanical water meters according to an embodiment of the present application. As Figure 1 and Figure 2 shown, the automatic reading method for mechanical water meters according to an embodiment of the present application includes the steps of: S1, obtaining a picture of a mechanical water meter collected by a camera; S2, extracting a reference mechanical water meter image from a background database, wherein the text direction of the mechanical water meter in the reference mechanical water meter image is 0°; S3, based on the comparative analysis between the reference mechanical water meter image and the mechanical water meter picture, determining the expected rotation angle of the mechanical water meter picture, wherein determining the expected rotation angle of the mechanical water meter picture includes: performing a hidden difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture; S4, rotating the mechanical water meter picture based on the expected rotation angle to obtain a rotated mechanical water meter picture; S5, inputting the rotated mechanical water meter picture into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain a meter reading; S6, transmitting the meter reading to a background monitoring center through a communication module.
[0030] In the above automatic recognition method of mechanical water meters, in step S1, a picture of the mechanical water meter collected by a camera is obtained. It should be understood that the automatic recognition of mechanical water meter readings is a key link in the intelligent water supply management process. As a widely used and technically mature image acquisition device, the camera can instantly capture the appearance of the mechanical water meter by virtue of its convenience and real-time performance. Whether it is in the water meter wells densely distributed in the urban water supply system or at the water meter installation points inside residential buildings and commercial buildings, the camera can be flexibly deployed to intuitively obtain the water meter dial image, providing the original data for subsequent automatic recognition processing.
[0031] In the specific implementation process, the selection of the camera needs to consider multiple factors comprehensively. Resolution is one of the primary considerations. To ensure that the fine scales, numbers, and other key features on the mechanical water meter dial can be clearly captured, a camera with high resolution should be selected. For example, in the general urban water supply system, since the water meters are widely distributed and some installation environments are relatively complex, to meet the image acquisition requirements in different scenarios, it is recommended to select a camera with a resolution of not less than 2 million pixels. In some special scenarios with extremely high requirements for image clarity, such as the severely worn water meter dials in old residential areas or the complex details of industrial water meter dials, cameras with 5 million pixels and above can even be selected. Such high-resolution cameras can provide richer image details, providing a more accurate data basis for subsequent character recognition and image processing algorithms, and effectively reducing the recognition error rate caused by blurred images.
[0032] At the same time, the selection of the lens is equally important. Different installation scenarios and the installation positions of the water meters determine the need to adapt lenses with different focal lengths and perspectives. For most common cases where the water meters are installed in standard water meter wells or on walls, a fixed-focus lens with a focal length between 2.8 mm and 12 mm can be selected. If the installation positions of the water meters are relatively scattered and there are different distances and angles, in order to be able to flexibly adjust the shooting range, a zoom lens can be selected, such as a 6 mm to 12 mm motorized zoom lens, and the focal length can be adjusted through remote control to ensure that the camera can clearly capture mechanical water meters at different positions. In addition, the aperture size of the lens also affects the image quality. In a relatively dark environment, such as a basement or a water meter well without light, a lens with a large aperture (such as F1.4 - F2.8) should be selected to ensure sufficient light intake and obtain clear images; while in an environment with sufficient light, a medium aperture (such as F4 - F8) lens can provide better depth-of-field control, enabling the entire water meter dial to be clearly imaged.
[0033] Furthermore, before installation, a comprehensive survey of the installation environment of the water meter is required, including the location, orientation, surrounding obstacles, and lighting conditions of the water meter. For indoor water meters, if installed in areas with limited space such as kitchens or bathrooms, the camera can be installed on the wall or ceiling above the water meter. By adjusting the angle of the camera, it can be aligned vertically or nearly vertically with the water meter dial to avoid image distortion caused by oblique viewing. During installation, special camera brackets or fixing kits can be used to ensure that the camera is firmly installed and will not be displaced due to vibration or other external force factors. For outdoor water meters, especially those installed in water meter wells, due to the relatively complex environment, problems such as water accumulation and humidity may exist. Cameras with waterproof and dustproof functions need to be selected and installed at appropriate positions on the water meter well cover or well wall to ensure that the camera's field of view can completely cover the water meter dial and avoid being blocked by debris in the well. In some special scenarios, such as water meters near the rooftop water tanks of high-rise buildings, due to the high installation position and difficulty of access, wireless cameras can be considered and installed and debugged through remote control to ensure that the camera can stably capture clear water meter images.
[0034] In addition, the setting of image acquisition parameters is crucial for obtaining high-quality pictures of mechanical water meters. Exposure time is one of the key parameters affecting image brightness and clarity. In an environment with sufficient light, the exposure time can be appropriately shortened to avoid loss of details due to over-bright images; while in a darker environment, the exposure time needs to be extended to ensure sufficient brightness of the image. For example, in a water meter well under direct sunlight, the exposure time can be set between 1 / 1000 second and 1 / 2000 second; while at night or in a dimly lit basement, the exposure time can be extended to 1 / 30 second to 1 / 100 second. However, it should be noted that too long an exposure time may cause the image to be blurred due to slight movement of the water meter pointer, so it needs to be reasonably adjusted according to the actual situation. Gain is also an important parameter, which can enhance the signal intensity of the image, but too high a gain will introduce noise and reduce image quality. Generally, the gain can be set between 0dB and 10dB, and the specific value needs to be adjusted according to the actual light conditions and image quality. In addition, the resolution and frame rate of the image also need to be set according to actual needs. On the premise of ensuring image clarity, if real-time monitoring of water meter changes is required, the resolution can be appropriately reduced to increase the frame rate; if more attention is paid to image details, a higher resolution can be selected, but the frame rate may need to be appropriately reduced. For example, in an industrial water monitoring scenario with high real-time requirements, the resolution can be set to 1280×720 pixels and the frame rate to 25 frames per second; while in a scientific research or fault troubleshooting scenario with extremely high requirements for image details, the resolution can be increased to 2560×1440 pixels and the frame rate reduced to 10 frames per second.
[0035] Secondly, data transmission and storage are important links to ensure the effective utilization of the collected mechanical water meter images. In terms of data transmission, an appropriate transmission method can be selected according to the actual installation environment and network conditions. For short-distance water meter installation scenarios, such as water meters within the same building, wired transmission methods can be adopted, such as Ethernet or USB interfaces. The Ethernet interface features high speed and stability, capable of meeting the rapid transmission requirements of a large amount of image data. By connecting the camera to a network switch and then accessing the local area network, efficient communication with data processing devices can be achieved. The USB interface has the advantages of convenient connection and plug-and-play, and is suitable for some simple scenarios with low requirements for transmission distance. For example, in small commercial premises or homes, the camera can be directly connected to a nearby computer via the USB interface for image acquisition and processing. For long-distance water meter installation scenarios, such as water meters widely distributed in urban water supply systems, wireless transmission methods are more suitable. 4G / 5G networks, with their high speed and wide coverage characteristics, can achieve real-time communication between the camera and the back-end data center. By installing a 4G / 5G communication module at the camera end and configuring the corresponding SIM card, the collected image data can be transmitted to the back-end server in real time via the wireless network. In some remote areas or areas with weak network signals, low-power wide-area network technologies such as LoRa can also be considered. Although its transmission speed is relatively slow, it has the advantages of low power consumption and wide coverage, and can meet the requirements of some scenarios with low requirements for data transmission real-time.
[0036] To ensure the stable operation of the entire image acquisition system, a perfect monitoring and maintenance mechanism also needs to be established. The working status of the camera, including the online status, image acquisition quality, data transmission rate, etc., is monitored in real time through monitoring software. When a fault or abnormal image quality is found in the camera, an alarm can be issued in a timely manner, and fault troubleshooting and repair can be carried out through remote diagnosis and maintenance functions. For example, when the monitoring system detects problems such as blurred or color-offset images in a certain camera, the parameters of the camera (such as focal length, exposure time, gain, etc.) can be remotely adjusted for preliminary repair; if the problem remains unresolved, maintenance personnel can be arranged to go to the site for inspection and repair. In addition, regular cleaning and maintenance of the camera are also important measures to ensure image acquisition quality. Especially in outdoor environments, the camera lens is easily affected by pollutants such as dust and rain. Regularly cleaning the lens can ensure image clarity and color reproduction. At the same time, regularly backing up and cleaning the data in the storage system, deleting expired or useless image data to free up storage space and ensure the efficient operation of the storage system.
[0037] In the above mechanical water meter automatic reading method, in step S2, a reference mechanical water meter image is extracted from the background database, and the text direction of the mechanical water meter in the reference mechanical water meter image is 0°. Here, in actual water supply facilities, the installation of mechanical water meters is affected by various factors such as spatial layout and pipeline orientation, and their installation angles vary greatly. As a result, in the mechanical water meter pictures captured by the camera, the text directions are diverse, seriously interfering with the subsequent text detection and recognition processes. Therefore, in order to unify the processing standard and improve the accuracy of water meter reading recognition, it is necessary to perform rotation correction on the mechanical water meter pictures. For this purpose, this application extracts a reference mechanical water meter image with a text direction of 0° from the background database and uses it as a standard template to provide a reference benchmark for the rotation correction of the captured mechanical water meter pictures.
[0038] In the above mechanical water meter automatic reading method, in step S3, based on the comparative analysis between the reference mechanical water meter image and the mechanical water meter picture, the expected rotation angle of the mechanical water meter picture is determined. Among them, determining the expected rotation angle of the mechanical water meter picture includes: performing implicit difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture. Specifically, in order to determine the expected rotation angle of the actually captured mechanical water meter picture relative to the standard template, this application further introduces an image processing technology based on deep learning. By comparing and analyzing the reference mechanical water meter image and the mechanical water meter picture, the difference in text direction between the two is captured, so as to determine the actual rotation angle of the text in the picture to be processed.
[0039] Figure 3 It is a flowchart of step S3 in the mechanical water meter automatic reading method according to an embodiment of the present application. As Figure 3 shown, step S3 includes: S31, extracting water meter text direction-sensitive features from the reference mechanical water meter image and the mechanical water meter picture to obtain a mechanical water meter text direction reference feature coding map and a mechanical water meter text direction detection feature coding map; S32, respectively performing text direction image feature enhancement based on global semantic guidance on the mechanical water meter text direction reference feature coding map and the mechanical water meter text direction detection feature coding map to obtain an enhanced mechanical water meter text direction reference feature coding map and an enhanced mechanical water meter text direction detection feature coding map; S33, inferring the expected rotation direction based on the feature difference between the enhanced mechanical water meter text direction reference feature coding map and the enhanced mechanical water meter text direction detection feature coding map to obtain the expected rotation angle of the mechanical water meter picture.
[0040] Specifically, in step S31, water meter text direction-sensitive features are extracted from the reference mechanical water meter image and the mechanical water meter picture to obtain a mechanical water meter text direction reference feature coding map and a mechanical water meter text direction detection feature coding map. In a specific example of this application, a trained CNN model is used to perform feature extraction on the reference mechanical water meter image and the mechanical water meter picture to obtain the mechanical water meter text direction reference feature coding map and the mechanical water meter text direction detection feature coding map. That is, in order to capture the text direction features in the mechanical water meter picture, this application adopts a convolutional neural network (CNN) model with excellent performance in the field of image processing to process the reference mechanical water meter image and the mechanical water meter picture respectively. Specifically, in the model training stage, first, a large number of mechanical water meter image samples are collected. The samples should cover various common rotation angles (such as 0°, 30°, 60°, 90°, 120°, 150°, 180°, etc.), and each sample is accurately labeled with its rotation angle. Then, the samples are divided into a training set, a validation set, and a test set, and the ratio can be set to 70%, 15%, 15%. The training set is used to train the model. During the training process, optimization algorithms such as stochastic gradient descent (SGD) are adopted to continuously adjust the model parameters so that the model can accurately learn the feature change patterns of the water meter text at different rotation angles, such as the stroke direction of numbers and the arrangement rules of characters. When the performance of the model on the validation set tends to be stable, it is considered that the model training is completed. Then, in the model testing stage, the trained model is tested using the test set to evaluate its accuracy in identifying the water meter text direction at different rotation angles. After the test is completed, the trained convolutional neural network model is applied to the actual processing of mechanical water meter pictures. In actual applications, first, the reference mechanical water meter image and the collected mechanical water meter picture are preprocessed, adjusted to the same size (such as 224×224 pixels), and the image pixel values are normalized to the range of [0,1]. Then, the two preprocessed images are respectively input into the trained CNN model. The model undergoes operations such as multiple convolutions, pooling, and fully connected layers to extract rotation-sensitive feature information in the image, such as edge contours and texture details, to describe the direction characteristics of the water meter text, thereby generating a mechanical water meter text direction reference feature coding map and the mechanical water meter text direction detection feature coding map.
[0041] Specifically, in step S32, the text direction image feature enhancement based on global semantic guidance is respectively performed on the mechanical water meter text direction reference feature coding map and the mechanical water meter text direction detection feature coding map to obtain the enhanced mechanical water meter text direction reference feature coding map and the enhanced mechanical water meter text direction detection feature coding map. It should be understood that due to the limitation of the local receptive field of the convolutional neural network, although it can capture the local texture detail features in the image, it is difficult to effectively model the long-distance dependence relationship in the image, thereby limiting the understanding of the overall text direction information of the water meter, and may lead to limited recognition ability of the text direction when processing images with complex backgrounds or low contrast between the water meter text and the background. In response to this, the present application proposes a text direction image feature enhancement method based on global semantic guidance, which guides the enhanced expression of local features by mining the global context information in the mechanical water meter text direction reference feature coding map and the mechanical water meter text direction detection feature coding map, so as to guide the model to pay more attention to the directional features of the water meter text, thereby further improving the accuracy of text direction recognition. Next, taking the feature enhancement processing process of the mechanical water meter text direction reference feature coding map as an example, it will be described in detail.
[0042] Figure 4 It is a flowchart of step S32 in the automatic reading method of the mechanical water meter according to an embodiment of the present application. As Figure 4 shown, step S32 includes: S321, extracting global key semantic information from the mechanical water meter text direction reference feature coding map to obtain a mechanical water meter text direction reference feature global key semantic information coding vector; S322, based on the mechanical water meter text direction reference feature global key semantic information coding vector, respectively performing feature enhancement based on global information guidance on the channel feature vectors at each pixel position in the mechanical water meter text direction reference feature coding map to obtain the enhanced mechanical water meter text direction reference feature coding map.
[0043] In a specific example of the present application, step S321 is expressed by the formula:
[0044]
[0045] where, R represents the set of real numbers, H, W, and C respectively represent the height, width, and number of channels of the mechanical water meter text direction reference feature coding map, F represents the mechanical water meter text direction reference feature coding map, Decouple(·) represents the decoupling operation, x1, x2, x i and x n respectively represent the first, second, i-th, and n-th mechanical water meter text direction reference feature local decoupled feature vectors obtained after decoupling F, n represents the number of mechanical water meter text direction reference feature local decoupled feature vectors, bi denotes the bias term, W i denotes the weight matrix, denotes matrix multiplication, (·) T denotes the transpose of a vector, v r denotes the transformation vector of the semantic saliency score of the local feature of the reference feature of the mechanical water meter text direction, s i denotes x i the corresponding semantic saliency score factor, softmax(·) denotes the normalized exponential function, v g denotes the global key semantic information encoding vector of the reference feature of the mechanical water meter text direction.
[0046] Here, by performing cross-space per-location global dependency modeling on the encoded map of the reference feature of the mechanical water meter text direction, the global importance of each position in the encoded map of the reference feature of the mechanical water meter text direction is understood, and based on this, feature compression and purification are performed to extract the global key semantic information in the encoded map of the reference feature of the mechanical water meter text direction, obtaining the global key semantic information encoding vector of the reference feature of the mechanical water meter text direction, providing global semantic guidance for subsequent local feature enhancement.
[0047] In a specific example of the present application, the step S322 includes: First, extracting the channel feature vector of the pixel position (i, j) from the encoded map of the reference feature of the mechanical water meter text direction as the to-be-processed channel vector f of the reference feature of the mechanical water meter text direction i,j = F(i, j, :) ∈ R C ; Then, performing key semantic information extraction based on the local neighborhood on the to-be-processed channel vector of the reference feature of the mechanical water meter text direction to obtain the local key semantic information encoding vector of the reference feature of the mechanical water meter text direction. That is, using the global key semantic information encoding vector as a guide, the feature of each pixel position in the encoded map of the reference feature of the mechanical water meter text direction is refined and enhanced. In particular, here, the to-be-processed channel vector of the reference feature of the mechanical water meter text direction can be the channel feature vector of any pixel position in the encoded map of the reference feature of the mechanical water meter text direction.
[0048] More specifically, perform key semantic information extraction based on the local neighborhood for the mechanical water meter text direction reference feature to-be-processed channel vector, including: determining the local neighborhood semantic association window of the mechanical water meter text direction reference feature to-be-processed channel vector based on the feature distribution characteristics of the mechanical water meter text direction reference feature to-be-processed channel vector, where the mechanical water meter text direction reference feature to-be-processed channel vector is located at the center position of the local neighborhood semantic association window; extracting the key semantic information of all mechanical water meter text direction reference channel feature vectors in the local neighborhood semantic association window to obtain the mechanical water meter text direction reference feature local key semantic information coding vector corresponding to the mechanical water meter text direction reference feature to-be-processed channel vector.
[0049] The above process can be expressed by the formula:
[0050]
[0051] where, f i,j represents the mechanical water meter text direction reference feature to-be-processed channel vector at the (i, j) position of F, ||·|| represents calculating the norm, log2(·) represents the logarithmic function with base 2, represents rounding up, W i,j represents the local neighborhood semantic association window of the mechanical water meter text direction reference feature to-be-processed channel vector, r represents the half side length of the local neighborhood semantic association window, k and l represent the row and column indices of the mechanical water meter text direction reference channel feature vector in the local neighborhood semantic association window, f k,l represents the mechanical water meter text direction reference channel feature vector at the (k, l) position within the neighborhood semantic association window, v l(i,j) represents the mechanical water meter text direction reference feature local key semantic information coding vector corresponding to the mechanical water meter text direction reference feature to-be-processed channel vector.
[0052] That is, by analyzing the feature distribution characteristics of the mechanical water meter text direction reference feature to-be-processed channel vector, dynamically perceive the neighborhood highest semantic correlation point of the current to-be-processed feature, thereby determining the local neighborhood semantic association window, realizing flexible adjustment of the receptive field range, so as to capture the local neighborhood context relevance while reducing unnecessary computational overhead and feature redundancy. After completing the division of the local window, calculate the position-wise mean vector between all mechanical water meter text direction reference channel feature vectors in the local neighborhood semantic association window of the mechanical water meter text direction reference feature to-be-processed channel vector as the mechanical water meter text direction reference feature local key semantic information coding vector, to extract the common semantic information within the local window range, providing more detailed semantic guidance for subsequent local feature enhancement.
[0053] Then, based on the semantic difference between the global key semantic information encoding vector of the mechanical water meter text direction reference feature and the local key semantic information encoding vector of the mechanical water meter text direction reference feature, perform feature enhancement processing on the to-be-processed channel vector of the mechanical water meter text direction reference feature to obtain an enhanced mechanical water meter text direction reference channel feature vector, where the enhanced mechanical water meter text direction reference channel feature vector is the channel feature vector at the pixel position (i, j) of the enhanced mechanical water meter text direction reference feature encoding map.
[0054] In a preferred example of the present application, performing feature enhancement processing on the to-be-processed channel vector of the mechanical water meter text direction reference feature based on the semantic difference between the global key semantic information encoding vector of the mechanical water meter text direction reference feature and the local key semantic information encoding vector of the mechanical water meter text direction reference feature includes: First, based on the to-be-processed channel vector of the mechanical water meter text direction reference feature, perform feature interaction optimization driven by semantic similarity on the local key semantic information encoding vector of the mechanical water meter text direction reference feature to obtain an optimized local key semantic information encoding vector of the mechanical water meter text direction reference feature, which is expressed by the formula:
[0055]
[0056] where, W l-f is the correlation matrix of vectors f i,j and v l(i,j) ; V ida is the diagonal vector composed of the diagonal elements of matrix W l-f ; V eig is the eigenvector composed of the eigenvalues of matrix W l-f ; denotes point addition, and v' l(i,j) denotes the optimized local key semantic information encoding vector of the mechanical water meter text direction reference feature corresponding to V l(i,j) .
[0057] Here, for the local key semantic information coding vector of the mechanical water meter text direction reference feature obtained by local semantic information extraction, the interaction between entities with similar semantic neighborhood types in the local semantic interaction system (i.e., the local key semantic information coding vector of the mechanical water meter text direction reference feature and the to-be-processed channel vector of the mechanical water meter text direction reference feature) is further characterized based on the concept of like forms. That is, the local key semantic information coding vectors of the mechanical water meter text direction reference feature with associated similar semantic neighborhood windows are interacted based on the semantic similarity drive of the to-be-processed channel vector of the mechanical water meter text direction reference feature, so that the local key semantic information coding vectors of the mechanical water meter text direction reference feature and the to-be-processed channel vector of the mechanical water meter text direction reference feature with similar attributes are more inclined to form a feature entity association. Specifically, the diagonal vector and eigenvector of the association representation of the local key semantic information coding vector of the mechanical water meter text direction reference feature and the to-be-processed channel vector of the mechanical water meter text direction reference feature are respectively used as the mediation-mediated effect representation and the target-mediated effect representation, and the mediated effect modeling is used to represent the indirect influence of the associated semantic similarity on the target variable through the mediating variable, so as to perform local semantic logic mediated inference through the like-form semantic network structure, and further improve the subsequent semantic mapping alignment.
[0058] Next, based on the semantic contrast analysis between the global key semantic information coding vector of the mechanical water meter text direction reference feature and the optimized local key semantic information coding vector of the mechanical water meter text direction reference feature, the semantic mapping guiding factor of the to-be-processed channel vector of the mechanical water meter text direction reference feature is determined, and based on the semantic mapping guiding factor, the to-be-processed channel vector of the mechanical water meter text direction reference feature is feature-modulated to obtain the enhanced mechanical water meter text direction reference channel feature vector, which is expressed by the formula:
[0059]
[0060] where S -1 represents the inverse matrix of the covariance matrix between v' l(i,j) and v g , s i,j (v g , v' l(i,j) ) represents the semantic mapping guiding factor of the to-be-processed channel vector of the mechanical water meter text direction reference feature, and f i,j ' represents the enhanced mechanical water meter text direction reference channel feature vector corresponding to f i,j .
[0061] It should be understood that the global key semantic information coding vector of the mechanical water meter text direction reference feature provides the key semantic guidance within the global scope, while the local key semantic information coding vector of the optimized mechanical water meter text direction reference feature defines the local semantic focus of the current feature. By further comparing and analyzing the two, the semantic significance of the mechanical water meter text direction reference feature to-be-processed channel vector in the global context can be determined, thereby guiding the targeted feature enhancement processing of the mechanical water meter text direction reference feature to-be-processed channel vector. Furthermore, based on the obtained semantic mapping guiding factor, the direction and intensity of feature enhancement are guided by multiplicative adjustment of the mechanical water meter text direction reference feature to-be-processed channel vector. In this way, the distinguishability of different feature parts in the mechanical water meter text direction reference feature coding map can be effectively enhanced, improving its feature expression ability, so that the enhanced mechanical water meter text direction reference feature coding map can more accurately reflect the directional characteristics of the water meter text, providing a more reliable feature basis for subsequent text direction recognition.
[0062] Specifically, in step S33, the expected rotation direction is speculated based on the feature difference between the enhanced mechanical water meter text direction reference feature coding map and the enhanced mechanical water meter text direction detection feature coding map to obtain the expected rotation angle of the mechanical water meter picture. In a specific example of the present application, step S33 includes: calculating the position-wise difference between the enhanced mechanical water meter text direction reference feature coding map and the enhanced mechanical water meter text direction detection feature coding map to obtain a mechanical water meter text direction difference implicit coding feature map; inputting the mechanical water meter text direction difference implicit coding feature map into an expected rotation direction speculation module based on a decoder to obtain the expected rotation angle of the mechanical water meter picture.
[0063] That is, by calculating the position-wise difference between the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map, an implicit encoding feature map of the mechanical water meter text direction difference is obtained to reveal the offset of the text direction features between the actually collected mechanical water meter image and the reference image, thereby providing a strong basis for the rotation correction of the mechanical water meter image. Then, a decoder-based expected rotation direction inference module is used to decode and infer the implicit encoding feature map of the mechanical water meter text direction difference to determine the expected rotation angle of the mechanical water meter image. Here, the expected rotation direction inference module is based on the decoder structure in deep learning, such as a deconvolutional neural network, which gradually upsamples and fuses features of the input implicit encoding feature map of the mechanical water meter text direction difference to gradually understand the spatial distribution difference between the text direction in the mechanical water meter image and the text direction in the reference mechanical water meter image, and thereby infers the angle by which the mechanical water meter image should be rotated relative to the reference image to achieve precise rotation correction of the mechanical water meter image.
[0064] In the technical solution of this application, the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map respectively represent the semantic enhanced features of the text posture image in the mechanical water meter image and the semantic enhanced features of the text posture reference image in the reference mechanical water meter image. The enhancement of the text direction image features will cause the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map to focus on the text direction image features, but it will also make their feature distributions too compact in the high-dimensional space. This makes the long-distance image semantic difference feature encoding in the implicit encoding feature map of the mechanical water meter text direction difference obtained in the process of calculating the position-wise difference between the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map insufficient, thereby reducing the expression effect of the implicit encoding feature map of the mechanical water meter text direction difference and affecting the accuracy of the expected rotation angle of the mechanical water meter image obtained by inputting it into the decoder-based expected rotation direction inference module.
[0065] To solve this technical problem, in the preferred embodiment of this application, before inputting the implicit encoding feature map of the mechanical water meter text direction difference into the decoder-based expected rotation direction inference module to obtain the expected rotation angle of the mechanical water meter image, feature distribution modulation is performed on the implicit encoding feature map of the mechanical water meter text direction difference to obtain an optimized implicit encoding feature vector of the mechanical water meter text direction difference, including:
[0066] Expand the implicit coding feature map of the mechanical water meter text direction difference into an implicit coding feature vector of the mechanical water meter text direction difference;
[0067] Perform dynamic weight calibration on the implicit coding feature vector of the mechanical water meter text direction difference to obtain an implicit coding dynamic weight distribution vector of the mechanical water meter text direction difference, expressed as:
[0068]
[0069] V' = V ⊙ V w
[0070] where sigmoid represents the activation function, μ represents the global feature mean of the implicit coding feature vector of the mechanical water meter text direction difference, V w represents the implicit coding modulation weight vector of the mechanical water meter text direction difference, ⊙ represents pointwise multiplication by position, and V' represents the implicit coding dynamic weight distribution vector of the mechanical water meter text direction difference;
[0071] Perform autocorrelation context association coding on the implicit coding dynamic weight distribution vector of the mechanical water meter text direction difference to obtain an implicit coding global space association matrix of the mechanical water meter text direction difference, expressed as:
[0072]
[0073] where T represents the transpose of the vector, S represents the length of the implicit coding dynamic weight distribution vector of the mechanical water meter text direction difference, and M represents the implicit coding global space association matrix of the mechanical water meter text direction difference;
[0074] Use the implicit coding global space association matrix of the mechanical water meter text direction difference as the forward fusion mask matrix, and perform forward propagation sparse modulation on the transposed vector of the implicit coding feature vector of the mechanical water meter text direction difference to obtain an implicit coding forward sparse fusion feature node vector of the mechanical water meter text direction difference, expressed as:
[0075]
[0076] where, represents matrix multiplication, and V1 represents the implicit coding forward sparse fusion feature node vector of the mechanical water meter text direction difference;
[0077] Project the mechanical water meter text direction difference implicit coding feature vector onto the modulation feature space of the mechanical water meter text direction difference implicit coding global space correlation matrix to backward propagate the mechanical water meter text direction difference implicit coding feature vector to the modulation feature space of the mechanical water meter text direction difference implicit coding global space correlation matrix to obtain a mechanical water meter text direction difference implicit coding backward sparse fusion feature node vector, denoted as:
[0078]
[0079] where V2 represents the mechanical water meter text direction difference implicit coding backward sparse fusion feature node vector;
[0080] Based on the mechanical water meter text direction difference implicit coding forward sparse fusion feature node vector and the mechanical water meter text direction difference implicit coding backward sparse fusion feature node vector, optimize the mechanical water meter text direction difference implicit coding feature vector to obtain an optimized mechanical water meter text direction difference implicit coding feature vector, denoted as:
[0081]
[0082] where α and β represent different weight hyperparameters, denotes element-wise addition, and V y represents the optimized mechanical water meter text direction difference implicit coding feature vector.
[0083] In this way, for the global space correlation fine-grained map of the dynamic weight assignment chain structure of the mechanical water meter text direction difference implicit coding feature vector under the asymmetric constraint sequence, due to the cross-domain context mapping distortion phenomenon triggered by the discretization offset of the space division threshold, use the local sparse fusion hybrid feature nodes of the mechanical water meter text direction difference implicit coding feature vector to decode the composite interaction architecture of its global space correlation map, and then reconstruct the feature reconstruction of the mechanical water meter text direction difference implicit coding feature vector by simulating the hybrid feature nodes based on phase conversion, so as to realize the implicit morphological evolution enhancement of the mechanical water meter text direction difference implicit coding feature vector under the dynamic trajectory convergence mechanism, and improve the feature expression effect of the mechanical water meter text direction difference implicit coding feature vector. In this way, improve the accuracy of the expected rotation angle of the mechanical water meter picture obtained by its input based on the decoder's expected rotation direction speculation module.
[0084] In the above automatic reading method of mechanical water meters, in step S4, based on the expected rotation angle, the mechanical water meter picture is rotated to obtain a rotated mechanical water meter picture. In the embodiments of the present application, an image rotation algorithm, such as Affine Transformation, is used to rotate and adjust the mechanical water meter picture according to the speculated expected rotation angle, ensuring that the text direction in the rotated mechanical water meter picture is consistent with the text direction in the reference image, thereby significantly improving the accuracy and efficiency of subsequent text recognition algorithms. In addition, during the rotation process, to avoid black edges or information loss in the rotated image, the Bilinear Interpolation algorithm can be used to fill the new pixel points generated during the rotation to ensure the integrity and clarity of the rotated image.
[0085] In the above automatic reading method of mechanical water meters, in step S5, the rotated mechanical water meter picture is input into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain the meter reading. Specifically, first, the mechanical water meter text detection model is used to scan and analyze the rotated and adjusted mechanical water meter picture to locate the text area in the water meter picture. In the embodiments of the present application, the mechanical water meter text detection model adopts the YOLOv3 (You Only Look Once version 3) object detection framework. Subsequently, the detected text area is input into the mechanical water meter text recognition model. The mechanical water meter text recognition model is based on OCR (Optical Character Recognition) technology to identify each character in the text area one by one and convert the recognition result into readable text information, thereby obtaining the meter reading of the mechanical water meter. In this way, through the automated processing of the model, the reading information of the water meter can be quickly and accurately obtained, greatly reducing the workload of manual meter reading and realizing the function of automatic meter reading.
[0086] In the above automatic reading method of mechanical water meters, in step S6, the meter reading is transmitted to the background monitoring center through the communication module. Specifically, the background monitoring center can receive and store the meter reading data from each mechanical water meter terminal in real time. By integrating and analyzing these data, the background monitoring center can comprehensively grasp the operating status of each water meter and promptly discover abnormal situations, such as water leakage and abnormal readings, so as to quickly take measures to ensure the normal operation of the water supply system. In addition, the background monitoring center can also associate these data with the user information system to achieve accurate metering and charging of user water consumption, improving the transparency and efficiency of charging.
[0087] In specific implementations, the selection of communication modules needs to fully consider various factors. In the context of modern communication technologies, there are various communication methods available for selection, such as 4G / 5G, Wi-Fi, and Bluetooth in the wireless communication field, as well as Ethernet in wired communication. For large-scale and widely distributed mechanical water meter monitoring scenarios, 4G / 5G communication modules become the first choice due to their high speed, wide coverage, and low latency characteristics. For example, in the urban water supply network, water meters may be distributed in every corner of the city, from bustling commercial areas to remote residential areas, and the 4G / 5G network can ensure the timely and stable transmission of meter readings to the background monitoring center. In some relatively enclosed areas, such as industrial parks or large residential communities, if a complete Wi-Fi network infrastructure has been built internally, Wi-Fi communication modules can also play their advantages. Their relatively high data transmission rate can meet the demand for rapid transmission of a large amount of water meter data, and the deployment cost is relatively low. For some scenarios with extremely high power consumption requirements, small data transmission volume, and short distances, such as when some smart water meters are installed in users' homes and only need to upload readings regularly, Bluetooth communication modules can be a low-power and convenient option. For wired communication methods, Ethernet has significant advantages in industrial environments or scenarios with extremely high requirements for data transmission stability, such as in the water meter monitoring system inside a large factory. Ethernet can provide a reliable, high-speed, and interference-resistant data transmission channel.
[0088] After selecting the communication module, it needs to be precisely configured. The configuration process involves the setting of multiple key parameters. First are the network access parameters. If a 4G / 5G communication module is used, the corresponding operator's SIM card needs to be inserted, and the correct APN (Access Point Name) needs to be configured in the module to ensure that the module can access the operator's mobile network. At the same time, the IP address acquisition method of the module needs to be set, and it can be selected to obtain dynamically (DHCP) or set statically. The dynamic acquisition method is suitable for scenarios with relatively flexible network environments and low requirements for device IP address management, which can simplify the configuration process; while static setting is more applicable when precise network management of the device is required to ensure data transmission stability, such as in the water meter monitoring systems of some financial institutions or government departments with extremely high requirements for data security and real-time performance. For Wi-Fi communication modules, the correct Wi-Fi network name (SSID) and password need to be entered in the module to achieve connection to the specified wireless network. During the configuration process, attention also needs to be paid to the selection of the network frequency band to avoid interference with other surrounding wireless devices and ensure the stability of communication.
[0089] The adaptation of data transmission protocols is the core to ensure the accurate and efficient transmission of meter reading data. Among numerous data transmission protocols, the TCP / IP protocol has become the mainstream choice due to its universality and reliability. When meter reading data needs to be transmitted through a communication module, the reading data should first be encapsulated in the format of the TCP / IP protocol. The TCP protocol is responsible for establishing a reliable connection between the data sending end and the receiving end, ensuring the orderly transmission and integrity of data. It establishes a connection through a three-way handshake, numbers and acknowledges the data during transmission, and will automatically retransmit if data loss or errors are detected. The IP protocol is responsible for data addressing and routing, determining the transmission path of data from the sending end to the receiving end. For example, at the data sending end, the meter reading is split into individual data packets, and TCP header and IP header information are added to each data packet. The TCP header contains information such as the source port number, destination port number, sequence number, acknowledgment number, etc., which are used to establish and maintain the connection and ensure the correct order of data; the IP header contains information such as the source IP address and destination IP address, which are used for data routing. In some scenarios with extremely high requirements for data transmission real-time and relatively stable network environments, the UDP protocol can also be considered. Compared with the TCP protocol, the UDP protocol has lower overhead and faster transmission speed. It does not require establishing a connection and directly encapsulates data into data packets for sending, and is suitable for some applications with relatively low requirements for data integrity but extremely high requirements for real-time, such as video surveillance data transmission. However, when transmitting meter reading data, since the accuracy of the reading is crucial, it is usually necessary to design additional checksum and retransmission mechanisms for UDP data at the application layer to ensure the reliable transmission of data.
[0090] To optimize the data transmission process, at the data sending end, the meter reading should be reasonably cached and packaged. Since the water meter readings may be collected periodically, to avoid wasting network resources due to frequent data transmissions, a suitable buffer can be set up. When the reading data in the buffer reaches a certain quantity or after a certain time interval, these data are packaged into a larger data packet for transmission. This can reduce the number of network connection establishments and improve the transmission efficiency. At the same time, during the data transmission process, the network status should be monitored in real time, such as the network signal strength, transmission rate, packet loss rate, etc. If it is found that the network status is not good, corresponding measures can be taken for adjustment, such as reducing the data transmission rate to ensure reliable data transmission, or switching to an alternative network channel. For example, when using a 4G / 5G communication module, if the signal strength is weak, the data transmission rate can be automatically reduced and switched from the 5G network to the 4G network to ensure continuous data transmission. At the data receiving end, an efficient data receiving and processing mechanism should be established. When the background monitoring center receives a data packet, first, the data packet should be unpacked to extract the original meter reading data. Then, the data is verified to check its integrity and accuracy, which can be achieved by calculating the checksum or using other data verification algorithms. If it is found that the data is incorrect, a retransmission request is sent to the sending end in a timely manner.
[0091] After the meter reading is successfully transmitted to the background monitoring center, a series of data processing tasks need to be carried out. First, the received reading data is stored in a dedicated database. The type of database should be reasonably selected according to the actual requirements and data volume. For example, relational databases such as MySQL and Oracle are suitable for scenarios with high requirements for structured data storage and complex queries; while for some big data scenarios with extremely large data volumes and high real-time requirements, non-relational databases such as MongoDB may be more appropriate. When storing data, the security and integrity of the data should be ensured, and technical means such as data backup and data encryption can be adopted. At the same time, the meter reading is analyzed in real time to generate various reports and charts, providing intuitive data displays for the water supply management department. For example, by analyzing the change trend of the water meter readings over a period of time, it can be judged whether there are abnormal situations such as water leakage in the water supply system; by comparing the water meter readings in different areas, the operating efficiency of the water supply facilities can be evaluated. In addition, the meter reading can also be associated with user information, the water fee calculation system, etc. to achieve automatic water fee calculation and bill generation, providing convenient services for users.
[0092] In summary, the automatic reading method of the mechanical water meter according to the embodiments of the present application is described. It uses a camera to collect pictures of the mechanical water meter, and at the same time extracts a reference mechanical water meter image with a text direction of 0° from the background database. By introducing an image processing technology based on deep learning, a hidden difference analysis based on text direction-sensitive features is performed on the two to determine the expected rotation angle of the collected mechanical water meter picture, and then the automatic correction of the mechanical water meter picture is realized, so as to facilitate text detection and recognition based on the rotation-corrected mechanical water meter picture, and realize the automatic reading of the water meter reading. In this way, complex situations such as diverse water meter installation environments and variable text directions of water meters can be effectively dealt with, and the accuracy of automatic recognition of water meter readings can be improved.
[0093] Furthermore, the present application also provides an automatic reading system for mechanical water meters.
[0094] Figure 5 FIG. is a block diagram of an automatic reading system for a mechanical water meter according to an embodiment of the present application. As Figure 5 shown, the automatic reading system 100 for a mechanical water meter according to an embodiment of the present application includes: a mechanical water meter picture acquisition module 110 for acquiring pictures of the mechanical water meter collected by a camera; a reference water meter image extraction module 120 for extracting a reference mechanical water meter image from the background database, where the text direction of the mechanical water meter in the reference mechanical water meter image is 0°; a rotation angle comparison and analysis module 130 for determining the expected rotation angle of the mechanical water meter picture based on a comparison analysis between the reference mechanical water meter image and the mechanical water meter picture, where determining the expected rotation angle of the mechanical water meter picture includes: performing a hidden difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture; a rotation correction module 140 for rotating the mechanical water meter picture based on the expected rotation angle to obtain a rotated mechanical water meter picture; a text recognition module 150 for inputting the rotated mechanical water meter picture into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain a meter reading; and a data transmission module 160 for transmitting the meter reading to a background monitoring center through a communication module.
[0095] Here, those skilled in the art can understand that the specific operations of each module in the above automatic reading system for mechanical water meters have been described in detail in the description of the above automatic reading method for mechanical water meters according to Figures 1 to 4 this application, and therefore, the repeated description thereof will be omitted.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. An automatic reading method for mechanical water meters, characterized in that Including: Obtaining a picture of a mechanical water meter collected by a camera; Extracting a reference mechanical water meter image from a background database, where the text direction of the mechanical water meter in the reference mechanical water meter image is 0°; Based on the comparative analysis between the reference mechanical water meter image and the mechanical water meter picture, determining the expected rotation angle of the mechanical water meter picture, wherein determining the expected rotation angle of the mechanical water meter picture includes: performing a hidden difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture, wherein the hidden difference analysis based on text direction-sensitive features is performed by obtaining a reference feature coding map of the mechanical water meter text direction and a detection feature coding map of the mechanical water meter text direction, and performing text direction image feature enhancement and feature difference calculation based on global semantic guidance; Based on the expected rotation angle, rotating the mechanical water meter picture to obtain a rotated mechanical water meter picture; Inputting the rotated mechanical water meter picture into a mechanical water meter text detection model and a mechanical water meter text recognition model to obtain a meter reading; Transmitting the meter reading to a background monitoring center through a communication module.
2. The automatic recognition method of the mechanical water meter according to claim 1, characterized in that Performing a hidden difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture, including: Extracting water meter text direction-sensitive features from the reference mechanical water meter image and the mechanical water meter picture to obtain a reference feature coding map of the mechanical water meter text direction and a detection feature coding map of the mechanical water meter text direction; Performing text direction image feature enhancement based on global semantic guidance on the reference feature coding map of the mechanical water meter text direction and the detection feature coding map of the mechanical water meter text direction respectively to obtain an enhanced reference feature coding map of the mechanical water meter text direction and an enhanced detection feature coding map of the mechanical water meter text direction; Based on the feature difference between the enhanced reference feature coding map of the mechanical water meter text direction and the enhanced detection feature coding map of the mechanical water meter text direction, speculating the expected rotation direction to obtain the expected rotation angle of the mechanical water meter picture.
3. The automatic recognition method of the mechanical water meter according to claim 2, wherein, Extracting water meter text direction-sensitive features from the reference mechanical water meter image and the mechanical water meter picture to obtain a reference feature coding map of the mechanical water meter text direction and a detection feature coding map of the mechanical water meter text direction, including: Using a trained CNN model to perform feature extraction on the reference mechanical water meter image and the mechanical water meter picture to obtain the reference feature coding map of the mechanical water meter text direction and the detection feature coding map of the mechanical water meter text direction.
4. The automatic reading method of the mechanical water meter according to claim 3, characterized in that, Performing text direction image feature enhancement based on global semantic guidance on the reference feature coding map of the mechanical water meter text direction to obtain an enhanced reference feature coding map of the mechanical water meter text direction, including: Performing global key semantic information extraction on the reference feature coding map of the mechanical water meter text direction to obtain a global key semantic information coding vector of the mechanical water meter text direction; Based on the global key semantic information encoding vector of the mechanical water meter text direction reference feature, perform feature enhancement guided by global information on the channel feature vectors at each pixel position in the mechanical water meter text direction reference feature encoding map to obtain the enhanced mechanical water meter text direction reference feature encoding map.
5. The automatic reading method of the mechanical water meter according to claim 4, characterized in that, Based on the global key semantic information encoding vector of the mechanical water meter text direction reference feature, perform fine-grained feature enhancement guided by global information on the channel feature vectors at each pixel position in the mechanical water meter text direction reference feature encoding map to obtain the enhanced mechanical water meter text direction reference feature encoding map, including: Extract the channel feature vector at pixel position (i, j) from the mechanical water meter text direction reference feature encoding map as the mechanical water meter text direction reference feature channel vector to be processed. Perform key semantic information extraction based on the local neighborhood on the mechanical water meter text direction reference feature channel vector to be processed to obtain the mechanical water meter text direction reference feature local key semantic information encoding vector. Based on the semantic difference between the global key semantic information encoding vector of the mechanical water meter text direction reference feature and the local key semantic information encoding vector of the mechanical water meter text direction reference feature, perform feature enhancement processing on the mechanical water meter text direction reference feature channel vector to be processed to obtain the enhanced mechanical water meter text direction reference channel feature vector, where the enhanced mechanical water meter text direction reference channel feature vector is the channel feature vector at pixel position (i, j) of the enhanced mechanical water meter text direction reference feature encoding map.
6. The automatic reading method of the mechanical water meter according to claim 5, characterized in that Perform key semantic information extraction based on the local neighborhood on the mechanical water meter text direction reference feature channel vector to be processed to obtain the mechanical water meter text direction reference feature local key semantic information encoding vector, including: Based on the feature distribution characteristics of the mechanical water meter text direction reference feature channel vector to be processed, determine the local neighborhood semantic association window of the mechanical water meter text direction reference feature channel vector to be processed, where the mechanical water meter text direction reference feature channel vector to be processed is located at the center position of the local neighborhood semantic association window. Extract the key semantic information of all mechanical water meter text direction reference channel feature vectors in the local neighborhood semantic association window to obtain the mechanical water meter text direction reference feature local key semantic information encoding vector corresponding to the mechanical water meter text direction reference feature channel vector to be processed.
7. The automatic reading method of the mechanical water meter according to claim 6, characterized in that, Extract the key semantic information of all mechanical water meter text direction reference channel feature vectors in the local neighborhood semantic association window to obtain the mechanical water meter text direction reference feature local key semantic information encoding vector corresponding to the mechanical water meter text direction reference feature channel vector to be processed, including: Calculate the position-wise mean vector between all mechanical water meter text direction reference channel feature vectors in the local neighborhood semantic association window of the mechanical water meter text direction reference feature channel vector to be processed to obtain the mechanical water meter text direction reference feature local key semantic information encoding vector.
8. The automatic reading method of a mechanical water meter according to claim 7, characterized in that, Based on the semantic difference between the global key semantic information encoding vector of the mechanical water meter text direction reference feature and the local key semantic information encoding vector of the mechanical water meter text direction reference feature, perform feature enhancement processing on the to-be-processed channel vector of the mechanical water meter text direction reference feature to obtain an enhanced mechanical water meter text direction reference channel feature vector, including: Based on the to-be-processed channel vector of the mechanical water meter text direction reference feature, perform feature interaction optimization driven by semantic similarity on the local key semantic information encoding vector of the mechanical water meter text direction reference feature to obtain an optimized local key semantic information encoding vector of the mechanical water meter text direction reference feature; Based on the semantic contrast analysis between the global key semantic information encoding vector of the mechanical water meter text direction reference feature and the optimized local key semantic information encoding vector of the mechanical water meter text direction reference feature, determine the semantic mapping guiding factor of the to-be-processed channel vector of the mechanical water meter text direction reference feature; Based on the semantic mapping guiding factor, perform feature modulation on the to-be-processed channel vector of the mechanical water meter text direction reference feature to obtain the enhanced mechanical water meter text direction reference channel feature vector.
9. The automatic recognition method of mechanical water meter according to claim 8, characterized in that, Based on the feature difference between the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map, speculate on the expected rotation direction to obtain the expected rotation angle of the mechanical water meter picture, including: Calculate the position-based difference between the enhanced mechanical water meter text direction reference feature encoding map and the enhanced mechanical water meter text direction detection feature encoding map to obtain a mechanical water meter text direction difference implicit encoding feature map; Input the mechanical water meter text direction difference implicit encoding feature map into an expected rotation direction speculation module based on a decoder to obtain the expected rotation angle of the mechanical water meter picture.
10. An automatic reading system for mechanical water meters, characterized in that, Including: A mechanical water meter picture acquisition module for acquiring mechanical water meter pictures collected by a camera; A reference water meter image extraction module for extracting a reference mechanical water meter image from a background database, where the mechanical water meter text direction in the reference mechanical water meter image is 0°; A rotation angle contrast analysis module for determining the expected rotation angle of the mechanical water meter picture based on the contrast analysis between the reference mechanical water meter image and the mechanical water meter picture. Among them, determining the expected rotation angle of the mechanical water meter picture includes: performing implicit difference analysis based on text direction-sensitive features on the reference mechanical water meter image and the mechanical water meter picture to determine the expected rotation angle of the mechanical water meter picture. Among them, the implicit difference analysis based on text direction-sensitive features is performed by obtaining a mechanical water meter text direction reference feature encoding map and a mechanical water meter text direction detection feature encoding map, and performing text direction image feature enhancement and feature difference calculation based on global semantic guidance; A rotation correction module for rotating the mechanical water meter picture based on the expected rotation angle to obtain a rotated mechanical water meter picture; A character recognition module, which is used to input the rotated mechanical water meter picture into a mechanical water meter character detection model and a mechanical water meter character recognition model to obtain the meter reading; A data transmission module, which is used to transmit the meter reading to the background monitoring center through a communication module.
Citation Information
Patent Citations
Water meter reading identification method, water meter reading identification device and electronic equipment
CN108304842A
Rotating image correction method based on lightweight neural network
CN117765227A
Identification and correction method and system based on bill orientation
CN119091451A
Multi-directional scene text recognition method and system based on multi-element attention mechanism
US20220121871A1