Household gas meter counter indication recognition method based on machine vision
By training a gas meter counter dataset using the YOLO object detection framework, identifying the counter region, and performing mathematical operations based on the scale lines and pointer position, the problem of long invalid detection time and poor environmental adaptability in the identification of household gas meter counter values is solved, achieving fast and accurate counter value identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2022-08-25
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for identifying the counter readings of household gas meters suffer from problems such as long invalid detection times and high requirements for the imaging environment. Traditional methods are difficult to quickly and conveniently identify counter readings in automated and IoT environments.
The YOLO object detection framework is used to train the gas meter counter dataset, identify the counter area and magnify it, and perform mathematical operations based on the scale lines and pointer position to accurately identify the counter value and adapt to different data acquisition environments.
It achieves a high degree of automation, quickly identifies gas meter counter readings, reduces labor costs, and improves the accuracy and adaptability of identification.
Smart Images

Figure CN115331239B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of metering technology, and in particular to a method for recognizing the readings of a household gas meter counter based on machine vision. Background Technology
[0002] Traditionally, the identification of household gas meter counter readings relies on manual reading and recording. However, with the increasing automation of household gas meter production and testing, and the demand for rapid and convenient data collection via the Internet of Things (IoT), automatic identification methods for household gas meter counter readings are becoming widely used. Currently, commonly used automatic detection methods include photoelectric acquisition of the counter's last digit and counter image recognition. In the first method, a photoelectric sensor collects a signal for each rotation of the counter's last digit dial, and the counter reading is derived from the total number of rotations. However, counting based on the dial's rotations introduces invalid detection time. Therefore, optimizing the counter reading identification process using counter image recognition methods has become a pressing issue.
[0003] Methods for recognizing the readings of household gas meter counters primarily employ machine vision-based image recognition methods. Patents CN205861144U, CN111707322B, and CN112903053B, among others, use grayscale conversion and image binarization to extract digital features and perform image recognition based on template matching. Patent CN109360396A, for example, segments the character image of the counter's digit wheel region and uses a BP neural network-based digital recognition algorithm to identify the segmented characters in the digit wheel region.
[0004] The specific patent prior art documents mentioned above are as follows:
[0005] 1) "Direct Reading Device for Gas Meter Counter Using Digital Image Recognition Technology", Patent No. CN205861144U. This patent discloses a direct reading device for gas meter counter using digital image recognition technology, including a direct reading system for gas meter counter using digital image recognition technology, an automatic detection servo robotic arm, a gas meter detection platform, a local area network switch, and a data interface. The direct reading system is connected to the input end of the automatic detection servo robotic arm via a data cable, and the output end of the automatic detection servo robotic arm is connected to the input end of the gas meter detection platform via a data cable. The output end of the gas meter detection platform is connected to the input end of the local area network switch via a data cable. The output end of the local area network switch is connected to the input end of an image recognition computer and an image recognition processing center via a data cable. The output end of the image recognition computer and the image recognition processing center is connected to the data interface via a data cable. The automatic detection servo robotic arm is equipped with a CMOS camera and a supplementary lighting system. The character recognition method for the character wheel area in this invention differs from the above, employing the YOLO target detection framework to recognize the numbers in the character wheel area, while also recognizing the scale and pointer.
[0006] 2) "A Smart Gas Meter with Automatic Data Feedback Function", Patent No. CN111707322B. This patent discloses a smart gas meter with automatic data feedback function, specifically involving a base meter. The top of the base meter has an inlet pipe and an outlet pipe. The front of the base meter is integrally connected to a casing. The front of the casing has a camera dustproof groove, an observation window, and a battery protective cover. A rotating shaft is rotatably mounted inside the top of the casing via a bearing. Connecting pieces are fixed to the outer walls of the left and right ends of the rotating shaft. A dust cover is fixed between the two connecting pieces. The dust cover includes a protective cover and a transparent cover. A camera mounting bracket is fixed to the back of the protective cover, and a miniature camera is mounted on the camera mounting bracket. The base meter internally includes an image processing module, an image recognition module, a data judgment module, a data storage module, a data processing module, and a wireless radio frequency transmission module. The detection method of this invention differs from the above invention. Instead of recognizing characters based on image pixel matching, it recognizes characters based on a YOLO object detection framework trained on a counter value dataset.
[0007] 3) "Method and Device for Reading Diaphragm Gas Meters Based on Machine Vision and Laser Sensing", Patent No. CN112903053B. This patent discloses a method and device for reading diaphragm gas meters based on machine vision and laser sensing, relating to the field of metering technology. The method uses a laser sensor to identify the right-hand tooth of the last digit wheel of the gas meter counter and sends a pulse signal. Verification can begin at any time after the flow rate reaches the calibration flow rate, without being limited to a specific start or end position, which improves verification efficiency, saves verification time, and significantly enhances verification accuracy. This invention utilizes machine vision algorithms to detect and position the laser sensor beam and the right-hand tooth of the last digit wheel of the gas meter, ultimately achieving rapid and accurate illumination of the laser beam on the right-hand tooth of the last digit wheel, improving the efficiency, accuracy, and reliability of automatic gas meter reading. This invention differs from the above inventions, which only use a camera to acquire gas meter images; this invention uses the YOLO target detection framework to identify the digits in the digit wheel area, and can also identify the scale and pointer.
[0008] 4) "Remote Meter Reading Method and System Based on Image Recognition Technology and NB-IoT Technology", Patent No. CN109360396A. This invention proposes a remote meter reading method based on image recognition technology and NB-IoT technology. The method includes: a camera acquiring water meter dial image data at a preset cycle; storing the acquired dial image data in a data storage device; sequentially performing image preprocessing, tilt correction, precise positioning of the dial wheel area, and character segmentation of the dial wheel area on the dial image data; using a digital recognition algorithm based on a BP neural network to recognize the characters in the segmented dial wheel area to obtain the dial reading; and using NB-IoT technology to send the dial reading to a transparent cloud server. This invention also proposes a remote meter reading system based on image recognition technology and NB-IoT technology, including an image acquisition module, a data storage module, a data processing module, an image recognition module, and a wireless transmission module. This invention differs from the above inventions in that it can not only recognize the characters in the dial wheel area but also determine the location of the characters, and accurately derive the counter value through mathematical calculations based on the numbers, scale lines, and pointer positions in the dial wheel area. Summary of the Invention
[0009] To address the aforementioned technical problems, the purpose of this invention is to provide a machine vision-based method for recognizing the readings of a household gas meter counter.
[0010] The objective of this invention is achieved through the following technical solution:
[0011] A machine vision-based method for recognizing the readings of a household gas meter counter includes:
[0012] A dataset of gas meter counters was created, and a counter object detection framework based on YOLO was trained to predict the target box of the counter region in the input gas meter image and output the counter position. Based on the counter position, the image containing only the counter was cropped and enlarged.
[0013] B creates a counter value recognition dataset from the counter images and trains it to obtain a YOLO-based target detection framework for the counter value region.
[0014] The C-based YOLO-based counter target detection framework selects the counter region from the input gas meter image, crops the selected region, and enlarges the region image.
[0015] The YOLO-based counter display area target detection framework identifies the numbers in the magnified area image and selects the position of each number. Based on the position of the number, the value of the number area is calculated. It also identifies the scale lines and pointer position in the magnified area image and calculates the scale value based on the relative position of the scale lines and pointer, thus obtaining the gas meter counter display result.
[0016] Compared with the prior art, one or more embodiments of the present invention may have the following advantages:
[0017] The YOLO object detection framework can not only recognize complete digits but also digits that are incomplete due to carry transformations. Besides digits, it can also recognize scale lines and pointers, thus accurately identifying the readings of household gas meter counters through mathematical operations. Compared to traditional template-matching image recognition methods, it has lower requirements for the imaging environment and can adapt to different recognition scenarios by changing the training dataset according to the actual image acquisition environment. This method features high automation, high speed, low labor costs, and high alignment accuracy, making it practically significant and worthy of widespread application. Attached Figure Description
[0018] Figure 1 This is a flowchart of a machine vision-based method for recognizing the counter readings of household gas meters.
[0019] Figure 2 This is a schematic diagram of the digital data subset in a machine vision-based method for recognizing the counter readings of household gas meters.
[0020] Figure 3 This is a diagram illustrating the recognition effect of the counter area indication in a machine vision-based method for recognizing the indication of a household gas meter counter.
[0021] In the diagram, 31-counter detection box; 32-scale selection box; 33-centroid of scale line selection box; 34-centroid of pointer selection box; 35-zero scale line; 36-digit selection box. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the embodiments and accompanying drawings.
[0023] like Figure 1 The image shows a machine vision-based method for recognizing the readings of a household gas meter counter, which includes the following steps:
[0024] Step 10: Create a dataset I for household gas meter counters counter Training a YOLO-based counter-based object detection framework L counter ;Frame L counter Predict the target bounding box of the counter region from the input image of a household gas meter and output the counter position. Based on this position, crop the image P containing only the counter. counter And it is magnified to obtain P' counter ;
[0025] Step 20: Convert the counter image P' counter Create a dataset for recognizing counter readings I display I displayA subset of numbers containing the complete digits 0-9 and transposed digits, I display_num Magnified scale line subset I display_scale and pointer subset I display_pointer The YOLO indicator region object detection framework L, after training, is obtained. display ;
[0026] Step 30: YOLO object detection framework L counter In the image of the household gas meter, select the counter area and crop out the selected area P. crop And its image is magnified to obtain P' crop ;
[0027] Step 40: YOLO Indication Region Target Detection Framework L display Identify P' crop The numbers are selected and their positions are outlined in the boxes. The numerical value of the number area is calculated based on the position of the number. P' is identified. crop The scale lines and pointer position are used to calculate the scale reading based on their relative positions; finally, the readings of both are combined to obtain the reading of the household gas meter counter.
[0028] Step 10 above specifically includes: I counter The image dataset is {F counter,1 ,F counter,2 ,F counter,3 ,……,F counter,N}, where N is I counter Number of images in the image. Establish an image pixel coordinate system, with the origin O at the top left vertex of the image, the positive u-axis pointing horizontally to the right, and the positive v-axis pointing vertically downward; frame L counter Generate a prediction counter region bounding box on the input image, and set its detection box position. Based on this location, the counter region P is cropped from the input image. counter And it is magnified to obtain P' counter ;
[0029] Step 20 above specifically includes: I display The image dataset is {F display,1 ,F display,2 ,F display,3 ,……,F display,n}, where n is I counter Number of images in the middle; each F display,i (i∈N) contains numbers, tick marks, and pointers, where:
[0030] {F display_num,1 ,F display_num,2 ,F display_num,3 ,……,F display_num,n} constitutes a subset of numbers Idisplay_num The complete digits 0-9 constitute 10 categories (such as...) Figure 2 As shown), let it be {O0, O1, ..., O9}, and the relationship between categories and numbers is as follows:
[0031] O i =i (i∈[0,9]) (1)
[0032] When adjacent numbers are carried over, only the lower half of the previous digit and the upper half of the next digit are clearly displayed. This type is called a transposed number, and there are 10 categories, denoted as {Q0, Q1, ..., Q9}. The relationship between the categories and the numbers is as follows:
[0033] Q j =j(j∈[0,9]) (2)
[0034] {F display_scale,1 ,F display_scale,2 ,F display_scale,3 ,……,F display_scale,n} constitutes a subset I of scale lines display_scale ;
[0035] {F display_pointer,1 ,F display_pointer,2 ,F display_pointer,3 ,……,F display_pointer,n} constitutes a subset of pointers I display_pointer ;
[0036] Step 30 above specifically includes: using the framework L counter Select the counter area within the input image frame of the household gas meter and set its detection frame position. Crop the selected area P crop And its image is magnified to obtain P' crop ;
[0037] Step 40 above specifically includes: the YOLO indicator region target detection framework L display Identify P' crop The numbers are selected by drawing a box around them, and let's say K numbers are selected. The K numbers are then arranged in ascending order based on the positive u-axis coordinate of the top left corner of the selection box. The sequential set, obtained from step 20, corresponds to the classification set {N'1, N'2, ..., N'...}. K}, corresponding to the recognition digit set {m1,m2,…,m K}, thus obtaining the numerical value M of the digital region;
[0038]
[0039] YOLO Indication Region Target Detection Framework Framework L display Identify P' cropThe tick marks are defined by selecting H tick marks, and the coordinate information of each selection box is as follows: This determines the position of the selection box's centroid. Selection box length C p ;
[0040]
[0041]
[0042] Based on the positive v-axis coordinates of the selection box centroid, a sequence set Φ is constructed from smallest to largest:
[0043]
[0044] Suppose a selection box has a maximum length C. max If the zero-scale selection box is located at the leftmost point of the zero-scale and is marked as 0, then according to the sequence set Φ, if selection box p is located at the leftmost point of the zero-scale and is separated by s selection boxes (including itself), it is marked as -s; if selection box p is located at the rightmost point of the zero-scale and is separated by t selection boxes, it is marked as +t; other selection boxes are marked according to their position on the zero-scale and the interval between them, and the sequence set Φ is rewritten as follows.
[0045] Frame L display Identify P c ' rop pointer, The coordinate information of the pointer selection box is used to determine the centroid position of the pointer selection box.
[0046]
[0047] In the set Insert R based on the magnitude of the positive v-axis coordinate. center , by R center The scale value U can be obtained by selecting the previous scale tick mark 'a'.
[0048]
[0049] The final reading of a household gas meter is obtained by adding the numerical value M in the digital area and the scale reading U (e.g., ...). Figure 3 (As shown).
[0050] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and variations in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of patent protection for this invention shall still be determined by the scope defined in the appended claims.
Claims
1. A machine vision-based method for identifying the indication of a domestic gas meter counter, characterized in that, include: A dataset of gas meter counters is created. A YOLO counter object detection framework is trained to predict the target box of the counter region in the input gas meter image and output the counter position. Based on the counter position, the image containing only the counter is cropped and enlarged. B creates a counter value recognition dataset from the counter images and trains it to obtain a YOLO-based target detection framework for the counter value region. The C YOLO counter target detection framework selects the counter area in the input gas meter image, crops the selected area, and enlarges the image of the area. D uses a YOLO-based counter display area target detection framework to identify the numbers in the magnified area image, select the position of each number, and calculate the value of the number area based on the position of the number; it also identifies the scale lines and pointer positions in the magnified area image, calculates the scale value based on the relative position of the scale lines and pointer, and obtains the gas meter counter display result. The D, based on the YOLO counter shows value area target detection framework is L display , L display Identification The number and frame all numbers, set the frame out of K numbers, according to the left upper corner u The axis positive direction coordinate from small to large constitutes The order set, corresponding to the classification set , corresponding to the identified number set {m1, m2, …, m K}, thus the number area value M; (3); Frame L display Identify The scale lines are framed, H scale lines are selected, and the coordinate information of each selected frame is The centroid position of the selected frame is obtained The length of the selected frame ; (4); (5) ; According to the selected block barycenter v-axis positive direction coordinate from small to large constitutes the order set : ; Let a box have a maximum length Then this is the zero box and is marked 0. With the zero box as a reference, the set of If box p is the leftmost box and is separated by s boxes, then it is marked -s. If checkbox p is located at the far right of the zero mark and is t checkboxes away, then it is marked as +t; Other boxes are based on the zero mark position and interval markings, and rewritten in the order set To : ; frame L display identify pointer, selecting the coordinates of the pointer frame, thereby obtaining the centroid position of the pointer frame ; (6) ; In the set According to v Axis positive direction coordinate size insertion By The previous scale frame mark a The available scale indication U; (7) ; The final reading of the household gas meter is obtained by adding the numerical value M in the digital area and the scale reading U.
2. The machine vision-based domestic gas meter counter indication recognition method according to claim 1, characterized in that, The data set of gas meter counters in A is as follows: , Image dataset is ,in N for Number of images; establish an image pixel coordinate system, with the origin O at the top left vertex of the image, the positive u-axis pointing horizontally to the right, and the positive v-axis pointing vertically downward; dataset. Generate a prediction counter region bounding box on the input image, and set its detection box position. The counter region is cropped from the input image based on the position of the detection box. P counter And on P counter Magnification .
3. The machine vision-based domestic gas meter counter indication recognition method according to claim 1, characterized in that, The counter value in B identifies the data set as I display , I display The subset of numbers contains the complete numbers 0-9 and the transposition numbers I display_num , the subset of scale lines processed by amplification I display_scale and the subset of pointers I display_pointer ; I display The image data set is , wherein n is the number of images in I counter , each F display,i , contains numbers, scale lines, pointers, wherein: constitute a digital subset Idisplay_ num The complete 0-9 digits constitute 10 categories, set as The category and digit relationship is as follows: (1); The upper and lower adjacent digits only clearly show the lower half of the previous digit and the upper half of the next digit due to the carry, which is called a transposed digit, and there are 10 categories, which are set as ; the category and digit relationship is as follows: (2); constituting a subset of scale lines ; constituting a subset of pointers .
4. The machine vision-based domestic gas meter counter indication recognition method according to claim 1, characterized in that, In the C, using YOLO-based counter target detection framework L counter In the input gas meter image frame selection counter area, set the detection frame position , and crop the frame selection area P crop And the frame selection area image magnification processing .
Citation Information
Patent Citations
Remote meter reading method and system based on image recognition technology and NB-IoT technology
CN109360396A
A smart gas meter with automatic data feedback function
CN111707322B
Method and Device for Reading Diaphragm Gas Meters Based on Machine Vision and Laser Sensing
CN112903053B
Digital image recognition technology's gas meter counter direct -reading device
CN205861144U
Electric meter reading identification method based on YOLOV3 network
CN111461121A