Water meter reading recognition method for OCR, target and key point detection
Through the evaporation scale reading recognition method based on OCR and target and key point detection, the problems of low efficiency and inadequacy of evaporation scale reading recognition in the prior art are solved, and high-precision and fast reading recognition are achieved to meet real-time requirements.
Patent Information
- Application Number
- CN202411761494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has high cost, low efficiency and error-prone problems in the recognition of evaporation scale readings. The traditional image processing methods have high requirements for environmental background, light and shooting angles, and the algorithm does not have universal adaptability.
The evaporative scale reading recognition method based on OCR, target and key point detection is adopted. By collecting the initial scale image for preprocessing, text detection and text recognition models are trained, square reading frames of the image are detected, readings are identified, and scale values are calculated through the particle coordinates of key points.
It improves the recognition accuracy under complex lighting conditions and variable environments, realizes rapid identification, meets the real-time reading requirements, and improves the accuracy of the evaporated water test by the Hydrology Bureau.
Smart Images

Figure CN119741715A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of evaporation scale reading recognition, and in particular to an evaporation scale reading recognition method. Background Art
[0002] The evaporation scale plays an important role in hydrological research. The evaporation data it provides is the basis for hydrological process research, model calibration, water resources management and climate change research. Through precise measurement and long-term monitoring, the evaporation scale provides important support for the advancement and application of hydrological science. The evaporation scale directly measures the evaporation of the water surface and provides accurate data. Evaporation is one of the main ways for water bodies to lose water. These data help quantify the evaporation process in the water cycle and further understand the consumption and replenishment of water resources.
[0003] In the field of evaporation scale reading and recognition, the traditional visual writing method has been gradually replaced by intelligent automatic systems due to its high cost, low efficiency, and easy errors. In recent years, the technology of digital image processing to calculate water level has developed rapidly. Technologies such as image difference method, Canny operator, and multi-template matching algorithm have been applied to the recognition and correction of scale scales, and then the scale pointer is detected through Hough transform, affine transform, and projection relationship. However, these traditional image processing methods have high requirements for the scale itself, environmental background, light, and shooting angle, and the algorithms are not universally adaptable. With the rapid development of deep learning technology, the adaptive recognition and induction of image features through deep neural networks has become an important direction for scale detection. Summary of the invention
[0004] In order to improve the accuracy of evaporation water testing by the Hydrological Bureau, this paper proposes a recognition method for evaporation scale readings based on OCR, target and key point detection.
[0005] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical scheme:
[0006] The present invention provides a water meter reading recognition method for OCR, target and key point detection, comprising the following steps:
[0007] Step 1, collect the initial scale image as a data set, perform preprocessing, and obtain the evaporation scale image;
[0008] Step 2: Use the annotated evaporation ruler image to train a text detection and text recognition model, and use the text detection model to detect the square reading frame of the image;
[0009] Step 3, using the square frame reading training to obtain a text recognition model, using the recognition model to obtain the square frame reading recognition result, and post-processing the recognition result to correct the recognized wrong numbers;
[0010] Step 4: Calculate the corresponding distance and angle through the particle coordinates of the key points, bring the actual scale value, angle and distance into the fitting equation, obtain the parameters of the fitting equation, and then use the linear regression method to calculate the scale value.
[0011] Further technology of the present invention:
[0012] Preferably, step three is specifically:
[0013] 1) Preprocess the input text image to improve the recognition accuracy;
[0014] 2) Based on text detection, the text area is extracted from the original image according to the results of text positioning;
[0015] 3) Extract useful features from images of text areas for training or recognition models;
[0016] 4) Use the annotated data set to train the recognition model, input the extracted features into the recognition algorithm, and obtain the text recognition results;
[0017] 5) Post-process the recognition results to eliminate incorrectly recognized numbers or non-numbers and find the correct scale pointer 0.
[0018] Preferably, step 4 is specifically as follows:
[0019] 1) Use the obtained scale pointer 0 box and the two boxes before and after the scale pointer 0 to calculate their particle coordinates respectively, and use the obtained coordinates to calculate the lengths of xy, xz, and yz;
[0020] 2) Calculate the angles formed by the two boxes before and after the scale pointer 0 and the box of the scale pointer 0;
[0021] 3) Use linear regression to fit the equation to solve the scale value;
[0022] 4) Obtain the parameters of the linear regression equation by inputting the true scale value, angle, and distance;
[0023] 5) Finally, we can get the scale value we need through the linear regression equation.
[0024] The beneficial effects of the present invention are as follows: the method trains text detection and text recognition models respectively through the collected image sets, the text detection is to detect the position where the text appears in the scale, the text recognition is to obtain the corresponding readings, and then calculates the particle coordinates of the key figures, and uses the corresponding angle values, distance values, and the fitting linear regression method to calculate the final scale value.
[0025] This method combines a variety of technical means to improve the recognition accuracy under complex lighting conditions and changing environments. It achieves fast recognition through efficient algorithms to meet real-time reading requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 It is a schematic diagram of the process of the present invention.
[0028] Figure 2 This is a schematic diagram of reading scale value data of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be further described in detail below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention but not all. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0030] like Figure 1 The present invention provides a water meter reading recognition method using OCR, target and key point detection, comprising the following steps:
[0031] Step 1: collect the initial scale image as a data set, perform preprocessing, and obtain the evaporation scale image; the preprocessing is color jittering to enhance the effect of the model under different lighting conditions;
[0032] Step 2: Use the labeled evaporation ruler image to train a text detection model, and use the text detection model to detect the square reading frame of the image;
[0033] Training the text detection model is as follows:
[0034] 1) Collect enough annotated data, including images and corresponding object bounding boxes or key points;
[0035] 2) Data preprocessing: scaling and normalizing the image to fit the model input and enhancing the data;
[0036] 3) Select the model architecture, configure the model parameters, and build the loss function;
[0037] 4) Train the model using the training data, calculate the loss through forward propagation, and update the model weights through back propagation;
[0038] 5) Evaluate the model performance on the validation set using accuracy, recall, and mAP indicators, and optimize the model based on the evaluation results, including adjusting the network structure, using more complex loss functions, or improving data enhancement strategies;
[0039] 6) Get the text detection model.
[0040] Step 3, using the square frame reading training to obtain a text recognition model, using the recognition model to obtain the square frame reading recognition result, and post-processing the recognition result to correct the recognized wrong numbers;
[0041] Step three is as follows:
[0042] 1) Preprocess the input text image to improve the recognition accuracy;
[0043] 2) Based on text detection, the text area is extracted from the original image according to the results of text positioning;
[0044] 3) Extract useful features from images of text areas for training or recognition models;
[0045] 4) Use the annotated data set to train the recognition model, input the extracted features into the recognition algorithm, and obtain the text recognition results;
[0046] 5) Post-process the recognition results to eliminate incorrectly recognized numbers or non-numbers and find the correct scale pointer 0.
[0047] Step 4: Calculate the corresponding distance and angle through the particle coordinates of the key points, bring the actual scale value, angle and distance into the fitting equation, obtain the parameters of the fitting equation, and then use the linear regression method to calculate the scale value.
[0048] Step 4 is as follows:
[0049] 1) Use the obtained scale pointer 0 box and the two boxes before and after the scale pointer 0 to calculate their particle coordinates respectively, and use the obtained coordinates to calculate the lengths of xy, xz, and yz, such as Figure 2 ;
[0050] 2) Calculate the angle α formed by the two boxes before and after the scale pointer 0 and the box of the scale pointer 0;
[0051] 3) Use linear regression to fit the equation to solve the scale value;
[0052] 4) Obtain the parameters of the linear regression equation by inputting the true scale value, angle, and distance;
[0053] 5) Finally, we can get the scale value we need through the linear regression equation.
[0054] Use linear regression to fit the equation that solves the scale value:
[0055] Y=β0+β1X xy +β2X xz +β3X yz
[0056] By inputting the true scale value, angle, and distance, we can get the parameters β0, β1, β2, and β3 of the linear regression equation.
[0057] Finally, the scale value can be obtained through the linear regression equation.
[0058] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A water meter reading recognition method based on OCR, target and key point detection, characterized in that: The following steps are involved: Step 1, collect the initial scale image as a data set, perform preprocessing, and obtain the evaporation scale image; Step 2: Use the annotated evaporation ruler image to train a text detection and text recognition model, and use the text detection model to detect the square reading frame of the image; Step 3, using the square frame reading training to obtain a text recognition model, using the recognition model to obtain the square frame reading recognition result, and post-processing the recognition result to correct the recognized wrong numbers; Step 4: Calculate the corresponding distance and angle through the particle coordinates of the key points, bring the actual scale value, angle and distance into the fitting equation, obtain the parameters of the fitting equation, and then use the linear regression method to calculate the scale value.
2. The water meter reading recognition method according to claim 1, characterized in that: Step three is as follows: 1) Preprocess the input text image; 2) Based on text detection, the text area is extracted from the original image according to the results of text positioning; 3) Use the labeled data set to train the recognition model, load the trained text recognition model, read the image to be detected to obtain the text recognition result.
3. The water meter reading recognition method according to claim 2, characterized in that: Step 4 is as follows: 1) Use the obtained scale pointer 0 box and key digital scale box to calculate their particle coordinates respectively, and use the obtained coordinates to calculate the lengths of xy, xz, and yz; 2) Calculate the angles formed by the two boxes before and after the scale pointer 0 and the box of the scale pointer 0; 3) Use linear regression to fit the equation to solve the scale value; 4) Obtain the parameters of the linear regression equation by inputting the true scale value, angle, and distance; 5) Finally, we can get the scale value we need through the linear regression equation.
Citation Information
Patent Citations
Water meter reading recognition method based on OCR and target and key point detection
CN117746412A
Reading identification method, device and equipment of pointer type instrument and storage medium
CN118736181A
Miniaturized cavity and evaporation table equipment
CN213652623U