Dial scale reading method, device and equipment for a pointer instrument

By using image segmentation and Hough line detection technology, the problems of low reading efficiency and large error of mechanical instruments have been solved, enabling high-precision readings in harsh environments, adapting to different lighting conditions and resolutions, and expanding the application range.

CN116844140BActive Publication Date: 2025-11-07XIAMEN HUIERKANG FOOD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310724975.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2025-11-07
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

Existing mechanical instrument reading methods are inefficient and have large errors, especially in harsh environments where they pose a risk to personnel. Furthermore, the error that is difficult to eliminate exists when determining the reading by detecting the straight line corresponding to the edge of the pointer.

Method used

By employing image segmentation and Hough line detection techniques, the target area, center, and radius of the pointer instrument are detected. The longest line segment is detected using the Hough line detection function, and the valid intersection point is determined based on the distance between the intersection point and the starting and ending points. This determines the current angle of the pointer and the dial scale.

Benefits of technology

It improves reading accuracy, adapts to different lighting conditions and resolutions, expands the range of applications, and avoids the influence of pointer shape and width on reading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116844140B_ABST
    Figure CN116844140B_ABST
Patent Text Reader

Abstract

The application discloses a dial scale reading method, device and equipment of a pointer instrument, and the method comprises the following steps: image segmentation is performed on a target image to obtain a target area where the pointer instrument is located and parameters of the pointer instrument; the target image is subjected to gray scale conversion and edge detection to obtain an edge image; in the target area, a Hough line detection function is used to detect all line segments in the target area, and the longest line segment is found out; the longest line segment is elongated to obtain two intersection points of the longest line segment and the edge of the target area, and the effective intersection points are judged according to the distances of the two intersection points, a starting point and an ending point and the radius; the current angle of the pointer instrument is determined according to the angle of the straight line formed by the effective intersection points and the center, and the dial scale of the pointer instrument is determined according to the current angle. In the embodiment, the accuracy of the reading of the pointer instrument is improved, and the embodiment can be suitable for different illumination light, resolution and background, and has a wider application range.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, in particular to a dial scale reading method, device and equipment of a pointer instrument. BACKGROUND

[0002] Mechanical instruments are widely used due to their advantages of strong anti-interference, dustproof, waterproof, long service life, etc. In some harsh environments, mechanical instruments are still the first choice.

[0003] In the early days, the reading of these mechanical instruments was more or less through manual meter reading method, but the manual meter reading method is not only low in efficiency, but also high in error rate, in addition, there may be personnel risk problems in harsh environments.

[0004] With the development of technology, automatic reading of mechanical instruments through machine vision has also been developed. These methods are mostly through detecting the angle of the straight line corresponding to the edge of the pointer, and then determining the reading of the instrument according to the angle.

[0005] The inventor found in the implementation of the present application that since the pointer usually has a width and the width of different parts of different pointers is also different, the use of the straight line corresponding to the edge of the pointer to determine the reading of the instrument will have an error that is difficult to eliminate. SUMMARY

[0006] Therefore, the purpose of the present application is to provide a dial scale reading method, device and equipment of a pointer instrument to improve the above problems.

[0007] The present application provides a dial scale reading method of a pointer instrument, which comprises:

[0008] performing image segmentation on a target image containing a pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument; the parameters include a center and a radius;

[0009] performing gray scale conversion and edge detection on the target image to obtain an edge image;

[0010] in the target region of the edge image, using a Hough line detection function to detect all line segments in the target region and find the longest line segment among all line segments;

[0011] determining the starting point and the ending point of the longest line segment according to the distance from the two end points of the longest line segment to the center;

[0012] extending the longest line segment to obtain two intersection points with the edge of the target region, and judging the effective intersection points according to the distance between the two intersection points and the starting point and the ending point and the radius;

[0013] According to the angle of the straight line formed by the effective intersection point and the center of the circle, the current angle of the pointer instrument is determined, and the dial scale of the pointer instrument is determined according to the current angle.

[0014] Preferably, the target image containing the pointer instrument is subjected to image segmentation to obtain a target region where the pointer instrument is located and the center of the circle and the radius of the pointer instrument.

[0015] The target image containing the pointer instrument is subjected to image segmentation by using the image segmentation mode of the YOLOv5 target detection algorithm to obtain a target region where the pointer instrument is located and the center of the circle and the radius of the pointer instrument.

[0016] Preferably, the parameter further includes the rotation angle of the pointer instrument; and the method further includes:

[0017] The target image is reversely rotated according to the rotation angle, so that the target image remains upright.

[0018] Preferably, when the edge image in the target region is used to calculate all line segments in the target region by using a Hough line detection function, and the longest line segment in all line segments is found, a mask range with the edge of the target region as the range is created to ensure that the calculation range of the Hough line detection function is within the target region.

[0019] Preferably, the longest line segment is extended to obtain two intersection points with the edge of the target region, and an effective intersection point is determined according to the distances of the two intersection points from the start point and the end point and the radius, and specifically includes:

[0020] The straight line function of the longest line segment and the circle function of the target region are obtained.

[0021] According to the straight line function and the circle function, the first intersection point p1 and the second intersection point p2 of the longest line segment and the edge of the target region are calculated.

[0022] The distance d1 of the first intersection point p1 from the start point and the distance d2 of the first intersection point p1 from the end point are calculated.

[0023] When d1 is less than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1.

[0024] When d1 is greater than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1.

[0025] When d1 is less than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2.

[0026] When d1 is greater than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2.

[0027] The embodiment of the present application also provides a dial scale reading device of a pointer instrument, which comprises:

[0028] an image segmentation unit, configured to perform image segmentation on a target image containing the pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument; the parameters comprise a center and a radius;

[0029] an edge detection unit, configured to perform gray scale conversion and edge detection on the target image to obtain an edge image;

[0030] a straight line detection unit, configured to use a Hough line detection function to detect all line segments in the target region of the edge image and find the longest line segment among all the line segments;

[0031] a start and end point determination unit, configured to determine a start point and an end point of the longest line segment according to distances from two end points of the longest line segment to the center;

[0032] an effective intersection determination unit, configured to extend the longest line segment to obtain two intersections of the longest line segment with edges of the target region, and determine an effective intersection according to distances of the two intersections from the start point and the end point and the radius;

[0033] a reading unit, configured to determine a current angle of the pointer instrument according to an angle of a straight line formed by the effective intersection and the center, and determine a dial scale of the pointer instrument according to the current angle.

[0034] Preferably, the parameters further comprise a rotation angle of the pointer instrument; and the device further comprises:

[0035] a rotation unit, configured to perform reverse rotation on the target image according to the rotation angle, so that the target image is kept upright.

[0036] Preferably, when the Hough line detection function is used to calculate all line segments in the target region of the edge image and find the longest line segment among all the line segments, a mask range is created with edges of the target region as a range, so as to ensure that a calculation range of the Hough line detection function is within the target region.

[0037] Preferably, the effective intersection determination unit is specifically configured to:

[0038] obtain a straight line function of the longest line segment and a circle function of the target region;

[0039] calculate the first intersection p1 and the second intersection p2 of the longest line segment with the edges of the target region according to the straight line function and the circle function;

[0040] Calculate the distance d1 between the first intersection point p1 and the starting point and the distance d2 between the first intersection point p1 and the ending point;

[0041] When d1 is less than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1;

[0042] When d1 is greater than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1;

[0043] When d1 is less than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2;

[0044] When d1 is greater than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2.

[0045] The embodiment of the present application also provides a dial scale reading device of a pointer instrument, which comprises a memory and a processor, and the memory stores a computer program which can be executed by the processor to realize the dial scale reading method of the pointer instrument.

[0046] In conclusion, in the embodiment, the reading method can avoid the influence of the shape and width of the pointer on the final reading of the pointer, improve the accuracy of the reading, and be suitable for different illumination light, resolution and background, and has a wider application range. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described in the following only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0048] Figure 1 is a flowchart of the dial scale reading method of the pointer instrument provided by the first embodiment of the present application.

[0049] Figure 2 is a schematic diagram of image segmentation on a target image containing a pointer instrument.

[0050] Figure 3 is a schematic diagram of an edge image.

[0051] Figure 4 is a schematic diagram of Hough line detection on a target image.

[0052] Figure 5 is a schematic diagram of determining the longest line segment.

[0053] Figure 6 is a schematic diagram of determining the starting point and the ending point of the longest line segment.

[0054] Figure 7 A diagram for determining the effective intersection point.

[0055] Figure 8 Fig. 1 is a structural schematic diagram of a dial scale reading device of a pointer instrument according to a second embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.

[0057] Referring to Figure 1 , the first embodiment of the present application provides a dial scale reading method of a pointer instrument, which can be executed by a dial scale reading device (hereinafter referred to as a reading device) of the pointer instrument, in particular, by one or more processors in the reading device to implement the following steps:

[0058] S101, performing image segmentation on a target image containing a pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument; the parameters include a center and a radius.

[0059] In this embodiment, in particular, the pointer instrument is a circular instrument.

[0060] In this embodiment, as Figure 2 indicated, the image segmentation mode of the YOLOv5 target detection algorithm can be used to perform image segmentation on a target image containing a pointer instrument to obtain a target region where the pointer instrument is located and a center and a radius of the pointer instrument.

[0061] Wherein, before using the YOLOv5 target detection algorithm to perform image segmentation, a data set needs to be prepared for image segmentation, then the YOLOv5 is trained on the data set, and finally the YOLOv5 is used for inference to obtain the target region where the pointer instrument is located.

[0062] Wherein, it can be known that the target region is a circular region, so the center C and the radius r of the circular region can also be obtained.

[0063] In addition, based on the YOLOv5 target detection algorithm, the rotation angle of the pointer instrument can also be determined, and then the target image is inversely rotated according to the rotation angle, so that the target image is kept upright, thereby improving the accuracy of the reading.

[0064] S102, performing gray scale conversion and edge detection on the target image to obtain an edge image.

[0065] As shown in the edge image, Figure 3 The edge detection algorithm can employ Roberts Cross operator, Prewitt operator, Sobel operator, Kirsch operator, compass operator, Canny operator, Laplacian operator, etc., and the present application is not limited in this regard.

[0066] S103, using a Hough line detection function to detect all line segments in the target region of the edge image, and finding the longest line segment among all line segments.

[0067] In this embodiment, the basic principle of Hough line detection is based on the duality of points and lines. In the line detection task, i.e., the straight line in the image space is one-to-one corresponding to the point in the parameter space, and the straight line in the parameter space is one-to-one corresponding to the point in the image space. This means that two very useful conclusions can be drawn:

[0068] 1) Each straight line in the image space corresponds to a separate point in the parameter space to represent;

[0069] 2) Any part of the line segment in the image space corresponds to the same point in the parameter space.

[0070] Therefore, the Hough line detection algorithm is to convert the line detection problem in the image space to the point detection problem in the parameter space, and to complete the line detection task by finding the peak value in the parameter space.

[0071] In order to avoid interference with Hough line detection, this embodiment creates a mask range with the target region as the range to ensure that the calculation is only in the target region where the instrument circle is located, as shown in Figure 4 .

[0072] In this embodiment, after using the Hough line detection function to detect all line segments in the target region, the longest line segment 10 can be obtained by calculating the length of each line segment, as shown in Figure 5 .

[0073] In this embodiment, the longest line segment 10 is identified as a part of the instrument pointer. It should be understood that since the parameters of the Hough line detection function are applicable to different lighting, resolution, background, etc., a straight line in the photo will often be detected as multiple straight lines, and it is not possible to achieve 100% accurate line detection.

[0074] S104, determining the starting point and the ending point of the longest line segment according to the distance from the two endpoints of the longest line segment to the center of the circle.

[0075] In the embodiment, the point close to the center of the circle is considered as the starting point of the longest line segment, and the point far from the center of the circle is considered as the ending point of the longest line segment.

[0076] S105, the longest line segment is extended to obtain two intersection points with the edge of the target region, and an effective intersection point is determined according to the distances of the two intersection points from the starting point and the ending point and the radius.

[0077] Specifically, in the embodiment:

[0078] First, a straight line function of the longest line segment and a circle function of the target region are obtained.

[0079] Then, the first intersection point p1 and the second intersection point p2 of the longest line segment with the edge of the target region are calculated according to the straight line function and the circle function.

[0080] In the same coordinate system, the corresponding straight line function of the longest line segment can be obtained according to the coordinates of the two endpoints of the longest line segment, and the circle function can also be obtained according to the center coordinates of the target region and the radius thereof. Then, the two intersection points of the extended line of the longest line segment with the edge of the target region can be obtained by combining the straight line function and the circle function, as shown in Figure 6 .

[0081] Next, the distance d1 of the first intersection point p1 from the starting point and the distance d2 of the first intersection point p1 from the ending point are calculated.

[0082] In the embodiment, it can be understood that only one of the two intersection points is an effective intersection point, and the other is an interference intersection point. The effective intersection point can be determined according to the relationship between the distance of the two intersection points from the starting point and the radius, as shown in Figure 7 . Specifically:

[0083] When d1 is less than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1;

[0084] When d1 is greater than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1;

[0085] When d1 is less than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2;

[0086] When d1 is greater than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2.

[0087] S106, the current angle of the pointer instrument is determined according to the angle of the straight line formed by the effective intersection point and the center, and the dial scale of the pointer instrument is determined according to the current angle.

[0088] In the embodiment, after the valid intersection point is determined, a straight line can be determined according to the center and the valid intersection point, and then the current angle of the pointer of the pointer instrument can be determined according to the angle of the straight line, and further the current instrument reading can be obtained according to the current angle and the scale distribution of the dial of the pointer instrument.

[0089] In summary, in the embodiment, the reading method can avoid the influence of the shape and width of the pointer on the final reading of the pointer, improve the accuracy of the reading, and be suitable for different illumination light, resolution and background, and have a wider application range.

[0090] Referring to Figure 8 The second embodiment of the present application also provides a dial scale reading device of a pointer instrument, which comprises:

[0091] An image segmentation unit 210 is configured to perform image segmentation on a target image containing a pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument, wherein the parameters include a center and a radius;

[0092] An edge detection unit 220 is configured to perform gray scale conversion and edge detection on the target image to obtain an edge image;

[0093] A straight line detection unit 230 is configured to use a Hough line detection function to detect all line segments in the target region of the edge image and find the longest line segment among all the line segments;

[0094] A start and end point determination unit 240 is configured to determine a start point and an end point of the longest line segment according to the distances from the two end points of the longest line segment to the center;

[0095] An effective intersection point determination unit 250 is configured to extend the longest line segment to obtain two intersection points of the longest line segment with the edge of the target region, and determine an effective intersection point according to the distances of the two intersection points from the start point and the end point and the radius;

[0096] A reading unit 260 is configured to determine a current angle of the pointer instrument according to the angle of a straight line formed by the effective intersection point and the center, and determine the scale distribution of the dial of the pointer instrument according to the current angle.

[0097] Preferably, the parameters further include a rotation angle of the pointer instrument; and the device further comprises:

[0098] A rotation unit is configured to perform reverse rotation on the target image according to the rotation angle, so that the target image remains upright.

[0099] Preferably, when a Hough line detection function is used to calculate all line segments in the target region of the edge image and find the longest line segment in all line segments, a mask range with the edge of the target region as a range is created to ensure that the calculation range of the Hough line detection function is in the target region.

[0100] Preferably, the valid intersection point determination unit 250 is specifically configured to:

[0101] obtain a straight line function of the longest line segment and a circle function of the target region;

[0102] calculate a first intersection point p1 and a second intersection point p2 of the longest line segment and the edge of the target region according to the straight line function and the circle function;

[0103] calculate a distance d1 of the first intersection point p1 from the starting point and a distance d2 of the first intersection point p1 from the ending point;

[0104] when d1 is less than the radius and d2 is less than the radius, the valid intersection point is the first intersection point p1;

[0105] when d1 is greater than the radius and d2 is less than the radius, the valid intersection point is the first intersection point p1;

[0106] when d1 is less than the radius and d2 is greater than the radius, the valid intersection point is the second intersection point p2;

[0107] when d1 is greater than the radius and d2 is greater than the radius, the valid intersection point is the second intersection point p2.

[0108] The third embodiment of the present application further provides a dial scale reading device of a pointer instrument, which comprises a memory and a processor, and the memory stores a computer program which can be executed by the processor to implement the dial scale reading method of the pointer instrument as described above.

[0109] The fourth embodiment of the present application further provides a computer readable storage medium which stores a computer program which can be executed by a processor of a device where the computer readable storage medium is located to implement the dial scale reading method of the pointer instrument as described above.

[0110] Exemplarily, the computer program of the present application can be divided into one or more modules which are stored in the memory and executed by the processor to complete the present application. The one or more modules can be a series of computer program instruction segments which can complete a specific function and are used to describe the execution process of the computer program in the device.

[0111] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like, which is the control center of the printing method and is connected to various parts of the method through various interfaces and lines.

[0112] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the printing method by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, a character conversion function, etc.), etc.; and the data storage area can store data created according to the use of the user terminal (such as audio data, character message data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory device.

[0113] If the module for implementing the user terminal is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the contents included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0114] It should be noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.

[0115] The above is only a preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed by the present application can be easily thought of by those skilled in the art, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0116] The above merely describes preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any changes or replacements within the technical scope disclosed by the present application, which can be easily thought by those skilled in the art, should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of reading a dial scale of an analog instrument, characterized in that, The method comprises the following steps: image segmentation is performed on the target image containing the pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument; the parameters include a center and a radius; gray scale conversion and edge detection are performed on the target image to obtain an edge image; in the target region of the edge image, a Hough line detection function is used to detect all line segments in the target region and find the longest line segment among all the line segments; the starting point and the ending point of the longest line segment are determined according to the distances from the two end points of the longest line segment to the center; the longest line segment is extended to obtain two intersection points of the longest line segment and the edge of the target region, and an effective intersection point is determined according to the distances of the two intersection points from the starting point and the ending point and the radius; the current angle of the pointer instrument is determined according to the angle of the straight line formed by the effective intersection point and the center, and the dial scale of the pointer instrument is determined according to the current angle; the longest line segment is extended to obtain two intersection points of the longest line segment and the edge of the target region, and an effective intersection point is determined according to the distances of the two intersection points from the starting point and the ending point and the radius, which specifically comprises: a straight line function of the longest line segment and a circle function of the target region are obtained; the first intersection point p1 and the second intersection point p2 of the longest line segment and the edge of the target region are calculated according to the straight line function and the circle function; the distance d1 of the first intersection point p1 from the starting point and the distance d2 of the first intersection point p1 from the ending point are calculated; when d1 is less than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1; when d1 is greater than the radius and d2 is less than the radius, the effective intersection point is the first intersection point p1; when d1 is less than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2; when d1 is greater than the radius and d2 is greater than the radius, the effective intersection point is the second intersection point p2.

2. The dial scale reading method of the pointer instrument according to claim 1, wherein the image segmentation is performed on the target image containing the pointer instrument to obtain a target region where the pointer instrument is located and a center and a radius of the pointer instrument, and specifically comprises: the image segmentation is performed on the target image containing the pointer instrument by using a YOLOv5 target detection algorithm to obtain a target region where the pointer instrument is located and a center and a radius of the pointer instrument.

3. The method of reading a dial scale of a pointer instrument according to claim 1, wherein, the parameters further include a rotation angle of the pointer instrument; and the method further comprises: the target image is reversely rotated according to the rotation angle, so that the target image is kept upright.

4. The method of reading a dial of a pointer instrument according to claim 1, wherein, when the Hough line detection function is used to calculate all line segments in the target region and find the longest line segment among all the line segments, a mask range with the edge of the target region as a range is created to ensure that the calculation range of the Hough line detection function is within the target region.

5. A dial scale reading device for an analog instrument, characterized in that, The method comprises the following steps: an image segmentation unit is configured to perform image segmentation on a target image containing a pointer instrument to obtain a target region where the pointer instrument is located and parameters of the pointer instrument; the parameters include a center and a radius; an edge detection unit is configured to perform gray scale conversion and edge detection on the target image to obtain an edge image; a straight line detection unit configured to detect all line segments in the target region of the edge image using a Hough line detection function, and find a longest line segment among the line segments; a start and end point determination unit configured to determine a start point and an end point of the longest line segment according to distances from two end points of the longest line segment to the center of the circle; an effective intersection determination unit configured to extend the longest line segment, obtain two intersections of the extended longest line segment with edges of the target region, and determine an effective intersection according to distances of the two intersections from the start point and the end point and the radius; a reading unit configured to determine a current angle of the pointer instrument according to an angle of a straight line formed by the effective intersection and the center of the circle, and determine a dial scale of the pointer instrument according to the current angle; the effective intersection determination unit is specifically configured to: obtain a straight line function of the longest line segment and a circle function of the target region; calculate a first intersection p1 and a second intersection p2 of the longest line segment with the edges of the target region according to the straight line function and the circle function; calculate a distance d1 of the first intersection p1 from the start point and a distance d2 of the first intersection p1 from the end point; when d1 is less than the radius and d2 is less than the radius, the effective intersection is the first intersection p1; when d1 is greater than the radius and d2 is less than the radius, the effective intersection is the first intersection p1; when d1 is less than the radius and d2 is greater than the radius, the effective intersection is the second intersection p2; when d1 is greater than the radius and d2 is greater than the radius, the effective intersection is the second intersection p2.

6. A dial scale reading device for a pointer instrument according to claim 5, characterised in that, the parameters further include a rotation angle of the pointer instrument; and the method further includes: a rotation unit configured to perform reverse rotation on the target image according to the rotation angle, so that the target image remains upright.

7. A dial scale reading device for a pointer instrument according to claim 5, wherein, when all line segments in the target region of the edge image are calculated using a Hough line detection function, and a longest line segment among the line segments is found, a mask range is created with edges of the target region as a range, so that a calculation range of the Hough line detection function is within the target region.

8. A dial scale reading device for an analog instrument, comprising: a memory and a processor, the memory storing a computer program, the computer program being executable by the processor to implement the dial scale reading method of the pointer instrument according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image-processing-based automatic reading number recognition method of pointer type instrument

    CN108460327A

  • High-precision real-time multi-scale dial pointer detection method and system

    CN110909772A