Method and system for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration

Through the flow-based counting method and peak detection algorithm, the number of rotating teeth of the plum blossom wheel of the water meter is calculated in real time, which solves the problem of low detection efficiency in the existing technology and realizes efficient detection of water meter calibration.

CN115371778BActive Publication Date: 2024-09-06SHANDONG HOUDE MEASUREMENT & CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211128403.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2024-09-06
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing water meter detection methods use image processing, especially deep learning algorithms, to achieve real-time detection of the number of rotating teeth of the plum blossom wheel, resulting in low detection efficiency.

Method used

A flow-based counting method is used to obtain continuous water meter dial images, use a preset positioning model to perform plum blossom wheel positioning and image processing, and combine the peak detection algorithm and compensation algorithm to calculate the number of rotating teeth of the plum blossom wheel in real time.

Benefits of technology

Real-time detection of the number of rotating teeth of the plum blossom wheel on the water meter is realized, which greatly improves the detection efficiency without waiting for the entire water meter calibration process to be completed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115371778B
    Figure CN115371778B
Patent Text Reader

Abstract

The invention provides a method for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration, and obtains a continuous multi-frame water meter dial image; for each frame of the image, a preset positioning model is used to obtain a positioning result of the plum blossom wheel, the image of the plum blossom wheel is intercepted according to the positioning result, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, a closing operation and a median filter are sequentially performed on the binary image, an AND operation is performed on the image after the median filter and a mask, a pixel summation operation is performed on the result image, and a point count of the current frame is obtained; according to the point count of each frame of the image, a peak detection algorithm and a compensation algorithm based on a flow are used to obtain the number of rotating teeth of the plum blossom wheel; the invention can obtain the counting result in real time without waiting for the entire water meter calibration process to be completed, thereby greatly improving the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of water meter calibration, and in particular to a method and system for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration. Background Art

[0002] The statements in this section merely provide background art related to the present invention and do not necessarily constitute prior art.

[0003] Water meters are widely used in tap water, heat, chemical and other industries. Enterprises or measurement departments that produce water meters need to perform performance verification on the indication errors of these water meters in accordance with the regulations formulated by relevant departments.

[0004] The inventors have found that in existing water meter inspections, the plum blossom wheel counting of the water meter is usually performed through image processing methods, and generally adopts an image recognition algorithm based on deep learning. Generally, it requires the training of a more complex deep learning algorithm to realize the recognition of water meter images. It is often necessary to wait for the entire water meter calibration process to be completed before obtaining the final plum blossom wheel counting result, and real-time detection of the plum blossom wheel counting cannot be achieved. Summary of the invention

[0005] In order to address the deficiencies in the prior art, the present invention provides a method and system for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration. The method is based on a flow counting method and calculates once for each picture input. Compared with general methods, the counting results can be obtained in real time without waiting for the entire water meter calibration process to be completed, thereby greatly improving the detection efficiency.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for use in water meter calibration.

[0008] A method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration comprises the following steps:

[0009] Acquire continuous multi-frame water meter dial images;

[0010] For each frame of image, a preset positioning model is used to obtain the positioning result of the plum blossom wheel. According to the positioning result, the image of the plum blossom wheel is intercepted, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, the binary image is sequentially closed and median filtered, the image after median filtering is ANDed with the mask, the resulting image is pixel summed to obtain the point count of the current frame;

[0011] According to the point count of each frame image, the number of rotating teeth of the plum blossom wheel is obtained based on the peak detection algorithm and compensation algorithm of the flow.

[0012] As an optional implementation, converting the scaled image into a binary image includes:

[0013] Calculate the mean grayscale value of all pixels in the scaled image, and use the mean as the threshold to convert the grayscale image into a binary image.

[0014] As an optional implementation method, obtaining the mask includes:

[0015] Set a binary image of preset pixels, take the center point of the binary image as the coordinate origin, the positive direction of the x-axis as 0 degrees, and the counterclockwise direction as the positive direction. Draw an arc with an angle of θ as the mask, where: θ = π / n.

[0016] As an optional implementation, a flow-based peak detection algorithm is executed on each frame image in the order of the frames, including:

[0017] Calculate the point count of the current frame image and assign the point count to the first variable;

[0018] According to the value of the first variable and the flow-based mean algorithm, the obtained mean is reassigned to the first variable;

[0019] assigning the obtained standard deviation to the second variable based on the current value of the first variable and the stream-based standard deviation algorithm;

[0020] Add the current value of the first variable to the global array. When the length of the global array is greater than 3, the last data in the global array is less than the second last data, the second last data is greater than the third last data, and the value of the second variable is greater than the standard deviation threshold, the peak count is increased by one and the peak time is recorded.

[0021] Execute the item number process for the next frame image until the peak value detection of all frame images is completed;

[0022] The counts were compensated based on the peak time of each frame.

[0023] As a further qualification, the counts are compensated based on the peak time of each frame, including:

[0024] Initialization, including: setting the start time variable to zero, setting the first peak time variable to zero, setting the last peak time variable to zero, setting the difference variable from the start to the first peak to zero, and setting the time variable from the peak to the last to zero;

[0025] The input is the plum blossom wheel count and the current time;

[0026] If the value of the start time variable is zero, assign the current time to the first peak time variable;

[0027] If the value of the first peak time variable is zero, when the value of the plum blossom wheel count is zero, return zero; when the value of the plum blossom wheel count is not zero, find the first peak, the value of the first peak time variable is the current time, the value of the last peak time variable is the current time, the value of the difference variable from the start to the first peak is the value of the first peak time variable and the value of the start time variable, and return the value of the plum blossom wheel count;

[0028] If the value of the first peak time variable is zero, when the plum blossom wheel count is equal to the previous plum blossom wheel count, the value of the peak to the last time variable is the value of the current time and the last peak time variable; when the plum blossom wheel count is not equal to the previous plum blossom wheel count, a new peak is found, zero is assigned to the peak to the last time variable, the current time is assigned to the last peak time variable, the current plum blossom wheel count is assigned to the previous plum blossom wheel count, the average period is obtained, and the compensated plum blossom wheel count is obtained according to the average period.

[0029] As a further limitation, the average period u = (Te-Tf) / (C-1), the compensated plum blossom wheel count is: C-1+(T1+T2) / u, where Te is the last peak time, Tf is the first peak time, C is the plum blossom wheel count, T1 is the difference from the beginning to the first peak, and T2 is the time from the peak to the end.

[0030] A second aspect of the present invention provides a system for detecting the number of rotating teeth of a plum blossom wheel of a water meter for use in calibrating a water meter.

[0031] A water meter plum blossom wheel rotation tooth number detection system for water meter calibration, comprising:

[0032] The data acquisition module is configured to: acquire a continuous plurality of frames of water meter dial images;

[0033] The single-needle image point count acquisition module is configured as follows: for each frame of image, a preset positioning model is used to obtain the positioning result of the plum blossom wheel, the image of the plum blossom wheel is intercepted according to the positioning result, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, a closing operation and a median filter are sequentially performed on the binary image, the image after the median filter is ANDed with the mask, and a pixel sum operation is performed on the result image to obtain the point count of the current frame;

[0034] The rotation teeth number acquisition module is configured to obtain the rotation teeth number of the plum blossom wheel according to the point count of each frame image and the peak detection algorithm and compensation algorithm based on the flow.

[0035] As an optional implementation, a flow-based peak detection algorithm is executed on each frame image in the order of the frames, including:

[0036] Calculate the point count of the current frame image and assign the point count to the first variable;

[0037] According to the value of the first variable and the flow-based mean algorithm, the obtained mean is reassigned to the first variable;

[0038] assigning the obtained standard deviation to the second variable based on the current value of the first variable and the stream-based standard deviation algorithm;

[0039] Add the current value of the first variable to the global array. When the length of the global array is greater than 3, the last data in the global array is less than the second last data, the second last data is greater than the third last data, and the value of the second variable is greater than the standard deviation threshold, the peak count is increased by one and the peak time is recorded.

[0040] Execute the item number process for the next frame image until the peak value detection of all frame images is completed;

[0041] The counts were compensated based on the peak time of each frame.

[0042] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as described in the first aspect of the present invention.

[0043] The fourth aspect of the present invention provides an electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration as described in the first aspect of the present invention are implemented.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1. The method and system for detecting the number of rotating teeth of the plum blossom wheel of a water meter used for water meter calibration described in the present invention is based on a flow counting method. Each time a picture is input, the counting result will be calculated once. Compared with the general method, the counting result can be obtained in real time without waiting for the entire water meter calibration process to be completed, which greatly improves the detection efficiency.

[0046] 2. The method and system for detecting the number of rotating teeth of the plum blossom wheel of a water meter used for water meter calibration described in the present invention adopt a preset positioning model to obtain the positioning result of the plum blossom wheel for each frame of image, intercept the image of the plum blossom wheel according to the positioning result, convert the intercepted image into a grayscale image, scale the grayscale image to a set size, convert the scaled image into a binary image, perform closing operation and median filtering on the binary image in sequence, perform AND operation on the image after median filtering and mask, perform pixel sum operation on the result image, obtain the point count of the current frame, and realize more efficient frame image processing.

[0047] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0049] Figure 1 A schematic diagram of the process of the single-frame image processing method provided in Embodiment 1 or Embodiment 2 of the present invention.

[0050] Figure 2 A schematic diagram of the process of single-frame image processing provided in Embodiment 1 or Embodiment 2 of the present invention.

[0051] Figure 3 A schematic diagram of a flow-based peak detection algorithm provided in Embodiment 1 or Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0053] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0054] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0055] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0056] Embodiment 1:

[0057] Embodiment 1 of the present invention provides a method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration, comprising the following process:

[0058] S1: plum blossom wheel positioning

[0059] When using a water meter to detect water leakage from a platform, record a video of the water meter dial, deframe the video, and manually annotate the plum blossom wheel in the video;

[0060] Use this manually annotated data to generate the data set used for yolov5 training, use the data set to train the deep learning model, and then convert the model into a model supported by the NCNN forward neural network. Then put the model into the Android App to automatically locate the plum blossom wheel in the image.

[0061] It is understandable that in some other implementations, other neural network algorithms, such as convolutional neural network algorithms, etc., may also be used to automatically position the plum blossom wheel.

[0062] S2: Plum Blossom Wheel Single Frame Image Point Counting Algorithm

[0063] The plum blossom wheel is the fastest rotating part in the water meter. The plum blossom wheel generally has 6 teeth, 10 teeth, etc. The amount of water flowing through the water meter after each tooth is called the pulse equivalent. By identifying the number of teeth of the plum blossom wheel, multiplying the identified number of teeth by the pulse equivalent, the amount of water flowing through the water meter can be obtained.

[0064] Prepare a mask image according to the number of teeth n of the plum blossom gear. The template is a 100*100 pixel binary image. The center point of the image is used as the coordinate origin, the positive direction of the x-axis is 0 degrees, and the counterclockwise direction is the positive direction. Draw an arc with an angle of θ as the mask, where:

[0065]

[0066] Taking the six-tooth plum blossom wheel as an example, θ is π / 6, that is, 30°. Figure 1 As shown in (1) in .

[0067] The processing of a single frame image follows the following process: Figure 2 As shown:

[0068] First, the image of the plum blossom wheel is intercepted according to the positioning result (see Figure 1 (2) in ), and then convert the image into a grayscale image (see Figure 1 (3) in ), scale the grayscale image to a fixed size of 100*100 (see Figure 1 (4) in the figure), calculate the mean grayscale value of all pixels in the image, and use the mean as the threshold to convert the grayscale image into a binary image (see Figure 1 (5) in ), perform a 5*5 closing operation on the binary image (see Figure 1 (6) in ), followed by median filtering (see Figure 1 (7) in ), the median filtered image is ANDed with the mask (see Figure 1 (8) in ), the result image is summed and recorded as the point count of the current frame.

[0069] S3: Plum blossom wheel point counting synthesis

[0070] The point count of each frame can be obtained by performing the above processing on each frame image in the whole detection process. The number of rotating teeth of the plum blossom wheel can be obtained by using the following flow-based peak detection algorithm and compensation algorithm.

[0071] The flow-based counting algorithm can obtain the counting results in real time. Each input image will drive the algorithm to run once. Compared with general algorithms, this algorithm can obtain the counting results in real time without waiting for the entire water meter verification process to be completed.

[0072] First, we need a flow-based mean algorithm and standard deviation algorithm. Algorithm 1 inputs a number x each time and returns the mean of the first size points. Algorithm 2 inputs a number x each time and gets the standard deviation of the first size numbers.

[0073] In this embodiment, “<=” means assignment.

[0074] Algorithm 1: Flow-based mean algorithm

[0075]

[0076]

[0077] Algorithm 2: Flow-based standard deviation algorithm

[0078]

[0079] Algorithm 3: Flow-based peak detection algorithm

[0080]

[0081] The above algorithm first uses a single-frame image point counting algorithm to process the image to obtain the count, and then uses a flow-based mean algorithm to remove the interference of the data center. When the standard deviation is greater than a specific threshold and the peak point is found, the peak position is recorded. The algorithm compensates for the count based on the assumption that the water flow velocity is uniform, which can obtain a more accurate count. Figure 3 The X-axis is the time axis, the Y-axis is the smoothed value of a single image count, and the yellow dot is the peak point marked by the algorithm.

[0082] The plum blossom wheel counting compensation algorithm used in the above algorithm is a compensation algorithm that obtains the number of cycles based on the peak value, such as Figure 3 There are 71 peaks shown, but the actual number of cycles is about 70.25.

[0083] Algorithm 4: Plum blossom wheel counting compensation algorithm

[0084]

[0085]

[0086] Embodiment 2:

[0087] Embodiment 2 of the present invention provides a water meter plum blossom wheel rotation tooth number detection system for water meter calibration, comprising:

[0088] The data acquisition module is configured to: acquire a continuous plurality of frames of water meter dial images;

[0089] The single-needle image point count acquisition module is configured as follows: for each frame of image, a preset positioning model is used to obtain the positioning result of the plum blossom wheel, the image of the plum blossom wheel is intercepted according to the positioning result, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, a closing operation and a median filter are sequentially performed on the binary image, the image after the median filter is ANDed with the mask, and a pixel sum operation is performed on the result image to obtain the point count of the current frame;

[0090] The rotation teeth number acquisition module is configured to obtain the rotation teeth number of the plum blossom wheel according to the point count of each frame image and the peak detection algorithm and compensation algorithm based on the flow.

[0091] The single needle image point counting acquisition module includes:

[0092] (1) Plum blossom wheel positioning

[0093] When using a water meter to detect water leakage, record a video of the water meter dial, decode the video, and manually mark each component in the video, including the code disk, plum blossom wheel, and pointer;

[0094] Use this manually annotated data to generate the data set used for yolov5 training, use the data set to train the deep learning model, and then convert the model into a model supported by the NCNN forward neural network. Then put the model into the Android App for automatic positioning of image components.

[0095] (2) Plum Blossom Wheel Single Frame Image Point Counting Algorithm

[0096] The plum blossom wheel is the fastest rotating component in the water meter. The plum blossom wheel generally has 6 teeth, 10 teeth and other types. The amount of water flowing through the water meter after each tooth is called the pulse equivalent. By identifying the number of teeth of the rotating plum blossom wheel and multiplying the identified number of teeth with the pulse equivalent, the amount of water flowing through the water meter can be obtained.

[0097] Prepare a mask image according to the number of teeth n of the plum blossom gear. The template is a 100*100 pixel binary image. The center point of the image is used as the coordinate origin, the positive direction of the x-axis is 0 degrees, and the counterclockwise direction is the positive direction. Draw an arc with an angle of θ as the mask, where:

[0098]

[0099] Taking the six-tooth plum blossom wheel as an example, θ is π / 6, that is, 30°. Figure 1 As shown in (1) in .

[0100] The processing of a single frame image follows the following process: Figure 2 As shown:

[0101] First, the image of the plum blossom wheel is intercepted according to the positioning result (see Figure 1 (2) in ), and then convert the image into a grayscale image (see Figure 1 (3) in ), scale the grayscale image to a fixed size of 100*100 (see Figure 1 (4) in the figure), calculate the mean grayscale value of all pixels in the image, and use the mean as the threshold to convert the grayscale image into a binary image (see Figure 1 (5) in ), perform a 5*5 closing operation on the binary image (see Figure 1 (6) in ), followed by median filtering (see Figure 1 (7) in ), the median filtered image is ANDed with the mask (see Figure 1 (8) in ), the result image is summed and recorded as the point count of the current frame.

[0102] The rotating tooth number acquisition module includes:

[0103] The point count of each frame can be obtained by performing the above processing on each frame image in the whole detection process. The number of rotating teeth of the plum blossom wheel can be obtained by using the following flow-based peak detection algorithm and compensation algorithm.

[0104] The flow-based counting algorithm can obtain the counting results in real time. Each input image will drive the algorithm to run once. Compared with general algorithms, this algorithm can obtain the counting results in real time without waiting for the entire water meter verification process to be completed.

[0105] First, we need a flow-based mean algorithm and standard deviation algorithm. Algorithm 1 inputs a number x each time and returns the mean of the first size points. Algorithm 2 inputs a number x each time and gets the standard deviation of the first size numbers.

[0106] Algorithm 1: Flow-based mean algorithm

[0107]

[0108]

[0109] Algorithm 2: Flow-based standard deviation algorithm

[0110]

[0111] Algorithm 3: Flow-based peak detection algorithm

[0112]

[0113] The above algorithm first uses a single-frame image point counting algorithm to process the image to obtain the count, and then uses a flow-based mean algorithm to remove the interference of the data center. When the standard deviation is greater than a specific threshold and the peak point is found, the peak position is recorded. The algorithm compensates for the count based on the assumption that the water flow velocity is uniform, which can obtain a more accurate count. Figure 3 The X-axis is the time axis, the Y-axis is the smoothed value of a single image count, and the yellow dot is the peak point marked by the algorithm.

[0114] The plum blossom wheel counting compensation algorithm used in the above algorithm is a compensation algorithm that obtains the number of cycles based on the peak value, such as Figure 3 There are 71 peaks shown, but the actual number of cycles is about 70.25.

[0115] Algorithm 4: Plum blossom wheel counting compensation algorithm

[0116]

[0117]

[0118] Embodiment 3:

[0119] Embodiment 3 of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as described in Embodiment 1 of the present invention.

[0120] Embodiment 4:

[0121] Embodiment 4 of the present invention provides an electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration as described in Embodiment 1 of the present invention are implemented.

[0122] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0123] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0124] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0126] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration, characterized in that: The process includes: Acquire continuous multi-frame water meter dial images; For each frame of image, a preset positioning model is used to obtain the positioning result of the plum blossom wheel. According to the positioning result, the image of the plum blossom wheel is intercepted, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, the binary image is sequentially closed and median filtered, the image after median filtering is ANDed with the mask, the resulting image is pixel summed to obtain the point count of the current frame; According to the point count of each frame image, the number of rotating teeth of the plum blossom wheel is obtained based on the peak detection algorithm and compensation algorithm of the flow; Execute the flow-based peak detection algorithm for each frame in the order of the frames, including: Calculate the point count of the current frame image and assign the point count to the first variable; According to the value of the first variable and the flow-based mean algorithm, the obtained mean is reassigned to the first variable; assigning the obtained standard deviation to the second variable based on the current value of the first variable and the stream-based standard deviation algorithm; Add the current value of the first variable to the global array. When the length of the global array is greater than 3, the last data in the global array is less than the second last data, the second last data is greater than the third last data, and the value of the second variable is greater than the standard deviation threshold, the peak count is increased by one and the peak time is recorded. Execute the item number process for the next frame image until the peak value detection of all frame images is completed; The counts were compensated based on the peak time of each frame.

2. The method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as claimed in claim 1, characterized in that: Convert the scaled image to a binary image, including: Calculate the mean grayscale values ​​of all pixels in the scaled image, and use the mean as the threshold to convert the grayscale image into a binary image.

3. The method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as claimed in claim 1, characterized in that: Obtaining the mask, including: Set a binary image of preset pixels, take the center point of the binary image as the coordinate origin, the positive direction of the x-axis as 0 degrees, and the counterclockwise direction as the positive direction. Draw an arc with an angle of θ as the mask, where: θ = π / n.

4. The method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as claimed in claim 1, characterized in that: The counts are compensated based on the peak time of each frame, including: Initialization, including: setting the start time variable to zero, setting the first peak time variable to zero, setting the last peak time variable to zero, setting the difference variable from the start to the first peak to zero, and setting the time variable from the peak to the last to zero; The input is the plum blossom wheel count and the current time; If the value of the start time variable is zero, assign the current time to the first peak time variable; If the value of the first peak time variable is zero, when the value of the plum blossom wheel count is zero, return zero; when the value of the plum blossom wheel count is not zero, find the first peak, the value of the first peak time variable is the current time, the value of the last peak time variable is the current time, the value of the difference variable from the start to the first peak is the value of the first peak time variable and the value of the start time variable, and return the value of the plum blossom wheel count; If the value of the first peak time variable is zero, when the plum blossom wheel count is equal to the previous plum blossom wheel count, the value of the peak to the last time variable is the value of the current time and the last peak time variable; when the plum blossom wheel count is not equal to the previous plum blossom wheel count, find a new peak, assign zero to the peak to the last time variable, assign the current time to the last peak time variable, assign the current plum blossom wheel count to the previous plum blossom wheel count, get the average period, and get the compensated plum blossom wheel count based on the average period.

5. The method for detecting the number of rotating teeth of a plum blossom wheel of a water meter for water meter calibration as claimed in claim 4, characterized in that: The average period u = (Te-Tf) / (C-1), the compensated plum blossom wheel count is: C-1+(T1+T2) / u, where Te is the last peak time, Tf is the first peak time, C is the plum blossom wheel count, T1 is the difference from the beginning to the first peak, and T2 is the time from the peak to the end.

6. A water meter plum blossom wheel rotation teeth number detection system for water meter calibration, characterized in that: include: The data acquisition module is configured to: acquire a continuous plurality of frames of water meter dial images; The single-needle image point count acquisition module is configured as follows: for each frame of image, a preset positioning model is used to obtain the positioning result of the plum blossom wheel, the image of the plum blossom wheel is intercepted according to the positioning result, the intercepted image is converted into a grayscale image, the grayscale image is scaled to a set size, the scaled image is converted into a binary image, a closing operation and a median filter are sequentially performed on the binary image, the image after the median filter is ANDed with the mask, and a pixel sum operation is performed on the result image to obtain the point count of the current frame; The rotating teeth number acquisition module is configured to: obtain the rotating teeth number of the plum blossom wheel according to the point count of each frame image, based on the peak detection algorithm and compensation algorithm of the flow; Execute the flow-based peak detection algorithm for each frame in the order of the frames, including: Calculate the point count of the current frame image and assign the point count to the first variable; According to the value of the first variable and the flow-based mean algorithm, the obtained mean is reassigned to the first variable; assigning the obtained standard deviation to the second variable based on the current value of the first variable and the stream-based standard deviation algorithm; Add the current value of the first variable to the global array. When the length of the global array is greater than 3, the last data in the global array is less than the second last data, the second last data is greater than the third last data, and the value of the second variable is greater than the standard deviation threshold, the peak count is increased by one and the peak time is recorded. Execute the item number process for the next frame image until the peak value detection of all frame images is completed; The counts were compensated based on the peak time of each frame.

7. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for detecting the number of rotating teeth of a plum blossom wheel of a water meter used for water meter calibration as described in any one of claims 1 to 5 are implemented.

8. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for detecting the number of rotating teeth of the plum blossom wheel of a water meter used for water meter calibration as described in any one of claims 1 to 5 are implemented.