A meter reading method and device based on an ultramicro video meter reader, a medium and a product
Patent Information
- Application Number
- CN202611046330.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]然而,上述单次拍照方案在追求高精度时存在一个技术问题
1、本技术方案通过识别目标机械水表的不同焦点区域(包括指针指示区域和数字滚轮区域),结合预标定过程中对焦程范围的动态优化,以及镜头对焦的平滑移动,使指针与数字滚轮两部分能够分别处于高质量成像状态,从而有效解决了浅景深导致的成像模糊问题,保证了混合式水表在多平面上的读数精确采集。
Smart Images

Figure CN122909480A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, specifically to a meter reading method, device, medium, and product based on an ultra-macro video meter reading instrument. Background Technology
[0002] In water resource management, efficient and accurate reading collection from existing mechanical water meters is fundamental to achieving intelligent water management. Traditional manual meter reading is inefficient, costly, and prone to errors due to the complex and diverse installation environments of water meters, failing to meet the demands of modern, refined management. While replacing all water meters with smart meters is one solution, its high cost and complex construction make large-scale implementation difficult. Therefore, developing a low-cost, high-efficiency technology for the intelligent transformation of existing water meters has become a significant technical challenge in the field.
[0003] To address this challenge, existing technologies have proposed a remote meter reading solution based on artificial intelligence and image capture. This solution involves installing a camera on a traditional water meter. By taking periodic photos, computer vision and OCR algorithms are used to identify the readings, which are then wirelessly uploaded. This modification enables remote automatic meter reading, avoids large-scale pipeline modifications, reduces labor costs, and provides a feasible solution to the meter reading acquisition problem.
[0004] However, the aforementioned single-shot method suffers from a technical problem in pursuing high accuracy. The use of a super macro lens to capture dial details results in an extremely shallow depth of field. For hybrid water meters with both analog and digital dials, there is a physical difference in depth between the two. Under shallow depth-of-field conditions, if the camera focuses on the analog dial, the digital dial will be blurry, and vice versa, making it impossible to clearly capture all the crucial information in a single photograph. This problem fundamentally limits the accuracy of meter reading identification. Summary of the Invention
[0005] This application provides a meter reading method, device, medium, and product based on an ultra-micro video meter reading instrument, which improves the accuracy of meter reading.
[0006] The first aspect of this application provides a meter reading method based on an ultra-macro video meter reader. The method includes: pre-calibrating a target mechanical water meter to identify focal areas on different planes of the meter dial, the focal areas including a pointer indication area and a digital scroll wheel area; determining a focal range based on each focal area; controlling the lens focus of the meter reader to smoothly move within the focal range based on the focal range, and activating infrared supplementary lighting and fog penetration functions according to ambient light intensity and fog concentration to obtain a video frame sequence; determining pointer keyframes and digital scroll wheel keyframes from the video frame sequence; applying a contour detection and angle recognition algorithm to the pointer keyframes to extract pointer readings; applying a character recognition algorithm to the digital scroll wheel keyframes to extract digital scroll wheel readings; and combining the pointer readings and the digital scroll wheel readings to generate a meter reading.
[0007] By employing the aforementioned technical solutions, the target mechanical water meter was pre-calibrated, accurately identifying focal areas on different planes of the dial. This enabled precise positioning of the pointer indication area and the digital scroll wheel area, laying the foundation for subsequent area-specific focusing. Determining the focal length range based on each focal area ensured that lens focus movement could completely cover all areas requiring clear imaging. Smoothly controlling the lens focus within the focal length range avoided image blurring caused by focus jumps, ensuring the continuity and stability of the video frame sequence. Dynamically activating infrared supplementary lighting and fog penetration functions based on ambient light intensity and fog concentration effectively improved imaging quality in low-light or foggy environments, enhancing the environmental adaptability of the meter reading system. Accurately identifying pointer and digital scroll wheel keyframes from the video frame sequence ensured that subsequent recognition algorithms could process based on the clearest image. Applying contour detection and angle recognition algorithms to the pointer keyframes and character recognition algorithms to the digital scroll wheel keyframes implemented optimized recognition strategies for different reading area features. Combining the pointer and digital scroll wheel readings generated the final meter reading, achieving complete and accurate extraction of the mechanical water meter reading. This technical solution identifies multiple focal areas on the dial of the target mechanical water meter through pre-calibration and determines the focal length range based on each focal area. Dynamic multi-face focusing is achieved by smoothly moving the lens focus. By optimizing imaging conditions through infrared illumination and fog penetration, key frame information of the pointer and digital scroll wheel is extracted from the video frame sequence. Efficient contour detection, angle recognition, and character recognition algorithms are used to accurately obtain the meter reading. Compared to traditional single-shot methods, this approach effectively solves the problems of image blurring and inaccurate readings caused by shallow depth of field, significantly improving reading accuracy and system applicability in complex environments, while also achieving low cost and high efficiency.
[0008] Optionally, the pre-calibration of the target mechanical water meter to identify the focal areas of the dial located on different planes specifically includes: performing semantic segmentation on the dial image of the target mechanical water meter to obtain the initial contour information of each component of the dial; analyzing the depth gradient change of the initial contour information to determine the height difference between the pointer indication area and the digital scroll wheel area; and constructing a three-dimensional spatial coordinate system based on the height difference and the depth of field parameters of the lens to map the pointer indication area and the digital scroll wheel area onto different focal planes to generate the focal areas.
[0009] By employing the aforementioned technical solution, semantic segmentation of the dial image of the target mechanical water meter enables automatic identification and extraction of precise contour information of each component of the dial, avoiding the tediousness and errors of manual annotation. Analyzing the depth gradient changes of the initial contour information accurately quantifies the height difference between the pointer indication area and the digital scroll wheel area, providing precise depth parameters for subsequent layered focusing. A three-dimensional spatial coordinate system is constructed based on the height difference and the lens's depth-of-field parameters, achieving accurate conversion of two-dimensional image information to three-dimensional spatial information, enabling the system to understand the three-dimensional structure of the dial. Precisely mapping the pointer indication area and the digital scroll wheel area to different focal planes generates accurate focal area definitions, ensuring that subsequent focusing processes can acquire clear images at the correct depth positions. This pre-calibration method based on semantic segmentation and depth analysis improves the automation and accuracy of focal area identification, providing a solid foundation for the reliable operation of the entire meter reading system.
[0010] Optionally, determining the focal length range based on each of the focal regions specifically includes: controlling the lens of the meter reader to gradually adjust the focal position starting from the minimum focusing distance, and recording the modulation transfer function (MTF) values of the pointer indication area and the digital roller area at each focal position; determining the first optimal focal position corresponding to the peak value of the MTF of the pointer indication area and the second optimal focal position corresponding to the peak value of the MTF of the digital roller area, and calculating the depth-of-focus difference between the first optimal focal position and the second optimal focal position; establishing a minimum coverage focal length including the pointer indication area and the digital roller area based on the depth-of-focus difference value and a preset depth-of-field extension coefficient, wherein the depth-of-field extension coefficient is calculated based on the lens aperture value and magnification; simulating the focal drift range at different installation angles and installation distances, and adding a tolerance margin corresponding to the focal drift range to the minimum coverage focal length to obtain the focal length range.
[0011] By employing the aforementioned technical solution, the lens is controlled to gradually adjust the focus position starting from the minimum focusing distance, and the modulation transfer function value is recorded. This enables a comprehensive evaluation of the image quality across the entire focusing range, ensuring the scientific accuracy of the focal length range determination. The optimal focus positions for both the pointer indicator area and the digital scroll wheel area are determined, and the depth-of-focus difference value is calculated, precisely quantifying the depth difference between different focus areas and providing key parameters for determining the focal length range. Based on the depth-of-focus difference value and the depth-of-field extension coefficient dynamically calculated according to the lens aperture value and magnification, the established minimum coverage focal length ensures that both focus areas obtain clear images while avoiding wasted scanning time due to an excessively large focal length range. By simulating the focus drift range under different installation angles and distances and adding corresponding tolerance margins, the final determined focal length range exhibits good robustness and can adapt to various deviations in actual installation. This focal length range determination method based on modulation transfer function and focus drift simulation ensures image quality while improving the system's practicality and reliability.
[0012] Optionally, activating the infrared supplementary lighting function and the fog penetration function based on the ambient light intensity and fog concentration specifically includes: acquiring the current ambient light intensity value using a light sensor integrated into the meter reader; comparing the current ambient light intensity value with a preset multi-level light threshold table to determine the supplementary lighting intensity level matching the current light intensity value, and activating the corresponding infrared supplementary lighting function based on the supplementary lighting intensity level; acquiring an initial environmental image and calculating an initial contrast index for the initial environmental image; comparing the initial contrast index with a preset multi-level clarity threshold table to determine the fog penetration intensity level corresponding to the current fog concentration, and activating the corresponding fog penetration function based on the fog penetration intensity level.
[0013] By adopting the above technical solution, an integrated light sensor acquires the current ambient illuminance value in real time, achieving precise perception of ambient lighting conditions and providing accurate data support for supplementary lighting decisions. The current ambient illuminance value is compared with a preset multi-level illuminance threshold table, and infrared supplementary lighting is activated based on the matched supplementary lighting intensity level, achieving fine-grained control of supplementary lighting intensity. This ensures image quality while avoiding reflection problems caused by excessive supplementary lighting. By calculating the contrast index of the initial environmental image, the impact of fog on image quality is accurately assessed, providing a quantitative basis for fog penetration processing. The initial contrast index is compared with a preset multi-level sharpness threshold table, and fog penetration is activated based on the corresponding fog penetration intensity level, achieving adaptive adjustment of fog penetration processing and effectively improving image sharpness in foggy environments. This adaptive supplementary lighting and fog penetration scheme based on environmental perception greatly improves the adaptability of the meter reading system under various complex environmental conditions, ensuring reliable meter reading in all weather and all environments.
[0014] Optionally, determining the pointer keyframe and the digital wheel keyframe from the video frame sequence specifically includes: traversing each frame in the video frame sequence and performing noise reduction preprocessing on each frame; for each preprocessed frame, calling the Laplacian operator to calculate a first sharpness evaluation value in the pointer-indicated area and a second sharpness evaluation value in the digital wheel area; retrieving and locating the image frame with the maximum first sharpness evaluation value to obtain the pointer keyframe; and retrieving and locating the image frame with the maximum second sharpness evaluation value to obtain the digital wheel keyframe.
[0015] By employing the aforementioned technical solution, traversing the video frame sequence and performing noise reduction preprocessing on each frame, noise interference in the image is effectively removed, providing cleaner image data for subsequent sharpness evaluation and improving the accuracy of sharpness calculation. For each preprocessed frame, the Laplacian operator is called to calculate the sharpness evaluation value in both the pointer indication area and the digit wheel area, achieving independent evaluation of the sharpness in different focal areas and avoiding the omission of local optimal solutions that may be caused by global evaluation. By retrieving the image frame with the largest first sharpness evaluation value as the pointer keyframe, it is ensured that pointer reading recognition can be based on the clearest image in the pointer area, improving the accuracy of pointer angle recognition. By retrieving the image frame with the largest second sharpness evaluation value as the digit wheel keyframe, it is ensured that the character recognition algorithm can process the clearest image of the digits, improving the accuracy of digit recognition. This method of regional sharpness evaluation and keyframe selection fully considers the imaging characteristics of different reading areas of mechanical water meters, achieving targeted optimization processing.
[0016] Optionally, after combining the pointer reading and the digital scroll wheel reading to generate the meter reading, the method further includes: retrieving historical valid meter readings from local memory and calculating the reading increment between the meter reading and the historical valid meter readings; comparing the reading increment with a preset increment threshold; if the reading increment is less than or equal to the preset increment threshold, then confirming the meter reading as a valid meter reading; if the reading increment is greater than the preset increment threshold, then marking the meter reading as a suspicious reading and triggering a re-meter reading process.
[0017] By adopting the above technical solution, historical valid meter readings are retrieved from local memory, establishing a reference benchmark for judging the reasonableness of readings. This enables the system to perform intelligent anomaly detection based on historical data. Calculating the increment between the current meter reading and historical valid meter readings quantifies changes in water consumption, providing intuitive numerical evidence for anomaly detection. Comparing the reading increment with a preset increment threshold enables automated anomaly detection based on the threshold, avoiding the subjectivity and inefficiency of manual judgment. When the reading increment is less than or equal to the preset increment threshold, it is automatically confirmed as a valid meter reading, ensuring meter reading efficiency under normal water usage conditions. When the reading increment exceeds the preset increment threshold, it is automatically marked as a suspicious reading and triggers a re-reading process, effectively preventing abnormal readings caused by identification errors or equipment malfunctions from being recorded, thus improving the reliability of meter reading data. This intelligent reading verification mechanism based on historical data significantly reduces the probability of erroneous readings and improves the data quality of the entire meter reading system.
[0018] Optionally, before comparing the reading increment with the preset increment threshold, the method further includes: obtaining a historical reading sequence containing multiple past meter reading cycles; calculating the average water consumption increment and standard deviation per unit time based on the historical reading sequence; and adding the average water consumption increment to the standard deviation by a preset multiple to obtain the preset increment threshold.
[0019] By employing the aforementioned technical solution, historical reading sequences encompassing multiple past meter reading cycles were obtained, constructing a complete water usage pattern dataset. This provides ample statistical samples for the dynamic determination of preset incremental thresholds. Based on the historical reading sequences, the average water usage increment and standard deviation per unit time were calculated, accurately characterizing the normal water usage characteristics and fluctuation range of the water meter, making threshold setting both personalized and scientific. The preset incremental threshold is obtained by adding the average water usage increment to the standard deviation of a preset multiple, realizing dynamic threshold calculation based on statistical principles. This considers both normal water usage fluctuations and retains sensitivity to abnormal situations. This adaptive threshold determination method can automatically adjust the judgment criteria according to different users' water usage habits, avoiding the misjudgment problems that may be caused by fixed thresholds. Statistical analysis of historical data makes anomaly detection more accurate, reducing the misjudgment of normal large water usage as abnormal, and effectively identifying genuine abnormal readings, significantly improving the intelligence and practicality of the meter reading system.
[0020] Secondly, embodiments of this application provide a meter reading device based on an ultra-macro video meter reader. The meter reading device based on the ultra-macro video meter reader includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the meter reading device based on the ultra-macro video meter reader to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a meter reading device based on an ultra-macro video meter reader, cause the meter reading device based on the ultra-macro video meter reader to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a meter reading device based on an ultra-macro video meter reader, causes the meter reading device based on the ultra-macro video meter reader to execute the method described in the first aspect and any possible implementation thereof.
[0023] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages: 1. This technical solution identifies different focal areas of the target mechanical water meter (including the pointer indication area and the digital roller area), combines dynamic optimization of the focal range during pre-calibration, and smooth movement of the lens focus, so that the pointer and digital roller can be in a high-quality imaging state respectively, thereby effectively solving the imaging blur problem caused by shallow depth of field and ensuring accurate acquisition of readings of the hybrid water meter on multiple planes.
[0024] 2. By combining real-time detection of ambient light intensity and fog concentration, this solution improves the imaging quality of the meter reader under complex lighting and harsh environmental conditions by adjusting the infrared supplementary lighting and fog penetration functions. Simultaneously, by filtering the video frame sequence based on image clarity, the extracted pointer keyframes and digital scroll wheel keyframes are ensured to have the highest image clarity, thereby improving the recognition accuracy of the reading algorithm.
[0025] 3. After the meter readings are generated, their reasonableness is verified using historical valid meter readings. By comparing the reading increment with a preset increment threshold, the mistransmission of abnormal or erroneous data is effectively avoided. Simultaneously, the increment threshold calculated based on historical reading sequences further enhances the system's intelligence and adaptability in detecting reading anomalies, improving the reliability and accuracy of meter readings. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a meter reading method based on an ultra-macro video meter reader disclosed in an embodiment of this application. Figure 2 This is another flowchart illustrating a meter reading method based on an ultra-micro video meter reader disclosed in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a meter reading device based on an ultra-macro video meter reading instrument provided in an embodiment of this application.
[0027] Explanation of reference numerals in the attached drawings: 301, Central Processing Unit; 302, Read-Only Memory; 303, Random Access Memory; 304, Bus; 305, Input / Output Interface; 306, Input Section; 307, Output Section; 308, Storage Section; 309, Communication Section; 310, Driver; 311, Removable Media. Detailed Implementation
[0028] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0029] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.
[0030] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple system devices refer to two or more system devices, and multiple screen terminals refer to two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0031] This application provides a meter reading method based on an ultra-macro video meter reader, referring to... Figure 1 , Figure 1This is a flowchart illustrating a meter reading method based on a super macro video meter reader, as provided in an embodiment of this application. The method is applied to a meter reader, which can execute a meter reading program based on the super macro video meter reader. The method includes steps S101 to S107, as follows: Step S101: Pre-calibrate the target mechanical water meter to identify the focal areas of the dial located on different planes. The focal areas include the pointer indication area and the digital scroll wheel area.
[0032] In step S101, the target mechanical water meter refers to the physical water meter device whose readings need to be recorded. Pre-calibration refers to the process of initially setting and calibrating various parameters and target characteristics of the meter reader before the formal meter reading task is executed. The dial refers to the panel portion of the target mechanical water meter that carries the scale, pointer, and digital rollers. The focal area refers to a specific image area on the dial that requires different lens focal positions to achieve clear imaging due to varying physical depths. The pointer indication area refers to the focal area on the dial containing the pointer indicating decimal readings and its corresponding scale. The digital roller area refers to the focal area on the dial containing multiple digital rollers displaying integer readings.
[0033] Specifically, the meter reader first acquires a complete image of the target mechanical water meter's dial. The meter reader's internal image processing unit uses a pre-trained semantic segmentation network to analyze the acquired dial image, automatically identifying and segmenting the pixel-level contours of the pointer, dial, and each digital scroll wheel. Based on this contour information and the meter reader's lens optical imaging model, the meter reader can analyze the physical height difference between the plane containing the pointer and the plane containing the digital scroll wheels. Due to this height difference, these two areas cannot simultaneously achieve optimal clarity at the same lens focal point. Therefore, the meter reader divides the pointer and its dial into a pointer indicating area and all digital scroll wheels into a digital scroll wheel area, thereby generating two focal areas located on different focal planes, completing the pre-calibration.
[0034] In one possible implementation, the target mechanical water meter is pre-calibrated to identify the focal areas of the dial located on different planes, specifically including steps S1011-S1023, as follows: Step S1011: Perform semantic segmentation on the dial image of the target mechanical water meter to obtain the initial contour information of each component of the dial.
[0035] In step S1011, the dial image refers to the digital image of the complete dial of the target mechanical water meter acquired by the meter reader. Semantic segmentation is a computer vision technique used to assign each pixel in the digital image to a specific category label, such as pointer, number, or background. The components of the dial refer to units on the dial that have independent functions or shapes, mainly including pointers, dials, and digital scroll wheel. Initial contour information refers to the set of pixel coordinates extracted by image processing algorithms that describes the shape and position of each component of the dial in the dial image.
[0036] Specifically, the meter reader first uses an image sensor to capture a high-resolution image of the target mechanical water meter's dial. This image is then input into a pre-trained deep learning semantic segmentation network model. This network analyzes and classifies each pixel in the dial image, assigning each pixel a predefined category label, such as pointer pixels, digit scroll wheel pixels, scale pixels, or background pixels. After pixel-level classification, the meter reader groups together all adjacent pixels with the same category label, forming different segmented regions. For each segmented region, such as the region representing the pointer and the regions representing the individual digit scroll wheels, the meter reader applies an edge detection algorithm to accurately delineate the outer boundaries of these regions. The set of pixel coordinate data for these outer boundaries constitutes the initial contour information of the various components of the dial.
[0037] Step S1012: Analyze the depth gradient change of the initial contour information to determine the height difference between the pointer indication area and the digital scroll wheel area.
[0038] In step S1012, the depth gradient change refers to the rate of change in image sharpness on both sides of the edge identified by the initial contour information when the lens focus moves slightly; this rate of change is related to the actual depth of the object. The pointer indication area refers to the area containing the pointer and its surrounding scale. The digital scroll wheel area refers to the area containing all digital scroll wheels. The height difference refers to the vertical spatial distance between the physical plane containing the pointer indication area and the physical plane containing the digital scroll wheel area.
[0039] Specifically, after acquiring initial contour information, the meter reader performs a micro-focal length scan. The meter reader controls the lens to move back and forth at the current focal position in very small steps, simultaneously acquiring a short image sequence. For each frame in the sequence, the meter reader uses a sharpness evaluation operator, such as a frequency domain energy operator, to calculate the sharpness values of the edges of the pointer indication area and the digital scroll wheel area defined by the initial contour information. By analyzing the change curves of the sharpness values of these two areas throughout the micro-focal length scan, the meter reader can find the precise focal position corresponding to the peak sharpness of each area. Since the pointer and digital scroll wheel are located at different physical depths, the meter reader obtains two different optimal focal positions. Using a pre-calibrated lens optical model, the meter reader accurately converts the difference between these two optimal focal positions into a distance value in physical space using a lens imaging formula. This distance value is the height difference between the pointer indication area and the digital scroll wheel area.
[0040] Step S1013: Based on the height difference and the depth of field parameters of the lens, construct a three-dimensional spatial coordinate system, map the pointer indication area and the digital scroll wheel area onto different focal planes, and generate the focus area.
[0041] In step S1013, the depth-of-field parameters of the lens refer to a set of optical parameters that determine the range of distances within which the lens can maintain image sharpness during a single focusing attempt, including the lens's focal length and aperture size. A three-dimensional spatial coordinate system is a mathematical reference system used to describe the position of an object in physical space, containing three mutually perpendicular coordinate axes: X, Y, and Z. The focal plane is a specific depth plane in the three-dimensional spatial coordinate system that is parallel to the lens's imaging plane and provides the sharpest image. The focal region refers to the target area in the three-dimensional spatial coordinate system whose spatial location and range are clearly defined and which needs to be clearly captured.
[0042] Specifically, the meter reader establishes an internal three-dimensional spatial coordinate system based on its own image sensor plane, where the Z-axis represents the depth direction, i.e., the direction parallel to the lens optical axis. Based on the height difference calculated in step S1012 and the depth-of-field parameters of its own lens, the meter reader defines two independent focal planes. For example, the meter reader can define the focal plane of the digital roller area at depth Z1, then the focal plane of the pointer indication area is defined at depth Z1 plus the height difference. Subsequently, the meter reader projects the initial two-dimensional contour information of the pointer indication area obtained in step S1011 onto the focal plane of the pointer indication area; simultaneously, it projects the initial two-dimensional contour information of the digital roller area onto the focal plane of the digital roller area. Through this mapping, the originally two-dimensional area information is given precise depth information, thus forming two separate areas with definite spatial positions in the three-dimensional spatial coordinate system. These two three-dimensional areas mapped onto different focal planes together constitute the finally generated focal area, providing a basis for subsequent precise focusing and meter reading.
[0043] Step S102: Determine the focal length range based on each focal region.
[0044] In step S102, the focal length range refers to the entire travel interval covered by the starting position to the ending position of the focal point of the meter reading instrument lens. This travel interval needs to ensure that all focal areas can be clearly imaged during the movement.
[0045] Specifically, the meter reader determines the focal length range based on the pointer indication area and digital scroll wheel area identified during the pre-calibration phase. The meter reader controls the lens drive unit, causing the lens focus to move gradually towards the farthest focusing distance, starting from the closest physical focusing distance, in preset small steps. At each focal position, the meter reader acquires an image frame and calculates the modulation transfer function (MTF) values for both the pointer indication area and the digital scroll wheel area, which are objective indicators of image sharpness. After completing the entire scan, the meter reader obtains two function curves showing the change in sharpness with focal position. The meter reader finds the first optimal focal position corresponding to the peak point of the curve in the pointer indication area and the second optimal focal position corresponding to the peak point of the curve in the digital scroll wheel area. Based on these two optimal focal positions, the meter reader dynamically calculates a depth-of-field extension factor, combined with the lens's aperture value and imaging magnification, thereby establishing a minimum coverage focal length that completely covers both optimal focal positions. To address potential angle or distance deviations during actual installation, the meter reader further simulates focus drift caused by these deviations using Monte Carlo simulation. This adds a margin of error to the minimum coverage focal length, ultimately determining a robust and efficient focal length range.
[0046] In one possible implementation, the focal length range is determined based on each focal region, specifically including steps S1021-S1024, as follows: Step S1021: Control the lens of the meter reader to gradually adjust the focus position starting from the minimum focusing distance, and record the modulation transfer function value of the pointer indication area and the digital roller area at each focus position.
[0047] In step S1021, the minimum focusing distance refers to the closest physical distance at which the optical lens of the meter reader can achieve a clear image. The focal position refers to a specific point in the focusing system of the meter reader's lens throughout its entire travel, typically quantified by the number of steps of the drive motor or the encoder reading. The modulation transfer function (MTF) value is an objective indicator used to evaluate the imaging quality of an optical system. This MTF value represents the image's ability to transmit contrast at different spatial frequencies; a higher value indicates a clearer image and stronger detail reproduction capability.
[0048] Specifically, the meter reader initiates an automatic scanning program. First, it instructs the lens drive system to move the lens to the minimum focusing distance defined by a mechanical limit. Then, the meter reader drives the lens to move towards infinity in preset fixed steps, for example, 5 micrometers at a time. At each independent focal position, the meter reader acquires a current dial image. For each acquired dial image, the meter reader uses the focal area information generated in the previous steps to locate the pointer indicator area and the digital scroll wheel area, respectively. The meter reader applies algorithms such as Fast Fourier Transform to the image data of these two areas to calculate their respective modulation transfer function (MJT) values. The meter reader stores the calculated MJT values for the pointer indicator area and the digital scroll wheel area, along with the current focal position data, as a data pair until the lens completes the entire scan from the minimum to the maximum focusing distance.
[0049] Step S1022: Determine the first optimal focal position corresponding to the peak value of the modulation transfer function in the pointer indication area and the second optimal focal position corresponding to the peak value of the modulation transfer function in the digital roller area, and calculate the depth of focus difference between the first optimal focal position and the second optimal focal position.
[0050] In step S1022, the modulation transfer function peak value refers to the highest modulation transfer function value achievable in a specific area throughout the entire focusing stroke, representing the sharpest image in that area. The first optimal focus position refers to the lens focus position where the modulation transfer function value of the area indicated by the pointer reaches its peak. The second optimal focus position refers to the lens focus position where the modulation transfer function value of the digital roller area reaches its peak. The depth of focus difference value refers to the absolute difference between the first optimal focus position and the second optimal focus position on the lens focusing stroke coordinates.
[0051] Specifically, after completing data acquisition for the entire focusing journey, the meter reader begins analyzing the recorded data. First, it iterates through all recorded modulation transfer function (MJF) values in the pointer indication area, using a peak-finding algorithm to find the maximum value, i.e., the MJF peak value. The meter reader records the focal position corresponding to this peak value and designates it as the first optimal focal position. Next, the meter reader processes all recorded MJF values in the digital roller area using the same method, finds the peak value in that area, and designates the focal position corresponding to this peak value as the second optimal focal position. Finally, the meter reader calculates the absolute value of the numerical difference between the first and second optimal focal positions to obtain the depth-of-focus difference value.
[0052] Step S1023: Based on the depth-of-field difference value and the preset depth-of-field expansion factor, establish the minimum coverage focal length including the pointer indication area and the digital scroll wheel area, wherein the depth-of-field expansion factor is calculated based on the lens aperture value and magnification.
[0053] In step S1023, the preset depth-of-field expansion factor is a multiplier greater than 1, used to expand the depth-of-field difference value to ensure that the two target areas are not only sharp at their optimal focus positions but also maintain sufficient sharpness within their depth of field. The lens aperture value is an optical parameter that controls the amount of light entering the lens. Magnification refers to the ratio of the image size to the actual object size. The minimum coverage focal length refers to the shortest focusing distance the lens needs to scan to ensure that both the pointer-indicated area and the digital dial area are captured clearly.
[0054] Specifically, the meter reader first reads the currently configured lens aperture value and the magnification at the current working distance from its own hardware parameter library. The meter reader then substitutes these two parameters into a preset optical calculation formula to calculate a preset depth-of-field extension factor. This formula reflects the optical principle that a smaller aperture and lower magnification result in a greater depth of field, thus requiring a smaller extension factor, and vice versa. Then, the meter reader multiplies the depth-of-field difference value calculated in step S1022 with the preset depth-of-field extension factor just calculated. The result of this product is determined as the minimum coverage focal length that can simultaneously cover the pointer indication area and the digital scroll wheel area with a clear image.
[0055] Step S1024: Simulate the focus drift range under different installation angles and distances, and increase the tolerance margin corresponding to the focus drift range based on the minimum coverage focal length to obtain the focal length range.
[0056] In step S1024, the focus drift range refers to the range within which the optimal focus position changes due to angular or distance deviations from the ideal position that may occur during the actual installation of the meter reader. The tolerance margin refers to the additional focusing travel margin added to compensate for these potential installation errors. The focal length range is the final determined complete focusing scan travel that the lens needs to perform during actual meter reading operations; this focal length range is the sum of the minimum coverage focal length and the tolerance margin.
[0057] Specifically, the meter reader accesses a deviation influence model stored internally. This model, established through extensive experimental data or optical simulation, describes the drift of the first and second optimal focal positions when the meter reader's installation angle deviates by a specific degree or the installation distance deviates by a specific millimeter. Based on preset allowable installation tolerances, such as ±5 degrees for angle deviation and ±2 millimeters for distance deviation, the meter reader queries or calculates the maximum possible focal drift from the deviation influence model; this maximum focal drift is the focal drift range. The meter reader uses this focal drift range as a tolerance margin and adds it to the minimum coverage focal length calculated in step S1023. This final sum is the focal length range that the meter reader must execute in all subsequent automatic meter reading tasks to ensure reliable acquisition of clear pointer and digital scroll images regardless of slight changes in installation position.
[0058] Step S103: Based on the focal length range, control the lens focus of the meter reader to move smoothly within the focal length range, and activate the infrared supplementary light function and fog penetration function according to the ambient light intensity and fog concentration to obtain a video frame sequence.
[0059] In step S103, the lens focus refers to the convergence point of the lens optical system. Smooth movement refers to the continuous and jitter-free change of the lens focus position within its focal length range. Ambient light intensity refers to the light brightness level of the environment in which the meter reader is located. Fog concentration refers to the density of water vapor or suspended particulate matter in the air that affects image clarity. Infrared supplementary lighting function refers to the function of the meter reader actively emitting infrared light to illuminate the target mechanical water meter under low light conditions. Fog penetration function refers to the function of mitigating the image blurring and contrast reduction caused by fog through algorithm processing. Video frame sequence refers to a collection of a series of static image frames continuously acquired during the movement of the lens focus.
[0060] Specifically, based on the focal length range determined in step S102, the meter reader drives its internal voice coil motor or stepper motor to control the lens focus to move smoothly and uniformly from the starting point to the ending point of the focal length range. Before and during the movement, the meter reader's built-in light sensor continuously detects the ambient light intensity. If the detected light intensity value is lower than a certain level in the preset multi-level light threshold table, the meter reader immediately activates the infrared supplementary lighting function and controls the emission power of the infrared LED according to the matching level to ensure sufficient imaging brightness. At the same time, the meter reader calculates the contrast index of the acquired image in real time to assess the fog concentration. If the contrast is lower than the preset sharpness threshold, it indicates the presence of fog interference, and the meter reader activates the digital defogging function, using image enhancement algorithms to improve the contrast and sharpness of subsequent acquired images. Throughout the smooth focus movement, the meter reader's image sensor continuously exposes and acquires images at a fixed frame rate, ultimately generating a video frame sequence containing the complete process from blurry to sharp and back to blurry.
[0061] In one possible implementation, the infrared supplementary lighting function and the fog penetration function are activated according to the ambient light intensity and fog concentration, specifically including steps S1031-S1034, as follows: Step S1031: Obtain the current ambient light intensity value through the light sensor integrated into the meter reading instrument.
[0062] In step S1031, the light sensor refers to a semiconductor device that can convert the intensity of received light signals into electrical signals. This light sensor is integrated into the hardware system of the meter reading instrument. The current ambient light intensity value refers to the visible light intensity value of the environment in which the meter reading instrument is located, as measured by the light sensor at a specific moment, usually in lux.
[0063] Specifically, before performing the meter reading task, the meter reader first activates its internal circuitry to power the light sensor integrated into the meter reader's casing or near the lens. The light sensor then senses the intensity of light in the surrounding environment. The photosensitive element inside the sensor converts the received photon energy into a corresponding current or voltage signal. The meter reader's microprocessor reads this electrical signal through an analog-to-digital converter and, based on the sensor's calibration data, converts the signal intensity into a standard, digital value representing the current ambient light intensity. This value accurately reflects the lighting conditions at the location of the target mechanical water meter's dial.
[0064] Step S1032: Compare the current ambient light intensity value with the preset multi-level light threshold table, determine the supplementary light intensity level that matches the current light intensity value, and enable the corresponding infrared supplementary light function based on the supplementary light intensity level.
[0065] In step S1032, the preset multi-level illumination threshold table refers to a data structure embedded in the meter reader's memory. This data structure defines multiple illumination ranges and the corresponding supplementary lighting strategy for each range. The supplementary lighting intensity level refers to the preset output power level of the meter reader's infrared supplementary lighting system, such as off, low, medium, and high levels. The infrared supplementary lighting function refers to the meter reader's ability to illuminate target objects by driving infrared light-emitting diodes (LEDs) to emit infrared light invisible to the human eye.
[0066] Specifically, the meter reading device's control system acquires the current ambient illuminance value measured in step S1031. The meter reading device accesses a preset multi-level illuminance threshold table stored internally. This table may contain the following rules: illuminance values below 5 lux correspond to a high supplementary lighting intensity level; illuminance values between 5 and 20 lux correspond to a medium supplementary lighting intensity level; illuminance values between 20 and 50 lux correspond to a low supplementary lighting intensity level; and illuminance values above 50 lux correspond to an off supplementary lighting intensity level. The meter reading device compares the current ambient illuminance value with each threshold in the table to find the range to which the illuminance value belongs, thereby determining a matching supplementary lighting intensity level. Subsequently, based on the determined supplementary lighting intensity level, the meter reading device sends a pulse width modulation (PWM) signal to the infrared LED's driving circuit. The duty cycle of the signal is proportional to the supplementary lighting intensity level, thereby precisely controlling the output power of the infrared LED to achieve the corresponding level of infrared supplementary lighting function.
[0067] Step S1033: Obtain the initial environment image and calculate the initial contrast index for the initial environment image.
[0068] In step S1033, the initial environmental image refers to a frame of original scene image captured by the meter reader using an image sensor without applying any image enhancement algorithms. The initial contrast index is a quantitative value obtained by statistically analyzing the pixel grayscale values of the initial environmental image, which is used to evaluate the degree of difference between bright and dark areas in the image.
[0069] Specifically, the meter reader instructs its image sensor to acquire a complete image frame under the current exposure settings; this frame serves as the initial environmental image. After image acquisition, the meter reader's image processing unit immediately analyzes the frame. The meter reader converts the image to grayscale and then applies a contrast calculation model, such as calculating the standard deviation of the image's grayscale histogram. A larger standard deviation indicates a wider distribution of pixel grayscale values, stronger contrast between light and dark areas, and higher contrast. After calculation, the meter reader obtains a specific floating-point or integer value; this value is the initial contrast index, used to characterize the sharpness of the current imaging environment.
[0070] Step S1034: Compare the initial contrast index with the preset multi-level clarity threshold table to determine the fog penetration intensity level corresponding to the current fog concentration, and activate the corresponding fog penetration function based on the fog penetration intensity level.
[0071] In step S1034, the preset multi-level clarity threshold table refers to a reference table stored inside the meter reader. This reference table establishes a correspondence between the initial contrast index value range and the required fog penetration processing intensity. The fog penetration intensity level refers to the preset processing intensity level of the digital image fog penetration algorithm. Different levels correspond to adjustments in algorithm parameters to address the impact of fog at different concentrations. The fog penetration function refers to the meter reader's application of specific image processing algorithms, such as dark channel prior algorithms, to reduce the blurring and whitening effects caused by fog or water vapor in the image, thereby restoring image details and colors.
[0072] Specifically, the meter reader matches the initial contrast ratio calculated in step S1033 with a preset multi-level clarity threshold table stored in the device. This table may define the following rules: an initial contrast ratio less than 0.3 indicates high fog concentration, corresponding to a strong fog penetration level; an initial contrast ratio between 0.3 and 0.6 indicates medium fog concentration, corresponding to a medium fog penetration level; an initial contrast ratio between 0.6 and 0.8 indicates low fog concentration, corresponding to a weak fog penetration level; and an initial contrast ratio greater than 0.8 indicates a clear image, requiring no fog penetration. The meter reader determines the fog penetration level corresponding to the current fog concentration through comparison. If the determined level is not "no fog penetration required," the meter reader activates the fog penetration function. During subsequent formal acquisition of the dial image for identification, the image processing unit adjusts key parameters of the fog penetration algorithm, such as the threshold for atmospheric light value estimation and the smoothing factor of the transmittance map, based on the determined fog penetration level, to perform real-time enhancement processing on the acquired image.
[0073] Step S104: Determine the pointer keyframe and digital scroll wheel keyframe from the video frame sequence.
[0074] In step S104, the pointer keyframe refers to the frame in the video frame sequence where the area indicated by the pointer is the clearest. The digital scroll wheel keyframe refers to the frame in the video frame sequence where the area of the digital scroll wheel is the clearest.
[0075] Specifically, the meter reader processes the video frame sequence generated in step S103. The meter reader iterates through each frame in the video frame sequence. For each frame, the meter reader calls the Laplacian operator, an operator sensitive to high-frequency information in the image, which can effectively quantify the image's sharpness. Within the coordinate range of the pointer indication area determined in the pre-calibration stage, the meter reader calculates a first sharpness evaluation value for the current frame image; simultaneously, within the coordinate range of the digital scroll wheel area, it calculates another second sharpness evaluation value. The meter reader compares the first sharpness evaluation values of all frames, finds the evaluation value with the highest value, and determines the image frame corresponding to this evaluation value as the pointer keyframe. Similarly, the meter reader retrieves the maximum value among the second sharpness evaluation values of all frames and determines the corresponding image frame as the digital scroll wheel keyframe.
[0076] In one possible implementation, determining the pointer keyframe and the digital scroll wheel keyframe from the video frame sequence specifically includes steps S1041-S1044, as follows: Step S1041: Traverse each frame of the video frame sequence and perform noise reduction preprocessing on each frame.
[0077] In step S1041, the video frame sequence refers to a set of static images continuously captured and arranged in chronological order by the meter reader during focal range scanning. Noise reduction preprocessing refers to the process of applying algorithms to the image to eliminate or reduce random interference signals present in the image before performing core analysis. These interference signals typically manifest as noise in the image.
[0078] Specifically, the meter reader first retrieves the complete video frame sequence captured during focal length scanning from its internal memory. The meter reader then initiates a loop processing flow, accessing each frame sequentially from the first to the last. For each frame in the sequence, the meter reader's image processing unit applies a preset noise reduction filter, such as a Gaussian filter or a median filter. This noise reduction filter smooths the image by calculating pixel values within the pixel's neighborhood, effectively filtering out random noise generated by the image sensor under low-light conditions, while preserving as much edge and detail information as possible. After processing, the meter reader obtains a cleaner, pre-processed video frame sequence for subsequent sharpness calculations.
[0079] Step S1042: For each preprocessed frame image, call the Laplacian operator to calculate the first sharpness evaluation value in the pointer-indicated area and the second sharpness evaluation value in the digital scroll wheel area.
[0080] In step S1042, the Laplacian operator is a second-order differential operator used for image processing. This operator highlights edges and details in an image by detecting the local gray-level change rate, and the intensity of its response can be used to quantify the image sharpness. The pointer indicator region refers to a pre-marked rectangular or polygonal region in the image that contains all pointers. The digital wheel region refers to the same pre-marked image region that contains all digital wheels. The first sharpness evaluation value is a numerical value specifically calculated for the pointer indicator region, characterizing the image sharpness of that region. The second sharpness evaluation value is a numerical value specifically calculated for the digital wheel region, characterizing the image sharpness of that region.
[0081] Specifically, the meter reader continues to traverse the video frame sequence after noise reduction preprocessing. For each frame, the meter reader first locates the pointer indicator area and the digital scroll wheel area based on pre-stored coordinate information. The meter reader applies the Laplacian operator to all pixels within the pointer indicator area for convolution, generating a response matrix containing the second derivative information of each point. Subsequently, the meter reader calculates the variance or sum of the absolute values of this response matrix to obtain a quantized value, which is the first sharpness evaluation value for the current frame. The meter reader applies the Laplacian operator to the digital scroll wheel area in the same frame using the exact same method and calculates the variance of its response to obtain the second sharpness evaluation value. The meter reader associates and stores the calculated first and second sharpness evaluation values with their corresponding frame numbers.
[0082] Step S1043: Retrieve and locate the image frame with the highest first sharpness rating to obtain the pointer keyframe.
[0083] In step S1043, the maximum first sharpness evaluation value refers to the largest value among all first sharpness evaluation values in the entire video frame sequence. The pointer keyframe refers to the original image frame corresponding to the maximum first sharpness evaluation value, which is considered to be the sharpest frame in the pointer portion of the entire sequence.
[0084] Specifically, after calculating the sharpness evaluation value for all frames, the meter reader begins analyzing the stored list of first sharpness evaluation values. The meter reader searches the entire list using a simple peak-finding algorithm or by directly traversing and comparing values to find the first sharpness evaluation value with the highest value. Once the maximum value is determined, the meter reader records the frame number that generated that maximum value. Finally, based on this frame number, the meter reader accurately extracts the corresponding complete image frame from the unprocessed raw video frame sequence and officially marks this image frame as the pointer keyframe for subsequent pointer reading identification.
[0085] Step S1044: Retrieve and locate the image frame with the highest second sharpness rating to obtain the digital scroll wheel keyframe.
[0086] In step S1044, the maximum second sharpness rating value refers to the largest value among all second sharpness rating values in the entire video frame sequence. The digital scroll wheel keyframe refers to the original image frame corresponding to the maximum second sharpness rating value, which is considered to be the sharpest frame in the digital scroll wheel portion of the entire sequence.
[0087] Specifically, the meter reader uses the same logic as in step S1043 to process the stored list of second-resolution evaluation values. The meter reader traverses this list, comparing all values to locate the largest second-resolution evaluation value. After finding this maximum value, the meter reader records the associated frame number. Then, using this frame number, the meter reader extracts the corresponding complete image frame from the original video frame sequence again. This extracted image frame is officially marked as a digital scroll wheel keyframe, specifically used for subsequent digital scroll wheel reading recognition.
[0088] Step S105: Apply contour detection and angle recognition algorithms to the pointer keyframes to extract pointer readings.
[0089] In step S105, the contour detection and angle recognition algorithm is an image processing algorithm used to identify the geometric shape of a specific object in an image and calculate its orientation. The pointer reading refers to the numerical value converted from the scale value indicated by the pointer, usually representing the decimal part of the total reading.
[0090] Specifically, the meter reader extracts the readings based on the pointer keyframe determined in step S104. First, the meter reader performs grayscale conversion and Gaussian filtering on the pointer indication area in the keyframe to reduce noise. Then, adaptive threshold binarization separates the pointer outline from the background. Next, the meter reader applies the Canny edge detection algorithm to extract the precise edge outline of the pointer. By analyzing the geometric features of all outlines, such as area and aspect ratio, the meter reader filters and locks onto the pointer outline. Subsequently, the meter reader calculates the central axis of the pointer outline and, based on the angle between the direction vector of the axis and the zero-gradient line vector of the dial calibrated during pre-calibration, accurately calculates the pointer's rotation angle. Finally, based on the correspondence between the total range and total angle of the dial, the meter reader converts the calculated rotation angle into a specific small value, which is the pointer reading.
[0091] Step S106: Apply a character recognition algorithm to the keyframe of the digital scroll wheel to extract the digital scroll wheel reading.
[0092] In step S106, the character recognition algorithm is an algorithm that can convert text or digital pixel information in an image into computer-editable text, usually referring to Optical Character Recognition (OCR). The digital scroll reading refers to the numerical value composed of the combination of numbers displayed on the digital scroll wheel, typically representing the integer part of the total reading.
[0093] Specifically, the meter reader processes the keyframes of the digital roller determined in step S104. First, the meter reader precisely locates and crops the digital roller area based on the coordinates determined during pre-calibration. Since the arrangement of numbers on the digital roller is fixed, the meter reader segments the cropped digital roller image into multiple independent single character images according to preset character spacing and quantity. For each segmented character image, the meter reader normalizes its size to a preset size, such as 32x32 pixels, and performs binarization. Then, the meter reader inputs the processed single character image into a pre-trained lightweight convolutional neural network. This network, trained on a large number of digital samples, can efficiently and accurately identify which number from 0 to 9 is in the image. The meter reader sequentially identifies all character images from left to right and concatenates the identification results to form a complete integer, which is the digital roller reading.
[0094] Step S107: Combine the pointer reading and the digital roller reading to generate the meter reading.
[0095] In step S107, the meter reading refers to the final water meter reading that combines the integer and decimal parts, which is the final result of this meter reading task.
[0096] Specifically, the meter reader acquires the digital scroll reading representing the integer part generated in step S106, and the pointer reading representing the decimal part generated in step S105. The meter reader performs arithmetic addition on these two values, adding the digital scroll reading to the pointer reading to obtain a precise value containing both integer and decimal places. This precise value is the final meter reading generated for this meter reading task, and the meter reader then stores or uploads this meter reading to the data center.
[0097] Please refer to Figure 2 In one possible implementation, after combining the pointer reading and the digital scroll wheel reading to generate the meter reading, the method further includes steps S201-S204, as follows: Step S201: Retrieve historical valid meter readings from local memory and calculate the increment between the meter reading and the historical valid meter readings.
[0098] In step S201, local memory refers to a non-volatile memory chip, such as flash memory or EEPROM, embedded inside the meter reader for persistent data storage. Historical valid meter readings refer to the water meter readings saved after the last successful meter reading and verification. The reading increment represents the difference between the current meter reading and the previous historical valid meter reading, reflecting the amount of water meter readings between the two readings.
[0099] Specifically, after the meter reader generates the current meter reading through image recognition and data combination, its control system immediately accesses its internal local memory. The meter reader locates a predefined file or data address in the local memory, specifically for storing historical valid meter readings. It reads this value and then performs a subtraction operation: subtracting the previously read historical valid meter reading from the currently acquired reading. The result is the reading increment. This increment is temporarily stored in the meter reader's memory for use in subsequent steps.
[0100] Step S202: Compare the reading increment with the preset increment threshold.
[0101] In step S202, the preset incremental threshold refers to a reference value that is pre-set in the meter reading system. This value defines the maximum reasonable increase in the water meter reading between two meter reading cycles under normal use.
[0102] Specifically, the meter reader's control system reads a preset incremental threshold from a dedicated configuration area. This threshold can be set according to the water meter's purpose, such as residential or industrial water use, and the meter reading cycle, such as daily, monthly, or quarterly, to ensure its rationality. The meter reader then compares the reading increment calculated in the previous step with this read preset incremental threshold. The comparison result determines whether the meter reader executes the logic of step S203 or step S204.
[0103] In one possible implementation, before comparing the reading increment with a preset increment threshold, the method further includes steps S2021-S2023, as follows: Step S2021: Obtain a historical reading sequence containing multiple past meter reading cycles.
[0104] In step S2021, the historical reading sequence refers to a series of past valid meter readings stored in local memory, arranged in chronological order of meter reading time. The meter reading cycle refers to a fixed time interval between two consecutive meter reading operations, such as one day or one month.
[0105] Specifically, before comparing the incremental readings, the meter reader first accesses its local memory. From a dedicated area for recording historical data, the meter reader reads a sequence of historical readings containing multiple reading cycles. This sequence may include monthly readings for the most recent 12 months. The meter reader loads this complete historical reading sequence into temporary memory in preparation for subsequent statistical calculations.
[0106] Step S2022: Based on the historical reading series, calculate the average water consumption increment and standard deviation per unit time.
[0107] In step S2022, the average water consumption increment per unit time refers to the average value obtained by summing the differences between all adjacent readings in the historical reading sequence and then dividing by the number of differences. This value reflects the average water consumption in each meter reading cycle. The standard deviation is a statistic used to measure the dispersion of historical water consumption increment data relative to the average water consumption increment. The larger the standard deviation, the greater the volatility of water consumption.
[0108] Specifically, the meter reader performs calculations based on the acquired historical reading sequence. First, the meter reader iterates through the historical reading sequence, calculating the difference between every two consecutive readings to obtain a water usage increment sequence. For example, for a sequence containing 12 months of readings, the meter reader will calculate the water usage increment for 11 individual months. Then, the meter reader performs statistical analysis on this water usage increment sequence, calculating the arithmetic mean of all water usage increments to obtain the average water usage increment per unit time. Simultaneously, the meter reader also calculates the standard deviation of this water usage increment sequence and saves both the average water usage increment and the standard deviation.
[0109] Step S2023: Add the average water consumption increment to the standard deviation of the preset multiple to obtain the preset increment threshold.
[0110] In step S2023, the preset multiplier is a numerical coefficient pre-configured in the meter reading system, used to adjust the weight of the standard deviation in the threshold calculation. The preset incremental threshold is an upper limit value used to determine whether the current reading increment is reasonable, dynamically calculated by combining average water consumption and water consumption fluctuation.
[0111] Specifically, the meter reader reads a preset multiplier from the system configuration. This multiplier is typically set to an empirical value, such as 3. The meter reader multiplies the standard deviation calculated in the previous step by this preset multiplier to obtain a correction value representing the normal fluctuation range. Then, the meter reader adds this correction value to the average water consumption increment calculated in the previous step. The result of this addition operation is ultimately determined as the preset increment threshold used for this verification. This dynamically generated preset increment threshold, compared to a fixed threshold, can better adapt to the fluctuations in water consumption habits of specific water meter users.
[0112] Step S203: If the reading increment is less than or equal to the preset increment threshold, the meter reading is confirmed as a valid meter reading.
[0113] In step S203, a valid meter reading refers to a final meter reading result that has passed the incremental rationality check and is recognized by the system as correct and reliable.
[0114] Specifically, when the comparison result in step S202 is that the reading increment is less than or equal to a preset increment threshold, the meter reader's control system determines that the current meter reading conforms to normal water usage patterns. The meter reader will mark the current meter reading as valid. Immediately afterwards, the meter reader will perform a crucial update operation: overwriting the original historical valid meter reading in local memory with this new valid meter reading. This operation ensures that the system will use the latest correct reading as the comparison benchmark for the next meter reading. After the update is completed, the meter reader can report the valid meter reading to the data center or terminate the current meter reading task.
[0115] Step S204: If the reading increment is greater than the preset increment threshold, the meter reading is marked as a suspicious reading and the re-meter reading process is triggered.
[0116] In step S204, a suspicious reading refers to a meter reading that fails the incremental reasonableness check and is initially judged by the system to be potentially erroneous. The re-meter reading process refers to an automated error correction mechanism that instructs the meter reader to perform a complete meter reading operation from scratch in order to obtain a correct reading.
[0117] Specifically, if the comparison result in step S202 shows that the reading increment is greater than a preset increment threshold, the meter reader's control system will consider the current reading abnormal. Possible reasons include image recognition errors, a surge in water meter usage within a short period, or data entry errors. The meter reader will mark this current reading as a suspicious reading and package it along with relevant image information into a log for subsequent analysis. The meter reader will not use this suspicious reading to update the historical valid meter readings in its local memory. Subsequently, the meter reader's control system will immediately issue an internal command to automatically trigger the re-meter reading process. This process will begin by adjusting the camera, performing focal length scanning, and acquiring image sequences, completely repeating all the meter reading steps.
[0118] The following describes a meter reading device based on an ultra-macro video meter reading instrument from the perspective of hardware processing in an embodiment of this invention. Please refer to [link to relevant documentation]. Figure 3 This is a schematic diagram of the structure of a meter reading device based on an ultra-macro video meter reading instrument in an embodiment of this application.
[0119] It should be noted that, Figure 3 The structure of the meter reading device based on the ultra-macro video meter reading instrument shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0120] like Figure 3As shown, a meter reading device based on a super macro video meter reading instrument includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage section 308 into a random access memory (RAM) 303, such as executing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for device operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0121] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.
[0122] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.
[0123] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0125] Specifically, a meter reading device based on an ultra-macro video meter reader in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements a meter reading method based on an ultra-macro video meter reader provided in the above embodiment.
[0126] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in a meter reading device based on a super macro video meter reading instrument as described in the above embodiments; or it may exist independently and not assembled into the meter reading device based on a super macro video meter reading instrument. The storage medium carries one or more computer programs, which, when executed by a processor of the meter reading device based on a super macro video meter reading instrument, cause the meter reading device to implement the meter reading method based on a super macro video meter reading instrument provided in the above embodiments.
Claims
1. A meter reading method based on an ultra-macro video meter reader, characterized in that, The method includes: The target mechanical water meter is pre-calibrated to identify the focal areas of the dial located on different planes. The focal areas include the pointer indication area and the digital scroll wheel area. Based on each of the aforementioned focal regions, the focal length range is determined; Based on the focal length range, the lens focus of the meter reading instrument is controlled to move smoothly within the focal length range, and the infrared supplementary light function and fog penetration function are activated according to the ambient light intensity and fog concentration to obtain a video frame sequence. Determine the pointer keyframe and the digital scroll wheel keyframe from the video frame sequence; Apply contour detection and angle recognition algorithms to the keyframes of the pointer to extract the pointer readings; A character recognition algorithm is applied to the keyframes of the digital scroll wheel to extract the digital scroll wheel readings; The pointer reading and the digital roller reading are combined to generate the meter reading.
2. The method according to claim 1, characterized in that, The pre-calibration of the target mechanical water meter, identifying the focal areas of the dial located on different planes, specifically includes: Semantic segmentation is performed on the dial image of the target mechanical water meter to obtain the initial contour information of each component of the dial; Analyze the depth gradient changes of the initial contour information to determine the height difference between the pointer indication area and the digital scroll wheel area; Based on the height difference and the lens's depth of field parameters, a three-dimensional spatial coordinate system is constructed, and the pointer indication area and the digital scroll wheel area are mapped onto different focal planes to generate the focal area.
3. The method according to claim 1, characterized in that, Determining the focal length range based on each of the aforementioned focal regions specifically includes: The lens of the meter reader is controlled to gradually adjust the focus position starting from the minimum focusing distance, and the modulation transfer function value of the pointer indication area and the digital roller area is recorded at each focus position; Determine the first optimal focal position corresponding to the peak value of the modulation transfer function of the pointer indication area and the second optimal focal position corresponding to the peak value of the modulation transfer function of the digital roller area, and calculate the depth of focus difference between the first optimal focal position and the second optimal focal position; Based on the depth-of-field difference value and the preset depth-of-field expansion coefficient, a minimum coverage focal length including the pointer indication area and the digital scroll wheel area is established, wherein the depth-of-field expansion coefficient is calculated based on the lens aperture value and magnification. Simulate the focus drift range under different installation angles and distances, and add the tolerance margin corresponding to the focus drift range to the minimum coverage focal length to obtain the focal length range.
4. The method according to claim 1, characterized in that, The activation of infrared supplementary lighting and fog penetration functions based on ambient light intensity and fog concentration specifically includes: The current ambient light intensity value is obtained by using the light sensor integrated into the meter reading device; The current ambient light intensity value is compared with a preset multi-level light threshold table to determine the supplementary light intensity level that matches the current light intensity value, and the corresponding infrared supplementary light function is activated based on the supplementary light intensity level. Acquire an initial environmental image and calculate an initial contrast index for the initial environmental image; The initial contrast index is compared with a preset multi-level clarity threshold table to determine the fog penetration intensity level corresponding to the current fog concentration, and the corresponding fog penetration function is activated based on the fog penetration intensity level.
5. The method according to claim 1, characterized in that, The step of determining the pointer keyframe and the digital scroll wheel keyframe from the video frame sequence specifically includes: Traverse each frame of the video frame sequence and perform noise reduction preprocessing on each frame; For each preprocessed frame, the Laplacian operator is invoked to calculate a first sharpness evaluation value within the pointer-indicated area and a second sharpness evaluation value within the digital scroll wheel area; The image frame with the highest first sharpness rating is retrieved and located to obtain the pointer keyframe; The image frame with the highest second sharpness rating is retrieved and located to obtain the digital scroll wheel keyframe.
6. The method according to claim 1, characterized in that, After combining the pointer reading and the digital roller reading to generate the meter reading, the method further includes: Retrieve historical valid meter readings from local memory and calculate the increment between the meter readings and the historical valid meter readings; The reading increment is compared with a preset increment threshold. If the reading increment is less than or equal to the preset increment threshold, the meter reading is confirmed as a valid meter reading. If the reading increment is greater than the preset increment threshold, the meter reading is marked as a suspicious reading, and the re-meter reading process is triggered.
7. The method according to claim 6, characterized in that, Before comparing the reading increment with a preset increment threshold, the method further includes: Obtain a historical reading sequence containing multiple past meter reading cycles; Based on the historical reading sequence, the average water consumption increment and standard deviation per unit time were calculated; The preset increment threshold is obtained by adding the average water consumption increment to the standard deviation of the preset multiple.
8. A meter reading device based on an ultra-macro video meter reading instrument, characterized in that, The meter reading device based on ultra-macro video meter reading instrument includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the meter reading device based on ultra-macro video meter reading instrument to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the meter reading device based on the ultra-macro video meter reading instrument, the meter reading device based on the ultra-macro video meter reading instrument performs the method as described in any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is run on the meter reading device based on the ultra-macro video meter reading instrument, the meter reading device based on the ultra-macro video meter reading instrument performs the method as described in any one of claims 1-7.