Instrument numerical analysis methods, devices, equipment and storage media

By obtaining the instrument template diagram and the pictures to be analyzed, and using the pointer analysis model for pointer pointer analysis and instrument numerical analysis, the problem that it is difficult for the existing technology to achieve accurate instrument readings in complex environments is solved, and the accuracy of instrument numerical analysis is improved.

CN114863129BActive Publication Date: 2025-03-11ZHUHAI UNITECH POWER TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210372620.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-03-11
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate instrument readings when the image background is complex or the dial is blurred or the dial is rotated.

Method used

By obtaining the instrument template diagram and the pictures to be analyzed, image preprocessing is performed based on the key scale values ​​of the instrument panel, pointer pointing analysis is performed using the pointer analysis model, the target scale arc length value is calculated, and the instrument numerical analysis is performed.

Benefits of technology

It improves the accuracy of instrument numerical analysis, can accurately identify pointer information in complex environments, and reduces image recognition errors caused by environmental problems and lighting factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114863129B_ABST
    Figure CN114863129B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image recognition, and discloses an instrument numerical analysis method, device, equipment and storage medium. The method comprises: collecting an instrument template image and a picture to be analyzed, wherein the instrument template image includes a key scale value of an instrument dial; preprocessing the picture to be analyzed by a preset image processing algorithm based on the key scale value to obtain a candidate picture; performing pointer pointing analysis on the candidate picture by a preset pointer analysis model to obtain target pointing information; calculating the target scale arc length based on the target pointing information to obtain the target scale arc length value; performing instrument numerical analysis based on the target scale arc length to obtain the target scale value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and in particular to an instrument numerical analysis method, device, equipment and storage medium. Background Art

[0002] The inspection tasks of traditional substations are mainly completed by staff. Manual meter reading in a high-voltage environment is very dangerous and labor-intensive, and it is difficult to carry out in severe climates. Therefore, an operating mode of replacing manual inspection with robot inspection has emerged. Among them, numerical analysis of pointer instruments is the most critical step in robot meter reading.

[0003] Currently, most methods for identifying pointer instrument readings are to identify the pointer through traditional image processing, and then calculate the value of the pointer instrument through the rotation angle between the pointer and the key scale value. This type of method requires a lot of image preprocessing, and it is difficult to achieve accurate instrument readings when the image background is complex or the dial is blurred or the dial is rotated. Summary of the invention

[0004] The embodiments of the present invention provide an instrument numerical analysis method, device, equipment and storage medium for improving the accuracy of instrument numerical analysis.

[0005] A first aspect of the present invention provides an instrument numerical analysis method, comprising: obtaining an instrument template diagram and a picture to be analyzed, wherein the instrument template diagram includes key scale values ​​of an instrument dial; preprocessing the picture to be analyzed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate picture, wherein a plurality of key scale values ​​are marked in the candidate picture; performing pointer pointing analysis on the candidate picture by a preset pointer analysis model to obtain target pointing information; calculating the target scale arc length of the candidate picture based on the target pointing information to obtain a target scale arc length value; performing instrument numerical analysis based on the target scale arc length to obtain a target scale value.

[0006] In a feasible implementation manner, the image to be analyzed is preprocessed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image, including: extracting feature points of the instrument template image and the image to be analyzed respectively to obtain a plurality of first feature points corresponding to the instrument template image and a plurality of second feature points corresponding to the image to be analyzed; performing feature point matching on the plurality of first feature points and the plurality of second feature points based on a preset matching algorithm to obtain a plurality of target feature point groups; calculating a transformation matrix on the plurality of target feature point groups by a preset consistency algorithm to obtain a projection transformation matrix; and projecting the key scale values ​​of the instrument dial to the image to be analyzed based on the projection transformation matrix to obtain a candidate image.

[0007] In a feasible implementation manner, after the picture to be analyzed is preprocessed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate picture, and before the candidate picture is subjected to pointer pointing analysis by a preset pointer analysis model to obtain target pointing information, it also includes: collecting multiple pointer instrument pictures; annotating the pointer contour of each pointer instrument picture in the multiple pointer instrument pictures to obtain a training picture set; and inputting the training picture set into a preset deep learning model for training to obtain the pointer analysis model.

[0008] In a feasible implementation, the pointer pointing analysis of the candidate image is performed using a preset pointer analysis model to obtain target pointing information, including: inputting the candidate image into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information; and performing straight line fitting on the pointer contour information using a distance minimization function of the pointer analysis model to obtain the target pointing information.

[0009] In a feasible implementation manner, the step of inputting the candidate image into the pointer analysis model for pointer contour analysis to obtain pointer contour information includes: inputting the candidate image into the pointer analysis model for binarization processing to obtain a binarized image; performing pointer coarse contour analysis on the binarized image to obtain a pointer coarse contour image; and performing contour transformation on the coarse contour image through a preset transformation algorithm to obtain pointer contour information.

[0010] In a feasible implementation, the target scale arc length calculation of the candidate image based on the target pointing information to obtain the target scale arc length value includes: identifying the intersection of the pointer in the candidate image and the scale arc in the candidate image based on the target pointing information to obtain the first arc endpoint; identifying the adjacent endpoints of the scale arc based on the first arc endpoint and the scale arc to obtain the second arc endpoint; calculating the target scale arc length using the first arc endpoint and the second arc endpoint to obtain the target scale arc length value.

[0011] In a feasible implementation, the instrument value analysis based on the target scale arc length to obtain the target scale value includes: identifying adjacent key scale positions based on the target pointing information to obtain the target key scale position and use it as the third arc endpoint; calculating the reference arc length through the third arc endpoint and the second arc endpoint to obtain a reference arc length value; performing a ratio analysis on the target scale arc length value and the reference arc length value to obtain a target arc length ratio; and performing an instrument value analysis based on the arc length ratio to obtain a target scale value.

[0012] The second aspect of the present invention provides an instrument numerical analysis device, including: an acquisition module, used to acquire an instrument template image and a picture to be analyzed, wherein the instrument template image includes key scale values ​​of the instrument dial; a processing module, used to pre-process the picture to be analyzed based on the key scale values ​​of the instrument dial through a preset image processing algorithm to obtain a candidate picture; a fitting module, used to perform pointer pointing analysis on the candidate picture through a preset pointer analysis model to obtain target pointing information; a calculation module, used to calculate the target scale arc length of the candidate picture based on the target pointing information to obtain the target scale arc length value; an analysis module, used to perform instrument numerical analysis based on the target scale arc length to obtain the target scale value.

[0013] In a feasible implementation, the processing module is specifically used to: extract feature points from the instrument template image and the picture to be analyzed respectively to obtain multiple first feature points corresponding to the instrument template image and multiple second feature points corresponding to the picture to be analyzed; perform feature point matching on the multiple first feature points and the multiple second feature points based on a preset matching algorithm to obtain multiple target feature point groups; calculate the transformation matrix of the multiple target feature point groups through a preset consistency algorithm to obtain a projection transformation matrix; project the key scale values ​​of the instrument dial to the picture to be analyzed based on the projection transformation matrix to obtain a candidate picture.

[0014] In a feasible implementation, the instrument numerical analysis device also includes: an acquisition module for acquiring multiple pointer instrument images; a labeling module for labeling the pointer contour of each pointer instrument image in the multiple pointer instrument images to obtain a training image set; and a training module for inputting the training image set into a preset deep learning model for training to obtain the pointer analysis model.

[0015] In a feasible implementation, the fitting module specifically includes: an analysis unit, used to input the image to be analyzed into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information; a fitting unit, used to perform a straight line fitting on the pointer contour information through the distance minimization function of the pointer analysis model to obtain the target pointing information.

[0016] In a feasible implementation, the analysis unit is specifically used to: input the candidate image into the pointer analysis model for binarization processing to obtain a binarized image; perform pointer coarse contour analysis on the binarized image to obtain a pointer coarse contour image; perform contour transformation on the coarse contour image through a preset transformation algorithm to obtain pointer contour information.

[0017] In a feasible implementation, the calculation module is specifically used to: identify the intersection of the pointer in the candidate image and the scale arc in the candidate image based on the target pointing information to obtain the first arc endpoint; identify the adjacent endpoints of the scale arc based on the first arc endpoint and the scale arc to obtain the second arc endpoint; calculate the target scale arc length through the first arc endpoint and the second arc endpoint to obtain the target scale arc length value.

[0018] In a feasible implementation, the analysis module is specifically used for: identifying adjacent key scale positions based on the target pointing information, obtaining the target key scale position and using it as the third arc endpoint; calculating the reference arc length through the third arc endpoint and the second arc endpoint to obtain a reference arc length value; performing a ratio analysis on the target scale arc length value and the reference arc length value to obtain a target arc length ratio; performing an instrument value analysis based on the arc length ratio to obtain a target scale value.

[0019] A third aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned instrument numerical analysis method.

[0020] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned instrument numerical analysis method.

[0021] In the technical solution provided by the present invention, the candidate image is subjected to pixel analysis through the pointer analysis model to obtain pointer pixels, and the connected domain extraction, splicing, size and shape analysis processing are performed on these pointer pixel points to determine the pointer area, and finally the pointer area is subjected to straight line fitting processing to obtain target pointing information. The pointer information is identified by straight line fitting through the pointer analysis model, and pointer identification can be performed in a complex environment, thereby reducing image recognition errors caused by environmental problems and lighting factors, improving the accuracy of pointer identification, and providing more accurate data for subsequent instrument numerical analysis. The arc length calculation function is used to calculate the arc length of the reference arc to determine the reference arc length, and the ratio calculation is performed between the target scale arc length value and the reference arc length to determine the ratio data, and then the instrument numerical analysis is performed according to the ratio data and the key scale numerical information to obtain the target scale value. The instrument numerical analysis is performed through the ratio, which can avoid the situation where the numerical analysis error is large when the instrument scale is uneven and the dial rotates, and further improve the accuracy of the instrument numerical analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of an embodiment of an instrument numerical analysis method in an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of another embodiment of the instrument numerical analysis method in an embodiment of the present invention;

[0024] Figure 3 This is a diagram showing the effect of image preprocessing in the instrument numerical analysis method in an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of an embodiment of an instrument numerical analysis device in an embodiment of the present invention;

[0026] Figure 5 It is a schematic diagram of another embodiment of the instrument numerical analysis device in the embodiment of the present invention;

[0027] Figure 6 FIG. 1 is a schematic diagram of an embodiment of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The embodiments of the present invention provide an instrument numerical analysis method, apparatus, device and storage medium for reducing the complexity of workflow configuration.

[0029] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 An embodiment of the instrument numerical analysis method in the embodiment of the present invention includes the following steps 101-105:

[0031] 101. Obtain an instrument template diagram and a picture to be analyzed, wherein the instrument template diagram includes key scale values ​​of the instrument dial;

[0032] It is understandable that the execution subject of the present invention may be an instrument value analysis device or a server, which is not limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.

[0033] Specifically, the server obtains an instrument picture as a template picture. It should be noted that the instrument picture is marked with the values ​​and coordinates of the key scales on the instrument. The key scales include the minimum scale, the maximum scale, the center point of the dial and other scale information. It should be noted that when obtaining the picture to be analyzed, the server controls the robot to arrive at the designated inspection position, and performs preliminary positioning of the instrument to determine whether the instrument is found. If so, it performs precise positioning, and then further determines whether the image is clear. If the image clarity meets the preset requirements, the picture to be analyzed is collected. If the image clarity does not meet the preset requirements, the server controls the image acquisition device to focus. When the image clarity is adjusted to meet the preset requirements, the picture to be analyzed is collected. If the instrument is not found, the server controls the robot to perform posture fine-tuning until the posture fine-tuning is terminated when the instrument is found. The server then controls the robot to execute subsequent steps.

[0034] 102. Preprocess the image to be analyzed by using a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image;

[0035] It should be noted that the image processing algorithm refers to a fast nearest neighbor approximation search algorithm, which extracts feature points from the instrument template image and the image to be analyzed, and constructs feature quantities based on the feature point set to compare and screen the feature quantities, and finally obtains a mapping set of matching points, and then matches and maps the images. Specifically, the server extracts features from the image to be analyzed and the template image, obtains multiple feature points of the image to be analyzed and the instrument template image, and then maps the image to be analyzed based on the multiple feature points to obtain candidate images, which can achieve fast and efficient matching.

[0036] 103. Perform pointer pointing analysis on the candidate image using a preset pointer analysis model to obtain target pointing information;

[0037] It should be noted that the pointer analysis model is generated based on pre-training of the deep learning model. Specifically, the server performs pixel analysis on the candidate image through the pointer analysis model to obtain pointer pixels, and performs connected domain extraction, splicing, size and shape analysis on these pointer pixels to determine the pointer area. Finally, a straight line fitting is performed on the pointer area to obtain the target pointing information. The pointer information is identified by straight line fitting using the pointer analysis model, which can perform pointer recognition in complex environments, improve the accuracy of pointer recognition, and provide more accurate data for subsequent instrument numerical analysis.

[0038] 104. Calculate the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value;

[0039] It should be noted that the arc length calculation is performed based on a preset arc length calculation function. Specifically, the server determines two adjacent key scale positions and the intersection position of the target pointing information and the arc scale of the instrument dial based on the target pointing information. Then, the server selects a target key scale position that is far away from the intersection position from the adjacent key scale positions, and determines the target scale arc based on the target key scale position and the intersection position. Finally, the server performs arc length calculation through the arc length calculation function to obtain the target scale arc length value, which can avoid the situation where the correct reading cannot be made when the image to be analyzed is rotated relative to the template image.

[0040] 105. Perform instrument numerical analysis based on the target scale arc length to obtain the target scale value.

[0041] Specifically, the server determines the reference arc based on the two adjacent key scale positions, and calculates the arc length of the reference arc through the arc length calculation function to determine the reference arc length, and calculates the ratio of the target scale arc length value and the reference arc length to determine the ratio data, and then performs instrument numerical analysis based on the ratio data and key scale numerical information to obtain the target scale value. Performing instrument numerical analysis through ratio can avoid large numerical analysis errors caused by uneven instrument scales, thereby further improving the accuracy of instrument numerical analysis.

[0042] In an embodiment of the present invention, the server performs pixel analysis on the candidate image through a pointer analysis model to obtain pointer pixels, and performs connected domain extraction, splicing, size and shape analysis processing on these pointer pixel points to determine the pointer area, and finally performs straight line fitting processing on the pointer area to obtain target pointing information. The pointer information is identified by straight line fitting through the pointer analysis model, and pointer identification can be performed in a complex environment, reducing image recognition errors caused by environmental problems and lighting factors, improving the accuracy of pointer identification, and providing more accurate data for subsequent instrument numerical analysis. The arc length calculation function is used to calculate the arc length of the reference arc to determine the reference arc length, and the ratio calculation is performed on the target scale arc length value and the reference arc length to determine the ratio data, and then the instrument numerical analysis is performed according to the ratio data and key scale numerical information to obtain the target scale value. The instrument numerical analysis is performed through the ratio, which can avoid the situation where the numerical analysis error is large when the instrument scale is uneven, and further improve the accuracy of the instrument numerical analysis.

[0043] See also Figure 2 Another embodiment of the instrument numerical analysis method in the embodiment of the present invention includes the following steps 201-206:

[0044] 201. Obtain an instrument template image and a picture to be analyzed, wherein the instrument template image includes key scale values ​​of the instrument dial;

[0045] Specifically, in this embodiment, the specific implementation of step 201 is similar to the above step 101 and will not be repeated here.

[0046] 202. Preprocess the image to be analyzed by using a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image;

[0047] Specifically, the server extracts feature points from the instrument template image and the picture to be analyzed respectively, and obtains multiple first feature points corresponding to the instrument template image and multiple second feature points corresponding to the picture to be analyzed; the server performs feature point matching on the multiple first feature points and the multiple second feature points based on a preset matching algorithm, and obtains multiple target feature point groups; the server calculates the transformation matrix for the multiple target feature point groups through a preset consistency algorithm, and obtains a projection transformation matrix; the server projects the key scale values ​​of the instrument dial to the picture to be analyzed based on the projection transformation matrix, and obtains a candidate picture.

[0048] Among them, first, the server locates the key points of the picture to be analyzed and the instrument template map respectively, and obtains multiple key points corresponding to the picture to be analyzed and multiple key points corresponding to the instrument template map. It should be noted that the key points are mainly used to locate the positions where the image features in the picture are obvious, such as instrument contour segmentation points, key scale position points, pointer center points and other key positions. Then, the server extracts feature points according to the multiple key points corresponding to the picture to be analyzed and the instrument template map respectively, and obtains multiple first feature points corresponding to the instrument template map and multiple second feature points corresponding to the picture to be analyzed. After the feature points are matched, multiple target feature point groups are obtained. It should be noted that when performing feature point matching, it is necessary to judge the number of feature point groups. When the number of feature point groups is greater than or equal to 10, the server calculates the projection transformation matrix, and then performs image processing according to the projection transformation matrix. If the number of feature point groups is less than 10, such as Figure 3 As shown, the picture on the left above is the instrument template picture, and the picture on the right is the picture to be analyzed. The server keeps the scale coordinates of the picture to be analyzed consistent with the coordinates of the instrument template picture, and obtains Figure 3 The lower middle picture determines the candidate picture. When calculating the projection transformation matrix, the server calculates the Euclidean distance of each feature point group, sets the value of 1.5 times the minimum Euclidean distance as the threshold, removes the feature point group whose Euclidean distance is greater than the set threshold, and calculates the projection transformation matrix of the template image mapped to the picture to be analyzed. At the same time, the random sampling consistency algorithm is used to remove the mismatched point group again, eliminating the interference caused by the erroneous point group, which can improve the matching accuracy. The server projects the key scale values ​​of the instrument dial to the picture to be analyzed based on the projection transformation matrix to obtain the candidate picture. The picture to be analyzed is calibrated through the transformation matrix to eliminate image distortion.

[0049] Optionally, after preprocessing the picture to be analyzed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate picture, and before inputting the picture to be analyzed into a pointer analysis model for pointer contour analysis to obtain pointer contour information, it may also include: the server collects multiple pointer instrument pictures; the server annotates the pointer contour of each pointer instrument picture in the multiple pointer instrument pictures to obtain a training picture set; the server inputs the training picture set into a preset deep learning model for training to obtain a pointer analysis model.

[0050] Among them, multiple pointer instrument pictures are crawled from multiple picture websites to generate a training gallery. It should be noted that when generating training pictures, a preset image annotation tool is used to annotate the pointer contours in the multiple pointer instrument pictures obtained, and the server inputs the training picture set into a preset deep learning model for training. It should be noted that when training the deep learning model, a preset loss function is used for iterative training. When the loss value is less than or equal to a preset threshold, a pointer analysis model is obtained. The present invention identifies pointers through deep learning, which greatly improves the accuracy and robustness of pointer recognition. When an unrecognizable instrument appears, it only needs to add the corresponding data for retraining, which is convenient for optimization.

[0051] 203. Input the image to be analyzed into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information;

[0052] Specifically, the server inputs the image to be analyzed into the pointer analysis model for binarization processing to obtain a binarized image; the server performs pointer coarse contour analysis on the binarized image to obtain a pointer coarse contour image; the server performs contour transformation on the coarse contour image through a preset transformation algorithm to obtain pointer contour information.

[0053] Among them, the server performs binary segmentation through the pointer analysis model to obtain a binary image, in which the grayscale value of the pixel points in the pointer contour area of ​​the image to be analyzed is 1, and the grayscale value of the pixel points outside the contour area of ​​the image to be analyzed is 0. Specifically, the server uses the classic inter-class difference segmentation method to obtain a segmentation threshold, and uses the segmentation threshold to perform binary segmentation on the grayscale matrix to obtain a binary image, the pixel points with a grayscale value of 0 are invalid points, and the pixel points with a grayscale value of 1 are valid points, that is, in the binary image, the grayscale value of the pixel points in the contour area of ​​the image to be analyzed is 1, and the grayscale value of the pixel points outside the contour area of ​​the image to be analyzed is 0. The server performs pointer coarse contour analysis on the binary image to obtain a pointer coarse contour image; the server performs contour transformation on the coarse contour image through a preset transformation algorithm to obtain pointer contour information.

[0054] 204. Perform straight line fitting on the pointer contour information through the distance minimization function of the pointer analysis model to obtain target pointing information;

[0055] It should be noted that the pointer contour information includes multiple discrete points. The vertical distances between the multiple discrete points and the straight line to be matched are determined according to the distance minimization function, and the minimum distance estimation is performed on the vertical distances between the multiple discrete points and the straight line to be matched. Images of the same pointer at different positions are taken respectively, and the pointer straight line is fitted according to the minimum distance method to obtain the corresponding correction slope, and a straight line is fitted according to the correction slope to obtain the target pointing information.

[0056] 205. Calculate the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value;

[0057] Specifically, the server identifies the intersection of the pointer in the candidate image and the scale arc in the candidate image based on the target pointing information to obtain the first arc endpoint; the server identifies the adjacent endpoints of the scale arc based on the first arc endpoint and the scale arc to obtain the second arc endpoint; the server calculates the target scale arc length through the first arc endpoint and the second arc endpoint to obtain the target scale arc length value.

[0058] Among them, the server identifies the adjacent endpoints of the scale arc based on the first arc endpoint and the scale arc, obtains the second arc endpoint and records it as point A, and the server identifies the intersection of the pointer in the candidate image and the scale arc in the candidate image based on the target pointing information, obtains the first arc endpoint and records it as point C, then arc AC is the target scale arc, and the arc length of the target scale arc is calculated by a preset arc length calculation formula to obtain the target scale arc length. The embodiment of the present invention determines the scale value and scale coordinate information by configuring a template diagram, which is more accurate and simpler. The server subsequently calculates the pointer value by the arc length ratio of the target scale arc on the scale arc, which increases the accuracy and rotation invariance of the pointer reading.

[0059] 206. Perform instrument numerical analysis based on the target scale arc length to obtain the target scale value.

[0060] Specifically, the server identifies adjacent key scale positions based on the target pointing information, obtains the target key scale position and uses it as the third arc endpoint; the server calculates the reference arc length through the third arc endpoint and the second arc endpoint to obtain the reference arc length value; the server performs a ratio analysis on the target scale arc length value and the reference arc length value to obtain the target arc length ratio; the server performs an instrument value analysis based on the arc length ratio to obtain the target scale value.

[0061] Among them, the server can determine the positions of two adjacent key scales according to the target pointing information, and then the server determines the distance information between the positions of the two adjacent key scales and the intersection C of the pointer and the scale arc in the target pointing information, and selects the adjacent key scale position far from the intersection C as point B, and then calculates the arc length of arc AB through the preset arc length calculation formula. The length of arc AB is the reference arc length value. It should be noted that the formula for determining the target scale value by ratio analysis is as follows:

[0062]

[0063] Among them, vla A ,val B ,val C Respectively represent the scale value of point A, the scale value of point B and the scale value of the pointer, l AB , l AC They represent the arc length values ​​of arc AC and arc length values ​​of arc AB respectively. Then the server performs ratio analysis based on the reference arc length value and the target readable arc length value to obtain the target scale value.

[0064] In an embodiment of the present invention, the server inputs a training image set into a preset deep learning model for training. It should be noted that when training the deep learning model, a preset loss function is used for iterative training. When the loss value is less than or equal to a preset threshold, a pointer analysis model is obtained. The present invention recognizes the pointer by means of deep learning, which greatly improves the accuracy and robustness of pointer recognition. When an unrecognizable instrument appears, only the corresponding data needs to be added for retraining, which is convenient for optimization. The embodiment of the present invention determines the scale value and scale coordinate information by configuring a template diagram, which is more accurate and simpler. The server subsequently calculates the pointer value by the arc length ratio of the target scale arc on the scale arc, which increases the accuracy and rotational invariance of the pointer reading.

[0065] See also Figure 4 , an embodiment of the instrument numerical analysis device in the embodiment of the present invention includes:

[0066] The acquisition module 401 is used to acquire an instrument template image and a picture to be analyzed, wherein the instrument template image includes key scale values ​​of the instrument dial;

[0067] A processing module 402 is used to pre-process the image to be analyzed based on the key scale values ​​of the instrument dial by a preset image processing algorithm to obtain a candidate image;

[0068] The fitting module 403 is used to perform pointer pointing analysis on the candidate image through a preset pointer analysis model to obtain target pointing information;

[0069] A calculation module 404 is used to calculate the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value;

[0070] The analysis module 405 is used to perform instrument value analysis based on the target scale arc length to obtain the target scale value.

[0071] In an embodiment of the present invention, the server performs pixel analysis on the candidate image through a pointer analysis model to obtain pointer pixels, and performs connected domain extraction, splicing, size and shape analysis processing on these pointer pixel points to determine the pointer area, and finally performs straight line fitting processing on the pointer area to obtain target pointing information. By performing straight line fitting with the pointer analysis model to identify pointer information, pointer recognition can be performed in complex environments, image recognition errors caused by environmental problems and lighting factors can be reduced, the accuracy of pointer recognition can be improved, and more accurate data can be provided for subsequent instrument numerical analysis.

[0072] See also Figure 5 Another embodiment of the instrument numerical analysis device in the embodiment of the present invention includes:

[0073] The acquisition module 401 is used to acquire an instrument template image and a picture to be analyzed, wherein the instrument template image includes key scale values ​​of the instrument dial;

[0074] A processing module 402 is used to pre-process the image to be analyzed based on the key scale values ​​of the instrument dial by a preset image processing algorithm to obtain a candidate image;

[0075] The fitting module 403 is used to perform pointer pointing analysis on the candidate image through a preset pointer analysis model to obtain target pointing information;

[0076] A calculation module 404 is used to calculate the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value;

[0077] The analysis module 405 is used to perform instrument value analysis based on the target scale arc length to obtain the target scale value.

[0078] Optionally, the processing module 402 is specifically used to: extract feature points from the instrument template image and the picture to be analyzed respectively to obtain multiple first feature points corresponding to the instrument template image and multiple second feature points corresponding to the picture to be analyzed; perform feature point matching on the multiple first feature points and the multiple second feature points based on a preset matching algorithm to obtain multiple target feature point groups; calculate the transformation matrix of the multiple target feature point groups through a preset consistency algorithm to obtain a projection transformation matrix; and project the key scale values ​​of the instrument dial to the picture to be analyzed based on the projection transformation matrix to obtain a candidate picture.

[0079] Optionally, the instrument numerical analysis device further includes:

[0080] The acquisition module 406 is used to acquire multiple pointer instrument pictures;

[0081] A labeling module 407 is used to label the pointer contour of each pointer instrument picture in the plurality of pointer instrument pictures to obtain a training picture set;

[0082] The training module 408 is used to input the training picture set into a preset deep learning model for training to obtain the pointer analysis model.

[0083] Optionally, the fitting module 403 specifically includes:

[0084] An analysis unit 4031 is used to input the image to be analyzed into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information;

[0085] The fitting unit 4032 is used to perform straight line fitting on the pointer contour information through the distance minimization function of the pointer analysis model to obtain the target pointing information.

[0086] Optionally, the analysis unit 4031 is specifically used to: input the image to be analyzed into the pointer analysis model for binarization processing to obtain a binarized image; perform pointer coarse contour analysis on the binarized image to obtain a pointer coarse contour image; perform contour transformation on the coarse contour image through a preset transformation algorithm to obtain pointer contour information.

[0087] Optionally, the calculation module 404 is specifically used to: identify the intersection of the pointer in the candidate image and the scale arc in the candidate image based on the target pointing information to obtain a first arc endpoint; identify adjacent endpoints of the scale arc based on the first arc endpoint and the scale arc to obtain a second arc endpoint; calculate the target scale arc length using the first arc endpoint and the second arc endpoint to obtain a target scale arc length value.

[0088] Optionally, the analysis module 405 is specifically used to: identify adjacent key scale positions based on the target pointing information, obtain the target key scale position and use it as the third arc endpoint; calculate the reference arc length through the third arc endpoint and the second arc endpoint to obtain a reference arc length value; perform ratio analysis on the target scale arc length value and the reference arc length value to obtain a target arc length ratio; perform instrument value analysis based on the arc length ratio to obtain a target scale value.

[0089] In the embodiment of the present invention, the arc length calculation function is used to calculate the arc length of the reference arc to determine the reference arc length, and the ratio calculation is performed between the target scale arc length value and the reference arc length to determine the ratio data, and then the instrument numerical analysis is performed based on the ratio data and key scale numerical information to obtain the target scale value. Performing instrument numerical analysis through the ratio can avoid the situation where the numerical analysis error is large when the instrument scale is uneven, thereby further improving the accuracy of the instrument numerical analysis.

[0090] Figure 6 6 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. The computer device 600 may have relatively large differences due to different configurations or performances, and may include one or more processors 610 and memories 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 633 or data 632. Among them, the memory 620 and the storage medium 630 may be temporary storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 600. Furthermore, the processor 610 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the computer device 600.

[0091] The computer device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input and output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 6 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.

[0092] The present invention also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the instrument numerical analysis method in the above-mentioned embodiments.

[0093] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the instrument numerical analysis method.

[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.

Claims

1. An instrument numerical analysis method, characterized in that: The method comprises: Obtaining an instrument template image and a picture to be analyzed, wherein the instrument template image includes key scale values ​​of an instrument dial; Preprocessing the image to be analyzed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image, wherein the candidate image is marked with multiple key scale values; Performing pointer pointing analysis on the candidate image through a preset pointer analysis model to obtain target pointing information; Calculate the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value; Performing instrument numerical analysis based on the target scale arc length to obtain the target scale value; The step of performing pointer pointing analysis on the candidate image by using a preset pointer analysis model to obtain target pointing information includes: Inputting the candidate image into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information; Performing straight-line fitting on the pointer contour information through the distance minimization function of the pointer analysis model to obtain the target pointing information, wherein the pointer contour information includes a plurality of discrete points; The step of performing straight line fitting on the pointer contour information through the distance minimization function of the pointer analysis model to obtain the target pointing information includes: The vertical distances between the multiple discrete points and the straight line to be matched are determined according to the distance minimization function, and the minimum distance of the vertical distances between the multiple discrete points and the straight line to be matched is estimated, and images of the same pointer at different positions are taken respectively, and the pointer straight line is fitted according to the minimum distance method to obtain a corrected slope, and a straight line is fitted according to the corrected slope to obtain target pointing information.

2. The instrument numerical analysis method according to claim 1, characterized in that: The preprocessing of the image to be analyzed by a preset image processing algorithm based on the key scale value of the instrument dial to obtain the candidate image includes: Extracting feature points from the instrument template image and the image to be analyzed respectively, to obtain a plurality of first feature points corresponding to the instrument template image and a plurality of second feature points corresponding to the image to be analyzed; Performing feature point matching on the plurality of first feature points and the plurality of second feature points based on a preset matching algorithm to obtain a plurality of target feature point groups; Performing transformation matrix calculation on the plurality of target feature point groups by using a preset consistency algorithm to obtain a projection transformation matrix; The instrument dial key scale values ​​are projected onto the image to be analyzed based on the projection transformation matrix to obtain a candidate image.

3. The instrument numerical analysis method according to claim 1, characterized in that: After the image to be analyzed is preprocessed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image, and before the pointer pointing analysis is performed on the candidate image by a preset pointer analysis model to obtain target pointing information, the method further includes: Collect pictures of multiple pointer instruments; Annotating a pointer contour of each pointer instrument picture in the plurality of pointer instrument pictures to obtain a training picture set; The training picture set is input into a preset deep learning model for training to obtain the pointer analysis model.

4. The instrument numerical analysis method according to claim 1, characterized in that: The step of inputting the candidate image into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information includes: Inputting the candidate image into the pointer analysis model for binarization processing to obtain a binarized image; Performing pointer rough outline analysis on the binarized image to obtain a pointer rough outline image; The rough contour image is transformed by a preset transformation algorithm to obtain pointer contour information.

5. The instrument numerical analysis method according to any one of claims 1 to 4, characterized in that: The calculating the target scale arc length of the candidate image based on the target pointing information to obtain the target scale arc length value includes: Based on the target pointing information, an intersection point of the pointer in the candidate image and a scale arc in the candidate image is identified to obtain a first arc endpoint; Based on the first arc endpoint and the scale arc, adjacent endpoints of the scale arc are identified to obtain a second arc endpoint; The target scale arc length is calculated by using the first arc endpoint and the second arc endpoint to obtain a target scale arc length value.

6. The instrument numerical analysis method according to claim 5, characterized in that: The instrument value analysis based on the target scale arc length is performed to obtain the target scale value, which includes: Based on the target pointing information, adjacent key scale positions are identified to obtain the target key scale position as the third arc endpoint; Calculate the reference arc length by using the third arc endpoint and the second arc endpoint to obtain a reference arc length value; Performing ratio analysis on the target scale arc length value and the reference arc length value to obtain a target arc length ratio; An instrument numerical value analysis is performed based on the arc length ratio to obtain a target scale value.

7. An instrument numerical analysis device, characterized in that: The instrument numerical analysis device comprises: An acquisition module, used to acquire an instrument template diagram and a picture to be analyzed, wherein the instrument template diagram includes key scale values ​​of an instrument dial; A processing module, configured to pre-process the image to be analyzed by a preset image processing algorithm based on the key scale values ​​of the instrument dial to obtain a candidate image, wherein the candidate image is marked with a plurality of key scale values; A fitting module, used for performing pointer pointing analysis on the candidate image through a preset pointer analysis model to obtain target pointing information; A calculation module, used for calculating the target scale arc length of the candidate image based on the target pointing information to obtain a target scale arc length value; An analysis module, used for performing instrument value analysis based on the target scale arc length to obtain a target scale value; The fitting module comprises: An analysis unit, configured to input the image to be analyzed into the pointer analysis model to perform pointer contour analysis to obtain pointer contour information; A fitting unit, configured to perform straight line fitting on the pointer contour information through a distance minimization function of the pointer analysis model to obtain the target pointing information, wherein the pointer contour information includes a plurality of discrete points; The fitting unit is specifically used for: The vertical distances between the multiple discrete points and the straight line to be matched are determined according to the distance minimization function, and the minimum distance of the vertical distances between the multiple discrete points and the straight line to be matched is estimated, and images of the same pointer at different positions are taken respectively, and the pointer straight line is fitted according to the minimum distance method to obtain a corrected slope, and a straight line is fitted according to the corrected slope to obtain target pointing information.

8. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the computer device to execute the instrument numerical analysis method according to any one of claims 1 to 6.

9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the instrument numerical analysis method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Instrument image recognition method and device, electronic equipment and computer readable medium

    CN113537153A