CN-115331239-B - Household gas meter counter indication recognition method based on machine vision
Abstract
The invention discloses a household gas meter counter indication value recognition method based on machine vision, which comprises the steps of manufacturing a gas meter counter data set, training a YOLO counter target detection frame to predict a counter area target frame of an input gas meter image, outputting a counter position, cutting only a counter image according to the counter position, amplifying the image, manufacturing the counter image into a counter indication value recognition data set, training to obtain a counter indication value area target detection frame based on YOLO, selecting a counter area in the input gas meter image frame, cutting out a frame selection area, amplifying the area image, identifying the number of the amplified area image by the counter indication value area target detection frame, respectively selecting the position of each number in a frame mode, calculating the number area value according to the number position, recognizing the scale line and pointer position of the amplified area image, and calculating the scale indication value according to the relative position of the scale line and the pointer to obtain a gas meter counter indication value result.
Inventors
- LIU GUIXIONG
- GAO ZEMING
Assignees
- 华南理工大学
- 华南理工大学
Dates
- Publication Date
- 20260421
- Application Date
- 20220825
- Priority Date
- 20220825
Claims (4)
- 1. The utility model provides a home gas meter counter indication recognition method based on machine vision which is characterized in that the method comprises the following steps: A, manufacturing a gas meter counter data set, training a YOLO counter target detection frame to predict a counter area target frame for an input gas meter image, outputting a counter position, cutting a counter image according to the counter position, and amplifying the image; B, manufacturing a counter image into a counter indication recognition data set, and training to obtain a counter indication area target detection frame based on YOLO; c YOLO counter target detection frame selects counter area in input gas meter image frame, cuts out frame selected area and amplifies area image; D, recognizing the digits of the amplified region image based on the counter indication value region target detection frame of the YOLO, respectively selecting the position of each digit in a frame mode, and calculating the numerical value of the digital region according to the digit position; in the D, a counter indication area target detection frame based on YOLO is identified for L display ,L display All numbers are selected by combining the numbers of the frame, K numbers are selected by setting the frame, and the frame is formed from small to large according to the positive direction coordinate of the u-axis at the upper left corner of the frame Sequential set, consisting of corresponding classified set Correspondingly identifying the number set { M 1 ,m 2 ,…,m K }, thereby a number region value M; (3); frame L display identification Setting up frames to select H scale marks, wherein the coordinate information of each frame is that Thereby obtaining the position of the centroid of the selection frame Frame length ; (4); (5) ; According to the positive direction coordinates of the v axis of the selection frame shape, a sequence set is formed from small to large : ; Setting a certain selection frame with the maximum length Then the frame is selected with zero scale and marked as 0, the zero scale is used as a reference, and the sequence is collected If the frame p is positioned at the leftmost position of zero scale and is separated by s frames, the frame p is marked as-s, if the frame p is positioned at the rightmost position of zero scale line and is separated by t frames, the frame p is marked as +t, other frames are marked according to the positions and intervals of the zero scale, and the sequence set is rewritten Is that : ; Frame L display identification The pointer is used to indicate the position of the pointer, Coordinate information of the pointer selection frame is obtained, and the centroid position of the pointer selection frame is obtained ; (6) ; At the collection Inserted according to the size of the positive direction coordinate of the v axis By the following constitution The previous scale frame selecting mark a can obtain a scale indication value U; (7) ; and adding the numerical area value M and the scale indication value U to obtain a final indication result of the household gas meter.
- 2. The machine vision-based home gas meter counter indication recognition method as set forth in claim 1, wherein the gas meter counter dataset in a is , The image dataset is Wherein N is Establishing image pixel coordinate system, with coordinate origin point O as the upper left vertex, u-axis positive direction as horizontal right and v-axis positive direction as vertical downward, and data set Generating a predictive counter area target frame on an input image, setting the position of the detection frame The counter region P counter is cut out from the input image according to the position of the detection frame and the P counter is amplified 。
- 3. The method for recognizing counter indication value of household gas meter based on machine vision as set forth in claim 1, wherein the counter indication value recognition dataset in B is a digital subset I display_num including complete digits 0-9 and transposed digits, and the amplified scale line subset I display_scale and pointer subset I display_pointer ;I display image dataset is Where n is the number of images in I counter , each F display,i , Comprises a number, a scale mark and a pointer, wherein: form a subset of numbers Idisplay _num, and the complete 0-9 numbers form 10 categories, set as The classification and numerical relationship is as follows: (1); The upper and lower adjacent digits only clearly show the lower half part of the upper digit and the upper half part of the lower digit due to carry, the type is called transposition digits, and 10 classifications are arranged The classification and numerical relationship is as follows: (2); Forming a subset of graduation marks ; Constructing a subset of pointers 。
- 4. The machine vision-based home gas meter counter indication recognition method as set forth in claim 1, wherein in said C, a counter target detection frame L counter based on YOLO is used to set a detection frame position in an input gas meter image frame selection counter area Clipping out the frame selection region P crop and amplifying the image of the frame selection region 。
Description
Household gas meter counter indication recognition method based on machine vision Technical Field The invention relates to the technical field of metering, in particular to a household gas meter counter indication value identification method based on machine vision. Background The traditional method for identifying the indication value of the counter of the household gas meter relies on manual reading and recording, but the household gas meter gradually goes to automatic production and detection, and the method for automatically identifying the indication value of the counter of the household gas meter is widely applied in application scenes such as quick and convenient requirements for acquiring data of the gas meter by the Internet of things. The automatic detection method commonly used at present is digital photoelectric acquisition at the end of a counter and image recognition of the counter. The counter indication value is obtained by the total rotation times after the digital rotary table at the end of the counter rotates once and is collected by the photoelectric sensing device, but invalid detection time is generated according to the rotary counting of the rotary table, so that how to optimize the counter indication value identification process by using the counter image identification method becomes a problem to be solved urgently. The method for identifying the indication value of the counter of the household gas meter is mainly an image identification method based on machine vision. Patent CN205861144U, CN111707322B, CN112903053B, etc., adopts a processing method such as gray-scale image conversion, image binarization, etc. to extract digital characteristics, and performs image recognition based on template matching. Patent CN109360396a, etc., uses a digital recognition algorithm based on BP neural network to recognize the character of the character wheel region after segmentation for the character image segmentation of the character wheel region of the counter. The specific patent reference documents are as follows: 1) "gas meter counter direct-reading device of digital image recognition technology", patent number CN205861144U. The patent discloses a direct reading device of a gas meter counter of a digital image recognition technology, which comprises a direct reading system of the gas meter counter of the digital image recognition technology, an automatic detection servo mechanical arm, a gas meter detection platform, a local area network switch and a data interface, wherein the direct reading system is connected with the input end of the automatic detection servo mechanical arm through a data line, the output end of the automatic detection servo mechanical arm is connected with the input end of the gas meter detection platform through a data line, the output end of the gas meter detection platform is connected with the input end of the local area network switch through a data line, the output end of the local area network switch is connected with the input ends of an image recognition computer and an image recognition processing center through the data line, the output ends of the image recognition computer and the image recognition processing center are connected with the data interface, and a CMOS camera and a light supplementing system are arranged on the automatic detection servo mechanical arm. The character wheel region character method of the invention is different from the above, and the character wheel region numbers can be identified by using the YOLO target detection frame, and meanwhile, scales and pointers can be identified. 2) "An intelligent gas meter with data automatic return function", patent number CN111707322B. The patent discloses an intelligent gas meter with an automatic data returning function, and particularly relates to an intelligent gas meter which comprises a base meter, wherein an air inlet pipe and an air outlet pipe are arranged at the top end of the base meter, a meter shell is integrally connected to the front face of the base meter, a camera dust-proof groove, an observation window and a battery outer protection cover are arranged on the front face of the meter shell, a rotating shaft is rotatably arranged in the top end of the meter shell through a bearing, connecting pieces are fixed on the outer walls of the left end and the right end of the rotating shaft, a dust blocking cover is fixed between the two connecting pieces and comprises a protection cover and a transparent cover, a camera mounting frame is fixed on the back face of the protection cover, a miniature camera is mounted on the camera mounting frame, and an image processing module, an image recognition module, a data judging module, a data storage module, a data processing module and a wireless radio frequency transmission module are arranged in the base meter. Unlike the above-described invention, the detection method of the present invention does not recognize characters based on image pixel m