Automatic reading method of pointer instrument, electronic equipment and storage medium

By horizontally processing the dial area and intercepting the scale area on the image data of the pointer instrument, and determining the pointer and scale position based on the area of ​​the connecting area, the problem of low automatic reading efficiency and accuracy in the prior art is solved, and the accurate reading and automatic reading recognition of dials with different angles is improved.

CN114782940BActive Publication Date: 2025-05-09SHANGHAI ELECTRICGROUP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210315809.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-05-09
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In the prior art, the automatic reading efficiency and accuracy of pointer instruments are low, and there are requirements for the number of channels of the instrument image and the appearance of the dial, resulting in limited detection effects.

Method used

By obtaining image data of the pointer instrument, horizontal processing of the dial area is performed, the scale area is intercepted, and the pointer and scale position are determined based on the area of ​​the connecting area, thereby realizing automatic reading.

Benefits of technology

This method can accurately identify dials with different angles, reduce interference from factors such as scale area and pointer color and shape, and improve the accuracy of automatic identification of instrument readings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782940B_ABST
    Figure CN114782940B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic reading method of a pointer instrument, an electronic device and a storage medium, the automatic reading method comprising: acquiring image data of the pointer instrument; horizontalizing a dial area in the image data to obtain a dial area after horizontalization; intercepting a scale area of ​​the dial area after horizontalization; determining a pointer position and a scale position of the pointer instrument based on an area of ​​a connected area in the scale area; and obtaining a reading of the pointer instrument based on the pointer position, the scale position and a scale value corresponding to the scale position. The present invention realizes automatic reading of the pointer instrument image by horizontalizing the dial area and determining the pointer position and the scale position based on the area of ​​the connected area, and reduces interference of factors such as the color and shape of the scale area and the pointer, thereby improving the accuracy of automatic recognition of the instrument reading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial image recognition, and in particular to an automatic reading method of a pointer-type instrument, an electronic device and a storage medium. Background Art

[0002] With the development of science and technology, various instruments are widely used in industry and life, which improves the efficiency of industrial production and improves the quality of people's lives. Among them, pointer instruments can be used to measure the physical properties of gases, currents, pressures and other substances. Pointer instruments are an indispensable detection tool. They have intuitive reading indication, simple structure, strong anti-interference ability and other characteristics. They are widely used in production practice. In order to meet production requirements, instruments must be calibrated regularly.

[0003] However, as the number of instruments increases, the workload of instrument reading also increases exponentially. Currently, instrument reading is mostly done by manual recording, which has high error rate, low efficiency and high cost. These problems undoubtedly bring huge challenges to the reading work. On this basis, automatic instrument reading has become a topic of common concern in academia and industry. At present, a large number of researchers have proposed efficient automatic instrument reading methods. With the popularization of deep learning and its high accuracy, instrument reading algorithms based on deep learning have become the mainstream for solving such problems. In addition, traditional algorithms and rules are still effective methods in this regard.

[0004] Some existing technologies use straight line features and circle features to locate the position of the dial, which is specific and not generalized enough. For instruments whose straight line features and circle features are not obvious enough, the detection effect is limited; some existing technologies use pointer angles and dial colors to read instrument readings, but there are requirements for the number of channels of the instrument image, and a color camera must be used to obtain the image, which increases the cost and threshold for obtaining the image. For instruments with different dial colors, the algorithm needs to be adjusted, which is not convenient enough; some existing technologies use the Hough transform method to find a straight line to find the pointer. When the pointer is not a pure straight line, the effect of this method in finding the pointer will be affected. The Hough transform method to find a circle is used to find the dial, which has great limitations and has requirements for the shape of the dial (it is required to be circular), and the positioning result of the dial is unstable. Summary of the invention

[0005] The technical problem to be solved by the present invention is to overcome the defects in the prior art that the automatic reading of pointer instruments is subject to many restrictions, resulting in low efficiency and accuracy, and to provide an automatic reading method for pointer instruments, an electronic device and a storage medium.

[0006] The present invention solves the above technical problems through the following technical solutions:

[0007] The present invention provides an automatic reading method for a pointer-type instrument, the automatic reading method comprising:

[0008] Acquiring image data of the pointer instrument;

[0009] Performing a horizontal processing on the dial area in the image data to obtain a horizontally processed dial area;

[0010] intercepting a scale area of ​​the dial area after the horizontalization process;

[0011] Determining a pointer position and a scale position of the pointer instrument based on an area of ​​a connected region in the scale region;

[0012] The reading of the pointer instrument is obtained based on the pointer position, the scale position and the scale value corresponding to the scale position.

[0013] Preferably, after the step of acquiring the image data of the pointer instrument, the automatic reading method further comprises:

[0014] Inputting the image data into a dial detection model to obtain the dial area;

[0015] Inputting the dial area into an instrument scale value text detection model to obtain scale value text;

[0016] The scale value text is input into an instrument scale value text recognition model to obtain the scale value corresponding to the scale position.

[0017] Preferably, after the step of acquiring the image data of the pointer instrument, the automatic reading method comprises:

[0018] Obtaining a dial image template corresponding to the dial area;

[0019] Affine correction is performed on the dial area based on the dial image template so that the dial area is rotated to a preset angle, and the scale value of the dial area is corrected based on the dial image template.

[0020] Preferably, the step of horizontalizing the dial area in the image data to obtain the horizontalized dial area comprises:

[0021] Fitting the dial area based on the arrangement characteristics of the scale area to obtain the center of the dial area;

[0022] Adding at least two rays of preset length starting from the center of the circle and passing through the scale area in the dial area;

[0023] The dial area is horizontalized based on the ray to obtain a horizontalized dial area.

[0024] Preferably, the step of intercepting the scale area of ​​the horizontalized dial area comprises:

[0025] Obtaining the coordinates of the scale area;

[0026] adjusting the coordinates so that the scale area includes a redundant area;

[0027] The scale area is intercepted on the dial area based on the coordinates.

[0028] Preferably, before the step of determining the pointer position and the scale position of the pointer instrument based on the area of ​​the connected area in the scale area, the automatic reading method further comprises:

[0029] Binarization is performed on the scale area to obtain a binary image;

[0030] The binary image is subjected to vertical projection processing to obtain a pixel distribution map; the pixel distribution map is used to determine the area of ​​the connected region in the binary image.

[0031] Preferably, the step of determining the pointer position of the pointer instrument based on the area of ​​the connected area in the scale area comprises:

[0032] The position with the largest number of pixels is determined as the candidate area for the pointer position;

[0033] Determine the connected region with the largest area in the binary image according to the candidate region of the pointer position;

[0034] The center line of the connected area is determined as the pointer position.

[0035] Preferably, the step of determining the scale position of the pointer instrument based on the area of ​​the connected area in the scale area comprises:

[0036] Determine the position where the number of pixels is within a preset range as the main scale position candidate area;

[0037] Determine a connected region in the binary image according to the major scale position candidate region;

[0038] The center line of the connected area is determined as the main scale position.

[0039] Preferably, the step of obtaining the reading of the pointer instrument based on the pointer position and the scale position comprises:

[0040] The reading is obtained based on the pointer position, the main scale position closest to the left side of the pointer, the main scale position closest to the right side of the pointer, and the scale values ​​corresponding to the main scale positions.

[0041] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the automatic reading method of the pointer instrument as described above when executing the computer program.

[0042] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the automatic reading method of the pointer instrument as described above is implemented.

[0043] The positive and progressive effects of the present invention are:

[0044] The automatic reading method, electronic device and storage medium of a pointer-type instrument provided by the present invention can accurately identify dials of different angles by horizontalizing the dial area, and intercepting the scale area in the dial area after the horizontalization process, wherein the area of ​​the connected area between the pointer and the scale is different, and the pointer position and the scale position are determined based on the area of ​​the connected area, thereby realizing automatic reading of the pointer-type instrument image, reducing interference from factors such as the color and shape of the scale area and the pointer, and improving the accuracy of automatic recognition of the instrument reading. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure is a flow chart of the automatic reading method of the pointer instrument according to the first embodiment of the present invention.

[0046] Figure 2 Schematic diagram of the effect of horizontalizing the dial area of ​​Example 1 of the present invention.

[0047] Figure 3 Schematic diagram of the flow of the automatic reading method of the pointer instrument of embodiment 2 of the present invention.

[0048] Figure 4 Schematic diagram of the effect of dial detection in Example 2 of the present invention.

[0049] Figure 5 This is a schematic diagram of the effect of instrument scale value text detection in Example 2 of the present invention.

[0050] Figure 6 This is a schematic diagram of the effect of the dial image template of Example 2 of the present invention.

[0051] Figure 7 Schematic diagram of the effect of affine correction of the dial area in Example 2 of the present invention.

[0052] Figure 8Schematic diagram of the effect of dial area correction in Example 2 of the present invention.

[0053] Fig. 9 This is a schematic diagram of the effect of center fitting of a square dial according to Example 2 of the present invention.

[0054] Fig.10 This is a schematic diagram of the effect of center fitting of the sector-shaped dial according to Example 2 of the present invention.

[0055] Fig.11 Schematic diagram of the effect of horizontalizing the dial area of ​​Example 2 of the present invention.

[0056] Fig.12 This is a schematic diagram of the effect of the scale area interception of Example 2 of the present invention.

[0057] Fig.13 This is a schematic diagram of the effect of the pointer position search process of embodiment 2 of the present invention.

[0058] Fig.14 This is a schematic diagram of the effect of the main scale position search process of Example 2 of the present invention.

[0059] Fig.15 Schematic diagram of the effect of determining the pointer position and main scale of the dial area in Example 2 of the present invention.

[0060] Fig.16 This is a schematic diagram of the hardware structure of an electronic device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0061] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0062] Example 1

[0063] This embodiment provides a method for automatically reading a pointer instrument. Figure 1 As shown, the automatic reading method includes:

[0064] S101, acquiring image data of the pointer instrument.

[0065] S102: horizontalize the dial area in the image data to obtain a horizontalized dial area. Figure 2 As shown, the dial area is the area formed by the scale and pointer of the dial, and is generally a circle or a part of a circle. The dial area is horizontalized so that the scale is arranged evenly along a straight line instead of being arranged evenly along an arc. By horizontalizing the dial area, dials of different angles can be accurately identified.

[0066] S103, intercepting the scale area of ​​the dial area after the horizontalization process;

[0067] S104. Determine the pointer position and scale position of the pointer instrument based on the area of ​​the connected area in the scale area. A connected area generally refers to an image area composed of foreground pixels with the same pixel value and adjacent positions in the image. Through connected area analysis, each connected area in the image can be found and marked. In the scale area after horizontalization, the end of the pointer away from the scale and close to the center of the dial has a larger area due to the flattening process, and the connected area of ​​the pointer is generally the largest; similarly, the area of ​​the main scale is larger than the area of ​​the secondary scale. Therefore, based on the area of ​​the connected area in the scale area after horizontalization, the pointer position and scale position of the pointer instrument can be accurately determined.

[0068] S105. Obtain a reading of the pointer instrument based on the pointer position, the scale position, and the scale value corresponding to the scale position.

[0069] The automatic reading method of a pointer-type instrument provided in the present embodiment can accurately identify dials of different angles by horizontalizing the dial area, and intercepting the scale area in the horizontalized dial area, wherein the areas of the connected areas of the pointer and the scale are different, and the pointer position and the scale position are determined based on the areas of the connected areas, thereby realizing automatic reading of the pointer-type instrument image, reducing interference from factors such as the color and shape of the scale area and the pointer, and improving the accuracy of automatic recognition of the instrument reading.

[0070] Example 2

[0071] like Figure 3 As shown, the automatic reading method of the pointer instrument of this embodiment is a further improvement of the embodiment 1, specifically:

[0072] In an optional implementation, after step S101, the automatic reading method further includes:

[0073] S201, input the image data into the dial detection model to obtain the dial area. Figure 4 As shown, the acquired image data including pointer instruments may include multiple pointer instruments, and may also include a large number of irrelevant interfering images. At this time, the dial detection model needs to be used to process the image data to obtain a dial area that can be read for subsequent processing. In an optional implementation, the dial detection model can use the yolo v3 (a v3 version of the You Only Look Once target detection model for image processing) model.

[0074] S202: Input the dial area into the instrument scale value text detection model to obtain the scale value text. Figure 5As shown, the dial area is input into the instrument scale value text detection model to obtain the scale value text and the position information of the scale value text. In an optional implementation, the instrument scale value text detection model can adopt a psenet (progressive scale expansion network) model.

[0075] S203, input the scale value text into the instrument scale value text recognition model to obtain the scale value corresponding to the scale position. In an optional implementation, the instrument scale value text recognition model can adopt the SAR (show, attend and read, a text recognition model) model.

[0076] In an optional implementation, after step S101, the automatic reading method includes:

[0077] S204: Obtain a dial image template corresponding to the dial area. Specifically, Figure 6 As shown, in an optional implementation, a front-shot, clear, non-rotated, and non-deformed dial picture can be resized to a predetermined size (such as 750*750) as a dial image template, and prior information corresponding to the dial image template is obtained. The prior information may include the scale value of the dial image template, the four vertices of the rectangular frame of the scale value arranged in a preset order (the order may be upper left-upper right-lower right-lower left), the radius of the horizontalization of the dial, the height of the scale line that the scale value can contain after the dial image template is horizontalized, and the width of the pointer, the arrangement of the scale values ​​of the dial image template, the table category of the dial image template, etc., so as to form a dial image template dictionary.

[0078] S205: Perform affine correction on the dial area based on the dial image template to rotate the dial area to a preset angle, and correct the scale value of the dial area based on the dial image template. Figure 7 As shown in FIG. 1 , the dial can be rotated to the right position by performing an affine transformation based on the coordinates of the center point of the detected scale value and the coordinates of the center point of the scale value of the dial image template; Figure 8 As shown in the figure, some scale values ​​in the dial are blocked by the pointer, resulting in the OCR (Optical Character Recognition) model to recognize incorrectly or fail to recognize. Through the dial image template and prior information, according to the scale arrangement rules and position rules, the missing scale can be filled.

[0079] In an optional implementation, step S102 includes:

[0080] S206: Fit the dial area based on the arrangement characteristics of the scale area to obtain the center of the dial area. Fig. 9 As shown in , for a square dial, since the dial has been rotated straight, according to the dial's scale arrangement characteristics, the coordinates of the center of the circle can be simply fitted as the horizontal coordinate x of the maximum scale and the vertical coordinate y of the 0 scale. Fig.10 As shown, for a sector-shaped dial, the center point coordinates of the detected scale values ​​are used to fit a circle.

[0081] S207. Add at least two rays of preset length starting from the center of the circle and passing through the scale area in the dial area.

[0082] S208: horizontalize the dial area based on the ray to obtain a horizontalized dial area. Fig.11 As shown, a ray of fixed length can be emitted outward from the center of the fitted circle, and the length is set to ensure that the dial is still within the area. In this way, the dial is flattened.

[0083] In an optional implementation, step S103 includes:

[0084] S209, obtaining the coordinates of the scale area.

[0085] S210, adjusting the coordinates so that the scale area includes the redundant area.

[0086] S211. Cut out a scale area on the dial area based on the coordinates.

[0087] like Fig.12 As shown, according to the coordinates mapped according to the scale values ​​detected by OCR, the coordinates are adjusted according to the preset values ​​to expand the scale area and include the redundant area, so as to obtain the minimum rectangular frame surrounding the pointer and the scale.

[0088] In an optional implementation, before step S104, the automatic reading method further includes:

[0089] S212, binarize the scale area to obtain a binary image. Specifically, Fig.13 As shown, the dial binarization can use the OTSU algorithm (inter-class variance maximum method), which is not affected by image brightness and contrast.

[0090] S213, vertically project the binary image to obtain a pixel distribution map; the pixel distribution map is used to determine the area of ​​the connected region in the binary image. Specifically, Fig.13 As shown, a pixel distribution map can be obtained by vertically projecting the binarized image.

[0091] In an optional implementation, step S104 includes:

[0092] S214: Determine the position with the largest number of pixels as the candidate area for the pointer position.

[0093] S215. Determine the connected region with the largest area in the binary image according to the candidate region of the pointer position.

[0094] S216: Determine the center line of the connected area as the pointer position.

[0095] like Fig.13 As shown in the figure, the determination of the pointer position takes into account that the pointer height is significantly different from the scale line, so the binarized image is vertically projected to obtain a pixel distribution map, and the position with the largest number of pixels is the candidate pointer area. Considering that the pointer has a certain width, the pointer can be further processed later. The point with the largest number of pixels can be verified with the connected domain with the largest area. The point with the largest projection value of the pointer must be in the largest connected domain. The connected area with the largest area is found through vertical projection, and the center line of the connected area is selected as the final pointer position to improve the accuracy of finding the pointer.

[0096] In another optional implementation, step S104 includes:

[0097] S217, determining a position where the number of pixels is within a preset range as a primary scale position candidate area;

[0098] S218, determining a connected region in the binary image according to the major scale position candidate region;

[0099] S219: Determine the center line of the connected area as the main scale position.

[0100] It is worth noting that this embodiment does not limit the order of the steps of searching for the pointer and searching for the scale. Fig.14 As shown in the figure, according to the scale arrangement rules, it can be seen that the scale line is within the horizontal axis of the corresponding scale. The scale area is taken up to a certain height as the search area of ​​the scale line. The same method as the pointer search method is used to search by vertical projection. The position where the number of pixels is within the preset range can be determined as the main scale position candidate area. The corresponding connected area in the binary image is determined based on the main scale position candidate area, and the center line of the connected area is determined as the pointer position. The final processing result is shown in the figure below. Fig.15 shown.

[0101] In an optional implementation, step S105 includes:

[0102] S220, obtaining a reading based on the pointer position, the main scale position closest to the left side of the pointer, the main scale position closest to the right side of the pointer, and the scale value corresponding to the main scale position.

[0103] Specifically, X pointer is the pointer position, X l-scale is the main scale nearest to the left of the pointer, X r-scale is the main scale nearest to the right of the pointer, V l Represents X l-scale The scale value represented by V r Represents X r-scale The scale value represented is calculated as follows:

[0104]

[0105] The automatic reading method of pointer instruments provided in this embodiment adopts a dial detection model based on deep learning, has no requirements on the appearance of the dial, has a certain degree of adaptability to changes in illumination, and can accurately detect the position of the dial; by horizontalizing the dial area, dials of different angles can be accurately identified, and the scale area is intercepted in the dial area after the horizontalization process and binarized; there is no requirement on the number of channels of the image, and both color and grayscale images can be read, reducing the requirements for the image sensor; the processing of the pointer is relatively fine, and considering that the pointer has a certain width, the connected area with the largest area is found through vertical projection, and the center line of the connected area is selected as the final pointer position, thereby realizing automatic reading of the pointer instrument image and improving the accuracy of automatic recognition of the instrument reading.

[0106] Example 3

[0107] Fig.16 The present invention provides a schematic diagram of the structure of an electronic device provided in Example 3. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the automatic reading method of the pointer instrument of Example 1 or Example 2 when executing the program. Fig.16 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0108] like Fig.16 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0109] The bus 33 includes a data bus, an address bus, and a control bus.

[0110] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .

[0111] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0112] The processor 31 executes various functional applications and data processing by running the computer program stored in the memory 32, such as the automatic reading method of the pointer instrument of Example 1 or Example 2 of the present invention.

[0113] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model-generated device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via a bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.

[0114] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0115] Example 4

[0116] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the automatic reading method of the pointer instrument of Embodiment 1 or Embodiment 2 is implemented.

[0117] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0118] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the automatic reading method of the pointer instrument of Example 1 or Example 2.

[0119] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.

[0120] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A method for automatically reading a pointer instrument, characterized in that: The automatic reading method comprises: Acquiring image data of the pointer instrument; Performing a horizontal processing on the dial area in the image data to obtain a horizontally processed dial area; intercepting a scale area of ​​the dial area after the horizontalization process; Determining a pointer position and a scale position of the pointer instrument based on an area of ​​a connected region in the scale region; Obtaining a reading of the pointer instrument based on the pointer position, the scale position, and the scale value corresponding to the scale position; The step of horizontalizing the dial area in the image data to obtain a horizontally processed dial area comprises: Fitting the dial area based on the arrangement characteristics of the scale area to obtain the center of the dial area; Adding at least two rays of preset length starting from the center of the circle and passing through the scale area in the dial area; Based on the rays, the dial area is horizontally processed to obtain a horizontally processed dial area; The reading of the pointer instrument is obtained according to the following formula: Among them, X pointer is the pointer position, X l-scale is the main scale nearest to the left of the pointer, X r-scale is the main scale nearest to the right of the pointer, V l Represents X l-scale The scale value represented by V r Represents X r-scale The scale value represented by V represents the reading of the pointer instrument.

2. The automatic reading method according to claim 1, characterized in that: After the step of acquiring the image data of the pointer instrument, the automatic reading method further comprises: Inputting the image data into a dial detection model to obtain the dial area; Inputting the dial area into an instrument scale value text detection model to obtain scale value text; The scale value text is input into an instrument scale value text recognition model to obtain the scale value corresponding to the scale position.

3. The automatic reading method according to claim 1, characterized in that: After the step of acquiring the image data of the pointer instrument, the automatic reading method includes: Obtaining a dial image template corresponding to the dial area; Affine correction is performed on the dial area based on the dial image template so that the dial area is rotated to a preset angle, and the scale value of the dial area is corrected based on the dial image template.

4. The automatic reading method according to claim 1, characterized in that: The step of intercepting the scale area of ​​the dial area after the horizontalization process comprises: Obtaining the coordinates of the scale area; adjusting the coordinates so that the scale area includes a redundant area; The scale area is intercepted on the dial area based on the coordinates.

5. The automatic reading method according to claim 1, characterized in that: Before the step of determining the pointer position and the scale position of the pointer instrument based on the area of ​​the connected area in the scale area, the automatic reading method further includes: Binarization is performed on the scale area to obtain a binary image; The binary image is subjected to vertical projection processing to obtain a pixel distribution map; the pixel distribution map is used to determine the area of ​​the connected region in the binary image.

6. The automatic reading method according to claim 5, characterized in that: The step of determining the pointer position of the pointer instrument based on the area of ​​the connected area in the scale area comprises: The position with the largest number of pixels is determined as the candidate area for the pointer position; Determine the connected region with the largest area in the binary image according to the candidate region of the pointer position; The center line of the connected area is determined as the pointer position.

7. The automatic reading method according to claim 5, characterized in that: The step of determining the scale position of the pointer instrument based on the area of ​​the connected area in the scale area comprises: Determine the position where the number of pixels is within a preset range as the main scale position candidate area; Determine a connected region in the binary image according to the major scale position candidate region; The center line of the connected area is determined as the main scale position.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the automatic reading method of the pointer instrument as described in any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automatic reading method of the pointer instrument as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Pointer instrument reading identification method

    CN107609557A

  • Reading method and device of pointer type disc instrument

    CN112464986A