A fully automated water meter positioning method

By using the water meter type identification model and the wheel position detection model in the water meter positioning system, the wheel area of ​​the water meter is accurately positioned, and the problems of low identification efficiency and waste of resources in the prior art are solved, and efficient water meter image recognition is achieved.

CN114067305BActive Publication Date: 2025-04-25ANHUI EMI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111375472.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-04-25
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

The existing remote water meter system for cameras cannot accurately locate the wheel area of ​​the water meter in the acquisition image, resulting in low recognition efficiency and waste of algorithm chip computing resources.

Method used

The fully automated water meter positioning method is adopted to detect the water meter type through the water meter type identification model, call the corresponding font wheel position detection model to detect the font wheel position, and obtain the inclination angle and position translation of the water meter, and perform image correction and character position position positioning.

Benefits of technology

The accurate positioning of the water meter wheel area in the collected image is achieved, the recognition efficiency is improved, and the computing resource use of the algorithm chip is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067305B_ABST
    Figure CN114067305B_ABST
Patent Text Reader

Abstract

The present invention relates to water meter image recognition, and in particular to a fully automatic water meter positioning method, which uses a water meter type recognition model to detect the water meter type in a captured image, calls a corresponding character wheel position detection model based on the water meter type to detect the character wheel position in the captured image, obtains the inclination angle and position translation of the water meter based on the character wheel position, performs image correction on the captured image, and positions the water meter in the corrected image based on the pre-stored character position corresponding to the water meter type. The technical solution provided by the present invention can effectively overcome the defect of the prior art that the water meter character wheel area in the captured image cannot be accurately positioned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to water meter image recognition, and in particular to a fully automatic water meter positioning method. Background Art

[0002] The existing smart water meter data reading methods mainly include photoelectric direct reading, pulse, electromagnetic, ultrasonic, camera, etc. Among them, the existing camera remote transmission water meter mainly takes a picture of the mechanical water meter character wheel part, and then transmits it to the data collection center for identification. The camera remote transmission water meter is a new type of water meter that has appeared in recent years. Since this water meter can solve the problem of data remote transmission, it can take a picture of the water meter data and upload it. In extreme cases, it can be manually verified to determine whether the water meter reading is correct.

[0003] When the camera assembly of the video remote water meter shoots, the images that really need to be calculated by the algorithm are concentrated in the water meter's character wheel area. The existing video remote water meter system will perform algorithm analysis and recognition on a large number of useless images, resulting in low recognition efficiency and a great waste of algorithm chip computing resources. One of the most important reasons for the above situation is that it is impossible to accurately locate the water meter character wheel area in the captured image. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] In view of the above-mentioned shortcomings of the prior art, the present invention provides a fully automatic water meter positioning method, which can effectively overcome the defect of the prior art that the part about the water meter wheel area in the captured image cannot be accurately positioned.

[0006] (II) Technical solution

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0008] A fully automated water meter positioning method utilizes a water meter type recognition model to detect the water meter type in a captured image, calls a corresponding character wheel position detection model based on the water meter type to detect the character wheel position in the captured image, obtains the inclination angle and position translation of the water meter based on the character wheel position, performs image correction on the captured image, and positions the water meter in the corrected image based on the pre-stored character position corresponding to the water meter type.

[0009] Preferably, the training method of the water meter type recognition model comprises:

[0010] S11. Collect a large number of sample images for each type of water meter, amplify the sample images, and mark the amplified sample images by category;

[0011] S12. All sample images together with the corresponding category labels are input into the DenseNet neural network model for model training, and the trained model file is deployed on the cloud server.

[0012] Preferably, the wheel position detection model is trained separately for each type of water meter, including:

[0013] S21. For each type of water meter, sample images from various angles are collected, the positions of the outer frames corresponding to the word wheels are manually marked on the sample images, and the sample images are amplified;

[0014] S22. Input the sample images and corresponding annotation information into the yolov5 deep network for model training, and deploy the trained network model on the cloud server.

[0015] Preferably, the step of obtaining the tilt angle and position translation of the water meter based on the position of the water meter wheel includes:

[0016] For water meters where the background color of the wheel area is obviously different from the background color of the dial and the wheel area is connected as a whole, the following method is used to obtain the tilt angle and position translation of the water meter:

[0017] The foreground image containing the wheel area is extracted from the acquired image, and the connected domain with the largest area in the foreground image is taken as the wheel area. Through contour analysis, straight line segment fitting and extraction in the contour sequence, the horizontal angle and center point coordinates of the wheel area are obtained, and then the inclination angle and position translation of the water meter are obtained.

[0018] Preferably, the step of obtaining the tilt angle and position translation of the water meter based on the position of the water meter wheel includes:

[0019] For water meters whose character wheel area is an independent rectangle and whose background color is obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter:

[0020] The foreground image including the character wheel area is extracted from the acquired image. The character area in the foreground image is filtered out by comparing the shape and size to obtain an independent rectangle of the character wheel area. Then, the four corners of the entire character wheel area are obtained to obtain the inclination angle and position translation of the water meter.

[0021] Preferably, the step of obtaining the tilt angle and position translation of the water meter based on the position of the water meter wheel includes:

[0022] For water meters with a rubber ring around the dial area and whose color is obviously different from the dial background color, the following method is used to obtain the tilt angle and position translation of the water meter:

[0023] The foreground image including the wheel area is extracted from the acquired image. The connected domains of non-wheel areas in the foreground image are filtered out by analyzing the shapes and areas of each connected domain. The outer contour of the wheel area is fitted with a straight line to obtain the inclination angle and position translation of the water meter.

[0024] Preferably, the step of obtaining the tilt angle and position translation of the water meter based on the position of the water meter wheel includes:

[0025] For a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, and whose background color of the character wheel area is not obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter:

[0026] The foreground image containing the character wheel area is extracted from the acquired image. According to the size of the water meter characters, the connected domain that does not meet the size requirements is filtered out. The corresponding character wheel area is determined by utilizing the collinearity of the centers of the first three water meter characters. The angle of the line connecting the centers of the first three water meter characters is the inclination angle of the water meter. The center point of the second character is used as the calibration point to calculate the position translation of the water meter.

[0027] Preferably, the step of obtaining the tilt angle and position translation of the water meter based on the position of the water meter wheel includes:

[0028] For a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, has no obvious difference between the background color of the character wheel area and the background color of the dial, and has a black area on the side of the character wheel area, the following method is used to obtain the tilt angle and position translation of the water meter:

[0029] The foreground image including the character wheel area is extracted from the acquired image. The black area on the side of the character wheel area, the water meter characters adhered to the black area and other connected domains that do not meet the size requirements are filtered out based on the size information. The inclination angle and position translation of the water meter are obtained based on the position and colinear characteristics of the center points of the three middle water meter characters.

[0030] Preferably, extracting the foreground image containing the character wheel area from the collected image comprises:

[0031] S31, after detecting the water meter type in the collected image using the water meter type recognition model, retrieve pre-stored information to obtain the dial color base value of the water meter of this type;

[0032] S32, setting a pixel threshold, and comparing the RGB value of each pixel in the collected image with the dial color base value;

[0033] S33, extracting any pixel point in the collected image whose RGB value is greater than the pixel threshold as a foreground image.

[0034] (III) Beneficial effects

[0035] Compared with the prior art, the fully automatic water meter positioning method provided by the present invention can identify the water meter type in the collected image by using a water meter type recognition model, and call the corresponding character wheel position detection model based on the water meter type to detect the character wheel position in the collected image, and can accurately obtain the inclination angle and position translation amount in combination with the character wheel position and water meter type, and then can accurately correct the collected image, and then use the pre-stored character position corresponding to the water meter type to achieve accurate positioning in the corrected image. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0037] Figure 1 It is a schematic diagram of the process of the present invention;

[0038] Figure 2 The captured image and the corresponding foreground image of the first type of water meter in the present invention;

[0039] Figure 3 The captured image and the corresponding foreground image of the second type of water meter in the present invention;

[0040] Figure 4 The captured image and the corresponding foreground image of the third type of water meter in the present invention;

[0041] Figure 5 The collected image and the corresponding foreground image of the fourth type of water meter in the present invention;

[0042] Figure 6 The captured image and the corresponding foreground image of the fifth type of water meter in the present invention;

[0043] Figure 7 This is a structural diagram of the DenseNet neural network model. DETAILED DESCRIPTION

[0044] 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 clearly and completely described 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, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] A fully automated water meter positioning method, such as Figure 1 As shown, a water meter type recognition model is used to detect the type of water meter in a captured image, and based on the water meter type, a corresponding character wheel position detection model is called to detect the character wheel position in the captured image. Based on the character wheel position, the inclination angle and position translation of the water meter are obtained, and image correction is performed on the captured image. The water meter type is positioned in the corrected image based on the pre-stored character position corresponding to the water meter type.

[0046] In order to query the corresponding pre-stored information according to the water meter type in the future, it is necessary to obtain the water meter type in the captured image in advance. When the camera remote water meter is installed for the first time, an image will be taken and transmitted to the cloud server, where the water meter type in the captured image will be detected and identified, and then the subsequent steps will be called to continue the analysis.

[0047] The training method of the water meter type recognition model includes:

[0048] S11. Collect a large number of sample images for each type of water meter (collect 50 sample images for each type of water meter), amplify the sample images (amplify the sample images of each type of water meter to 500 by image rotation, translation, affine transformation, etc.), and mark the amplified sample images by category;

[0049] S12. All sample images together with the corresponding category labels are input into the DenseNet neural network model for model training, and the trained model file is deployed on the cloud server.

[0050] The shooting equipment used to collect sample images is consistent with the camera remote water meter in terms of camera type, resolution, image compression format, light intensity, etc.

[0051] The wheel position detection model is trained separately for each type of water meter, including:

[0052] S21. For each type of water meter, sample images of various angles are collected (50 sample images are collected for each type of water meter), the outer frame positions corresponding to the word wheels are manually marked on the sample images, and the sample images are amplified (by image rotation, translation, affine transformation, etc., the sample images of each type of water meter are amplified to 500);

[0053] S22. Input the sample images and corresponding annotation information into the yolov5 deep network for model training, and deploy the trained network model on the cloud server.

[0054] Since the amplification method of the sample image is known, the amplified sample image does not need to be marked with the outer frame position corresponding to the word wheel, and only needs to be calculated according to the outer frame position and the amplification method in the sample image before amplification.

[0055] After obtaining the approximate position of the wheel area through the above steps, it is necessary to further obtain the inclination angle and position translation of the water meter (including the amplitude of the required translation in the horizontal and vertical directions). After analyzing the dial images of all water meters on the market, it is found that they can be divided into 5 categories. The water meters in each category can use the same idea to obtain the inclination angle and position translation. Through this method of classifying all water meters and applying targeted strategies to each, it is possible to achieve automatic positioning of all types of water meters.

[0056] ① Such as Figure 2 As shown, for a water meter whose background color of the character wheel area is obviously different from that of the dial, and whose character wheel area is connected as a whole, the following method is used to obtain the tilt angle and position translation of the water meter:

[0057] The foreground image containing the wheel area is extracted from the acquired image, and the connected domain with the largest area in the foreground image is taken as the wheel area. Through contour analysis, straight line segment fitting and extraction in the contour sequence, the horizontal angle and center point coordinates of the wheel area are obtained, and then the inclination angle and position translation of the water meter are obtained.

[0058] ② If Figure 3 As shown, for a water meter whose character wheel area is an independent rectangle and whose background color is obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter:

[0059] The foreground image including the character wheel area is extracted from the acquired image. By comparing the shape and size (the size of the small rectangle is known from the pre-stored information), the character area in the foreground image is filtered out to obtain an independent rectangle of the character wheel area (pre-stored information shows that it contains 4 small rectangles. Affected by the actual image effect, the rectangle extraction is incomplete, but it does not affect the rectangle analysis). Then, the four corners of the entire character wheel area are obtained to obtain the inclination angle and position translation of the water meter.

[0060] ③ Such as Figure 4 As shown, for a water meter with a rubber ring around the character wheel area and a color of the rubber ring that is significantly different from the dial background color, the following method is used to obtain the tilt angle and position translation of the water meter:

[0061] A foreground image including the character wheel area is extracted from the captured image (the dial color base value and the pixel threshold for extracting the rubber ring are recorded in the pre-stored information corresponding to this type of water meter). The shapes and areas of each connected domain (all recorded in the pre-stored information) are analyzed, and the connected domains of non-character wheel areas in the foreground image are filtered out. A straight line fitting is performed on the outer contour of the character wheel area to obtain the inclination angle and position translation of the water meter.

[0062] ④ Such as Figure 5As shown, for a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, and whose background color of the character wheel area is not obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter:

[0063] A foreground image including the character wheel area is extracted from the acquired image. According to the size of the water meter characters, the connected domains that do not meet the size requirements (such as the H character on the left, the m character on the right, and various connected domains above and below) are filtered out. The corresponding character wheel area is determined by utilizing the collinearity of the centers of the first three water meter characters. The angle of the line connecting the centers of the first three water meter characters is the inclination angle of the water meter. The center point of the second character is used as the calibration point to calculate the position translation of the water meter.

[0064] Since it is rare for two characters on a water meter to be half characters at the same time (even if this happens, it can be avoided through manual intervention), the first three characters are basically whole characters. Therefore, the collinearity of the centers of the first three water meter characters can be used to determine the character wheel area to which these three characters belong (the size difference of the three characters can also be used as judgment information).

[0065] ⑤ If Figure 6 As shown, for a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, has no obvious difference between the background color of the character wheel area and the background color of the dial, and has black areas on the sides of the character wheel area (these two black areas are caused by the fact that the width of the character wheel is not enough to fill the space), the following method is used to obtain the tilt angle and position translation of the water meter:

[0066] A foreground image including the character wheel area is extracted from the acquired image. The black area on the side of the character wheel area, the water meter characters adhered to the black area, and other connected areas that do not meet the size requirements (such as the spacing line between two characters) are filtered out based on the size information. The inclination angle and position translation of the water meter are obtained based on the position and colinear characteristics of the center points of the three middle water meter characters.

[0067] In the technical solution of the present application, in the process of obtaining the tilt angle and position translation of the above five types of water meters, a foreground image containing the character wheel area is extracted from the captured image, including:

[0068] S31, after detecting the water meter type in the collected image using the water meter type recognition model, retrieve pre-stored information to obtain the dial color base value of the water meter of this type;

[0069] S32, setting a pixel threshold, and comparing the RGB value of each pixel in the collected image with the dial color base value;

[0070] S33, extracting any pixel point in the collected image whose RGB value is greater than the pixel threshold as a foreground image.

[0071] Since the lighting conditions of the captured image are consistent with those of the template image, the dial color base value of the current captured image is consistent with that of the template. Figure 1 The dial color base value refers to the color value of the water meter dial area.

[0072] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fully automatic water meter positioning method, characterized in that: The water meter type recognition model is used to detect the water meter type in the collected image, and the corresponding character wheel position detection model is called based on the water meter type to detect the character wheel position in the collected image. The inclination angle and position translation of the water meter are obtained based on the character wheel position, and the collected image is corrected, and the pre-stored character position corresponding to the water meter type is positioned in the corrected image; The method of obtaining the tilt angle and position translation of the water meter based on the position of the character wheel includes: For water meters where the background color of the wheel area is obviously different from the background color of the dial and the wheel area is connected as a whole, the following method is used to obtain the tilt angle and position translation of the water meter: Extract the foreground image containing the wheel area from the collected image, take the connected domain with the largest area in the foreground image as the wheel area, and obtain the horizontal angle and center point coordinates of the wheel area through contour analysis, straight line segment fitting and extraction in the contour sequence, and then obtain the inclination angle and position translation of the water meter; The method of obtaining the tilt angle and position translation of the water meter based on the position of the character wheel includes: For water meters whose character wheel area is an independent rectangle and whose background color is obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter: Extract the foreground image containing the character wheel area from the collected image, filter out the character area in the foreground image by comparing the shape and size, obtain the independent rectangle of the character wheel area, and then obtain the four corners of the whole character wheel area, and obtain the inclination angle and position translation of the water meter; The method of obtaining the tilt angle and position translation of the water meter based on the position of the character wheel includes: For water meters with a rubber ring around the dial area and whose color is obviously different from the dial background color, the following method is used to obtain the tilt angle and position translation of the water meter: Extract the foreground image containing the wheel area from the collected image, filter out the connected domains of the non-wheel area in the foreground image by analyzing the shapes and areas of each connected domain, perform linear fitting on the outer contour of the wheel area, and then obtain the inclination angle and position translation of the water meter; The method of obtaining the tilt angle and position translation of the water meter based on the position of the character wheel includes: For a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, and whose background color of the character wheel area is not obviously different from that of the dial, the following method is used to obtain the tilt angle and position translation of the water meter: Extract the foreground image containing the character wheel area from the collected image, filter out the connected domain that does not meet the size requirements according to the water meter character size, and use the collinearity of the centers of the first three water meter characters to determine the corresponding character wheel area. The angle of the line connecting the centers of the first three water meter characters is the inclination angle of the water meter. Take the center point of the second character as the calibration point to calculate the position translation of the water meter. The method of obtaining the tilt angle and position translation of the water meter based on the position of the character wheel includes: For a water meter whose character wheel area is an independent rectangle, has no rubber ring around it, has no obvious difference between the background color of the character wheel area and the background color of the dial, and has a black area on the side of the character wheel area, the following method is used to obtain the tilt angle and position translation of the water meter: The foreground image including the character wheel area is extracted from the acquired image. The black area on the side of the character wheel area, the water meter characters adhered to the black area and other connected domains that do not meet the size requirements are filtered out based on the size information. The inclination angle and position translation of the water meter are obtained based on the position and colinear characteristics of the center points of the three middle water meter characters.

2. The fully automatic water meter positioning method according to claim 1, characterized in that: The training method of the water meter type recognition model comprises: S11. Collect a large number of sample images for each type of water meter, amplify the sample images, and mark the amplified sample images by category; S12. All sample images together with the corresponding category labels are input into the DenseNet neural network model for model training, and the trained model file is deployed on the cloud server.

3. The fully automatic water meter positioning method according to claim 1, characterized in that: The wheel position detection model is trained separately for each type of water meter, including: S21. For each type of water meter, sample images from various angles are collected, the outer frame positions corresponding to the word wheels are manually marked on the sample images, and the sample images are amplified; S22. Input the sample images and corresponding annotation information into the yolov5 deep network for model training, and deploy the trained network model on the cloud server.

4. The fully automatic water meter positioning method according to claim 1, characterized in that: The step of extracting a foreground image including a character wheel area from the acquired image comprises: S31, after detecting the water meter type in the collected image using the water meter type recognition model, retrieve pre-stored information to obtain the dial color base value of the water meter of this type; S32, setting a pixel threshold, and comparing the RGB value of each pixel in the collected image with the dial color base value; S33, extracting any pixel point in the collected image whose RGB value is greater than the pixel threshold as a foreground image.

Citation Information

Patent Citations

  • Camera shooting direct-reading NB-TOT remote water meter

    CN113390482A