Pointer instrument reading recognition method, device, equipment and storage medium
By identifying the pointer segments, key scale points and text detection boxes of the pointer instrument, combining the scale values to calculate the initial reading, and determining the final reading based on the standard deviation, the problems of low recognition accuracy and poor anti-interference ability in the prior art are solved, and the problem of low recognition accuracy and poor anti-interference ability in realization is achieved Higher recognition accuracy and adaptability.
Patent Information
- Application Number
- CN202411236179.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-09-04
AI Technical Summary
In the prior art, when identifying the reading of a pointer instrument, the recognition accuracy is not high, resulting in large errors in the reading of the pointer, especially in the case of interference, unclear scale value or the pointer blocks the scale value, the anti-interference ability is poor.
By obtaining pointer segments, key scale points and text detection boxes in the instrument image, matching text recognition results, combining the scale values of key scale points to calculate the initial reading, and determining the final reading based on the standard deviation of multiple initial readings, reducing the specific reading for specific Excessive dependence of scale point positions and scale values improves fault tolerance and robustness.
It improves the recognition accuracy and adaptability of pointer instruments, can accurately identify instrument readings in complex environments, and enhances anti-interference ability and robustness.
Smart Images

Figure CN118736181B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of meter reading recognition, and in particular to a reading recognition method, device, equipment and storage medium for a pointer-type meter. Background Art
[0002] In the inspection robot system, the automatic recognition technology of instrument readings is a key part of the inspection task, especially for pointer instruments, including pressure gauges, ammeters, water meters, and voltmeters. The recognition task of these instruments faces great challenges, mainly due to the accurate identification of the three key parameters of pointer, scale, and scale value. At present, the positioning of the pointer position and scale point of the instrument usually adopts artificial intelligence computer vision algorithms, among which the semantic segmentation network algorithm is the mainstream. For the position detection of the scale value, the semantic segmentation algorithm and the target detection algorithm are mainly used. For the recognition of the scale value, OCR (Optical Character Recognition) technology is dominant. However, when the reading is recognized by this method, the recognition accuracy is not high, resulting in a large error in the recognized pointer reading.
[0003] Therefore, how to improve the recognition accuracy of pointer instruments is a problem that those skilled in the art need to solve. Summary of the invention
[0004] The present application provides a method, device, equipment and storage medium for identifying the reading of a pointer instrument to improve the identification accuracy of the pointer instrument.
[0005] In a first aspect, the present application provides a method for identifying a reading of a pointer instrument, comprising:
[0006] Acquire instrument images of pointer instruments;
[0007] Identify pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image;
[0008] Determine a text detection frame that matches each key scale point, and use the text recognition result of the text detection frame as the scale value of the matching key scale point;
[0009] Combine the scale values of any two key scale points, and calculate the initial reading corresponding to each combination according to the key scale points and scale values of each combination;
[0010] Determine the final reading of the pointer meter from all combined initial readings.
[0011] Optionally, calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination includes:
[0012] According to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment, the coordinates of the center of the pointer and the coordinates of the end where the pointer points are determined;
[0013] Calculate the scale value per unit radian according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer circle; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value;
[0014] Calculate the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the pointer center, the coordinates of the pointer pointing end and the coordinates of the starting scale point;
[0015] An initial reading corresponding to each combination is determined using the starting scale value, the deflection angle, and the scale value per unit radian.
[0016] Optionally, the step of determining the coordinates of the center of the pointer and the coordinates of the end of the pointer pointing to according to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment includes:
[0017] Calculate the distance difference between the coordinates of each target circle center and the coordinates of each key scale point, and calculate the sum of all distance differences;
[0018] The difference and the smallest target circle center coordinate are used as the initial pointer circle center coordinate;
[0019] According to the coordinates of both ends of the pointer line segment, the coordinates of the center of the pointer located on the pointer line segment are found from the initial pointer center coordinates, and the coordinates of the endpoint farthest from the pointer center coordinates among the two end coordinates are used as the pointer pointing end coordinates.
[0020] Optionally, calculating the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the center of the pointer, the coordinates of the end to which the pointer points, and the coordinates of the starting scale point includes:
[0021] Setting a vertically downward reference center line with the pointer center coordinate as the starting point;
[0022] Calculate a first clockwise angle between the reference circle center straight line and the pointer line segment;
[0023] Calculate the second clockwise angle between the reference circle center straight line passing through the pointer circle center coordinates and the starting scale point;
[0024] The deflection angle is calculated by the first clockwise angle and the second clockwise angle.
[0025] Optionally, the identifying of the pointer line segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image includes:
[0026] Identifying a pointer polygon in the instrument image and a key scale point polygon of each key scale point through a feature pyramid network;
[0027] extracting a pointer line segment from the pointer polygon;
[0028] Calculate the key point coordinates of each key point polygon;
[0029] The text detection frames in the instrument image and the text recognition results corresponding to each text detection frame are identified by an optical character recognition model.
[0030] Optionally, determining a text detection frame matching each key scale point and using the text recognition result of the text detection frame as the scale value of the matching key scale point includes:
[0031] Filter invalid text detection boxes from all text detection boxes;
[0032] From the filtered text detection frames, searching for a final text detection frame that matches each key scale point; the final text detection frame is a detection frame that satisfies the distance condition;
[0033] The text recognition result of the final text detection frame is used as the scale value of the key scale point matching the final text detection frame.
[0034] Optionally, a final reading of the pointer meter is determined based on all combined initial readings, including:
[0035] Calculate the standard deviation of the initial readings for all combinations;
[0036] Determining whether the standard deviation is less than a first predetermined threshold;
[0037] If yes, then determine the two target key scale points that are closest to the coordinates of the end pointed by the pointer, and use the initial reading calculated by combining the two target key scale points as the final reading; if no, then determine whether the standard deviation is less than a second predetermined threshold;
[0038] If yes, then the average of all initial readings is taken as the final reading; if no, then the median of all initial readings is taken as the final reading; wherein, the first predetermined threshold is less than the second predetermined threshold.
[0039] In a second aspect, the present application provides a reading recognition device for a pointer-type instrument, comprising:
[0040] An acquisition module, used for acquiring an instrument image of a pointer-type instrument;
[0041] A recognition module, used to recognize pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image;
[0042] A matching module is used to determine a text detection frame that matches each key scale point, and use the text recognition result of the text detection frame as the scale value of the matched key scale point;
[0043] A calculation module, used for combining the scale values of any two key scale points, and calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination;
[0044] A determination module is used to determine a final reading of the pointer instrument based on all the combined initial readings.
[0045] In a third aspect, the present application provides an electronic device, including:
[0046] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the above-mentioned reading identification method through the computer program.
[0047] In a fourth aspect, the present application provides a computer storage medium storing computer executable instructions for executing the steps of the above-mentioned reading identification method of the present application.
[0048] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: in the reading recognition method of the pointer instrument provided by the present application, it is first necessary to respectively identify the pointer line segment, key scale points, text detection frame and text recognition results corresponding to each text detection frame in the instrument image, and determine the scale value of each key scale point by matching; that is, the method of the present application can improve the recognition accuracy; and, when determining the final reading, the present application determines multiple initial readings by combining the scale values of any two key scale points, and determines the final reading based on the standard deviation of all combined initial readings; it can be seen that the present application reduces the excessive reliance on the accuracy of the position of specific scale points and the scale value, thereby improving the fault tolerance rate, so that the present solution can still accurately recognize the instrument reading in the presence of interference in the instrument image, unclear scale values, pointer blocking the scale value and other interference conditions; further, the present application determines the final reading by multiple initial readings, which can effectively improve the accuracy of instrument reading recognition, making the present solution more robust and adaptable when recognizing instrument readings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0052] Figure 1 A schematic diagram of a method for identifying a reading of a pointer instrument provided in an embodiment of the present application;
[0053] Figure 2 A scale value matching process provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a method for identifying a reading of a pointer instrument provided in an embodiment of the present application;
[0055] Figure 4 A schematic flow chart of another method for identifying readings of a pointer-type instrument provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the overall flow of a method for identifying a reading of a pointer instrument provided in an embodiment of the present application;
[0057] Figure 6 A schematic diagram of the structure of a reading recognition device for a pointer-type instrument provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] Specifically, the traditional solution mainly uses semantic segmentation algorithms and target detection algorithms for the position detection of scale values. In terms of scale value recognition, OCR (Optical Character Recognition) technology is dominant. In this method, the model is first trained to accurately segment the pointer of the instrument, a small number of fixed-position scale points, and the scale value position information. Subsequently, with the help of the computer vision algorithm library OpenCV (Open Source Computer Vision Library), the polygon center point acquisition method is used to locate the scale points, and the line segment of the pointer is obtained by the straight line detection algorithm through the OpenCV Hough transform. In terms of scale value recognition, the OCR model is trained to extract the scale value. Finally, the side of the pointer segment close to the center point of the image is taken as the center of the circle, and the unit radian scale value is calculated based on the angle relationship between the two known scale points and the offset relationship between the pointer segment and the pointer segment, and the specific scale value pointed to by the pointer is obtained.
[0060] However, when this method selects a small number of fixed-position scale points and scale values, if a certain point or scale value is not correctly identified or an identification error occurs, or the scale value area cannot be accurately identified because it is blocked by the pointer, it will hinder the subsequent calculation of the pointer scale value. This recognition error or failure reflects that the method has relatively poor anti-interference ability in the face of noise and interference. Secondly, this type of method mainly uses Hough transform to perform a straight line detection algorithm to obtain the line segment of the pointer and takes it close to the center end as the center of the pointer. However, the actual situation is that the pointer polygon segmented by the segmentation network can only indicate the direction of the pointer, but cannot ensure that its close to the center end is the accurate center position of the pointer. Since the center position has not been clearly corrected, there is a large error in identifying the value of the instrument pointer.
[0061] Therefore, the conventional solution still has problems such as poor anti-interference capability and poor pointer reading recognition accuracy. To solve these problems, the present invention proposes a pointer instrument reading recognition method to improve the recognition accuracy of the pointer instrument.
[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0063] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0064] See also Figure 1 , Figure 1 A flowchart of a method for identifying a reading of a pointer instrument provided in an embodiment of the present application is provided. The method specifically comprises the following steps:
[0065] S101, acquiring an instrument image of a pointer instrument;
[0066] Specifically, the instrument image includes an image of a pointer-type instrument whose reading is to be identified. The pointer-type instrument image can be acquired by an inspection robot or by other means, which are not specifically limited here.
[0067] S102, identifying pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image;
[0068] In this embodiment, when identifying the pointer line segments, key scale points, text detection frames and each text detection frame in the instrument image, they can be obtained simultaneously in different ways, such as: using a deep neural network to identify the pointer line segments and key scale points in the instrument image, and at the same time, using an optical character recognition model to identify the text detection frames in the instrument image and the text recognition results corresponding to each text detection frame, thereby achieving parallel accelerated computing and saving recognition time.
[0069] S103, determining a text detection frame that matches each key scale point, and using the text recognition result of the text detection frame as the scale value of the matched key scale point;
[0070] In this embodiment, the text detection frame matching the key scale point can be determined by the distance between each key scale point and different text detection frames, thereby determining the scale value of each key scale point. It can be seen that this solution separates the key scale point and pointer line segment recognition process from the text detection frame and text recognition result recognition process, and then determines the scale value of the key scale point through the position information of the key scale point and the text detection frame. This method can effectively improve the recognition accuracy of the key scale points, pointer line segments, and scale values of the pointer instrument.
[0071] S104, combining the scale values of any two key scale points, and calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination;
[0072] It should be noted that when determining the reading of a pointer instrument, this solution does not determine the reading directly based on the position of the pointer, but first combines the scale values of any two key scale points, calculates the initial reading through the scale values of each group of key scale points, and then determines the final reading based on the initial reading. For example: If there are 5 key scale points in total: key scale point 1, key scale point 2, key scale point 3, key scale point 4, and key scale point 5, select key scale point 1 and key scale point 2 as a combination, calculate the scale value of the unit radian based on the scale values of the two scale points and the angle between the two scale points and the center of the circle, and then combine the angle between key scale point 1 and the pointer segment to calculate the initial reading of the combination of key scale point 1 and key scale point 2. Similarly, the initial readings of other combinations are calculated through the same steps. The number of calculated initial readings is related to the number of key scale points, that is, the number of initial readings is equal to ; where n is the number of key scale points.
[0073] That is to say, this scheme proposes a method for identifying instrument readings based on the scale values of all key scale points. Compared with the calculation method of the scale value of a single scale point, this scheme can reduce the excessive reliance on the accuracy of the position and scale value of a specific scale point, thereby improving the fault tolerance rate. This enables this scheme to accurately identify instrument readings in the presence of various interferences such as interference in the instrument image, unclear scale values, and pointers blocking the scale values, thereby improving the accuracy and adaptability of instrument readings in complex environments.
[0074] S105. Determine the final reading of the pointer instrument according to the initial readings of all combinations.
[0075] It is understandable that after calculating multiple initial readings by S104, the final reading of the pointer-type instrument can be determined according to the initial readings of all combinations, such as: the average value of each initial reading can be directly used as the final reading, or it can be determined according to the degree of change between each initial reading, which is not specifically limited here. For example, in this embodiment, the final reading can be determined by calculating the range, adjacent maximum difference, standard deviation and other methods of the initial readings of all combinations. In this embodiment, only the calculation of the standard deviation to determine the final reading is used as an example for explanation. The standard deviation can reflect the degree of dispersion of each initial reading. The smaller the value of the standard deviation, the lower the dispersion, and the larger the value of the standard deviation, the higher the dispersion. After calculating the standard deviation of multiple initial readings, the final reading can be determined according to the value of the standard deviation. For example: if the value of the standard deviation is small, the initial reading calculated by the combination of two key scale points near the pointer can be directly selected as the final reading. If the value of the standard deviation is large, the average value of all initial readings can be used as the final reading.
[0076] In summary, it can be seen that the present application can improve the recognition accuracy of pointer segments, key scale points, text detection boxes and text recognition results by respectively identifying pointer segments, key scale points, text detection boxes and text recognition results; and, the present application determines multiple initial readings by combining the scale values of any two key scale points, which can reduce excessive reliance on the accuracy of specific scale point positions and scale values, thereby improving the fault tolerance rate, so that the present solution can still accurately identify the instrument readings in various interference-bearing situations such as interference in the instrument image, unclear scale values, and the pointer blocking the scale values; further, the present application determines the final reading through multiple initial readings, which can effectively improve the accuracy of instrument reading recognition, making the present solution more robust and adaptable when identifying instrument readings.
[0077] Based on the above embodiment, in this embodiment, the process of S102 in identifying the pointer line segment, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image specifically includes the following steps:
[0078] Identifying a pointer polygon in the instrument image and a key scale point polygon of each key scale point through a feature pyramid network;
[0079] extracting a pointer line segment from the pointer polygon;
[0080] Calculate the key point coordinates of each key point polygon;
[0081] The text detection frames in the instrument image and the text recognition results corresponding to each text detection frame are identified by an optical character recognition model.
[0082] In this embodiment, the pointer polygon in the instrument image and the key scale point polygon of each key scale point can be specifically identified through the feature pyramid network. Among them, the feature pyramid network is FPN (Feature Pyramid Network), which is a neural network architecture for image segmentation tasks. It is designed to solve the problem of insufficient feature extraction of objects at different scales. The main idea of FPN is to obtain rich semantic information from feature maps at different levels by constructing a top-down and lateral connected pyramid structure. The top-down path of the network starts from high-level semantic information and gradually samples down, while the lateral connection is responsible for fusing the underlying detail information. This structure enables the network to retain both high-level semantics and low-level details, thereby better adapting to objects of different scales.
[0083] This embodiment first needs to establish an instrument data set, marking all the scale points of the displayed scale values of the instrument, which are called key scale points in this solution. In this embodiment, ResNet (Residual Network) 50 can be used as the backbone network of the FPN segmentation network, and the number of output layers is 2, namely the key scale point layer and the pointer layer. The FPN semantic segmentation network outputs the key scale point polygons of all key scale points on the instrument, as well as the pointer polygons.
[0084] Moreover, after obtaining the key scale point polygon output by the network, this solution needs to further process the coordinates of the key scale points. In this embodiment, the center of mass of the polygon can be calculated for each key point polygon as the coordinates of the key scale point, and the coordinates of the center of mass can be obtained by taking the average of the polygon coordinate list. After obtaining the pointer polygon output by the network, this solution needs to further process to obtain the pointer line segment. This embodiment is implemented through the following two steps: First, with the help of the skimage library (a digital image processing package developed based on Python) of Python (programming language), the skimage.morphology.skeletonize function is applied to extract the skeleton of the pointer polygon; the goal of this process is to simplify the representation of the image object while retaining its core structure. Secondly, the skeleton graph is processed by using the Hough transform technology, and the cv2.HoughLines function in the OpenCV library is used to effectively detect the line segments of the pointer polygon. Through the above steps, the accurate extraction of the pointer line segments can be achieved.
[0085] Furthermore, the optical character recognition model of this solution can be PaddleOCR, which is an end-to-end OCR (Optical Character Recognition) tool library developed based on the PaddlePaddle framework. It mainly includes two important parts, namely det (Detection) and rec (Recognition), which are used for text detection and text recognition respectively. In this embodiment, text detection and text recognition are performed directly on the instrument image through PaddleOCR, and the coordinates of all text detection boxes and text box recognition results of the instrument are obtained. It should be noted that this embodiment does not specifically limit the execution order between the process of obtaining the coordinates of the pointer line segment and the key scale point, and the process of obtaining the text detection box and text recognition results. The two processes can be executed successively or simultaneously, but in order to improve the calculation efficiency, this embodiment can execute the above two processes simultaneously.
[0086] In summary, it can be seen that this scheme can use the feature pyramid network to accurately identify all key scale points and pointer segments of the pointer instrument, and use the PaddleOCR model to accurately identify all text information in the pointer instrument to improve the accuracy of the instrument reading.
[0087] Based on the above embodiments, this embodiment specifically includes the following steps when determining the text detection frame that matches each key scale point and using the text recognition result of the text detection frame as the scale value of the matching key scale point: first, filtering invalid text detection frames from all text detection frames; then, searching for the final text detection frame that matches each key scale point from the filtered text detection frames; the final text detection frame is a detection frame that meets the distance condition; finally, using the text recognition result of the final text detection frame as the scale value of the key scale point that matches the final text detection frame.
[0088] It should be noted that after identifying the key scale points, text detection frames and text recognition results, it is necessary to determine the text recognition results corresponding to each key scale point by matching. In order to improve the accuracy of matching, this solution needs to filter all detected text detection frames to remove invalid text detection frames. Figure 2 , is a scale value matching process provided by an embodiment of the present invention, and the process specifically includes the following steps:
[0089] S1031, determining whether the text recognition result of each text detection frame is a number;
[0090] If yes, execute S1032; if no, filter the corresponding text detection box;
[0091] S1032, using the text detection frame whose text recognition result is a number as the first text detection frame;
[0092] S1033, determining whether the confidence of each first text detection box exceeds a confidence threshold;
[0093] If yes, execute S1034; if no, filter the corresponding text detection box;
[0094] S1034, using the first text box whose confidence exceeds the confidence threshold as the second text detection box;
[0095] S1035, searching for a final text detection frame matching each key scale point from all second text detection frames; the final text detection frame is a second text detection frame that meets the distance condition;
[0096] S1036: Using the text recognition result of the final text detection frame as the scale value of the key scale point that matches the final text detection frame.
[0097] pass Figure 2 It can be seen that when filtering invalid text detection frames, this solution first needs to detect whether the text recognition results in each text detection frame are numbers. If they are numbers, the text detection frame with a text recognition result of numbers is called the first text detection frame, and the detection continues. If it is not a number, the text detection frame is filtered out. For the first text detection frame that has been initially filtered, it is necessary to screen it again by checking its confidence. The confidence of the text frame is the reliability index of each text detection frame output by PaddleOCR. The higher the confidence, the more reliable the detection result. Among them, the specific value of the confidence threshold can be customized. This solution only takes the confidence threshold of 0.9 as an example. That is: the first text detection frame with a confidence greater than 0.9 is called the second text detection frame that meets the confidence condition, otherwise the text detection frame is filtered and the subsequent process is not executed.
[0098] Furthermore, the present solution also needs to calculate the center coordinates of each second text detection frame, and calculate the distance from each key scale point to each center coordinate. Each key scale point selects a second text detection frame that satisfies the distance condition as its matching final text detection frame. In the present embodiment, the distance condition specifically refers to: if the distance value between the center coordinates of the second text detection frame and the coordinates of the corresponding key scale point is less than a predetermined distance threshold, the second text detection frame is used as the final text detection frame that matches the key scale point. The predetermined distance threshold can also be set according to actual conditions. In the present embodiment, the predetermined distance threshold can be set to 80. After determining the final text detection frame that matches each key scale point, the text recognition result of the final text detection frame can be used as the scale value of the matching key scale point.
[0099] In summary, it can be seen that after obtaining all text detection frames, in order to improve the matching accuracy, this scheme can remove invalid text detection frames by detecting text content, confidence, etc.; and, this scheme can effectively improve the recognition accuracy of key scale points, pointer segments, and scale values of pointer instruments by separating the recognition process of key scale points and pointer segments from the recognition process of text detection frames and text recognition results, and then determining the scale values of key scale points through the position information of key scale points and text detection frames.
[0100] See also Figure 3 , Figure 3 A flowchart of a method for identifying a reading of a pointer instrument provided in an embodiment of the present application is provided. The method specifically comprises the following steps:
[0101] S201, acquiring an instrument image of a pointer instrument;
[0102] S202, identifying pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image;
[0103] S203, determining a text detection frame that matches each key scale point, and using the text recognition result of the text detection frame as the scale value of the matched key scale point;
[0104] S204, determining the coordinates of the center of the pointer and the coordinates of the end of the pointer pointing according to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment;
[0105] S205, combining the scale values of any two key scale points, and calculating the scale value of a unit arc according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value;
[0106] S206, calculating the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the pointer center, the coordinates of the pointer pointing end and the coordinates of the starting scale point;
[0107] S207, determining an initial reading corresponding to each combination using the starting scale value, the deflection angle, and the scale value per unit radian;
[0108] S208. Determine the final reading of the pointer instrument according to the initial readings of all combinations.
[0109] In this embodiment, when calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination, it is necessary to first determine the pointer center coordinates and the pointer pointing end coordinates. In this embodiment, the above S204 specifically includes the following contents: calculating the distance difference between each target center coordinate and the coordinates of each key scale point, and calculating the difference sum of all distance differences; taking the target center coordinate with the smallest difference sum as the initial pointer center coordinate; according to the coordinates of the two ends of the pointer line segment, searching the pointer center coordinate located on the pointer line segment from the initial pointer center coordinates, and taking the coordinate of the end point farthest from the pointer center coordinate among the two end coordinates as the pointer pointing end coordinate.
[0110] It should be noted that the accurate determination of the center coordinates directly affects the recognition accuracy of the instrument readings. In this solution, the center coordinates are not simply determined by the endpoints of the pointer line segment. Since multiple key scale points are segmented out in the FPN segmentation network, and these scale points are not collinear, this solution first calculates the distance value from a certain coordinate to each key scale point. The coordinate with the least sum of the differences between these distance values is the center coordinate. This embodiment uses this as the objective function of the process of optimizing the center coordinates; and this embodiment obtains the pointer line segment in the FPN segmentation network output, and the center coordinates must fall on the straight line where the pointer line segment is located. This embodiment uses this as the equality constraint condition of the optimization process. That is: this solution specifically sets the objective function and equality constraint conditions to accurately determine the pointer center coordinates and the pointer pointing end coordinates. Among them, the objective function is used to find the initial pointer center coordinates, the sum of the distance differences between the initial pointer center coordinates and the coordinates of each key scale point is minimized, and the equality constraint is used to find the final pointer center coordinates from each initial pointer center coordinates, which is the initial pointer center coordinates on the pointer line segment.
[0111] Specifically, in the rectangular coordinate system, in this embodiment, the center coordinates to be optimized are referred to as target center coordinates, and the target center coordinates are After the instrument image passes through the segmentation network, n key scale point coordinates are output. The coordinates of a single key scale point are expressed as , after the instrument image passes through the segmentation network, the pointer line segment is obtained. The coordinates of the two endpoints of the pointer line segment are , ,in , we get the following initial optimization formula, where formula (1) is the objective function and formula (2) is the equality constraint.
[0112] (1)
[0113] (2)
[0114] In this embodiment, the above two initial optimization formulas are improved for the convenience of calculation. When calculating the distance difference, this solution uses the square of the distance difference instead of the absolute value to simplify the calculation process. In addition, when the pointer points vertically, there is a situation where the horizontal coordinates of the pointer segments are equal, which will cause the denominator to be 0 in the equality constraint of the initial optimization formula. Therefore, the present invention introduces the maximum function in the equality constraint for smoothing. The specific improved formula is as follows:
[0115]
[0116] It should be noted that the minimum value can also be introduced into the equality constraint to perform smoothing, which is not specifically limited here. In the process of calculating the pointer center coordinates, the midpoint of the pointer line segment can be used as the starting point of the target center coordinates. After multiple iterations, the optimized pointer center coordinates are obtained. After the pointer center coordinates are determined, the coordinates of the endpoints of the pointer line segment that are farthest from the pointer center coordinates can be used as the pointer pointing end coordinates.
[0117] Furthermore, after the coordinates of the center of the pointer and the end of the pointer are determined by the above process, the reading of the meter can be calculated. In this embodiment, multiple combinations need to be determined first. The combination is a combination of the scale values of any two key scale points. For each combination, the corresponding initial reading can be calculated, and then the final reading is determined based on the multiple initial readings. The calculation process of the initial reading may specifically include the following steps:
[0118] 1. Determine a combination generated by the scale values of any two key scale points; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value. In this embodiment, the starting scale value is expressed as ;
[0119] 2. Calculate the scale value per unit arc according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer circle;
[0120] Specifically, when calculating the scale value of a unit radian, first, a line segment connecting the pointer and the center of the circle is constructed through the starting scale point and another key scale point in the combination to form an angle, and the angle value of the clockwise size of the angle is calculated; the difference in the scale values of the two key scale points in the combination is calculated, and the difference in the scale values is divided by the angle value to obtain the scale value of the unit radian. In this embodiment, the scale value of the unit radian is expressed as .
[0121] 3. Calculate the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the pointer center, the pointer pointing end and the starting scale point;
[0122] The process of calculating the deflection angle in this scheme is as follows: set a vertically downward reference center line with the pointer center coordinates as the starting point; calculate the first clockwise angle between the reference center line and the pointer line segment; calculate the second clockwise angle between the reference center line passing through the pointer center coordinates and the starting scale point; calculate the deflection angle through the first clockwise angle and the second clockwise angle.
[0123] Specifically, since the present solution uses a permutation and combination method to calculate multiple initial readings, the coordinates of the pointer end may be located in the clockwise direction of the starting scale point or in the counterclockwise direction during the process. In order to eliminate confusion, in the present solution, a reference ray is introduced as an auxiliary calculation. The reference ray is a straight line from the center of the circle pointing vertically downward. Since the instrument image is positive, the coverage of the instrument scale will not intersect with the reference ray. When calculating the offset angle between the pointer end and the starting scale point, the first clockwise angle of the angle formed by the line segment connecting the reference ray to the pointer end and the center of the circle is first calculated. This embodiment represents the first clockwise angle as , and then calculate the second clockwise angle of the angle formed by the line segment connecting the reference ray to the starting scale point and the center of the circle. In this embodiment, the second clockwise angle is expressed as .
[0124] 4. Using the starting scale value, deflection angle, and unit radian scale value, determine the initial reading corresponding to each combination.
[0125] Specifically, this embodiment calculates the initial reading of each combination by the following formula:
[0126]
[0127] in, is the initial reading, is the starting scale value of the starting scale point in each combination, is the first clockwise angle, is the second clockwise angle, The scale value is in radians.
[0128] From the above, it can be seen that this scheme optimizes the calculation method of the pointer center coordinates. When calculating the pointer center coordinates, the traditional method only uses the pointer close to the center end as the pointer center coordinates. In practice, the error of determining the pointer center coordinates in this way is large, and it is overly dependent on the accuracy of the segmentation network, and has poor anti-interference ability. Therefore, in this scheme, the optimization objective function and equality constraints are established based on the key scale points and pointers, as well as the improved optimization objective function and equality constraints to obtain the optimized pointer center coordinates. This scheme can effectively improve the accuracy and anti-interference ability of the instrument reading calculation by optimizing the pointer center coordinates. Furthermore, in order to improve the accuracy of the readings, this scheme calculates the initial readings of multiple groups of key scale points and scale values in a combined manner, and selects the best reading from multiple initial readings. This method enables this scheme to have stronger anti-interference ability.
[0129] See also Figure 4 , Figure 4A flowchart of another method for identifying readings of a pointer instrument provided in an embodiment of the present application is provided, and the method specifically comprises the following steps:
[0130] S301, acquiring an instrument image of a pointer instrument;
[0131] S302, identifying pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image;
[0132] S303, determining a text detection frame that matches each key scale point, and using the text recognition result of the text detection frame as the scale value of the matched key scale point;
[0133] S304, combining the scale values of any two key scale points, and calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination;
[0134] S305, calculating the standard deviation of the initial readings of all combinations;
[0135] S306, determining whether the standard deviation is less than a first predetermined threshold;
[0136] If yes, execute S307; if no, execute S308;
[0137] S307, determining two target key scale points that are closest to the coordinates of the end pointed by the pointer, and taking the initial readings calculated by combining the two target key scale points as the final readings;
[0138] S308, determining whether the standard deviation is less than a second predetermined threshold;
[0139] If yes, execute S309; if no, execute S310;
[0140] S309, taking the average of all initial readings as the final reading;
[0141] S310. Taking the median of all initial readings as the final reading; wherein the first predetermined threshold is less than the second predetermined threshold.
[0142] Specifically, if n key scale points and scale values are matched, then after permutation and combination, we can get The combination of key scale points and scale values can calculate the corresponding initial reading for each combination, and these combination results provide a variety of possible instrument readings.
[0143] In this embodiment, in order to further optimize the readings and avoid the situation of numerical value recognition errors, the standard deviation of each initial reading list is used for judgment. The standard deviation reflects the degree of dispersion of the combination results. A smaller standard deviation means that the difference in the combination results is smaller, while a larger standard deviation means that there are outliers in the meter reading list. In this embodiment, the appearance of outliers may be due to: the recognition error of the key scale points of the instrument and the recognition error of the scale value. Therefore, the size of the standard deviation can provide information about the accuracy of the meter readings and help to screen out more accurate meter readings.
[0144] In this embodiment, when determining the final reading according to the standard deviation, it can be divided into the following three cases, and each case selects a different strategy as the final instrument reading output:
[0145] 1. When the standard deviation is less than the first predetermined threshold:
[0146] It should be noted that this embodiment involves two standard deviation thresholds, namely: a first predetermined threshold and a second predetermined threshold, and the first predetermined threshold is less than the second predetermined threshold. The values of the first predetermined threshold and the second predetermined threshold can be customized according to actual conditions. In this embodiment, the first predetermined threshold is 1 and the second predetermined threshold is 10 as an example for explanation.
[0147] When the standard deviation is less than 1, it is considered that the difference in the instrument values is small, so the "proximity principle" can be used to combine the instrument values as output. Among them: the proximity principle means that the two target key scale points closest to the coordinates of the end pointed by the pointer are determined, and the initial reading calculated by combining the two target key scale points is used as the final reading.
[0148] 2. When the standard deviation is greater than or equal to the first predetermined threshold and less than the second predetermined threshold:
[0149] That is, the standard deviation is greater than or equal to 1 and less than 10, which means that there are certain differences in the numerical calculation of the instrument. Therefore, the average value of the instrument reading list is selected as the output.
[0150] 3. When the standard deviation is greater than or equal to the second predetermined threshold:
[0151] That is, the standard deviation is greater than or equal to 10, which means that there are outliers in the numerical calculation of the instrument, resulting in large differences. Therefore, the median of the instrument reading list is selected as the output.
[0152] From the above content, it can be seen that after this scheme determines the standard deviation of each initial reading, it can be divided into different processing situations according to the size of the standard deviation, and the size of the standard deviation can reflect the degree of discreteness of each initial reading. After the processing situation is determined, the final reading can be determined according to the pre-set output strategy to improve the accuracy and robustness of the instrument reading.
[0153] See also Figure 5 , Figure 5 This is a schematic diagram of the overall flow of a method for identifying the readings of a pointer instrument provided in an embodiment of the present application. Figure 5 It can be seen that after obtaining the meter image, this scheme can input the meter image into the FPV segmentation network and the PaddleOCR model respectively, output the pointer polygon and multiple key scale point polygons through the FPN semantic segmentation network, and output all text boxes and text content through the PaddleOCR model. The pointer polygon can extract the pointer line segment through the skimage library, and multiple key scale point polygons can determine the coordinates of multiple key scale points by calculating the mass point; the center coordinates can be optimized by using the objective function and equality constraints, as well as the pointer line segment and multiple key scale point coordinates, to obtain the optimized pointer center coordinates and pointer pointing end coordinates; after the PaddleOCR model outputs all text boxes and text content, it can be matched with the coordinates of multiple key scale points. After the match is successful, multiple key scale points and corresponding scale values are obtained; after combining each key scale point, multiple preliminary readings are calculated, and the preferred final reading is determined based on the multiple preliminary readings, so as to obtain the meter reading.
[0154] It can be seen that this solution realizes the accurate recognition of the scale values, scale points and pointer segments of the pointer instrument, as well as the accurate matching of the scale values and scale points through the FPV segmentation network and the PaddleOCR model. Subsequently, the coordinates of the center of the pointer circle can be accurately determined through the objective function and the relevant constraint function. Next, the possible combinations of the pointer scales are calculated through the permutation and combination method to obtain multiple initial readings. Based on the results of the combination, the final reading is selected by calculating the standard deviation and taking the mean, median and "the nearest calculated value" as the benchmark. Through the above process, the accurate recognition of the pointer instrument can be ensured in the presence of interference, providing a reliable solution for the acquisition of instrument-related data.
[0155] See also Figure 6 , Figure 6 A schematic diagram of a reading recognition device for a pointer instrument provided in an embodiment of the present application, the device specifically comprises:
[0156] An acquisition module 11 is used to acquire an instrument image of a pointer instrument;
[0157] A recognition module 12, used to recognize pointer segments, key scale points, text detection frames in the instrument image, and text recognition results corresponding to each text detection frame;
[0158] A matching module 13 is used to determine a text detection frame that matches each key scale point, and use the text recognition result of the text detection frame as the scale value of the matched key scale point;
[0159] A calculation module 14 is used to combine the scale values of any two key scale points, and calculate the initial reading corresponding to each combination according to the key scale points and scale values of each combination;
[0160] The determination module 15 is used to determine the final reading of the pointer instrument according to all the combined initial readings.
[0161] As an optional embodiment, the calculation module includes:
[0162] A first determining unit is used to determine the coordinates of the center of the pointer and the coordinates of the end of the pointer pointing according to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment;
[0163] A first calculation unit is used to calculate the scale value of a unit arc according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value;
[0164] A second calculation unit, used for calculating the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the center of the pointer, the coordinates of the end pointed by the pointer and the coordinates of the starting scale point;
[0165] The second determining unit is used to determine an initial reading corresponding to each combination by using the starting scale value, the deflection angle and the scale value per unit radian.
[0166] As an optional embodiment, the first determining unit includes:
[0167] A first calculation subunit is used to calculate the distance difference between each target circle center coordinate and each key scale point coordinate, and calculate the difference sum of all distance differences;
[0168] The first determination subunit is used to use the difference and the minimum target circle center coordinates as the initial pointer circle center coordinates;
[0169] The second determination subunit is used to find the pointer center coordinates located on the pointer line segment from the initial pointer center coordinates according to the two end coordinates of the pointer line segment, and use the endpoint coordinates farthest from the pointer center coordinates among the two end coordinates as the pointer pointing end coordinates.
[0170] As an optional embodiment, the second computing unit includes:
[0171] A setting subunit, used for setting a vertically downward reference center line with the pointer center coordinates as the starting point;
[0172] A second calculation subunit, used for calculating a first clockwise angle between the reference circle center straight line and the pointer line segment;
[0173] A third calculation subunit, used for calculating a second clockwise angle between the reference circle center straight line passing through the pointer circle center coordinates and the starting scale point;
[0174] The fourth calculation subunit is configured to calculate a deflection angle using the first clockwise angle and the second clockwise angle.
[0175] As an optional embodiment, the identification module includes:
[0176] A first recognition unit is used to recognize a pointer polygon and a key scale point polygon of each key scale point in the instrument image through a feature pyramid network;
[0177] An extraction unit, used for extracting a pointer line segment from the pointer polygon;
[0178] A third calculation unit is used to calculate the key scale point coordinates of each key scale point polygon;
[0179] The second recognition unit is used to recognize text detection frames in the instrument image and text recognition results corresponding to each text detection frame through an optical character recognition model.
[0180] As an optional embodiment, the matching module includes:
[0181] A filtering unit, used for filtering invalid text detection frames from all text detection frames;
[0182] A search unit, used to search for a final text detection frame matching each key scale point from the filtered text detection frames; the final text detection frame is a detection frame that satisfies the distance condition;
[0183] The third determining unit is configured to use the text recognition result of the final text detection frame as the scale value of the key scale point matching the final text detection frame.
[0184] As an optional embodiment, the determining module includes:
[0185] a fourth calculation unit, for calculating the standard deviation of all combined initial readings;
[0186] A first judging unit, configured to judge whether the standard deviation is less than a first predetermined threshold; if so, triggering the third determining unit, and if not, triggering the second judging unit;
[0187] The third determination unit is used to determine two target key scale points that are closest to the coordinates of the end pointed by the pointer, and use the initial readings calculated by combining the two target key scale points as the final readings;
[0188] A second judging unit, configured to judge whether the standard deviation is less than a second predetermined threshold; if so, triggering a fourth determining unit; if not, triggering a fifth determining unit;
[0189] A fourth determining unit, configured to take an average value of all initial readings as the final reading;
[0190] A fifth determination unit is used to take the median of all initial readings as the final reading; wherein the first predetermined threshold is less than the second predetermined threshold.
[0191] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0192] See also Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device specifically includes:
[0193] A processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. The processor 21 executes the steps of the reading identification method described in any of the above method embodiments through the computer program.
[0194] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0195] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used to store the following computer program 221, wherein the computer program is loaded and executed by the processor 21, and the relevant steps in the reading recognition method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 22 may also include an operating system 222 and data 223, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 222 may include Windows, Unix, Linux, etc.
[0196] In some embodiments, the electronic device may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power source 27 , and a communication bus 28 .
[0197] certainly, Figure 7 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include Figure 7 More or fewer components than shown, or combinations of certain components.
[0198] In another exemplary embodiment, a computer storage medium is also provided, and when the program instructions are executed by a processor, the steps of the reading identification method described in any of the above method embodiments are implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0199] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0200] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0201] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for identifying the reading of a pointer instrument, characterized in that: include: Acquire instrument images of pointer instruments; Identify pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image; Determine a text detection frame that matches each key scale point, and use the text recognition result of the text detection frame as the scale value of the matching key scale point; Combine the scale values of any two key scale points, and calculate the initial reading corresponding to each combination according to the key scale points and scale values of each combination; Determine the final reading of the pointer instrument from the initial readings of all combinations; The step of calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination includes: According to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment, the coordinates of the center of the pointer and the coordinates of the end where the pointer points are determined; Calculate the scale value per unit radian according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer circle; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value; Calculate the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the pointer center, the coordinates of the pointer pointing end and the coordinates of the starting scale point; Determine an initial reading corresponding to each combination using the starting scale value, the deflection angle, and the scale value per unit radian; The step of determining the coordinates of the center of the pointer and the coordinates of the end of the pointer pointing to according to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment includes: Calculate the distance difference between the coordinates of each target circle center and the coordinates of each key scale point, and calculate the sum of all distance differences; The difference and the smallest target circle center coordinate are used as the initial pointer circle center coordinate; According to the coordinates of both ends of the pointer line segment, the coordinates of the center of the pointer located on the pointer line segment are found from the initial pointer center coordinates, and the coordinates of the endpoint farthest from the pointer center coordinates among the two end coordinates are used as the pointer pointing end coordinates.
2. The reading recognition method according to claim 1, characterized in that: Calculating the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the pointer center, the coordinates of the pointer pointing end, and the coordinates of the starting scale point includes: Setting a vertically downward reference center line with the pointer center coordinate as the starting point; Calculate a first clockwise angle between the reference circle center straight line and the pointer line segment; Calculate the second clockwise angle between the reference circle center straight line passing through the pointer circle center coordinates and the starting scale point; The deflection angle is calculated by the first clockwise angle and the second clockwise angle.
3. The reading recognition method according to claim 1, characterized in that: The identifying of the pointer line segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image includes: Identifying a pointer polygon in the instrument image and a key scale point polygon of each key scale point through a feature pyramid network; extracting a pointer line segment from the pointer polygon; Calculate the key point coordinates of each key point polygon; The text detection frames in the instrument image and the text recognition results corresponding to each text detection frame are identified by an optical character recognition model.
4. The reading recognition method according to claim 1, characterized in that: The step of determining a text detection frame that matches each key scale point and using the text recognition result of the text detection frame as the scale value of the matched key scale point includes: Filter invalid text detection boxes from all text detection boxes; From the filtered text detection frames, searching for a final text detection frame that matches each key scale point; the final text detection frame is a detection frame that satisfies the distance condition; The text recognition result of the final text detection frame is used as the scale value of the key scale point matching the final text detection frame.
5. The reading recognition method according to any one of claims 1 to 4, characterized in that: Determine the final reading of the pointer meter based on all combined initial readings, including: Calculate the standard deviation of the initial readings for all combinations; Determining whether the standard deviation is less than a first predetermined threshold; If yes, then determine the two target key scale points that are closest to the coordinates of the end pointed by the pointer, and use the initial reading calculated by combining the two target key scale points as the final reading; if no, then determine whether the standard deviation is less than a second predetermined threshold; If yes, then the average of all initial readings is taken as the final reading; if no, then the median of all initial readings is taken as the final reading; wherein, the first predetermined threshold is less than the second predetermined threshold.
6. A reading recognition device for a pointer instrument, characterized in that: include: An acquisition module, used for acquiring an instrument image of a pointer-type instrument; A recognition module, used to recognize pointer segments, key scale points, text detection frames and text recognition results corresponding to each text detection frame in the instrument image; A matching module is used to determine a text detection frame that matches each key scale point, and use the text recognition result of the text detection frame as the scale value of the matched key scale point; A calculation module, used for combining the scale values of any two key scale points, and calculating the initial reading corresponding to each combination according to the key scale points and scale values of each combination; A determination module, for determining a final reading of the pointer instrument based on all the combined initial readings; Wherein, the calculation module includes: A first determining unit is used to determine the coordinates of the center of the pointer and the coordinates of the end of the pointer pointing according to the coordinates of each key scale point and the coordinates of both ends of the pointer line segment; A first calculation unit is used to calculate the scale value of a unit arc according to the coordinates and scale values of the key scale points of each combination and the coordinates of the center of the pointer; wherein the key scale point with the smallest scale value in each combination is the starting scale point, and the scale value of the starting scale point is the starting scale value; A second calculation unit, used for calculating the deflection angle between the pointer line segment and the starting scale point according to the coordinates of the center of the pointer, the coordinates of the end pointed by the pointer and the coordinates of the starting scale point; A second determining unit, configured to determine an initial reading corresponding to each combination by using the starting scale value, the deflection angle, and the scale value per unit radian; Wherein, the first determining unit includes: A first calculation subunit is used to calculate the distance difference between each target circle center coordinate and each key scale point coordinate, and calculate the difference sum of all distance differences; The first determination subunit is used to use the difference and the minimum target circle center coordinates as the initial pointer circle center coordinates; The second determination subunit is used to find the pointer center coordinates located on the pointer line segment from the initial pointer center coordinates according to the two end coordinates of the pointer line segment, and use the endpoint coordinates farthest from the pointer center coordinates among the two end coordinates as the pointer pointing end coordinates.
7. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the reading identification method described in any one of claims 1 to 5 through the computer program.
8. A computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the steps of the reading identification method described in any one of claims 1 to 5 of the present application.
Citation Information
Patent Citations
Pointer instrument reading method based on deep neural network
CN115035364A