A method for identifying pointer instrument readings based on deep learning

Through the method based on deep learning, the dial content of the pointer instrument is automatically identified and analyzed, which solves the difficult problems of manual interference and feature extraction in the existing technology, and achieves fast and accurate identification of instrument readings.

CN118736583BActive Publication Date: 2025-01-24BEIJING ZHIMENG XINTONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410834351.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2025-01-24
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

The prior art has problems such as manual interference, low efficiency, low accuracy and poor real-time performance in pointer instrument reading recognition, especially under the diversity of instrument types and environmental complexity, feature extraction is difficult.

Method used

Adopting deep learning methods, through training detection models, including instrument detection models and dial content detection models, automatically identify the boundary box, needle shaft, pointer, and scale of the instrument dial, calculate the angle of pointer and scale point, combine the OCR recognition algorithm to obtain the reading number Essence

Benefits of technology

It achieves fast and accurate instrument reading identification without manual intervention, saves a lot of manual labor, and has high accuracy and strong robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736583B_ABST
    Figure CN118736583B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying pointer-type instrument readings based on deep learning, the method comprising the following steps: obtaining an instrument dial boundary frame and cropping and correcting to obtain an instrument dial image; obtaining a sub-boundary frame and obtaining scale point readings and center point coordinates; obtaining a pointer angle and a scale point angle according to the center point coordinates; obtaining the pointer front scale point angle and the pointer rear scale point angle according to the pointer angle and the scale point angle, and then obtaining the pointer front scale point reading and the pointer rear scale point reading; obtaining the instrument reading according to the pointer angle, the pointer front scale point angle, the pointer rear scale point angle, the pointer front scale point reading and the pointer rear scale point reading. The present invention has the following beneficial effects: the pointer-type instrument reading identification method based on deep learning provided by the present invention does not require manual intervention, saves labor, has a fast recognition speed, a high accuracy rate, and strong robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pointer instrument readings, and in particular to a pointer instrument reading recognition method based on deep learning. Background Art

[0002] Pointer instruments can reflect the state of the measured object in real time and have been widely used in many fields of production and life, especially in the power industry, playing a pivotal role. Pointer instruments have simple structures, strong real-time performance, intuitive display and low prices. In addition, their reliability and stability have been fully verified in complex environments, and they can operate stably for a long time to ensure the continuity and accuracy of monitoring data.

[0003] At present, there are two main ways to read pointer instruments: one is the manual method, which not only requires rich experience, but is also restricted by human subjective factors, resulting in low reading efficiency, low accuracy and poor real-time performance. With the development of computer vision technology, people have begun to use machine vision technology to identify instrument readings. Traditional machine vision methods can automatically read instrument readings, but rely on manual extraction of relevant features, which not only requires high experience for algorithm personnel, but also due to the diversity of instrument types and the complexity of the environment, it may be very difficult to design an effective feature extraction method. Summary of the invention

[0004] In order to solve the above-mentioned problems in the prior art, the present invention provides a pointer meter reading recognition method based on deep learning, which does not require manual intervention, saves manpower, has a fast recognition speed, high accuracy and strong robustness.

[0005] In order to achieve the above-mentioned object of the invention, the present invention provides a pointer meter reading recognition method based on deep learning, comprising the following steps:

[0006] Obtaining a detection model according to the training data set; the detection model includes an instrument detection model and a dial content detection model;

[0007] Get a picture including the instrument image;

[0008] Acquire an instrument panel boundary frame based on the picture and the instrument detection model, and crop to obtain an initial instrument panel image;

[0009] Correcting and processing the initial instrument panel image to obtain an instrument panel image;

[0010] Based on the dial content detection model, a sub-bounding box is obtained according to the instrument dial image; the sub-bounding box includes: a needle axis bounding box, a pointer bounding box and a scale bounding box;

[0011] Acquire the center point coordinates according to the sub-boundary box, the center point coordinates include: the needle axis center point coordinates, the pointer center point coordinates and the scale center point coordinates; or acquire the needle axis center point coordinates according to the scale center point coordinates;

[0012] Obtaining the pointer vertex coordinates according to the needle axis center point coordinates, the pointer center point coordinates and the pointer bounding box;

[0013] Obtaining a pointer angle according to the coordinates of the needle axis center point and the coordinates of the pointer vertex, and obtaining a scale point angle according to the coordinates of the needle axis center point and the coordinates of the scale center point;

[0014] Obtaining the pointer front scale point angle and the pointer rear scale point angle according to the pointer angle and the scale point angle;

[0015] Based on the OCR recognition algorithm, the pointer front scale point reading and the pointer rear scale point reading are obtained according to the pointer front scale point angle and the pointer rear scale point angle;

[0016] The meter reading is obtained according to the pointer angle, the angle of the scale point in front of the pointer, the angle of the scale point behind the pointer, the reading of the scale point in front of the pointer and the reading of the scale point behind the pointer.

[0017] Furthermore, the meter reading is:

[0018]

[0019] In the formula, res is the meter reading, r1 is the reading of the scale point before the pointer, r2 is the reading of the scale point after the pointer, θ r is the pointer angle, θ1 is the angle of the scale point before the pointer, and θ2 is the angle of the scale point after the pointer.

[0020] Furthermore, the initial instrument dial image is corrected and processed by a perspective transformation method to obtain the instrument dial image.

[0021] Furthermore, when the sub-boundary box is successfully obtained, the center point coordinates are obtained according to a center point coordinate calculation formula, and the center point coordinate calculation formula is:

[0022]

[0023] Where x is the horizontal coordinate of the center point, y is the vertical coordinate of the center point, box is the sub-bounding box, box[0] is the horizontal coordinate of the upper left corner of the sub-bounding box, box[1] is the vertical coordinate of the upper left corner of the sub-bounding box, box[2] is the horizontal coordinate of the lower right corner of the sub-bounding box, and box[3] is the vertical coordinate of the lower right corner of the sub-bounding box.

[0024] Further, when the acquisition of the needle axis bounding box fails, the needle axis center point coordinates are obtained according to the scale center point coordinates. The steps are as follows:

[0025] Select three non-collinear scale center points;

[0026] Based on the fact that the distances from the scale center points to the needle axis center point are equal, formula one is obtained according to the three non-collinear scale center points. Formula one is:

[0027]

[0028] In the formula, is the abscissa of the first scale center point, is the abscissa of the second scale center point, is the abscissa of the third scale center point, is the ordinate of the first scale center point, is the ordinate of the second scale center point, is the ordinate of the third scale center point, x0 is the abscissa of the needle axis center point, y0 is the ordinate of the needle axis center point, and r is the distance from the scale center point to the needle axis center point;

[0029] Simplify formula one to obtain formula two. Formula two is:

[0030]

[0031] Obtain the determinant of formula two according to formula two. The determinant of formula two is:

[0032]

[0033] In the formula, |A| is the determinant of formula two;

[0034] Solve the determinant of formula two according to Cramer's rule to obtain the needle axis center point coordinates as:

[0035]

[0036] In the formula,

[0037] Further, the formula for the pointer vertex coordinates is:

[0038] When x t0 > x0, y t0 < y0:

[0039]

[0040] When x t0 > x0, y t0> When y0:

[0041]

[0042] When x t0 < x0, y t0 < y0:

[0043]

[0044] When x t0 < x0, y t0 > y0:

[0045]

[0046] When x t0 > x0, y t0 = y0:

[0047]

[0048] When x t0 < x0, y t0 = y0:

[0049]

[0050] When x t0 = x0, y t0 < y0:

[0051]

[0052] When x t0 = x0, y t0 > y0:

[0053]

[0054] Wherein, x t is the abscissa of the pointer vertex, y t is the ordinate of the pointer vertex, x0 is the abscissa of the center point of the needle shaft, y0 is the ordinate of the center point of the needle shaft, x t0 is the abscissa of the center point of the pointer bounding box, y t0 is the ordinate of the center point of the pointer bounding box, x t1 is the abscissa of the upper left corner point of the pointer bounding box, y t1 is the ordinate of the upper left corner point of the pointer bounding box, x t2 is the abscissa of the lower right corner point of the pointer bounding box, y t2 is the ordinate of the lower right corner point of the pointer bounding box.

[0055] Furthermore, the calculation formula for obtaining the pointer angle is:

[0056]

[0057] Where x0 is the horizontal coordinate of the center point of the needle axis, y0 is the vertical coordinate of the center point of the needle axis, and x t is the horizontal coordinate of the pointer vertex, y t is the vertical coordinate of the pointer vertex, θ r is the pointer angle and π is the circumference of a circle.

[0058] Furthermore, the steps of obtaining the reading of the scale point before the pointer and the reading of the scale point after the pointer are:

[0059] Obtaining instrument configuration information according to the instrument dial;

[0060] Detecting the instrument dial image by using the dial content detection model to obtain a scale boundary box;

[0061] Using an OCR recognition algorithm to recognize text information within the scale boundary box to obtain a reading;

[0062] Aligning the reading with the instrument configuration information to obtain a scale point reading;

[0063] Obtaining the scale point angle according to the scale center point and the needle axis center point;

[0064] Obtaining scale point reading and scale point angle matching information according to the scale point reading and the scale point angle;

[0065] Obtaining the angle of the scale point before the pointer and the angle of the scale point after the pointer according to the scale point angle and the pointer angle;

[0066] The pointer front scale point reading is obtained according to the pointer front scale point angle and the scale point reading and scale point angle matching information, and the pointer rear scale point reading is obtained according to the pointer rear scale point angle and the scale point reading and scale point angle matching information.

[0067] Furthermore, the training data set includes a training instrument data set and a training dial data set, the instrument detection model is obtained according to the training instrument data set, and the dial content detection model is obtained according to the training dial data set.

[0068] Furthermore, the pointer meter reading recognition method based on deep learning is implemented using the YOLOv8 algorithm.

[0069] The beneficial effects of the present invention are as follows: the method provided by the present invention does not require manual intervention, and only requires inputting a picture or image to perform reading recognition of a pointer-type instrument, which can save a lot of manual labor and has the advantages of fast recognition speed, high accuracy, and strong robustness;

[0070] The present invention combines the YOLOv8 algorithm or other algorithms with the OCR recognition technology to achieve accurate detection of the pointer, needle axis and scale on the pointer instrument and its instrument panel, and accurately analyzes and obtains the instrument reading by deeply analyzing the pointer angle, the center point position of the scale, etc.

[0071] For the special case where the needle axis boundary box is not detected and the scale boundary information is incomplete, the present invention can also realize the instrument reading, and the reading is reliable and has strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 A schematic diagram of the principle of the invention;

[0073] Figure 2 It is a schematic diagram of the needle axis boundary box, the pointer boundary box, and the scale boundary box in the present invention. DETAILED DESCRIPTION

[0074] In order to clearly illustrate the technical features of this solution, this solution is described below through a specific implementation method.

[0075] See also Figure 1 , an embodiment of the present invention provides a pointer meter reading recognition method based on deep learning, comprising the following steps:

[0076] A detection model is obtained according to a training data set; preferably, the detection model is obtained by a YOLOv8 algorithm, and the detection model includes an instrument detection model and a dial content detection model; the instrument detection model is used to infer an instrument dial image in a picture, and the dial content detection model is used to infer a needle axis, a pointer and a scale in the instrument dial image; the training data set includes a training instrument data set and a training dial data set, the instrument detection model is obtained according to the training instrument data set, and the dial content detection model is obtained according to the training dial data set.

[0077] Acquire a picture including an instrument image, and use a digital camera or a video camera to take a picture of the instrument to acquire the picture including the instrument image;

[0078] Acquire an instrument panel boundary frame based on the picture and the instrument detection model, and crop to obtain an initial instrument panel image;

[0079] Correcting and processing the initial instrument panel image to obtain an instrument panel image;

[0080] Based on the dial content detection model, a sub-bounding box is obtained according to the instrument dial image; the sub-bounding box includes: a needle axis bounding box, a pointer bounding box and a scale bounding box; the sub-bounding box obtained by using the YOLOv8 algorithm is shown in Figure 2 ;

[0081] Get the pointer angle θ based on the child bounding box r ;

[0082] According to the pointer angle θ r Obtain the angle θ1 of the scale point before the pointer and the angle θ2 of the scale point after the pointer;

[0083] Based on the OCR recognition algorithm, the reading of the scale point in front of the pointer r1 and the reading of the scale point behind the pointer r2 are obtained according to the angle θ1 of the scale point in front of the pointer and the angle θ2 of the scale point behind the pointer;

[0084] According to the pointer angle θ r , the angle θ1 of the scale point in front of the pointer, the angle θ2 of the scale point behind the pointer, the reading r1 of the scale point in front of the pointer and the reading r2 of the scale point behind the pointer to obtain the instrument reading res.

[0085] The meter readings are:

[0086]

[0087] In the formula, res is the meter reading, r1 is the reading of the scale point before the pointer, r2 is the reading of the scale point after the pointer, θ r is the pointer angle, θ1 is the angle of the scale point before the pointer, and θ2 is the angle of the scale point after the pointer.

[0088] In some preferred embodiments, the sub-bounding boxes include: needle axis bounding box box0, pointer bounding box box t and the scale bounding box box r ; The steps to get the pointer angle based on the sub-bounding box are:

[0089] The center point coordinates are obtained according to the sub-bounding box. The center point coordinates include: the needle axis center point coordinates (x0, y0), the pointer center point coordinates (x to ,y to ) and the coordinates of the scale center point;

[0090] According to the pointer bounding box t 、Pointer center point coordinates (x to ,y to ) and the coordinates of the needle axis center point (x0, y0) to obtain the pointer vertex coordinates (x t ,y t );

[0091] According to the coordinates of the needle axis center point (x0, y0) and the pointer vertex coordinates (x t ,y t ) to obtain the pointer angle.

[0092] In common algorithms, when the bounding box of different types of target objects is determined, the coordinates of the bounding box are also determined, that is, when the sub-bounding box is obtained by the corresponding algorithm: the coordinates of the sub-bounding box are expressed as:

[0093] Sub-bounding box [[box[0], box[1]], [box[2], box[3]]], where box is the sub-bounding box;

[0094] in:

[0095] The needle axis bounding box is [[box0[0], box0[1]], [box0[2], box0[3]]]; where box0 is the needle axis bounding box;

[0096] Pointer bounding box [[box t [0],box t [1]],[box t [2], box t [3]]]; where box t is the pointer bounding box;

[0097] Scale bounding box [[box m [0],box m [1]],[box m [2], box m [3]]]; where box m is the scale bounding box, m=1~n, m is the scale point number, "1" is the number corresponding to the smallest scale, and "n" is the number corresponding to the largest scale;

[0098] When the sub-bounding box is obtained successfully, the center point coordinates are obtained according to the center point coordinate calculation formula. The center point coordinate calculation formula is:

[0099]

[0100] Where x is the horizontal coordinate of the center point, y is the vertical coordinate of the center point, box is the sub-bounding box, box[0] is the horizontal coordinate of the upper left corner of the sub-bounding box, box[1] is the vertical coordinate of the upper left corner of the sub-bounding box, box[2] is the horizontal coordinate of the lower right corner of the sub-bounding box, and box[3] is the vertical coordinate of the lower right corner of the sub-bounding box.

[0101] That is, when the needle axis bounding box box0 is obtained successfully, according to the center point coordinate calculation formula, the coordinates of the needle axis center point are:

[0102]

[0103] Where x0 is the horizontal coordinate of the center point of the needle axis, y0 is the vertical coordinate of the center point of the needle axis, box0 is the bounding box of the needle axis, box0[0] is the horizontal coordinate of the upper left corner of the bounding box of the needle axis, box0[1] is the vertical coordinate of the upper left corner of the bounding box of the needle axis, box0[2] is the horizontal coordinate of the lower right corner of the bounding box of the needle axis, and box0[3] is the vertical coordinate of the lower right corner of the bounding box of the needle axis.

[0104] Likewise, when the pointer bounding box t When the acquisition is successful, according to the center point coordinate calculation formula, the pointer center point coordinates are:

[0105]

[0106] In the formula, x t0 is the horizontal coordinate of the center point of the pointer, y t0 is the ordinate of the center point of the pointer, box t is the pointer bounding box, box t [0] is the horizontal coordinate of the upper left corner of the pointer bounding box, box t [1] is the ordinate of the upper left corner of the pointer bounding box, box t [2] is the horizontal coordinate of the lower right corner of the pointer bounding box, box t [3] is the vertical coordinate of the lower right corner of the pointer bounding box.

[0107] Similarly, the coordinates of the scale center point can be obtained according to the calculation formula of the center point coordinates. m When the acquisition is successful, according to the center point coordinate calculation formula, the scale center point coordinates are:

[0108]

[0109] In the formula, x m0 is the horizontal coordinate of the scale center point, y m0 is the vertical coordinate of the scale center point, box m is the scale bounding box, box m [0] is the horizontal coordinate of the upper left corner of the scale bounding box, box m [1] is the ordinate of the upper left corner of the scale bounding box, box m [2] is the horizontal coordinate of the lower right corner of the scale bounding box, box m [3] is the vertical coordinate of the lower right corner of the scale bounding box.

[0110] When obtaining the sub-boundary frame according to the instrument dial image, the pointer boundary frame is usually obtained more completely, while the scale boundary frame and the needle axis boundary frame may be incomplete or cannot be obtained, such as the needle axis or scale is blocked by the pointer, or has a logo pasted or printed on it.

[0111] When the needle axis bounding box is not obtained successfully, the coordinates of the needle axis center point are obtained according to the coordinates of the scale center point. The steps are:

[0112] Select three non-collinear scale center points; the coordinates are: coordinates of the first scale center point The coordinates of the second scale center point The third scale point coordinates

[0113] Based on the equal distance between the scale center point and the needle axis center point, formula 1 is obtained according to the three non-collinear scale center points. Formula 1 is:

[0114]

[0115] In the formula, is the horizontal coordinate of the center point of the first scale, is the horizontal coordinate of the center point of the second scale, is the horizontal coordinate of the third scale center point, is the ordinate of the center point of the first scale, is the ordinate of the center point of the second scale, is the ordinate of the third scale center point, x0 is the abscissa of the needle axis center point, y0 is the ordinate of the needle axis center point, and r is the distance from the scale center point to the needle axis center point;

[0116] Simplifying formula 1, we get formula 2, which is:

[0117]

[0118] The determinant of formula 2 is obtained according to formula 2, and the determinant of formula 2 is:

[0119]

[0120] Where |A| is the determinant of formula 2;

[0121] Solve the determinant of formula 2 according to Cramer's rule to obtain the coordinates of the center point of the needle axis:

[0122]

[0123] In the formula,

[0124] For ease of description, the pointer bounding box [[box t [0],box t [1]],[box t [2], box t [3]]] is represented as [[x t1 ,yt1 , [x t2 , y t2 , the formula for the pointer vertex coordinates is:

[0125] When x t0 > x0, y t0 < y0:

[0126]

[0127] When x t0 > x0, y t0 > y0:

[0128]

[0129] When x t0 < x0, y t0 < y0:

[0130]

[0131] When x t0 < x0, y t0 > y0:

[0132]

[0133] When x t0 > x0, y t0 = y0:

[0134]

[0135] When x t0 < x0, y t0 = y0:

[0136]

[0137] When x t0 = x0, y t0 < y0:

[0138]

[0139] When x t0 = x0, y t0 > y0:

[0140]

[0141] In the formula, x t is the abscissa of the pointer vertex, y t is the ordinate of the pointer vertex, x0 is the abscissa of the center point of the needle shaft, y0 is the ordinate of the center point of the needle shaft, x t0is the horizontal coordinate of the center point of the pointer bounding box, y t0 is the ordinate of the center point of the pointer bounding box, x t1 The horizontal coordinate of the upper left corner of the pointer bounding box, y t1 is the ordinate of the upper left corner of the pointer bounding box, x t2 is the horizontal coordinate of the lower right corner of the pointer bounding box, y t2 The ordinate of the lower right corner of the pointer's bounding box.

[0142] Furthermore, the calculation formula for obtaining the pointer angle is:

[0143]

[0144] Where x0 is the horizontal coordinate of the center point of the needle axis, y0 is the vertical coordinate of the center point of the needle axis, and x t is the horizontal coordinate of the pointer vertex, y t is the vertical coordinate of the pointer vertex, θ r is the pointer angle and π is the circumference of a circle.

[0145] Furthermore, the steps of obtaining the reading of the scale point before the pointer and the reading of the scale point after the pointer are:

[0146] Obtaining instrument configuration information according to the instrument dial; the instrument includes an instrument dial;

[0147] Detecting the instrument dial image by using the dial content detection model to obtain a scale boundary box;

[0148] Using an OCR recognition algorithm to recognize text information within the scale boundary box to obtain a reading;

[0149] The reading is aligned with the instrument configuration information to obtain the scale point reading; when obtaining the sub-boundary frame according to the instrument dial image, when the scale is blocked by the pointer, pasted or printed with a logo, etc., the number of detected scale bounding frames will be inconsistent with the number of scale points on the actual instrument dial, that is, the reading needs to be aligned with the instrument configuration information to obtain the sub-boundary frame according to the instrument dial image. Figure 2 Taking the instrument dial image in as an example, the instrument configuration information obtained according to the instrument dial is [0, 10, 20, 30, 40, 50, 60, 70, 80]. When some scales are not detected, some information is missing. For example, when the scale "20" is not detected, it is [0, 10, 30, 40, 50, 60, 70, 80]. After alignment with the instrument configuration information, the scale point readings are 0, 10, 20, 30, 40, 50, 60, 70, 80 respectively.

[0150] Obtaining the scale point angle according to the scale center point and the needle axis center point;

[0151] Similar to the calculation process of the pointer angle, the angle between each scale center point and the needle axis center point is the scale point angle, and the calculation formula of the scale point angle is:

[0152]

[0153] Where x0 is the horizontal coordinate of the center point of the needle axis, y0 is the vertical coordinate of the center point of the needle axis, and x m0 is the horizontal coordinate of the scale center point, y m0 is the ordinate of the scale center point, is the angle of the scale point, π is the circumference of a circle. m=1~n, m is the scale point number, "1" is the number corresponding to the smallest scale, and n is the number corresponding to the largest scale;

[0154] According to the scale point angle and the pointer angle, the scale point angle before the pointer and the scale point angle after the pointer are obtained; the pointer angle θ r Angle with scale point Compare and find the angle θ with the pointer r The angle between two adjacent scale points Where, the angle θ with the pointer r Adjacent and less than the pointer angle θ r The scale point angle is the angle θ1 of the scale point in front of the pointer, and the angle θ r Adjacent and greater than the pointer angle θ r The scale point angle is the angle θ2 of the scale point before the pointer;

[0155] According to the scale point readings and the scale point angles, the scale point readings and scale point angle matching information are obtained; the scale point readings and scale point angle matching information is a dictionary with the scale point angles as keys and the scale point readings as values, Figure 2 The information of the middle scale point reading and the scale point angle matching is: in, The scale point angles can be obtained through the scale point angle calculation formula, that is, each scale point angle corresponds to a scale point reading;

[0156] Obtaining the angle of the scale point before the pointer and the angle of the scale point after the pointer according to the scale point angle and the pointer angle;

[0157] The scale point reading in front of the pointer is obtained according to the scale point angle in front of the pointer and the matching information of the scale point reading and the scale point angle; the scale point reading behind the pointer is obtained according to the scale point angle behind the pointer and the matching information of the scale point reading and the scale point angle, that is, the scale point angle in front of the pointer and the scale point angle behind the pointer are both scale point angles, and the scale point reading in front of the pointer and the scale point reading behind the pointer are both scale point readings. By calling the matching information of the scale point readings and the scale point angles, the scale point reading in front of the pointer corresponding to the scale point angle in front of the pointer and the scale point reading behind the pointer corresponding to the scale point angle behind the pointer can be obtained respectively.

[0158] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0160] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A pointer instrument reading recognition method based on deep learning, characterized in that: The following steps are involved: Obtain a detection model based on the training data set; The detection model includes an instrument detection model and a dial content detection model; Get a picture including the instrument image; Acquire an instrument panel boundary frame based on the picture and the instrument detection model, and crop to obtain an initial instrument panel image; Correcting and processing the initial instrument panel image to obtain an instrument panel image; Based on the dial content detection model, obtaining a sub-bounding box according to the instrument dial image; The sub-boundary boxes include: a needle axis boundary box, a pointer boundary box and a scale boundary box; Acquire the center point coordinates according to the sub-boundary box, the center point coordinates include: the needle axis center point coordinates, the pointer center point coordinates and the scale center point coordinates; or acquire the needle axis center point coordinates according to the scale center point coordinates; Obtaining the pointer vertex coordinates according to the needle axis center point coordinates, the pointer center point coordinates and the pointer bounding box; Obtaining a pointer angle according to the coordinates of the needle axis center point and the coordinates of the pointer vertex, and obtaining a scale point angle according to the coordinates of the needle axis center point and the coordinates of the scale center point; Obtaining the pointer front scale point angle and the pointer rear scale point angle according to the pointer angle and the scale point angle; Based on the OCR recognition algorithm, the pointer front scale point reading and the pointer rear scale point reading are obtained according to the pointer front scale point angle and the pointer rear scale point angle; Obtaining an instrument reading according to the pointer angle, the pointer front scale point angle, the pointer rear scale point angle, the pointer front scale point reading, and the pointer rear scale point reading; The meter readings are: In the formula, res is the meter reading, r1 is the reading of the scale point before the pointer, r2 is the reading of the scale point after the pointer, θ r is the pointer angle, θ1 is the angle of the scale point before the pointer, and θ2 is the angle of the scale point after the pointer.

2. The method for identifying pointer meter readings based on deep learning according to claim 1, characterized in that: The initial instrument panel image is corrected and processed by using a perspective transformation method to obtain the instrument panel image.

3. The method for identifying pointer meter readings based on deep learning according to claim 2, characterized in that: When the sub-boundary box is successfully obtained, the center point coordinates are obtained according to the center point coordinate calculation formula, and the center point coordinate calculation formula is: Where x is the horizontal coordinate of the center point, y is the vertical coordinate of the center point, box is the sub-bounding box, box[0] is the horizontal coordinate of the upper left corner of the sub-bounding box, box[1] is the vertical coordinate of the upper left corner of the sub-bounding box, box[2] is the horizontal coordinate of the lower right corner of the sub-bounding box, and box[3] is the vertical coordinate of the lower right corner of the sub-bounding box.

4. The method for identifying pointer meter readings based on deep learning according to claim 3 is characterized in that: When the needle axis boundary box is not successfully obtained, the coordinates of the needle axis center point are obtained according to the coordinates of the scale center point, the steps are: Select three non-collinear scale center points; Based on the equal distance between the scale center point and the needle axis center point, formula 1 is obtained according to the three non-collinear scale center points, and the formula 1 is: In the formula, is the horizontal coordinate of the center point of the first scale, is the horizontal coordinate of the center point of the second scale, is the horizontal coordinate of the third scale center point, is the ordinate of the center point of the first scale, is the ordinate of the center point of the second scale, is the ordinate of the third scale center point, x0 is the abscissa of the needle axis center point, y0 is the ordinate of the needle axis center point, and r is the distance from the scale center point to the needle axis center point; Simplifying formula 1, we get formula 2, which is: The determinant of formula 2 is obtained according to formula 2, and the determinant of formula 2 is: Where |A| is the determinant of formula 2; Solve the determinant of formula 2 according to Cramer's rule to obtain the coordinates of the center point of the needle axis: In the formula, 5. The method for identifying pointer meter readings based on deep learning according to claim 3 or 4, characterized in that: The formula for the pointer vertex coordinates is: When x t0 > x0, y t0 < y0: When x t0 >x0、y t0 >y0: When x t0 < x0, y t0 < y0: When x t0 <x0、y t0 >y0: When x t0 >x0、y t0 =y0: When x t0 <x0、y t0 =y0: When x t0 = x0, y t0 < y0: When x t0 =x0,y t0 >y0: In the formula, x t is the horizontal coordinate of the pointer vertex, y t is the ordinate of the pointer vertex, x0 is the abscissa of the needle axis center point, y0 is the ordinate of the needle axis center point, x t0 is the horizontal coordinate of the center point of the pointer bounding box, y t0 is the ordinate of the center point of the pointer bounding box, x t1 The horizontal coordinate of the upper left corner of the pointer bounding box, y t1 The ordinate of the upper left corner of the pointer bounding box, x t2 is the horizontal coordinate of the lower right corner of the pointer bounding box, y t2 The ordinate of the lower right corner of the pointer's bounding box.

6. The method for identifying pointer meter readings based on deep learning according to claim 5, characterized in that: The calculation formula for obtaining the pointer angle is: Where x0 is the horizontal coordinate of the center point of the needle axis, y0 is the vertical coordinate of the center point of the needle axis, and x t is the horizontal coordinate of the pointer vertex, y t is the vertical coordinate of the pointer vertex, θ r is the pointer angle and π is the circumference of a circle.

7. The method for identifying pointer meter readings based on deep learning according to claim 1, characterized in that: The steps of obtaining the reading of the scale point before the pointer and the reading of the scale point after the pointer are as follows: Obtaining instrument configuration information according to the instrument dial; Detecting the instrument dial image by using the dial content detection model to obtain a scale boundary box; Using an OCR recognition algorithm to recognize text information within the scale boundary box to obtain a reading; Aligning the reading with the instrument configuration information to obtain a scale point reading; Obtaining the scale point angle according to the scale center point and the needle axis center point; Obtaining scale point reading and scale point angle matching information according to the scale point reading and the scale point angle; Obtaining the angle of the scale point before the pointer and the angle of the scale point after the pointer according to the scale point angle and the pointer angle; The pointer front scale point reading is obtained according to the pointer front scale point angle and the scale point reading and scale point angle matching information, and the pointer rear scale point reading is obtained according to the pointer rear scale point angle and the scale point reading and scale point angle matching information.

8. The method for identifying pointer meter readings based on deep learning according to claim 1, characterized in that: The training data set includes a training instrument data set and a training dial data set. The instrument detection model is obtained according to the training instrument data set, and the dial content detection model is obtained according to the training dial data set.

9. The method for identifying pointer meter readings based on deep learning according to claim 1, characterized in that: The pointer meter reading recognition method based on deep learning is implemented using the YOLOv8 algorithm.

Citation Information

Patent Citations

  • Circular pointer type meter reading method of a switch cabinet detection device

    CN109034170A

  • Multi-pointer representation number recognition device and method based on deep learning

    CN117456147A