Multi-category instrument general reading method and system, electronic device, storage medium, program product

By adopting a universal reading method for multiple types of instruments and using a standardized reading architecture based on anchor point information and configuration files, the problems of poor universality and insufficient robustness of instrument readings in existing technologies are solved, and efficient, low-cost adaptation and accurate reading of multiple types of instruments are achieved.

CN123182202APending Publication Date: 2026-11-27SHENZHEN HUAZHIREN CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611455050.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing instrument reading technologies suffer from poor versatility, insufficient robustness, high adaptation costs, limited product coverage, deep coupling between identification and calculation, lack of fault tolerance mechanisms, fixed scale style assumptions, and high adaptation costs for new instruments.

Method used

It adopts a universal reading method for multiple types of instruments, and through the steps of benchmark construction, identification processing, correction processing, information transfer and reading calculation, it realizes the standardized reading of instruments by using anchor point information and configuration files. Combined with the degradation fusion strategy and dual verification mechanism, it supports the identification and calculation of multiple forms, multiple scales and multiple reading areas.

Benefits of technology

It enables instruments with different shapes, scales, and reading methods to complete identification and reading under the same process, reducing adaptation costs, improving robustness and accuracy, supporting automatic adaptation of multiple scale styles and reading areas, shortening the adaptation cycle by 80%, and reducing data annotation costs by 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182202A_ABST
    Figure CN123182202A_ABST
Patent Text Reader

Abstract

The application discloses a multi-category instrument general reading method and system, electronic equipment, a storage medium and a program product. The method comprises the following steps: acquiring a reference graph and a configuration file of a target type instrument; acquiring a working graph and performing target detection; solving a correction matrix based on anchor point information and performing perspective transformation to obtain a corrected graph; transplanting static information in the configuration file to the corrected graph; and identifying and calculating an instrument reading based on the corrected graph and the transplanted information. The application realizes deep decoupling of identification and calculation through "reference graph prestorage+template transplantation", realizes high robustness correction through hierarchical anchor points and degradation fusion, adapts to all scale styles through a "forward transformation-linear interpolation-inverse transformation" general architecture, realizes accurate deviation correction of a pointer through adaptive switching of a double imaging model, is suitable for multi-category instruments, supports linkage calculation of three types of reading areas, namely, a pointer, characters and a state, has low training cost, and greatly reduces the instrument identification landing and iterative maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a universal reading method for multiple types of instruments; it also relates to a universal reading system for multiple types of instruments. Furthermore, this invention relates to an electronic device, a computer-readable storage medium, and a computer program product for implementing the universal reading method for multiple types of instruments. Background Technology

[0002] Instrument readings are a crucial part of data acquisition in industrial settings and are widely used in industries and applications such as power, petroleum, chemical, water treatment, pharmaceuticals, and laboratory testing.

[0003] Existing instrument reading technologies are mainly divided into three categories:

[0004] (1) Traditional image processing methods: Extract pointer and scale features based on edge detection, Hough transform, template matching, etc. The drawbacks are that they are sensitive to changes in lighting, stains, occlusion, and reflection, have poor robustness, and can only be customized for a single type of instrument, with weak versatility.

[0005] (2) AI recognition method: Directly detect key features of the instrument based on networks such as YOLO and CNN. The drawback is that recognition and calculation are deeply coupled. In scenes with occlusion, stains, or reflections, the scale lines and numbers cannot be recognized, which will lead to the failure of the overall reading. In addition, different instruments need to be re-labeled and trained, resulting in high adaptation costs.

[0006] (3) Feature matching correction method: perspective correction is achieved based on feature point matching such as SIFT and ORB. The drawbacks are that there is no fault tolerance degradation mechanism, no anchor point hierarchical design, strict reliance on the coplanar assumption, and it is only suitable for circular uniform scale instruments, with a narrow coverage.

[0007] Analysis of existing technologies (such as CN121053668A, a method and system for intelligent recognition of scale instrument readings; CN119625749A, a method and system for recognizing electrical instrument readings based on key point mapping; CN121640435A, a method for reading pointer-type instruments based on image processing and target detection, etc.) reveals the following common technical deficiencies in the current field of instrument reading:

[0008] (1) No universal standardized architecture: each type of instrument corresponds to a set of algorithms, and the data structure, calculation logic and reading rules are not universal. New instruments need to be developed from scratch, and the maintenance cost is extremely high.

[0009] (2) Limited instrument category coverage: Most solutions only support round pointer instruments and are not compatible with square, elliptical, level gauge, translational and other multi-form instruments, nor do they support digital display and status-based mixed instruments.

[0010] (3) Deep coupling between recognition and calculation: The scale lines and numbers must be recognized in the working drawing in order to complete the reading. When there is obstruction, dirt, reflection, or insufficient lighting, the recognition failure will directly lead to the failure of the overall reading, resulting in insufficient robustness.

[0011] (4) No fault tolerance mechanism for correction: There is no anchor point layered fusion strategy and downgrade remediation mechanism. When the feature point matching is insufficient or of poor quality, the failure is directly corrected.

[0012] (5) No pointer height deviation correction: It generally relies on front shooting to avoid perspective shift, but does not solve the height perspective shift and error caused by pointer protrusion from a geometric level, resulting in a significant decrease in the accuracy of side shooting.

[0013] (6) Fixed scale style assumption: The scale is assumed to be uniform arithmetic distribution, and non-linear scales such as logarithmic, square root, negative logarithmic, reciprocal fraction and segmented mixed scales are not supported.

[0014] (7) High cost of adapting to new instruments: Adapting to new instrument models requires a large number of labeled samples and model retraining, resulting in a long implementation cycle and high cost.

[0015] (8) Data and logic are deeply bound together: There is no standardized hierarchical static data storage carrier. The scale coordinates, anchor point classification, and reading business rules are hard-coded in the program code. Instrument iteration and scale expansion require a lot of modification of the algorithm source code.

[0016] Therefore, there is an urgent need for a reading recognition solution that is versatile, robust, low-cost to adapt to, and covers multiple types of instruments. Summary of the Invention

[0017] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a universal reading method for multiple types of instruments that is highly versatile, robust, low in adaptation cost, and covers a wide range of categories, so as to solve at least one technical problem in the prior art, such as poor instrument recognition versatility, insufficient robustness, and high adaptation cost.

[0018] In addition, the present invention also provides a universal reading system for multiple types of instruments.

[0019] In addition, the present invention also provides an electronic device.

[0020] In addition, the present invention also provides a computer-readable storage medium.

[0021] In addition, the present invention also provides a computer program product.

[0022] The technical solution adopted by the universal reading method for multiple types of instruments of the present invention is as follows: The universal reading method for multiple types of instruments of the present invention includes the following steps:

[0023] S1: Benchmark Construction: For the target type of instrument, obtain a benchmark map, generate a configuration file based on the benchmark map, and construct the instrument's digital static information data architecture. The configuration file contains the instrument's anchor point information, scale information, and reading rule information.

[0024] S2: Identification and processing: Obtain the working image, perform target detection on the working image, and obtain the positioning information and dynamic target information of the instrument in the working image;

[0025] S3: Correction Processing: Based on the anchor point information in the configuration file and the anchor point information detected in the working diagram, solve the correction matrix, and use the correction matrix to perform perspective transformation on the instrument area in the working diagram to obtain the correction diagram;

[0026] S4: Information transfer: Transfer the static information in the configuration file to the annotation file of the correction diagram;

[0027] S5: Reading Calculation: Based on the correction diagram and the transplanted static information, identify and calculate the reading of the instrument.

[0028] The anchor point information includes correction anchor points, which are fixed points on the reference plane of the instrument, used to solve the correction matrix. The number of correction anchor points is redundant to ensure that there are still enough correction anchor points to calculate the correction matrix when some correction anchor points cannot be used during training and recognition. The anchor point information also includes verification anchor points, which are fixed points on the instrument that are not on the reference plane. The verification anchor points do not participate in solving the correction matrix and are used to verify the quality of the correction matrix and / or the anchor point annotation.

[0029] The verification anchor points are used to verify the correction matrix as follows: the verification anchor points are mapped to the correction image coordinate system through the correction matrix, and their offset from the coordinates of the reference image is calculated; if the offset conforms to the theoretical perspective distribution law of the corresponding imaging model, the correction matrix is ​​deemed to be of qualified quality; if the offset direction is chaotic and has no radial distribution law, the correction matrix is ​​deemed to have ill-conditioned distortion; the verification anchor points are used to verify the quality of the anchor point annotation as follows: under the premise that the quality of the correction matrix is ​​qualified, if the offset of a single verification anchor point exceeds the theoretical calculation value, the annotation of that verification anchor point is deemed to have an error.

[0030] In step S3, the correction matrix is ​​solved using a downgraded fusion strategy, which includes:

[0031] Level 1: Solve the homography transformation matrix using preset correction anchor points;

[0032] Second level: When the number of preset anchor points is insufficient, extract image feature points as supplementary anchor points and re-solve the homography transformation matrix;

[0033] Level 3: Solve for the affine transformation matrix when there are still insufficient anchor points;

[0034] Level 4: If none of the above levels can generate a qualified correction matrix, an alarm message will be output.

[0035] In step S3, after performing perspective transformation using the correction matrix, the image coordinates of the correction anchor points on the correction image coincide with those of the corresponding correction anchor points on the reference image.

[0036] The configuration file is a hierarchically structured storage configuration file, which contains at least one of the following nodes: image information node, instrument information node, annotation entity information node, anchor point information node, function area information node, and reading logic information node; the function area node contains at least one of character reading area data, status reading area data, and pointer reading area data.

[0037] The configuration file also includes information on the matching relationship between pointers and scale groups. The matching relationship is implemented through a globally unique numbering system. Each pointer, scale group, and measurement attribute set has an independent number. It supports at least one of the following mapping relationships: one pointer matching multiple scale groups, multiple pointers matching one scale group, and multiple pointers matching multiple scale groups. Each pointer matches at least one scale group and at least one measurement attribute set of that scale group.

[0038] The information transfer step includes: transferring at least one of the fixed area data from the scale annotation key points, character reading area annotation boxes, and status position annotation boxes in the configuration file to the annotation file of the correction diagram; and transferring the needle root key points and needle tip key points of the pointer in the reference diagram to the corresponding positions of the pointer in the correction diagram based on the pointer contour fitting results.

[0039] The reading calculation steps include: based on the relative positional relationship between the pointer and the scale, the reading is obtained by interpolation calculation using a "forward transformation-linear interpolation-inverse transformation" architecture. Specifically, the scale values ​​of the pointer's adjacent scales are mapped to a linear space through a forward transformation, linear interpolation is performed in the linear space to obtain the transformed reading, and then the reading is obtained through an inverse transformation.

[0040] The reading styles of the scale include at least one of the following: uniform, logarithmic, square root, negative logarithmic, reciprocal fraction, irregular, and any combination thereof; for segmented mixed scales, different interpolation intervals are divided by boundary markers, and each interval independently performs the "forward transformation - linear interpolation - inverse transformation" process.

[0041] When the scale is a closed loop scale, the connecting scale of the closed loop scale has dual scale values, and the interpolation calculation uses a wraparound interpolation logic to eliminate reading jumps at the start and end scale boundaries.

[0042] The pointer includes at least one of a rotating pointer and a translation pointer, and / or the pointer includes at least one of a physical pointer and a virtual pointer; the distribution shape of the scale includes at least one of a circle, a square, a sector, an ellipse, a polygon, and a straight line.

[0043] The reading calculation also includes the identification of the character reading area and the status reading area, as well as the joint calculation of at least two of the pointer reading area, character reading area and status reading area; the joint calculation is performed based on the joint reading rules stored in the configuration file in the form of expressions.

[0044] The expression supports at least one of the following operators: arithmetic operations, exponentiation, comparison operations, logical operations, and conditional operations. It supports switching the measurement attributes of the pointer reading area and / or character reading area based on the recognition result of the status reading area, and supports custom status description output.

[0045] Step S3 further includes a pointer height difference correction step: obtaining the height information of the pointer from the reference plane, correcting the position of the pointer based on the height information, and obtaining the true projection position of the pointer on the reference plane; the pointer height difference correction step includes: selecting an imaging model according to the normalized object distance, the imaging model including at least one of a parallel projection geometric model and a strict pinhole center perspective model.

[0046] When the normalized object distance is ≥3, a parallel projection geometric model is used; when the normalized object distance is <3, a strict pinhole center perspective model is used. The correction steps of the parallel projection geometric model include: fitting the global tilt angle using the least squares method based on the correction anchor point, calculating the outlier pixel offset Δpixel = h·S·tanθ, and calculating the true point coordinates based on the pixel offset and the unit perspective tilt vector, where h is the outlier height, S is the pixel density, and θ is the global tilt angle. The correction steps of the strict pinhole center perspective model include: solving the camera extrinsic parameters using the PnP algorithm based on the coplanar correction anchor point, solving the world coordinates of the outlier point by combining the outlier height constraint with the pinhole imaging equation, and mapping the world coordinates back to the reference map coordinate system to obtain the true point coordinates.

[0047] Step S3 further includes an image distortion correction step: performing distortion correction processing on the reference image and / or the working image; when the working image is a training image, the method further includes training an object detection model based on the training image and the corresponding annotation information; when the working image is an inference image, it is used for final reading recognition.

[0048] The target detection adopts the YOLO target detection model, and the detected objects include at least one of the instrument area, pointer area and anchor point area. For fixed shooting scenes, the correction matrix is ​​fixed after the first recognition, and only the pointer area is detected in the subsequent inference graph, and the correction matrix is ​​reused.

[0049] The instrument is an instrument with a pointer reading area, and the instrument includes at least one of the following: circular instrument, square instrument, elliptical instrument, polygonal instrument, level gauge, and translational instrument.

[0050] The technical solution adopted by the multi-category instrument universal reading system of the present invention is as follows: The multi-category instrument universal reading system of the present invention includes:

[0051] The benchmark module is used to acquire benchmark diagrams for the target type of instrument and generate configuration files to construct a digital static information data architecture for the instrument. The configuration files contain the anchor point information, scale information and reading rule information of the instrument.

[0052] The training module is used to train the target detection model based on the working image and its corresponding annotation information;

[0053] The reasoning module includes: a detection unit for performing target detection on the input working diagram to obtain instrument positioning information and dynamic target information; a correction unit for solving a correction matrix based on the anchor point information in the configuration file and the detected anchor point information, and using the correction matrix to perform perspective transformation to obtain a correction diagram; a transplantation unit for transplanting the static information in the configuration file to the annotation file of the correction diagram; and a reading calculation unit for identifying and calculating the reading of the instrument based on the correction diagram and the transplanted static information.

[0054] The extension module includes at least one of the following: an outlier correction unit, an anchor point labeling quality control unit, and a pointer height difference correction unit.

[0055] The outlier correction unit includes a parallel projection geometric model subunit and a strict pinhole center perspective model subunit, which automatically switches according to the normalized object distance; the anchor point annotation quality control unit is used to perform quality verification of the correction matrix and anchor point annotation; the pointer height difference correction unit is used to calculate the true point coordinates of the pointer key points on the correction map and update the correction annotation file.

[0056] The correction unit uses a downgraded fusion strategy to solve the correction matrix. The downgraded fusion strategy includes at least: solving the homography transformation matrix using preset correction anchor points; extracting image feature points as supplementary anchor points to solve the homography transformation matrix when the preset anchor points are insufficient; and solving the affine transformation matrix when the anchor points are still insufficient.

[0057] The technical solution adopted by the electronic device of the present invention is as follows: the electronic device includes a processor, a memory, and a computer program stored in the memory; when the processor executes the computer program, it implements the general reading method for multiple types of instruments.

[0058] The technical solution adopted by the computer-readable storage medium of the present invention is as follows: the storage medium stores a computer program, and when the computer program is executed by a processor, it implements the general reading method for multiple types of instruments.

[0059] The technical solution adopted by the computer program product of the present invention is as follows: the computer program product includes a computer program, which, when executed by a processor, implements the general reading method for multiple types of instruments.

[0060] The beneficial effects of this invention are as follows: This invention constructs a standardized reading architecture applicable to multiple types of instruments. With template construction and portability as the core architecture and a hierarchical structured configuration file as the unified data carrier, it combines technologies such as anchor point classification correction, degradation fault tolerance mechanism, universal interpolation framework, precise height difference correction, and multi-zone linkage rules. This enables instruments of different shapes, scales, and reading methods to complete identification and reading under the same process. It addresses the fundamental shortcomings of existing technologies—"one algorithm per type of instrument, poor universality, and high adaptation costs"—from an architectural perspective. Furthermore, it addresses issues related to perspective correction, scale calculation, pointer deviation, and multi-zone linkage. This paper proposes systematic solutions to address the pain points of various sub-technologies, including dynamic and other technical aspects. It constructs a unified and standardized reading system, integrating pointer, character, and status reading areas into a single management and calculation framework. A highly robust perspective correction and quality control system is established, proposing an anchor point role separation strategy, along with a degradation recovery mechanism and a dual verification system. A unified interpolation system with universal scale styles is established, breaking the fixed assumption of "default uniform scale" and natively supporting linear, non-linear, and segmented mixed scales. Precise geometric correction of pointer height perspective deviation is achieved, supporting industrial-grade reading accuracy in high-angle side-view shooting scenarios. This covers all instrument scenarios. It precisely addresses specific needs, natively supporting seamless reading with closed-loop scales, independent calculation of multiple pointers and scale groups, and linked calculation of multiple reading areas; it is equipped with lightweight inference capabilities, lowering the deployment threshold; suitable for intelligent reading recognition of various pointer instruments, level gauges, translation instruments, and digital display hybrid instruments in industrial and laboratory scenarios, covering various scale shapes such as circles, squares, ellipses, and polygons, and supporting various scale styles such as uniform scales, logarithmic scales, square root scales, negative logarithmic scales, reciprocal fractional scales, and segmented mixed scales, compatible with independent recognition and joint calculation of pointer, character, and status reading areas; and features in-architecture AI detection. Measurement is used solely as a lightweight target localization method, significantly reducing detection categories and training costs. All static information and reading rules related to the instrument itself are externalized to the configuration file. Adding a new instrument does not require modifying the algorithm kernel; only a baseline map and corresponding configuration file need to be created for adaptation. No modification to the core algorithm logic is required, shortening the adaptation development cycle by 80%. New instrument adaptation requires only 5-10 training image annotations, reducing data annotation costs by over 90%. Adopting a unified architecture across multiple categories significantly reduces instrument adaptation costs, fundamentally solving the high cost and low versatility problem of traditional solutions that rely on "one algorithm per type of instrument." Specifically, this includes:

[0061] (1) Strong versatility: By using a benchmark graph and configuration files, the differences between instruments are externalized. One algorithm framework can adapt to various instrument shapes such as round, square, elliptical, level gauge, and translation type, and cover various scale styles such as uniform, logarithmic, and square root. The unified "forward transformation - linear interpolation - inverse transformation" architecture natively supports linear, nonlinear and segmented mixed scales. All scale styles are automatically adapted. There is no additional development cost for nonlinear scales. The adaptation efficiency of multi-segment nonlinear instruments is significantly improved. The deployment cost of mixed instruments is reduced. The amount of code is small, the maintenance cost is low, and the scalability is strong.

[0062] (2) High robustness: recognition and calculation are decoupled, scale information is pre-stored in the configuration file, and the reference map pre-stores all stationary area information. Only the pointer and anchor point need to be detected during the inference stage, without the need for real-time scale recognition. The dial can still output readings stably even when there are partial obstructions, stains, or reflections. The success rate of recognition in complex industrial sites is more than 40% higher than that of traditional solutions.

[0063] (3) Strong fault tolerance: The degradation fusion strategy is adopted. When there are insufficient anchor points, the automatic degradation is avoided to prevent overall failure. The complete fault-tolerant link from optimal homography transformation to affine degradation can adaptively cope with complex field conditions such as anchor point occlusion, reflection loss, and image blurring. The effective reading rate of low-quality images is improved by 60%.

[0064] (4) High precision: By accurately correcting the height difference of the dual-model pointers, the perspective offset error in the side shooting scene is eliminated, and the reading accuracy of the side shooting reaches the industrial level. The relative error of the reading in the large tilt angle side shooting scene is reduced from 8% to 15% to less than 0.5%, which meets the high precision reading requirements of industrial instruments.

[0065] (5) Lightweight: AI only needs to detect a small number of targets, and at least one type of target needs to be detected. The number of model parameters is reduced by more than 60%, the training samples are small, the inference speed is increased by 50%, and it can be deployed on low computing power devices such as embedded inspection equipment and edge cameras.

[0066] (6) Low adaptation cost: The new instrument only needs to create a baseline diagram and configuration file, without modifying the algorithm code, which greatly reduces the cost of iteration and maintenance.

[0067] Similarly, the multi-category instrument universal reading system, electronic device, computer-readable storage medium, and computer program product of the present invention also have the above-mentioned beneficial effects. Attached Figure Description

[0068] Figure 1 This is a schematic diagram of a combined reading instrument with multiple types of reading zones.

[0069] Figure 2 This is a schematic diagram of an air temperature and humidity disc instrument with multiple pointers and multiple scale groups according to Embodiment 9 of the present invention;

[0070] Figure 3 This is a schematic diagram of the world coordinate system and image coordinate system according to an embodiment of the present invention;

[0071] Figure 4 This is a schematic diagram of an instrument, a reference diagram, a working diagram, a correction diagram, and anchor points, outliers, real points, and virtual points on it, according to an embodiment of the present invention.

[0072] Figure 5 This is a schematic diagram showing the key points of the pointer's root when the rotation center is hidden, according to an embodiment of the present invention.

[0073] Figure 6 This is a schematic diagram of the reference icon of the integrated temperature and pressure flow meter according to Embodiment 1 of the present invention;

[0074] Figure 7 This is a schematic diagram of the instrument identification diameter, camera distance, and normalized object distance according to an embodiment of the present invention;

[0075] Figure 8 This is a schematic diagram of the principle of perspective offset of the parallel projection geometric model in an embodiment of the present invention (the relationship between the deviation and tilt angle of the virtual point and the real point under the parallel ray of the camera).

[0076] Figure 9 This is a schematic diagram showing the relationship between anchor point distance and camera tilt angle under the parallel projection geometric model of this invention.

[0077] Figure 10 This is a schematic diagram of the parallel projection geometric model according to an embodiment of the present invention;

[0078] Figure 11 This is a schematic diagram of a strictly pinhole center perspective model according to an embodiment of the present invention;

[0079] Figure 12 This is a schematic diagram of the overall process of the universal reading method for multiple types of instruments according to an embodiment of the present invention;

[0080] Figure 13 This is a schematic diagram of the overall structure of the universal reading system for multiple types of instruments according to an embodiment of the present invention;

[0081] Figure 14 This is a flowchart illustrating the processing procedure of a single type of instrument in the reference module of the universal reading system for multiple types of instruments according to an embodiment of the present invention.

[0082] Figure 15 This is a flowchart illustrating the single-image processing procedure of the training module of the multi-category instrument universal reading system according to an embodiment of the present invention.

[0083] Figure 16 This is a schematic diagram of the anchor point fusion correction process with multi-level degradation remedy according to an embodiment of the present invention;

[0084] Figure 17 This is a flowchart illustrating the single-image inference process of the identification module of the universal reading system for multiple types of instruments according to an embodiment of the present invention.

[0085] Figure 18 This is a schematic diagram of the processing flow of the reference module for the identification item in the multi-category instrument universal reading system of this invention.

[0086] Figure 19 This is a schematic diagram of the processing flow of the training module for the identification item in the multi-category instrument universal reading system of this invention.

[0087] Figure 20 This is a schematic diagram of the processing flow of the inference module for the identification item in the multi-category instrument universal reading system of this invention. Detailed Implementation

[0088] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. The embodiments disclosed below are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the claims. Equivalent variations made according to the claims of the present invention shall still fall within the scope of protection of the present invention.

[0089] Unless otherwise defined herein, the terminology used herein has the same meaning as commonly understood in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the invention.

[0090] There are many types of instruments, and their dial structures and reading rules exhibit a high degree of diversity and irregularity. Generally speaking, the dial structures related to reading can be divided into three main categories: pointer reading areas, character reading areas, and status reading areas. For example... Figure 1 As shown, the same instrument can contain multiple different types of reading areas at the same time.

[0091] (I) Pointer Reading Area: This area consists of a pointer and a scale group. A single instrument may contain one or more pointers and one or more scale groups. Pointers and scale groups support many-to-many mapping: a single pointer can be paired with a single scale group or multiple scale groups, and multiple pointers can share a single scale group. Pointers are classified by their indicating method as rotary pointers (rotating around a fixed center of rotation) and translational pointers (translating along a straight line segment); by their form of existence as physical pointers (possessing a physical entity) and virtual pointers (lacking a physical entity, such as level dividing lines, flapper contact lines, and digital display indicating lines). Scale groups are classified by their distribution shape as linear scale groups and rotary scale groups (arc-shaped, square, elliptical, irregular, etc.); by their connection relationship as open scale groups and closed scale groups (connected scales have dual scale values); and by their reading style as regular (uniform, logarithmic, square root, negative logarithmic, reciprocal fraction, etc.), irregular, and segmented combination. Each scale group has four properties: physical quantity, unit, scale value, and multiplier, collectively referred to as a measurement attribute set. A scale group may have one or more measurement attribute sets.

[0092] (ii) Character reading area: The readings in this area are directly displayed as character values ​​using digital displays, rotary dials, etc., and can be read directly; it can also be equipped with one or more sets of measurement attributes.

[0093] (III) Status Reading Area: This area reads non-continuous discrete status values, such as on / off, high / medium / low, normal / alarm, active / reactive / apparent, etc., which are mostly realized through indicator lights, knobs, and buttons. Each status reading area has several status groups, and each status group contains one or more status bits.

[0094] (iv) Reading format: Most pointer reading areas and character reading areas are numerical readings, while some instruments are non-numerical (such as compasses); the status reading areas are all non-numerical status values.

[0095] like Figure 3 , Figure 4 , Figure 7 , Figure 9 As shown, the following are the definitions and related explanations of the terms used in this invention:

[0096] Reference image: A standard reference image taken directly from the instrument when the camera's optical axis is perpendicular to the reference plane. It must be clear, without distortion, obstruction, dirt, or reflection, and with uniform lighting. Each type of instrument corresponds to a unique reference image and a unique configuration file.

[0097] Configuration file: A standardized data file based on benchmark annotations, instrument parameters, reading rules, etc. It is stored in a hierarchical structure such as JSON and serves as the static data carrier for the entire general architecture.

[0098] Working image: Instrument images captured by a camera in any orientation in the actual field.

[0099] Training graph: A working graph used for training AI models.

[0100] Inference graph: A working graph used for final reading identification.

[0101] Image to be corrected: The image obtained by cropping each instrument from the working drawing.

[0102] Correction image: A frontal view image similar to the reference image, obtained by performing perspective transformation on the image to be corrected using a correction matrix, based on the reference image. The correction image and the reference image have a fixed area overlap relationship—they are the same size, and the positions, shapes, and sizes of all visible fixed areas on the reference plane are completely identical. Each image to be corrected and its corresponding correction image have only one instrument.

[0103] Anchor points: Fixed points on the instrument with obvious visual characteristics, each anchor point has a globally unique number. They are divided into two categories based on function: correction anchor points and verification anchor points; and into two categories based on generation method: preset anchor points and feature anchor points.

[0104] Correction anchor points: all located on the reference plane, used to establish the projection transformation relationship between the working drawing and the reference drawing, participate in the solution of the correction matrix, and strictly satisfy the coplanar constraint.

[0105] Verification anchor points: These are outlier fixed points that are not on the reference plane (they can be higher or lower than the reference plane), such as shell screws, nameplate corners, fixed protrusions, pointer rotation centers, etc. They do not participate in the solution of the correction matrix and are only used for verification of the correction matrix and annotation quality.

[0106] Preset anchor points: Anchor points marked manually or with software assistance on the baseline map and training map.

[0107] Feature anchor points: planar feature points automatically extracted using feature matching algorithms such as SIFT / ORB / AKAZE.

[0108] World coordinate system: A three-dimensional coordinate system (O-XYZ) of the real physical world, with units in mm. In this invention, the reference plane of the instrument is taken as the XOY plane of the world coordinate system. The direction of the normal of the reference plane pointing towards the camera side is the Z-axis of the world coordinate system, and the origin is the centroid of the corresponding position of each anchor point on the image to be calibrated on the reference image. Different types of instruments have their own world coordinate systems.

[0109] Image coordinate system: A two-dimensional coordinate system (o-xy) on the image, with units of pixels (px). The origin is the top-left pixel of the image, the x-axis points to the right, and the y-axis points downwards. Each image has its own image coordinate system.

[0110] Virtual and Real Points: The pixels that appear on the corrected image after outlier transformation by the correction matrix are virtual points; the points on the reference plane that are perpendicularly projected from outliers along the Z-axis of the world coordinate system are real points. There is a perspective offset between real and virtual points, and the position of the real points needs to be obtained through offset calculations.

[0111] Reference plane: The plane on the instrument that minimizes reading error. It has a sufficient number of identifiable fixed points and is typically the dial surface. Outliers are points not on the reference plane. The height of an outlier is the perpendicular orthogonal distance from the outlier to the reference plane.

[0112] Pixel density: The number of pixels corresponding to one millimeter of physical length on a reference plane, measured in pixels per millimeter (px / mm). It serves as a bridge between physical size and image size.

[0113] Normalized object distance: The ratio of camera distance to the diameter read by the instrument. When k≥3, it is a far-field shooting scene, using a parallel projection geometric model; when k<3, it is a near-field shooting scene, using a strict pinhole center perspective model.

[0114] Camera tilt angle: The angle between the optical axis of the working camera and the normal of the reference plane of the instrument being photographed, with a value of [0°, 90°].

[0115] Camera intrinsic parameters: The camera's own internal parameters, including the intrinsic parameter matrix K (3×3), radial distortion coefficient, tangential distortion coefficient, etc.

[0116] Camera extrinsic parameters: External parameters used by the camera, including the rotation matrix R (3×3) and the translation vector t (3-dimensional column vector).

[0117] Correction matrix H: 3×3 homography transformation matrix or 2×3 affine transformation matrix, describing the projection transformation relationship of a point on the same plane between two images from different viewpoints.

[0118] The imaging equation for a pinhole camera is: s[x,y,1] T = K(R[X,Y,Z] T + t), used for the mutual conversion between world coordinates and image coordinates in a strict pinhole center perspective model, where K is the camera intrinsic matrix, R is the rotation matrix, t is the translation vector, and s is the depth scale factor.

[0119] Perspective tilt vector: When shooting at an angle in the far field, the global tilt direction and degree of the camera relative to the instrument reference plane is the basis for the direction and degree of elevation correction. The unit perspective tilt vector only represents the direction.

[0120] like Figure 12 As shown, the universal reading method for multiple types of instruments in this embodiment is a universal visual recognition reading method for multiple types of instruments based on the decoupling of hierarchical anchor point correction and template transplantation, including the following steps:

[0121] S1: Benchmark Construction: For the target type of instrument, obtain a benchmark map, generate a configuration file based on the benchmark map, and construct a digital static information data architecture for the instrument. The configuration file contains the anchor point information, scale information, and reading rule information of the instrument. This process only needs to be performed once for each type of instrument participating in the identification and is completed before training and inference.

[0122] S2: Identification and processing: Obtain the working image, perform target detection on the working image, and obtain the positioning information and dynamic target information of the instrument in the working image;

[0123] S3: Correction Processing: Based on the anchor point information in the configuration file and the anchor point information detected in the working diagram, solve the correction matrix, and use the correction matrix to perform perspective transformation on the instrument area in the working diagram to obtain the correction diagram;

[0124] S4: Information transfer: Transfer the static information in the configuration file to the annotation file of the correction diagram;

[0125] S5: Reading Calculation: Based on the correction diagram and the transplanted static information, identify and calculate the reading of the instrument.

[0126] Specifically, the anchor point information includes correction anchor points, which are fixed points on the reference plane of the instrument, used to solve the correction matrix. The number of correction anchor points is redundant to ensure that there are still enough correction anchor points for identification and calculation of the correction matrix when some correction anchor points cannot be used during training and recognition (such as being occluded or only a part of the instrument is visible). The anchor point information also includes verification anchor points, which are fixed points on the instrument that are not on the reference plane. The verification anchor points do not participate in solving the correction matrix and are used to verify the quality of the correction matrix and / or the anchor point annotation.

[0127] The redundancy in the number of correction anchor points has at least two advantages: (1) Robustness in strong interference scenarios: When the working diagram has adverse conditions such as partial occlusion, stains, and reflections, even if the number of identifiable effective anchor points is less than the total number of annotations on the baseline diagram, the correction matrix can still be stably solved by relying on the remaining effective anchor points. (2) Local shooting adaptation scenarios: When the working diagram only captures a local area of ​​the instrument, as long as there are enough effective correction anchor points in that area, the correction and reading recognition of that area can still be completed normally. For example, for a water meter that simultaneously sets up a digit wheel reading display area and multiple small pointer display areas, if it is only necessary to obtain the measurement value of the digit wheel reading area, a miniature camera can be attached to the surface of the water meter and only the digit wheel reading area can be photographed. The model training and inference recognition can still be completed by relying on the redundant correction anchor points in that area.

[0128] Furthermore, a dual verification mechanism is adopted. The verification anchor points verify the correction matrix (correction matrix quality verification) in the following way: the verification anchor points are mapped to the correction image coordinate system through the correction matrix, and their offset from the coordinates of the reference image is calculated; if the offset conforms to the theoretical perspective distribution law of the corresponding imaging model, the correction matrix is ​​deemed to be of qualified quality; if the offset direction is chaotic and there is no radial distribution law, the correction matrix is ​​deemed to have pathological distortion (such as local qualified but global distortion caused by collinear anchor points or concentrated distribution); the verification anchor points verify the anchor point annotation quality (annotation quality verification) in the following way: under the premise that the correction matrix quality is qualified, if the offset of a single verification anchor point exceeds the theoretical calculation value, the annotation of the verification anchor point is deemed to have an error, realizing accurate troubleshooting of single-point faults.

[0129] In this implementation, anchor point classification is combined with dual verification, which improves both correction accuracy and fault diagnosis efficiency: the roles of correction anchor points and verification anchor points are separated, ensuring the coplanar constraint of the homography matrix from the source, and improving the planar correction accuracy by 30%; dual verification can accurately distinguish between "ill-conditioned distortion of the correction matrix" and "single-point labeling error", improving the dataset quality control efficiency by an order of magnitude.

[0130] Furthermore, in step S3, the correction matrix is ​​solved using a downgraded fusion strategy (downgraded fusion correction), which includes:

[0131] Level 1 (Optimal Mode): Solve the homography transformation matrix using preset correction anchor points. When there are ≥4 preset correction anchor points and the RANSAC in-point ratio meets the standard, directly solve the optimal homography correction matrix.

[0132] Level 2 (Feature Supplementation Mode): When the number of preset anchor points is insufficient, image feature points are extracted as supplementary anchor points using algorithms such as SIFT / ORB / AKAZE, and the homography transformation matrix is ​​re-solved.

[0133] Level 3 (Affine Degradation Mode): Solve for the affine transformation matrix when there are still insufficient anchor points;

[0134] Level 4 (Failure Alarm Mode): When none of the above levels can generate a qualified correction matrix, an alarm message is output.

[0135] In step S3, after performing perspective transformation using the correction matrix, the image coordinates of the correction anchor points on the correction image coincide with those of the corresponding correction anchor points on the reference image.

[0136] Specifically, the configuration file is a hierarchically structured storage configuration file, containing the following nodes: image information node, instrument information node, annotation entity information node, anchor point information node, functional area information node, and reading logic information node; the functional area node contains character reading area data, status reading area data, and pointer reading area data. The configuration file also includes pointer and scale group matching information. This matching relationship is implemented through a globally unique numbering system, enabling flexible binding. Each pointer, scale group, and measurement attribute set has an independent number. The configuration file defines the matching relationship between pointers, scale groups, and measurement attribute sets. During inference, each pointer is solved independently without interference. It supports any mapping relationship where one pointer matches multiple scale groups (e.g., a clock with hour, minute, and second hands), multiple pointers match one scale group (e.g., a saturated vapor pressure thermometer), or multiple pointers match multiple scale groups, enabling independent calculation of multiple pointers and multiple scale groups. Each pointer must match at least one scale group, and each scale group must match at least one measurement attribute set; that is, each pointer must match at least one scale group and at least one measurement attribute set of that scale group. For example, a clock has three hands (hour hand ph, minute hand pm, second hand ps) and a scale group s. This scale group s has three sets of measurement attributes (units are hour ah, minute am, and second as). The hour hand ph corresponds to s and ah, the minute hand pm corresponds to s and am, and the second hand ps corresponds to s and as. Similarly, a pressure gauge has one hand and one scale group, but this scale group has two sets of measurement attributes (units are Pa and bar). Therefore, the hand corresponds to this scale group, but simultaneously corresponds to both sets of measurement attributes.

[0137] The configuration file specifically includes the following nodes:

[0138] image_info: Basic information about the baseline image (filename, size, pixel density, camera intrinsics).

[0139] meter_info: The unique type number and type description of the meter.

[0140] annotated_regions: The number and annotation information of each annotated entity (anchor point, character reading area, status bit, pointer, needle tip and needle root, scale).

[0141] anchors: A list of anchor point numbers for correction and verification.

[0142] functional_regions: Functional area data - Character reading area (number, display type, measurement attribute set), status reading area (status group number, status bit number, mutual exclusion relationship), pointer reading area (pointer number and type, needle root and needle tip number, matching scale group and measurement attribute set, common rotation center pointer group), scale group (number, scale number list, measurement attribute set including physical quantity / unit / multiplier / scale value sequence / reading style identifier / auxiliary parameter).

[0143] last_reading_logic_formulas: The final reading logic expression (physical quantity, calculation formula, unit, state description).

[0144] Furthermore, the information transfer step includes: transferring at least one of the fixed area data from the scale annotation key points, character reading area annotation boxes, and status position annotation boxes in the configuration file to the annotation file of the correction diagram; and transferring the needle root key points and needle tip key points of the pointer in the reference diagram to the corresponding positions of the pointer in the correction diagram based on the pointer contour fitting results.

[0145] Furthermore, the reading calculation step includes: based on the relative positional relationship between the pointer and the scale, an interpolation calculation is performed using a "forward transformation-linear interpolation-inverse transformation" architecture to obtain the reading. Specifically, the scale values ​​of adjacent scales of the pointer are mapped to a linear space through a forward transformation, linear interpolation is performed in the linear space to obtain the transformed reading, and then an inverse transformation is performed to obtain the reading. That is, a unified three-stage architecture is adopted.

[0146] (1) Forward transformation: Based on the scale reading style stored in the configuration file, the nearest left and right scale values ​​are linearized by forward transformation; for segmented mixed scales, the pointer interval is determined by the delimiter and the corresponding forward transformation function is called.

[0147] (2) Linear interpolation: In linear space, linear interpolation is performed based on the ratio of pointer angle (rotation pointer) or distance (translation pointer) to obtain the transformed reading; the difference between the pointer reading transformed value and the left scale transformed value, and the difference between the right scale transformed value and the pointer reading transformed value, are equal to the ratio of the left and right angles (or left and right distances).

[0148] (3) Inverse transformation: Perform the corresponding inverse transformation on the transformed reading to restore it to the direct reading.

[0149] The transformation relationships of each reading style are as follows:

[0150] Reading style Forward transform f(s) <![CDATA[Inverse transform f -1 (t)]]> linear s t logarithmic ln s <![CDATA[e t ]]> Square root √s <![CDATA[t 2 ]]> negative logarithm -ln s <![CDATA[-e t ]]> reciprocal fraction 1 / (s+R) 1 / t - R Irregular No transformation No transformation

[0151] For segmented mixed scales, each segment executes the above process independently, and the calculations between segments are completely isolated. In the reciprocal fraction, R can be calculated by the scale values ​​s1 and s2 of the left and right scales and the angles (distances) L1 and L2 between them and the starting scale: R = (s2·L2- s1·L1) / ( L1 - L2), or directly input.

[0152] The reading styles of the scale include at least one of the following: uniform, logarithmic, square root, negative logarithmic, reciprocal fraction, irregular, and any combination thereof; for segmented mixed scales, different interpolation intervals are divided by boundary markers, and each interval independently performs the "forward transformation - linear interpolation - inverse transformation" process.

[0153] When the scale is a closed-loop scale (such as a clock scale), the connecting scales of the closed-loop scale have dual scale values ​​(starting value and ending value). The interpolation calculation uses a wraparound interpolation logic to eliminate the reading jump problem at the starting and ending scale boundaries. For example, if the 12 o'clock mark on a clock is marked as (0, 12), when the hand is between 11 and 12, the calculation uses 12 as the upper bound to avoid jumping to 0. Therefore, seamless processing of the closed-loop scale is achieved, with no reading jumps across all angles.

[0154] The pointer includes at least one of a rotating pointer and a translation pointer, and / or the pointer includes at least one of a physical pointer and a virtual pointer; the distribution shape of the scale includes at least one of a circle, a square, a sector, an ellipse, a polygon, and a straight line.

[0155] Furthermore, the reading calculation also includes the identification of the character reading area and the status reading area, as well as the joint calculation of at least two of the pointer reading area, character reading area, and status reading area. All three types of reading areas are uniformly managed in a configuration file, and the joint calculation is executed based on the joint reading rules stored in the configuration file in the form of expressions. The expressions support at least one of the following operators: arithmetic operations, exponentiation, comparison operations, logical operations, and conditional operations. They also support switching the measurement attributes of the pointer reading area and / or the character reading area based on the identification result of the status reading area, and support custom status descriptions (over-limit, normal, alarm, etc.) output.

[0156] Furthermore, step S3 also includes a pointer height difference correction step: obtaining the height information of the pointer from the reference plane, correcting the position of the pointer based on the height information, and obtaining the true projection position of the pointer on the reference plane; the pointer height difference correction step includes: selecting an imaging model according to the normalized object distance, the imaging model including a parallel projection geometric model and a strict pinhole center perspective model.

[0157] like Figure 10 , Figure 11As shown, two imaging models are automatically switched based on the normalized object distance. Specifically, when the normalized object distance is ≥3, a parallel projection geometric model is used; when the normalized object distance is <3, a strict pinhole center perspective model is used. The correction steps of the parallel projection geometric model include: Figure 8 As shown, based on the correction anchor points, the global tilt angle is fitted using the least squares method to calculate the outlier pixel offset Δpixel = h·S·tanθ. Based on the pixel offset and the unit perspective tilt vector u, the true point coordinates are calculated: true point coordinates = virtual point coordinates - Δpixel·u, where h is the outlier height, S is the pixel density, and θ is the global tilt angle. The correction steps of the strict pinhole center perspective model include: converting the correction anchor point coordinates on the reference image to world coordinates (divided by pixel density, Z=0); solving the camera extrinsic parameters R and t based on the coplanar correction anchor points using the PnP algorithm; inversely mapping the virtual points back to the pixel coordinate system of the image to be corrected using the correction matrix; and combining the outlier height Z=h with the pinhole imaging equation s[x,y,1]. T = K(R[X,Y,h] T + t), solve for the world coordinates (X,Y); multiply the world coordinates by the pixel density and add the centroid coordinates to obtain the true point coordinates.

[0158] Furthermore, step S3 also includes an image distortion correction step: performing distortion correction processing on the reference image and / or the working image; when the working image is a training image, the method further includes training an object detection model based on the training image and the corresponding annotation information; when the working image is an inference image, it is used for final reading recognition.

[0159] Furthermore, the target detection employs the YOLO target detection model, and the detected objects include the instrument frame, pointer area, and anchor point area. For fixed shooting scenes, the correction matrix is ​​fixed after the first recognition, and only the pointer area is detected in subsequent inference graphs, thus reusing the correction matrix. This embodiment is based on a template porting decoupling architecture. During the training phase, the YOLO model only needs to label three types of core targets (instrument frame, pointer, and anchor point), without labeling scales and numbers, greatly reducing the training sample size. In fixed camera scenes, this can be further compressed to detecting only pointers (one type of target). The correction matrix is ​​fixed and reused after the first deployment, reducing the number of parameters by more than 60% and increasing the inference speed by 50%. After the correction matrix is ​​fixed, the single-frame inference time is <50ms, which can support real-time monitoring models of multiple video streams and can be deployed on low-computing-power edge devices, such as fixed camera scenes. It is a lightweight AI inference architecture.

[0160] In this embodiment, the instrument is an instrument with a pointer reading area, and the instrument includes at least one of the following: circular instrument, square instrument, elliptical instrument, polygonal instrument, level gauge, and translational instrument.

[0161] like Figure 13 As shown, the multi-category instrument universal reading system of this embodiment is a multi-category instrument universal reading system based on hierarchical anchor point correction and template transplantation decoupling, including:

[0162] The benchmark module is used to acquire benchmark maps for the target type of instrument and generate configuration files to construct a digital static information data architecture for the instrument. The configuration files contain anchor point information, scale information and reading rule information of the instrument. This module only needs to be executed once for each type of instrument participating in the identification and is completed before training and inference.

[0163] The training module is used to train the target detection model based on the working graph and its corresponding annotation information;

[0164] The reasoning module includes: a detection unit for performing target detection on the input working diagram to obtain instrument positioning information and dynamic target information; a correction unit for solving a correction matrix based on the anchor point information in the configuration file and the detected anchor point information, and using the correction matrix to perform perspective transformation to obtain a correction diagram; a transplantation unit for transplanting the static information in the configuration file to the annotation file of the correction diagram; and a reading calculation unit for identifying and calculating the reading of the instrument based on the correction diagram and the transplanted static information.

[0165] The extended module includes an outlier correction unit, an anchor point annotation quality control unit, and a pointer height difference correction unit, designed for use in high-precision scenarios. Specifically, the outlier correction unit comprises a parallel projection geometric model subunit and a strict pinhole center perspective model subunit, automatically switching based on the normalized object distance. The anchor point annotation quality control unit performs quality checks on the correction matrix and anchor point annotations. The pointer height difference correction unit calculates the true coordinates of pointer key points on the correction image and updates the correction annotation file. The correction unit employs a degradation fusion strategy to solve the correction matrix. This strategy includes: using preset correction anchor points to solve the homography transformation matrix; extracting image feature points as supplementary anchor points when preset anchor points are insufficient to solve the homography transformation matrix; and solving the affine transformation matrix when anchor points are still insufficient.

[0166] The entire architecture described above uses configuration files as the unified data architecture and template portability as the core logic. All differences in instruments are defined through configuration files, and the underlying algorithm process is completely unified.

[0167] like Figures 14-17 As shown, the specific descriptions of each module are as follows:

[0168] (a) Baseline Module

[0169] This process only needs to be executed once for each type of instrument involved in the identification, and it is completed before training and inference.

[0170] S00 baseline map construction: Collect baseline maps that meet the requirements.

[0171] S01 baseline icon annotation:

[0172] S010: Assign a unique type number to the instrument.

[0173] S011: The character reading area is labeled with a rotating rectangle and a unique number.

[0174] S012: Status bits are labeled with a rotated rectangle and have a unique number; status groups are uniquely numbered, and status bits are assigned to the corresponding status groups.

[0175] S013: The pointer is labeled with a rotating rectangle and a unique number; input the pointer type (rotational / translation). The base and tip of the pointer are labeled with key points and unique numbers, and associated with the corresponding pointers. The ray pointing from the base to the tip indicates the pointer direction. For pointers with a hidden rotation center, the rotation center can be determined by rotating the pointer twice and marking the overlapping lines; the intersection point is the rotation center. Figure 5 As shown.

[0176] S014: Each scale group has a unique number, and the scale points are marked with key points and unique numbers; further marking of secondary or even tertiary scales can be added to improve accuracy.

[0177] S015: Anchor points should be marked with key points and unique numbers, and at least correction anchor points should be marked. Anchor points should be distributed as widely and evenly as possible on the dashboard.

[0178] S02 Instrument Rule Input:

[0179] S020: Input the reading style for each scale group (uniform, logarithmic, square root, negative logarithmic, reciprocal fraction, irregular, and segmented combination).

[0180] S021: Input each set of measurement attributes (physical quantity, unit, multiplier), with a unique number for each set.

[0181] S022: Input a sequence of labeled scale values. Convert non-numerical scale values ​​to numerical values; mark closed scales with double scale values; mark segmented mixed scales with delimiters.

[0182] S023: Input the matching relationship between each pointer and the scale group and measurement attribute set.

[0183] S024: Input the constraint relationship of multiple pointers sharing the same rotation center.

[0184] S025: Measurement attribute set for input character reading area.

[0185] S026: The relationship between input status groups and status bits and the rules for determining status.

[0186] S027: Input the final reading rule, supporting expression-based definition (including arithmetic operations, exponentiation, comparison operations, logical operations, conditional operations, cross-zone value retrieval, etc.).

[0187] S03 Configuration File Processing: Organize, check, and convert configuration files to form a format that is consistent, complete, and program-processable.

[0188] (II) Training Module

[0189] S10 training image acquisition: Acquired using methods such as fixed camera and moving camera.

[0190] S11 Training Icon Annotation: Mark the location and type of each instrument (number and baseline) Figure 1 To), each pointer, each anchor point (numbered and referenced) Figure 1 (To). Mark as many anchor points as possible.

[0191] S12 Annotation File Processing: Organize, check, and convert training annotation files.

[0192] Obtaining and annotating the S13 single-instrument calibration diagram:

[0193] S130: Obtain the image to be corrected by cropping the instrument area from the training image, and obtain the annotation file to be corrected by coordinate offset.

[0194] S131: Solve the correction matrix using a method with degradation remedy.

[0195] S132: Use the correction matrix to transform the perspective of the image to be corrected into a corrected image.

[0196] S14 AI Recognition Training: Trained using models such as YOLO to recognize gauges (label boxes and type numbers), pointers (label boxes and numbers), and anchors (key points and numbers).

[0197] (III) Reasoning Module

[0198] S20 Reasoning Graph Acquisition.

[0199] S21 Instrument AI Recognition: Utilizes a trained model to identify instruments, pointers, and anchor points in the reasoning graph. For fixed camera scenes, results can be saved after the first recognition.

[0200] S22 Acquisition and recognition of single instrument calibration diagram: Same as training module S13.

[0201] S23 Annotation Information Porting (Template Porting):

[0202] S230: Fixed Area Data Transfer - Copy all fixed area data (scale annotation key points, character reading area annotation boxes, status bit annotation boxes) related to readings from the baseline map and configuration file to the correction map and correction annotation file.

[0203] S231: Pointer contour fitting and key point transplantation - The key points of the pointer root and tip in the reference image are transplanted to the corresponding positions of the pointer in the correction image through contour fitting.

[0204] S24 Correction Chart Reading Recognition:

[0205] S240: Pointer reading area reading calculation - based on the "forward transformation - linear interpolation - inverse transformation" architecture.

[0206] S241: Character reading area reading recognition - using OCR models such as EasyOCR.

[0207] S242: Status reading area reading recognition - using conventional image recognition technology.

[0208] S243: Final reading calculation - Calculated according to the final reading rules in the configuration file.

[0209] (iv) Extension Module

[0210] For applications requiring high precision, it includes an outlier correction module S30, an anchor point marking quality verification module S31, and a pointer height difference reading correction module S32.

[0211] S30 Outlier Correction Module:

[0212] S300: Image distortion removal – using checkerboard calibration or OpenCV's undistort function for distortion removal.

[0213] S301: Parallel projection geometric model (k≥3) - Based on the correction anchor point, the global tilt angle is fitted by the least squares method, and the outlier pixel offset Δpixel = h·S·tanθ is calculated. The real point coordinates = virtual point coordinates - Δpixel·u.

[0214] S302: Strict pinhole center perspective model (k<3) - The coordinates of the reference image correction anchor points are converted into world coordinates. The camera extrinsic parameters are solved using the PnP algorithm. The world coordinates of outliers are solved by solving the pinhole imaging equations simultaneously. The coordinates of the real points are then mapped back to the reference image.

[0215] S31 Anchor Point Marking Quality Verification Module:

[0216] S310: The configuration file is supplemented to verify the anchor points and their height, pixel density, and camera intrinsic parameters.

[0217] S311: Supplement and verify anchor point annotations and camera intrinsic parameters in the working annotation file.

[0218] S312: Dual verification: Function 1 is to verify the quality of the correction matrix - verify whether the anchor point offset conforms to the theoretical perspective distribution and identify pathological distortion; Function 2 is to verify the quality of the annotation - if the single point offset exceeds the threshold, the anchor point is judged to be incorrectly labeled.

[0219] S32 Pointer Elevation Difference Reading Correction Module: The configuration file is supplemented with pointer key point height, pixel density, and camera intrinsic parameters; the working file is supplemented with camera intrinsic parameters; the imaging model is selected based on the normalized object distance to calculate the pointer's true point coordinates and update the correction annotation file.

[0220] For a recognition project, it's necessary to process multiple instruments and images, which may have varying accuracy requirements. Accordingly, a corresponding overall processing flow needs to be expanded based on the baseline module, training module, and inference module. Figures 18-20 The above three modules are used to identify the overall call flow of the project.

[0221] Based on the same principle as the universal reading method and system for multiple types of instruments in this embodiment, this embodiment also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it implements the universal reading method for multiple types of instruments described in this embodiment. The processor may be a CPU, GPU, etc., and the memory may be RAM, ROM, EEPROM, CD-ROM, disk storage medium, or any other medium capable of carrying or storing a computer program and capable of being read by a computer. No limitation is made here. The electronic device may be a computer, tablet computer, or smartphone, etc.

[0222] This embodiment also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the multi-category instrument universal reading method described in this embodiment. The readable storage medium may be RAM, ROM, EEPROM, SSD, CD-ROM, DVD, USB flash drive, or any other storage medium that can be used to carry or store the computer program and can be read by a computer.

[0223] This embodiment also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the universal reading method for multiple types of instruments described in this embodiment.

[0224] It should be understood that although arrows indicate the steps in the flowcharts of this embodiment, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated otherwise, in this embodiment, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed simultaneously, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this embodiment does not limit this.

[0225] The following are further examples of specific implementation scenarios for each step of the instrument reading process.

[0226] Example 1: Building the instrument's configuration file

[0227] Scenario definition: Before training and inference, each type of instrument needs to complete the annotation of benchmark icons and the construction of configuration files, which is the foundation for the implementation of the general architecture.

[0228] Input conditions: frontal reference diagram, instrument instruction manual.

[0229] Implementation steps: Invoke the benchmark module, and sequentially execute benchmark icon annotation, rule entry, and data verification to generate a standardized JSON configuration file. The configuration file covers six top-level nodes: image_info (basic information of the benchmark image), meter_info (instrument number and type), annotated_regions (annotated entity information), anchors (list of calibration / verification anchor points), functional_regions (functional area data: properties of character reading area / status reading area / pointer reading area), and last_reading_logic_formulas (final reading logic expression).

[0230] The configuration file example structure is as follows (e.g.) Figure 6 As shown, taking an integrated temperature and pressure flow meter as an example):

[0231] • image_info: Stores filename, size, pixel density, and camera intrinsics.

[0232] • meter_info: meter_class_id is “meter_0_1”, and type is “temperature and pressure integrated flow meter”.

[0233] • annotated_regions: Stores the numbering and annotation information for each anchor point, character reading area, status bit, pointer, scale, needle tip and needle root.

[0234] • Anchors: correction_anchors contains the numbers of the scale points and dedicated anchor points; calibration_anchors contains the numbers of the calibration anchor points and outliers such as the pointer root.

[0235] •functional_regions.symbol_reading_areas: Character reading area n1, metering attribute set n1_as_1 (physical quantity "flow rate", unit m³ / h, multiplier 1.0).

[0236] •functional_regions.status_reading_areas: The status group st_f contains status bits st1 and st2, which are mutually exclusive.

[0237] • functional_regions.point_reading_areas: Pointer p1 (pressure pointer, rotary, needle root p1_r, needle tip p1_t, matching scale group s1 and measurement attribute set s1_as_1); Pointer p2 (temperature pointer, matching scale group s2 and measurement attribute set s2_as_1). Scale group s1 contains a list of scale numbers and a measurement attribute set (physical quantity "pressure", unit bar, multiplier 1.0, scale value sequence [0,2,4,...,16], reading style "linear"); scale group s2 is similar (physical quantity "temperature", unit ℃, scale value sequence [0,10,20,...,120]).

[0238] • last_reading_logic_formulas: Three final readings (pressure, temperature, flow rate), which can be defined using expressions.

[0239] Example 2: Scenario of a conventional positive-shot circular pressure gauge

[0240] Scenario definition: An industrial inspection robot is shooting a circular pointer pressure gauge from the front, with a range of 0 to 1.0 MPa, uniform scale, shooting tilt angle < 5°, no obvious obstruction, normalized object distance ≈ 4, which belongs to the far-field parallel projection scenario.

[0241] Input conditions: baseline configuration file (4 correction anchors: 0°, 90°, 180°, 270° scale points; 2 calibration anchors: diagonal screws on the outer casing; 10 main scale markings; pointer height 3mm; pixel density 12px / mm); inference graph; YOLO detection model.

[0242] Implementation steps:

[0243] 1. Instrument detection cropping: The instrument frame and type number in the YOLO detection inference graph are cropped to obtain the image to be calibrated, and the coordinates are marked for synchronous offset.

[0244] 2. Anchor point detection and classification: All 4 correction anchor points and 2 verification anchor points were detected, and the categories were classified according to the configuration file.

[0245] 3. Solving the homography correction matrix: The four correction anchor points meet the threshold requirement of ≥4. The homography correction matrix H is solved using RANSAC + least squares method. The proportion of interior points is 95%, which is considered qualified.

[0246] 4. Double verification: Map the verification anchor point to the correction diagram through H, and calculate the Euclidean distance between it and the baseline diagram annotation; the theoretical offset under the parallel projection model is 1.8px, and the actual offset is 2.1px. The deviation is within the 2px threshold, so the H quality is qualified and the annotation is correct.

[0247] 5. Perspective Correction: Transform the image to be corrected into a frontal corrected image using H, and simultaneously correct the coordinates of the pointer detection box.

[0248] 6. Fixed-range migration: The scale coordinates, range, and graduation values ​​in the configuration file are directly migrated to the calibration annotation file without the need for secondary scale recognition.

[0249] 7. Reading calculation: Fit the pointer profile to obtain the coordinates of the needle root and the needle tip, and calculate the pointer angle; perform linear interpolation between the 0.3MPa and 0.4MPa scales to obtain a reading of 0.35MPa.

[0250] This embodiment is mainly implemented through an inference module and an extended verification module, integrating anchor point classification, dual verification, decoupling of recognition and calculation, and uniform scale support.

[0251] Example 3: Fixed Camera Monitoring Scenario

[0252] Scenario definition: A fixed camera in a substation monitors a pressure gauge of a known model. The viewing angle is fixed and the environment is stable and unobstructed.

[0253] Input conditions: pre-calibrated homography correction matrix H; baseline image configuration file; real-time video frames; lightweight YOLO pointer detection model.

[0254] Implementation steps:

[0255] 1. Upon initial deployment, perform a complete anchor point detection and H calibration, solidify the correction matrix and instrument area coordinates, and write them to the configuration file.

[0256] 2. Daily inference only requires one type of YOLO detection pointer area, eliminating the need for repeated detection of instruments and anchor points, thus minimizing the number of detection categories.

[0257] 3. Call the fixed H function to correct the pointer area to the reference map coordinate system.

[0258] 4. After transplanting the pre-stored scale information, the interpolation calculation of the reading is completed. The inference time for a single frame is less than 50ms, and it can support real-time monitoring of multiple video streams.

[0259] This embodiment is mainly implemented through a lightweight inference module, integrating AI lightweighting and decoupling of recognition computation.

[0260] Example 4: Precise correction scene captured by side-view shooting at a large tilt angle

[0261] Scenario definition: The inspection robot is taking a side view of the instrument, with a pitch angle of ≈20°, an azimuth angle of ≈30°, a normalized object distance of ≈2.2, a pointer height of 5mm, and significant perspective offset. A strict pinhole center perspective model is used.

[0262] Input conditions: baseline configuration file (6 correction anchors, 2 calibration anchors, pixel density, scale parameters); working camera intrinsic parameter matrix; inference graph; detection model.

[0263] Implementation steps:

[0264] 1. Complete anchor point detection, classification, and homography correction matrix solution.

[0265] 2. Double verification confirms that the correction matrix H is qualified, and the verification anchor point offset conforms to the radial distribution law of pinhole perspective.

[0266] 3. Enable a strict pinhole perspective correction model: Using the world coordinates (Z=0) of the correction anchor point and the pixel coordinates of the working image as input, the external parameters R and t of the working camera are solved by the PnP algorithm.

[0267] 4. Map the virtual points of the needle tip and needle root on the correction image back to the pixel coordinate system of the working image using the inverse matrix of H to obtain the corresponding needle tip and needle root coordinates on the image to be corrected.

[0268] 5. Combining the Z-coordinate constraint of pointer height h = 5mm, establish the simultaneous pinhole imaging equations s[x,y,1]. T = K(R[X,Y,h] T + t), eliminate the depth scale factor s, and solve for the world plane coordinates (X,Y,0) corresponding to the needle tip and the needle root.

[0269] 6. Map the world plane coordinates back to the reference map coordinate system through pixel density inverse transformation. Based on the correspondence between the reference map and the correction map, obtain the actual coordinates of the needle tip and needle root.

[0270] 7. Calculate the pointer angle based on the actual coordinates of the needle tip and needle root, and interpolate to obtain the corrected reading.

[0271] This embodiment is mainly implemented through the inference module and the pointer height difference correction module, which integrates dual-model height difference correction and dual verification into one, and reduces the relative error of the side-view image reading from 8% in the traditional scheme to less than 0.5%.

[0272] Example 5: Glass Tube Level Gauge (Virtual Pointer) Scenario

[0273] Scenario definition: Industrial glass tube level gauge, without physical pointer, using the horizontal dividing line of the liquid level as a virtual pointer, uniform scale, vertical translation reading.

[0274] Input conditions: baseline configuration file (liquid level upper and lower limit scales, scale values, tube edge correction anchor points, marked as translational virtual pointers); inference graph.

[0275] Implementation steps:

[0276] 1. The type of level gauge, the position of the horizontal dividing line of the liquid level (as a virtual pointer), and the correction anchor point are obtained through AI reasoning.

[0277] 2. Based on the correction anchor point pairs on the reasoning diagram and the reference diagram, solve for the homography correction matrix to complete the perspective correction.

[0278] 3. Transplant the reference scale information, perform pointer fitting and transplant key points of needle root and needle tip, and linearly interpolate along the vertical direction of liquid level to obtain the liquid level height reading.

[0279] This embodiment is mainly implemented through the inference module, which integrates virtual pointers and translation support.

[0280] Example 6: Logarithmic scale sound level meter scenario

[0281] Scenario definition: Pointer-type sound level meter with a logarithmic scale (dB units) and the scale intervals decrease as the value increases.

[0282] Input conditions: baseline configuration file (with main scales labeled 10dB, 30dB, 50dB, 70dB, and 90dB, automatically recognized as logarithmic scales by the system); inference graph.

[0283] Implementation steps:

[0284] 1. Complete perspective correction and scale information transfer.

[0285] 2. The system automatically analyzes the correspondence between the scale values ​​and the coordinates and determines that it is a logarithmic scale distribution.

[0286] 3. After calculating the pointer angle, take the logarithm of the left and right adjacent scale values ​​(forward transformation), perform linear interpolation, and then take the exponent (inverse transformation) to restore the actual reading.

[0287] This embodiment is mainly implemented through the inference module, which integrates support for multiple scale styles, avoids systematic errors caused by uniform interpolation, and improves the accuracy of nonlinear scale readings by an order of magnitude.

[0288] Example 7: Square Scale Group Instrument Scenario

[0289] Scene definition: A square panel digital pointer hybrid instrument with scales distributed along the edge of a rectangle.

[0290] Input conditions: baseline configuration file (the four vertices on the dial and each scale point are correction anchor points, and the scale points are labeled); inference graph.

[0291] Implementation steps:

[0292] 1. Detect the four vertices and each scale point of the square dial as correction anchor points, and use the homography correction matrix to map the perspective distortion square back to the standard correction diagram.

[0293] 2. Transplant edge scale information, convert the pointer angle into the proportion of arc length along the edge of the rectangle, and interpolate to obtain the reading.

[0294] This embodiment is mainly implemented through the inference module, which integrates multi-form dial support and is also applicable to other shape dial groups.

[0295] Example 8: Closed-loop scale clock dial scenario

[0296] Scene definition: A simulated mechanical clock with a circular dial, a closed ring scale from 0 to 12 hours, with the 0 and 12 hour marks completely overlapping, a frontal shot scene, and a normalized object distance of ≈3.5.

[0297] Input conditions: Baseline configuration file (marked as a closed loop scale, with the main scale marked at times 1 / 2 / 3 / ... / 10 / 11 / 12, and the 12th scale marked with dual scale values ​​(0,12); 4 dial edge correction anchor points; pointer height parameters); Inference graph (the hour hand points to 11:50, near the boundary area between the beginning and end 0 / 12).

[0298] Implementation steps:

[0299] 1. Inspect the clock face and the four corner correction anchor points, solve the homography correction matrix to complete perspective correction, and double-check to confirm that the accuracy is qualified.

[0300] 2. Load the baseline scale configuration. The system recognizes that the current scale is a closed loop and automatically enables the wrap-around interpolation calculation logic.

[0301] 3. Detect the position of the hour hand: The hand falls within the boundary between the 11 o'clock main scale and the 0 o'clock (12 o'clock) main scale.

[0302] 4. Surround Interpolation Calculation: Automatically recognizes scenarios where the scale crosses the beginning and end boundaries, uses 12 (instead of 0) as the upper limit of the scale value, and performs linear interpolation along the circumferential angle ratio to finally output a stable reading of 11:50, completely avoiding the boundary calculation error of ordinary linear interpolation where "the reading jumps to 0 when the pointer is close to the 12 o'clock boundary".

[0303] This cyclic scale logic can be superimposed with segmented mixed scales (such as multi-range ring pressure gauges). The configuration file simultaneously marks closed dual scale values ​​and segmentation marks. The interpolation architecture automatically processes the ring-loop logic first and then performs segmented transformations. The two mechanisms do not conflict with each other.

[0304] This embodiment is mainly implemented through the inference module, which integrates cyclic closed scale processing and recognition calculation decoupling.

[0305] Example 9: Scenario of a circular instrument for air temperature and humidity

[0306] Scenario definition: A circular instrument for air temperature and humidity, such as... Figure 2 As shown, it includes a main temperature pointer (-30~50℃, coarse pointer) and a humidity accuracy pointer (10~100%RH, fine pointer), which share the same rotation center and correspond to two independent sets of ring scales, respectively, for a frontal shot scene.

[0307] Input conditions: baseline configuration file (two pointers numbered P1 and P2 respectively; bound to two independent scale groups and temperature and humidity measurement attributes; six dial correction anchor points; two calibration anchor points; dual pointer height parameters); inference graph; detection model.

[0308] Implementation steps:

[0309] 1. Anchor point detection and classification, solving the homography correction matrix, and double-checking the correction accuracy to ensure it meets the requirements.

[0310] 2. After the perspective correction is completed, the two pointers are tested in different areas, and the coarse main pointer for temperature and the fine precision pointer for humidity are distinguished by preset numbers.

[0311] 3. Load two independent scale configurations for temperature and humidity respectively, calculate the deflection angle and interpolate the interpretation values ​​for the two pointers separately, and the two sets of operations do not interfere with each other.

[0312] 4. Output temperature and humidity readings simultaneously according to the preset joint reading output rules.

[0313] This embodiment is mainly implemented through the inference module, which integrates multi-pointer and multi-scale group support, and decoupling of recognition and calculation.

[0314] Example 10: Three-phase smart energy meter digital display + status combined reading scenario

[0315] Scenario definition: A three-phase smart energy meter, including one set of digital tube character reading areas and three status indicator lights (active / reactive / apparent), with the status light switching corresponding to the physical quantity meaning of the digital display.

[0316] Input conditions: baseline configuration file (character reading area and status reading area are labeled separately; configure joint reading rules: when the reactive light is on, the digital display shows reactive power; when the active light is on, the digital display shows active power; when the apparent light is on, the digital display shows apparent power); inference graph; OCR model; detection model.

[0317] Implementation steps:

[0318] 1. Detect the instrument area and correction anchor points, solve the uniform correction matrix to complete the overall correction.

[0319] 2. Transplant the reference information of the two types of reading areas and perform recognition respectively: the status reading area recognizes the on / off state of the indicator light and determines that the current state is "no power"; the character reading area uses OCR to recognize the digital tube value.

[0320] 3. Call the joint reading rule, match the corresponding metering attribute according to the status bit, and output the final reading: ["Reactive power", kvar, digital tube value, "Reactive power indicator light on"].

[0321] This embodiment is mainly implemented through the inference module, which integrates support for multiple types of reading areas and decoupling of recognition and calculation.

[0322] Example 11: Degradation and Remediation Scenario for Insufficient Anchor Points

[0323] Scenario definition: Poor on-site shooting conditions, the dial is partially obscured, and only 2 of the 4 preset correction anchor points are detected.

[0324] Input conditions: baseline configuration file; low-quality inference graph; detection model.

[0325] Implementation steps:

[0326] 1. There are only 2 preset correction anchor points, which does not meet the threshold of ≥4, triggering the first level of downgrade.

[0327] 2. Use the AKAZE algorithm to extract planar feature points from the image to be corrected and the reference image. After matching and filtering, obtain 5 feature anchor points and add them to the set of correction anchor points.

[0328] 3. Resolve the homography correction matrix. If the offset is disordered by checking the anchor point, the quality of H is determined to be unqualified, triggering the second level of degradation.

[0329] 4. Select 2 preset anchor points + 1 high-confidence feature anchor point to solve for the affine transformation matrix.

[0330] 5. If the anchor point verification deviation is within the allowable range, the affine transformation is deemed qualified, and the reading process continues.

[0331] 6. The output reading is simultaneously labeled with the "Affine Degradation Mode" confidence level label.

[0332] This embodiment is mainly implemented through the inference module degradation mechanism, which integrates degradation remedy and dual verification.

[0333] Example 12: Benchmark Annotation Quality Verification Scenario

[0334] Scenario definition: Quality control of batch labeled datasets. The fitting residual of the homography correction matrix is ​​very small, but the overall offset of the verification anchor points reaches 15px, which is much larger than the theoretical value of 3px.

[0335] Input conditions: baseline configuration file; training icon annotation file; correction matrix calculation results.

[0336] Implementation steps:

[0337] 1. The mean error of the corrected anchor point reprojection is 0.8px, indicating that the H-fit quality is good.

[0338] 2. Calculate and verify the anchor point offset: The direction and height are consistent, but the value of 15px deviates significantly from the theoretical value of 3px in parallel projection.

[0339] 3. Dual verification judgment logic: H is qualified + the offset direction is regular + the value deviates from the theoretical value → the anchor point is located as a reference map to verify the misalignment of the coordinates.

[0340] 4. Output alarm: "The verification anchor point may be incorrect. Manual verification is recommended." At the same time, the normal reading output is retained with a confidence level mark, and the entire sample does not need to be discarded.

[0341] This embodiment is mainly implemented through the anchor point marking quality verification module, which integrates dual verification functions.

[0342] Example 13: Scenario for verifying and troubleshooting ill-conditioned homography correction matrix

[0343] Scenario definition: The lower half of the dial is obscured, and only three collinear scale correction anchor points on the upper half of the dial are detected. The solved homography correction matrix has low local residuals but global perspective distortion.

[0344] Input conditions: baseline configuration file (8 uniformly distributed correction anchor points, 3 verification anchor points at different heights); inference graph (lower half occluded, only the 3 collinear correction anchor points in the upper half are identified); detection model.

[0345] Implementation steps:

[0346] 1. Only 3 collinear correction anchor points were detected. Solving the homography correction matrix, the reprojection error of the correction anchor points themselves was only 1.2px, which seems to be acceptable.

[0347] 2. Perform dual verification function: Map the verification anchor points at 3 different locations to the correction image and calculate the offset: The offset direction of the verification anchor points at different heights is chaotic, with no uniform radial distribution pattern, and the offset is far greater than the theoretical perspective value.

[0348] 3. Judgment logic: The corrected anchor point residual is qualified, but the verification anchor point offset is irregular → the homography correction matrix is ​​judged to have ill-conditioned distortion (collinear anchor points cause global distortion).

[0349] 4. Trigger the second-level degradation: After supplementing the feature anchor points, resolve the matrix, or downgrade to an affine transformation, and continue reading after passing the verification again.

[0350] This embodiment is mainly implemented through the anchor point marking quality verification module, which integrates dual verification function and degradation, accurately detects hidden faults of "partial compliance, global distortion", and avoids erroneous readings.

[0351] Example 14: Pointer-type megohmmeter (segmented reciprocal fraction + logarithmic mixed scale)

[0352] Scene definition: Mechanical insulation resistance megohmmeter dial, segmented mixed scale: 0~10MΩ range is reciprocal fraction (inv), 10~10000MΩ range is logarithmic (log), main scale marked on the dial: 0, 10, 100, 1000, 10000; single rotating pointer, circular non-closed scale, normalized object distance 4.2, far-field parallel projection scene, frontal photography.

[0353] Input conditions: The reference chart should include all key points of the main scale, uniformly distributed correction anchors, and two shell calibration anchors; the instrument manual should indicate the threshold of the two scale segments as 10MΩ and the reciprocal fractional auxiliary constant R=8; the inference graph should be taken normally with no obstruction, and YOLO should detect the complete pointer and all correction anchors.

[0354] Implementation steps:

[0355] 1. Configuration parameters related to segmentation in the configuration file (excerpt from the scale group section in the JSON5 fragment): scale_value_sequence is [0, *10, 100, 1000, 10000] (* is the delimiter), scale_marking_mapping_auto is "inv+log", and in scale_marking_aux, inv_R=8.

[0356] 2. Pre-correction process: After the perspective transformation generates the correction diagram, the reference scale, segmentation rules, and transformation parameters are all transferred to the correction annotation file.

[0357] 3. Segmented reading calculation: Fit the pointer and calculate the angle between the pointer and the adjacent left and right scales: left scale 10MΩ, right scale 100MΩ, determine that the pointer falls within the second logarithmic interval. Adopt the "forward transformation - linear interpolation - inverse transformation" framework: take the logarithm of the left and right scale values ​​10 and 100 (forward transformation), obtain the transformed reading through linear interpolation, and then take the exponent (inverse transformation) to obtain the final reading.

[0358] This embodiment is mainly implemented through the reading calculation submodule of the inference module, which integrates a general architecture of multi-style segmented scales and decoupling of recognition and calculation, and the scale is pre-stored without the need for real-time recognition.

[0359] This invention constructs a standardized reading architecture applicable to multiple types of instruments. With template construction and portability as the core architecture and a hierarchical structured configuration file as the unified data carrier, it combines technologies such as anchor point classification correction, degradation fault tolerance mechanism, universal interpolation framework, precise height difference correction, and multi-zone linkage rules. This enables instruments of different shapes, scales, and reading methods to complete identification and reading under the same process. It addresses the fundamental shortcomings of existing technologies—"one algorithm per type of instrument, poor universality, and high adaptation costs"—at the architectural level. Furthermore, it proposes systematic solutions to pain points in specific technologies such as perspective correction, scale calculation, pointer deviation, and multi-zone linkage. By constructing a unified and universal standardized reading system, it integrates all three types of reading areas—pointer, character, and status—into a single... This system provides a comprehensive management and computational framework; establishes a robust perspective correction and quality control system, proposes an anchor point role separation strategy, and includes a degradation recovery mechanism and a dual verification system; establishes a unified interpolation system applicable to all scale styles, breaking the fixed assumption of "default uniform scale" and natively supporting linear, nonlinear, and segmented mixed scales; achieves precise geometric correction of pointer height difference perspective deviation, supporting industrial-grade reading accuracy in large-angle side-view shooting scenarios; covers the detailed needs of instruments across all scenarios, natively supporting seamless reading of closed-loop scales, independent calculation of multiple pointers and multiple scale groups, and linked calculation of multiple types of reading areas; includes lightweight inference capabilities to lower the deployment threshold; and is suitable for intelligent operation of various pointer instruments, level gauges, translation instruments, and digital display hybrid instruments in industrial, laboratory, and other scenarios. It can recognize readings, covering various dial shapes such as circles, squares, ellipses, and polygons. It supports various scale styles, including uniform scales, logarithmic scales, square root scales, negative logarithmic scales, reciprocal fraction scales, and segmented mixed scales. It is compatible with independent recognition and joint calculation of pointer, character, and status reading areas. The AI ​​detection within the architecture is only used as a lightweight target localization method, significantly reducing the number of detection categories and training costs. All static information and reading rules related to the instrument itself are externalized to the configuration file. Adding a new instrument does not require modifying the algorithm kernel; only a baseline image and corresponding configuration file need to be created for adaptation. No modification to the core algorithm logic is required, shortening the adaptation development cycle by 80%. New instrument adaptation only requires 5-10 training image annotations, reducing data annotation costs by 90%. 0% or more; adopting a unified architecture for multiple categories, the cost of instrument adaptation is greatly reduced, fundamentally solving the high cost and low versatility problem of the traditional solution of "one algorithm for one type of instrument"; specifically including: (1) strong versatility: by adding a reference diagram and configuration file, the differences between instruments are externalized, and one algorithm framework can adapt to various forms of instruments such as round, square, elliptical, liquid level gauge, and translation type, covering various scale styles such as uniform, logarithmic, and square root, and the unified "positive transformation - linear interpolation - inverse transformation" architecture natively supports linear, nonlinear and segmented mixed scales, automatic adaptation of all scale styles, no additional development cost for nonlinear scales, significantly improved adaptation efficiency of multi-segment nonlinear instruments, reduced deployment cost of mixed instruments, less code, low maintenance cost, and strong expansion capability;(2) High robustness: Recognition and calculation are decoupled. The scale information is pre-stored in the configuration file. The reference map pre-stores all stationary area information. Only the pointer and anchor point need to be detected during the inference stage. There is no need to recognize the scale in real time. The dial can still output readings stably when there are partial obstructions, stains, or reflections. The recognition success rate in complex industrial sites is more than 40% higher than that of traditional solutions. (3) Strong fault tolerance: The degradation fusion strategy is adopted. When there are insufficient anchor points, the automatic degradation is avoided to prevent overall failure. The complete fault-tolerant link from optimal homography transformation to affine degradation can adaptively cope with complex field conditions such as anchor point obstruction, reflection loss, and image blurring. The effective reading rate of low-quality images is increased by 60%. (4) Accuracy High: By accurately correcting the height difference of the dual-model pointers, the perspective offset error in the side-shot scene is eliminated, and the reading accuracy of the side-shot is industrial-grade. The relative error of the reading in the large-angle side-shot scene is reduced from 8% to 15% to less than 0.5%, which meets the high-precision reading requirements of industrial instruments; (5) Lightweight: The AI ​​only needs to detect a small number of targets, and at least one type of target needs to be detected. The number of model parameters is reduced by more than 60%, the training samples are small, and the inference speed is increased by 50%. It can be deployed in low-computing-power devices such as embedded inspection equipment and edge cameras; (6) Low adaptation cost: The new instrument only needs to make a benchmark map and configuration file. There is no need to modify the algorithm code, and the iteration and maintenance cost is greatly reduced. Similarly, the multi-category instrument universal reading system, electronic equipment, computer-readable storage medium and computer program products of the present invention also have the above-mentioned beneficial effects.

[0360] This invention can be widely applied in the field of instrument reading recognition.

Claims

1. A universal reading method for multiple types of instruments, characterized in that: The method includes the following steps: S1: Benchmark Construction: For the target type of instrument, obtain a benchmark map, generate a configuration file based on the benchmark map, and construct the instrument's digital static information data architecture. The configuration file contains the instrument's anchor point information, scale information, and reading rule information. S2: Identification and processing: Obtain the working image, perform target detection on the working image, and obtain the positioning information and dynamic target information of the instrument in the working image; S3: Correction Processing: Based on the anchor point information in the configuration file and the anchor point information detected in the working diagram, solve the correction matrix, and use the correction matrix to perform perspective transformation on the instrument area in the working diagram to obtain the correction diagram; S4: Information transfer: Transfer the static information in the configuration file to the annotation file of the correction diagram; S5: Reading Calculation: Based on the correction diagram and the transplanted static information, identify and calculate the reading of the instrument.

2. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The anchor point information includes correction anchor points, which are fixed points on the reference plane of the instrument, used to solve the correction matrix. The number of correction anchor points is redundant to ensure that there are still enough correction anchor points to calculate the correction matrix when some correction anchor points cannot be used during training and recognition. The anchor point information also includes verification anchor points, which are fixed points on the instrument that are not on the reference plane. The verification anchor points do not participate in solving the correction matrix and are used to verify the quality of the correction matrix and / or the anchor point annotation.

3. The universal reading method for multiple types of instruments according to claim 2, characterized in that: The verification anchor points are used to verify the correction matrix as follows: the verification anchor points are mapped to the correction image coordinate system through the correction matrix, and their offset from the coordinates of the reference image is calculated; if the offset conforms to the theoretical perspective distribution law of the corresponding imaging model, the correction matrix is ​​deemed to be of qualified quality; if the offset direction is chaotic and has no radial distribution law, the correction matrix is ​​deemed to have ill-conditioned distortion; the verification anchor points are used to verify the quality of the anchor point annotation as follows: under the premise that the quality of the correction matrix is ​​qualified, if the offset of a single verification anchor point exceeds the theoretical calculation value, the annotation of that verification anchor point is deemed to have an error.

4. The universal reading method for multiple types of instruments according to claim 1, characterized in that: In step S3, the correction matrix is ​​solved using a downgraded fusion strategy, which includes: Level 1: Solve the homography transformation matrix using preset correction anchor points; Second level: When the number of preset anchor points is insufficient, extract image feature points as supplementary anchor points and re-solve the homography transformation matrix; Level 3: Solve for the affine transformation matrix when there are still insufficient anchor points; Level 4: If none of the above levels can generate a qualified correction matrix, an alarm message will be output.

5. The universal reading method for multiple types of instruments according to claim 1, characterized in that: In step S3, after performing perspective transformation using the correction matrix, the image coordinates of the correction anchor points on the correction image coincide with those of the corresponding correction anchor points on the reference image.

6. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The configuration file is a hierarchically structured storage configuration file, which contains at least one of the following nodes: image information node, instrument information node, annotation entity information node, anchor point information node, function area information node, and reading logic information node; the function area node contains at least one of character reading area data, status reading area data, and pointer reading area data.

7. The universal reading method for multiple types of instruments according to claim 6, characterized in that: The configuration file also includes information on the matching relationship between pointers and scale groups. The matching relationship is implemented through a globally unique numbering system. Each pointer, scale group, and measurement attribute set has an independent number. It supports at least one of the following mapping relationships: one pointer matching multiple scale groups, multiple pointers matching one scale group, and multiple pointers matching multiple scale groups. Each pointer matches at least one scale group and at least one measurement attribute set of that scale group.

8. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The information transfer step includes: transferring at least one of the fixed area data from the scale annotation key points, character reading area annotation boxes, and status position annotation boxes in the configuration file to the annotation file of the correction diagram; and transferring the needle root key points and needle tip key points of the pointer in the reference diagram to the corresponding positions of the pointer in the correction diagram based on the pointer contour fitting results.

9. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The reading calculation steps include: based on the relative positional relationship between the pointer and the scale, the reading is obtained by interpolation calculation using a "forward transformation-linear interpolation-inverse transformation" architecture. Specifically, the scale values ​​of the pointer's adjacent scales are mapped to a linear space through a forward transformation, linear interpolation is performed in the linear space to obtain the transformed reading, and then the reading is obtained through an inverse transformation.

10. The universal reading method for multiple types of instruments according to claim 9, characterized in that: The reading styles of the scale include at least one of the following: uniform, logarithmic, square root, negative logarithmic, reciprocal fraction, irregular, and any combination thereof; for segmented mixed scales, different interpolation intervals are divided by boundary markers, and each interval independently performs the "forward transformation - linear interpolation - inverse transformation" process.

11. The universal reading method for multiple types of instruments according to claim 9, characterized in that: When the scale is a closed loop scale, the connecting scale of the closed loop scale has dual scale values, and the interpolation calculation uses a wraparound interpolation logic to eliminate reading jumps at the start and end scale boundaries.

12. The universal reading method for multiple types of instruments according to claim 9, characterized in that: The pointer includes at least one of a rotating pointer and a translation pointer, and / or the pointer includes at least one of a physical pointer and a virtual pointer; the distribution shape of the scale includes at least one of a circle, a square, a sector, an ellipse, a polygon, and a straight line.

13. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The reading calculation also includes the identification of the character reading area and the status reading area, as well as the joint calculation of at least two of the pointer reading area, character reading area and status reading area; the joint calculation is performed based on the joint reading rules stored in the configuration file in the form of expressions.

14. The universal reading method for multiple types of instruments according to claim 13, characterized in that: The expression supports at least one of the following operators: arithmetic operations, exponentiation, comparison operations, logical operations, and conditional operations. It supports switching the measurement attributes of the pointer reading area and / or character reading area based on the recognition result of the status reading area, and supports custom status description output.

15. The universal reading method for multiple types of instruments according to claim 1, characterized in that: Step S3 also includes a pointer height difference correction step: obtaining the height information of the pointer from the reference plane, correcting the position of the pointer based on the height information, and obtaining the true projection position of the pointer on the reference plane; The pointer height difference correction step includes: selecting an imaging model based on the normalized object distance, wherein the imaging model includes at least one of a parallel projection geometric model and a strict pinhole center perspective model.

16. The universal reading method for multiple types of instruments according to claim 15, characterized in that: When the normalized object distance is ≥3, a parallel projection geometric model is used; when the normalized object distance is <3, a strict pinhole center perspective model is used. The correction steps of the parallel projection geometric model include: fitting the global tilt angle using the least squares method based on the correction anchor point, calculating the outlier pixel offset Δpixel = h·S·tanθ, and calculating the true point coordinates based on the pixel offset and the unit perspective tilt vector, where h is the outlier height, S is the pixel density, and θ is the global tilt angle. The correction steps of the strict pinhole center perspective model include: solving the camera extrinsic parameters based on the coplanar correction anchor points using the PnP algorithm, solving the world coordinates of the outliers by combining the outlier height constraints with the pinhole imaging equations, and mapping the world coordinates back to the reference map coordinate system to obtain the true point coordinates.

17. The universal reading method for multiple types of instruments according to claim 1, characterized in that: Step S3 further includes an image distortion correction step: performing distortion correction processing on the reference image and / or the working image; when the working image is a training image, the method further includes training an object detection model based on the training image and the corresponding annotation information; when the working image is an inference image, it is used for final reading recognition.

18. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The target detection adopts the YOLO target detection model, and the detected objects include at least one of the instrument area, pointer area and anchor point area. For fixed shooting scenes, the correction matrix is ​​fixed after the first recognition, and only the pointer area is detected in the subsequent inference graph, and the correction matrix is ​​reused.

19. The universal reading method for multiple types of instruments according to claim 1, characterized in that: The instrument is an instrument with a pointer reading area, and the instrument includes at least one of the following: circular instrument, square instrument, elliptical instrument, polygonal instrument, level gauge, and translational instrument.

20. A universal reading system for multiple types of instruments, characterized in that: include: The benchmark module is used to acquire benchmark diagrams for the target type of instrument and generate configuration files to construct a digital static information data architecture for the instrument. The configuration files contain the anchor point information, scale information and reading rule information of the instrument. The training module is used to train the target detection model based on the working image and its corresponding annotation information; The reasoning module includes: The detection unit is used to perform target detection on the input working diagram to obtain instrument positioning information and dynamic target information; The correction unit is used to solve the correction matrix based on the anchor point information in the configuration file and the detected anchor point information, and to use the correction matrix to perform perspective transformation to obtain the correction image. The transplantation unit is used to transplant the static information in the configuration file to the annotation file of the correction diagram; A reading calculation unit is used to identify and calculate the reading of the instrument based on the correction diagram and the transplanted static information; The extension module includes at least one of the following: an outlier correction unit, an anchor point labeling quality control unit, and a pointer height difference correction unit.

21. The universal reading system for multiple types of instruments according to claim 20, characterized in that: The outlier correction unit includes a parallel projection geometric model subunit and a strict pinhole center perspective model subunit, which automatically switches according to the normalized object distance. The anchor point annotation quality control unit is used to perform quality verification of the correction matrix and anchor point annotation. The pointer height difference correction unit is used to calculate the actual point coordinates of the pointer key points on the correction diagram and update the correction annotation file.

22. The universal reading system for multiple types of instruments according to claim 20, characterized in that: The correction unit uses a downgraded fusion strategy to solve the correction matrix. The downgraded fusion strategy includes at least: solving the homography transformation matrix using preset correction anchor points; extracting image feature points as supplementary anchor points to solve the homography transformation matrix when the preset anchor points are insufficient; and solving the affine transformation matrix when the anchor points are still insufficient.

23. An electronic device, comprising: A processor, a memory, and a computer program stored in the memory; characterized in that: when the processor executes the computer program, it implements the universal reading method for multiple types of instruments as described in any one of claims 1 to 19.

24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the universal reading method for multiple types of instruments as described in any one of claims 1 to 19.

25. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by the processor, it implements the universal reading method for multiple types of instruments as described in any one of claims 1 to 19.

Citation Information

Patent Citations

  • Pointer type electrical instrument reading method and device for physical, chemical and biological experiment scoring

    CN119625749A

  • Pointer type instrument reading method and system combining image correction and multi-feature recognition

    CN121053668A

  • Pointer type instrument reading method based on image processing and target detection

    CN121640435A