A reading method and device of a pointer type meter, an electronic device and a storage medium
By processing images of pointer-type meters at petrochemical sites and extracting dial and needle features using a network model, a simulated dial and needle are constructed, solving the problem of cumbersome meter reading for users and enabling convenient and accurate acquisition of scale values.
Patent Information
- Application Number
- CN202210530635.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-05-16
AI Technical Summary
At petrochemical sites, there are many types of pointer-type meters, and the scale lines may not correspond to scale values, which requires users to spend a lot of effort to read the values.
By acquiring sampled images of the meter, a pre-trained network model is used to filter and process the images, extract feature information of the dial and hands, construct a simulated dial and hands, and calculate the scale value.
It improves the convenience and accuracy of reading the pointer scale value, reduces the user's workload, and reduces the impact of image distortion on the reading.
Smart Images

Figure CN115082910B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a reading method and device for a pointer type meter, an electronic device and a storage medium. BACKGROUND
[0002] The pointer type meter can be a non-electronic display instrument, which is suitable for various harsh environments, such as high temperature environment, underwater environment, severe cold environment, etc., and is widely used in aerospace, biological medicine, petrochemical industry, etc.
[0003] In the related art, a large number of meters need to be configured in a petrochemical field to monitor the petrochemical field. Since the petrochemical field environment is relatively complex, a patrol robot is used to shoot the meters in the petrochemical field, and the sample images generated by the shooting are fed back to the user, so that the user can read the values of the meters through the sample images to reasonably evaluate the situation of the petrochemical field.
[0004] In the process of implementing the present application, the inventors have found that at least the following problems exist in the prior art:
[0005] There are various types of meters, and each scale line on the meter does not necessarily correspond to a scale value, so that the user needs to consume a lot of energy to calculate the value pointed by the pointer, resulting in a large workload of the user. SUMMARY
[0006] In order to improve the problem that the user needs to consume a lot of energy to read the value pointed by the pointer, the present application provides a reading method and device for a pointer type meter, an electronic device and a storage medium.
[0007] In a first aspect, the present application provides a reading method for a pointer type meter, which adopts the following technical solution:
[0008] A reading method for a pointer type meter, comprising the following steps:
[0009] Obtaining a sample image of a meter to be measured as a to-be-measured image;
[0010] Obtaining dial feature information and pointer feature information in the to-be-measured image;
[0011] According to the dial feature information, an analog dial is obtained, wherein the analog dial comprises scale lines and corresponding analog scale values;
[0012] According to the dial feature information and the pointer feature information, an analog pointer is obtained;
[0013] According to the analog dial and the analog pointer, a target scale value corresponding to the analog pointer is obtained.
[0014] By adopting the technical scheme, the image to be measured is first processed in data, that is, the corresponding dial feature information and the hand feature information are obtained. Then, the analog hand, the scale line and the corresponding analog scale value are obtained through the dial feature information and the hand feature information, and then the scale value pointed by the analog hand can be obtained. Compared with the manual calculation and re-reading mode, the method is more convenient and accurate, thereby reducing the workload of the user.
[0015] In a specific implementation manner, the obtaining of the dial feature information and the hand feature information in the image to be measured specifically includes the following steps.
[0016] Based on the preset first network model, it is judged whether the image to be measured is a preset type of meter image.
[0017] If yes, the sampling dial and the sampling hand in the meter image are obtained according to the preset second network model.
[0018] The dial feature information is obtained according to the sampling dial.
[0019] The hand feature information is obtained according to the sampling dial and the sampling hand.
[0020] By adopting the technical scheme, the first network model is used to preliminarily screen the obtained image to be measured, so as to reduce the possibility of operation processing on non-meter images, and then to reduce the operation amount of processing all images to be measured. The second network model is used to remove the noise points in the image to be measured, so as to reduce the influence of the noise points on the value pointed by the read hand, thereby improving the accuracy of the value pointed by the read hand.
[0021] In a specific implementation manner, the obtaining of the analog hand according to the dial feature information and the hand feature information specifically includes the following steps.
[0022] The center of the meter is obtained according to the dial feature information and the hand feature information.
[0023] The hand virtual frame surrounding the edge of the sampling hand and the plurality of connection lines connecting the two ends of the sampling hand are generated according to the hand feature information.
[0024] In the plurality of connection lines, a preset number of connection lines are selected as candidate lines according to the length.
[0025] The hand region frame is constructed with the hand virtual frame as the diagonal line, and the target diagonal line that coincides with the hand virtual frame is selected in the hand region frame.
[0026] In the candidate lines, the target candidate line with the smallest angle between the target diagonal line is obtained.
[0027] Generate the analog hand by taking the end point of the target candidate line away from the center of the meter as the head of the hand and taking the center of the meter as the tail of the hand.
[0028] By adopting the technical solution, the center of the meter is obtained as the tail of the hand through the dial feature information and the hand feature information. The virtual frame of the hand is generated by sampling the edge of the hand, and the longer candidate line connecting the two ends of the sampled hand is obtained. Since the image may be distorted, the individual connecting line is lengthened when the sampled hand is distorted into a right-angle contour image. By selecting a preset number of connecting lines as candidate lines, the end point of the lengthened connecting line is effectively avoided as the head of the hand, which is beneficial to improving the accuracy of the analog hand. Then, the hand region frame is constructed by taking the virtual frame of the hand as a diagonal line, and the target diagonal line is selected, so that the target candidate line with the smallest angle with the target diagonal line is obtained. The tilt angle of the entire analog hand is determined by the diagonal line, which is beneficial to reducing the influence of image distortion on the selection of candidate lines, so as to improve the accuracy of the generated analog hand.
[0029] In a specific implementation, the analog dial is obtained according to the dial feature information, specifically including the following steps:
[0030] Obtain each scale line and a reference scale value in the dial feature information.
[0031] Obtain an analog scale value corresponding to each scale line according to the each scale line and the reference scale value.
[0032] Obtain an analog dial according to the each scale line and the corresponding analog scale value.
[0033] By adopting the technical solution, the reference scale value is used to assign values to all scale lines, so that the analog scale value corresponding to each scale line can be obtained, thereby providing a basic condition for subsequent reading of the value pointed to by the analog hand.
[0034] In a specific implementation, the target scale value corresponding to the analog hand is obtained according to the analog dial and the analog hand, specifically including the following steps:
[0035] Obtain an extended angle region formed by extending adjacent scale lines.
[0036] Determine the target extended angle region where the analog hand is located and the hand angle proportion.
[0037] Obtain a target analog scale value corresponding to the target extended angle region.
[0038] Obtain the target scale value corresponding to the analog hand according to the target analog scale value and the hand angle proportion.
[0039] By adopting the technical scheme, when the area pointed to by the analog pointer is between two scale lines, the proportion of the pointer angle of the analog pointer can be obtained by determining a certain extension angle region (i.e., a target extension angle region) in which the analog meter is located, and the scale value corresponding to the analog pointer can be obtained by combining the analog scale value of the target extension angle region, so as to improve the accuracy of the read scale value.
[0040] In a specific implementation, the obtaining of the extension angle region formed by the extension of the adjacent scale lines specifically includes the following steps:
[0041] obtaining a meter center according to the dial feature information and the pointer feature information;
[0042] obtaining a connecting line of the meter center and each scale line;
[0043] obtaining an extension angle region formed by the extension of the adjacent connecting lines.
[0044] By adopting the technical scheme, when the angle between each scale line is needed to be obtained, the connecting line of each scale line and the meter center is obtained, and the corresponding extension angle region is obtained through two adjacent connecting lines, so as to realize the calculation of the value pointed to by the analog pointer.
[0045] In a specific implementation, the obtaining of the meter center according to the dial feature information and the pointer feature information includes the following steps:
[0046] obtaining an extension intersection point formed by the extension of each scale line;
[0047] determining a pointer tail region according to the pointer feature information;
[0048] selecting a target extension intersection point in the extension intersection point and located in the pointer tail region;
[0049] performing clustering processing on the target extension intersection point to obtain the meter center.
[0050] By adopting the technical scheme, the scale line of the pointer usually points to the meter center, but due to the angle deviation of the scale line of the meter, the extension intersection points formed by the extension of each scale line are distributed around the meter center. Eliminating the points outside the pointer tail region helps to reduce the influence of the accuracy of the meter center obtained due to the too large angle deviation of some scale lines, and the selected target extension intersection point is subjected to clustering processing, so that a more accurate meter center can be obtained.
[0051] In a second aspect, the application provides a reading device of a pointer type meter, which adopts the following technical scheme:
[0052] A reading device of a pointer type meter comprises:
[0053] An image acquisition module is configured to acquire a sampling image of a meter to be measured as a to-be-measured image;
[0054] A feature acquisition module is configured to acquire dial feature information and hand feature information in the to-be-measured image;
[0055] A dial acquisition module is configured to acquire an analog dial according to the dial feature information, wherein the analog dial comprises scale lines and corresponding analog scale values;
[0056] A hand acquisition module is configured to acquire an analog hand according to the dial feature information and the hand feature information;
[0057] A scale value acquisition module is configured to acquire a target scale value corresponding to the analog hand according to the analog dial and the analog hand.
[0058] By using the above technical solution, the feature acquisition module performs data processing on the to-be-measured image, i.e., acquires corresponding dial feature information and hand feature information. Then, the dial acquisition module acquires an analog dial, and the hand acquisition module acquires an analog hand, and then the scale value pointed to by the analog hand can be acquired. Compared with the manual calculation and reading method, the method is more convenient and accurate, thereby reducing the workload of the user.
[0059] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:
[0060] Optionally, the electronic device comprises a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the reading method of the pointer type meter according to the first aspect.
[0061] By using the above technical solution, an electronic device can implement the reading method of the pointer type meter according to the related computer program stored in the memory, thereby improving the collaboration between different source information when reading the scale value pointed to by the hand, and improving the timeliness and accuracy of the read scale value.
[0062] In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical solution:
[0063] Optionally, the storage medium stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the reading method of the pointer type meter according to the first aspect.
[0064] By adopting the technical scheme, corresponding programs can be stored, and thus the collaboration between different source information when reading the scale value pointed by the analog hand is improved, so that the timeliness and accuracy of the read scale value are improved.
[0065] To sum up, the present application includes at least one of the following beneficial technical effects:
[0066] The data processing of the to-be-measured image can obtain corresponding dial feature information and analog hand feature information. Then, the analog hand, the scale line and the corresponding analog scale value are obtained, and the scale value pointed by the analog hand can be obtained. Compared with the artificial estimation and re-reading method, it is more convenient and accurate, thereby reducing the workload of the user.
[0067] The detection model (i.e., the first network model) preliminarily screens the obtained to-be-measured image, reduces the possibility of operating and processing non-dial image, and easily reduces the operation amount of processing all to-be-measured images. The detection model (i.e., the second network model) removes the noise points in the to-be-measured image, so as to reduce the influence of the noise points on the value pointed by the read analog hand, thereby improving the accuracy of the value pointed by the read analog hand.
[0068] Since the image may be distorted, the individual connection line is elongated when the sampling pointer is distorted into a right-angle contour image. By selecting a preset number of connection lines as candidate lines, the end points of the elongated connection lines are effectively avoided as the head of the analog hand, which is beneficial to improve the accuracy of the analog hand. By the diagonal line, the inclination angle of the whole analog hand is determined, which is beneficial to reduce the influence of image distortion on screening the candidate lines, and is easy to improve the accuracy of the generated analog hand. BRIEF DESCRIPTION OF DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0070] Figure 1 is a structure diagram of a reading device of a pointer type meter of an embodiment of the present application.
[0071] Figure 2 is a flowchart of a reading method of a pointer type meter of an embodiment of the present application.
[0072] Figure 3 is a schematic diagram of a to-be-measured image corresponding to a meter A of an embodiment of the present application.
[0073] Figure 4 Figure 1 is a flow diagram of a reading device of a pointer type meter according to an embodiment of the present application.
[0074] Figure 5 Figure 2 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0076] The embodiments of the present application provide a reading method of a pointer type meter, which can be applied to a reading system of the pointer type meter. The framework structure of the reading system of the pointer type meter can be as shown in Figure 1, and the reading system can include an inspection robot and a reading device. Specifically, the execution subject of the method can be the reading device in the reading system, and the reading device can be assisted to be realized by the inspection robot. The inspection robot can capture the surface of each meter in a petrochemical site to generate and send a sample image. The reading device can be a server, and can be used to process the sample image to obtain the scale value pointed by the pointer in the sample image. The reading device can also send the scale value to a user terminal to show the scale value of each meter in the petrochemical site to the user. The user terminal can be a computer, a mobile phone or a tablet. Figure 1 The embodiments of the present application will be described in detail below with reference to the specific embodiments and the processing flow shown in Figure 2.
[0077] Figure 2 The embodiments of the present application will be described in detail below with reference to the specific embodiments and the processing flow shown in Figure 2.
[0078] Step 201: obtaining a sample image of a meter to be measured as a to-be-measured image.
[0079] In implementation, the inspection robot captures each meter (i.e. the meter to be measured) and sends the sample image generated by the capturing to the reading device. The reading device can obtain the sample image of the meter to be measured, and take the sample image as the to-be-measured image to digitally process the meter in the to-be-measured image.
[0080] Step 202: obtaining dial feature information and pointer feature information in the to-be-measured image.
[0081] In implementation, the reading device can obtain the parameters (i.e. the dial feature information and the pointer feature information) of the meter in the to-be-measured image. The dial feature information can include the size of the dial, the number of scale lines, the scale value corresponding to the scale line, etc. The pointer feature information can include the length, the width and the position on the dial of the pointer, etc.
[0082] Further, in the process of acquiring the dial feature information and the hand feature information, since there are noise points in the image captured by the inspection robot, in order to reduce the influence caused by such situations, in another embodiment, the following content is further included:
[0083] The reading device is provided with a first network model and a second network model in advance, the first network model is obtained by training a preset type of meter through a neural network, and the preset type of meter can be various circular instruments; the second network model is also obtained by training the dial and the hand in various meters through a neural network, so as to detect the dial and the hand in the meter image.
[0084] In implementation, the reading device inputs the to-be-tested image into the preset first network model, and the first network model judges whether the to-be-tested image is a preset type of meter image. When the to-be-tested image is a preset type of meter image, the reading device outputs the to-be-tested image into the preset second network model again, and obtains the sampling dial and the sampling hand in the meter image through the second network model. The reading device obtains the dial feature information according to the sampling dial, for example, the positions of the start point and the end point of each scale line on the dial, the scale value and the like; and obtains the hand feature information according to the sampling dial and the sampling hand, for example, the positions of the start point and the end point of the hand on the dial, the size of the hand and the like.
[0085] In step 203, an analog dial is acquired according to the dial feature information, wherein the analog dial includes each scale line and corresponding analog scale value.
[0086] In implementation, the reading device obtains the analog dial according to the positions of the start point and the end point of each scale line on the dial, the scale value and the like, and the analog dial contains each scale line and the scale line corresponds to the analog scale value. Specifically, when some scale lines on the dial are damaged and / or some scale lines on the dial do not correspond to the scale value, the reading device can complete the scale line and / or assign a value to the scale line through the acquired dial feature information, so as to form a relatively complete analog dial.
[0087] Optionally, in order to assign a value to all scale lines, in another embodiment, the specific assignment process can be as follows:
[0088] In implementation, the reading device obtains each scale line and the reference scale value in the dial feature information, wherein the reference scale value can be a scale value marked by some scale lines in the meter. The reading device obtains the unmarked scale lines between the adjacent reference scale lines through the reference scale lines marked with the reference scale value, and calculates the scale value of the unmarked scale lines according to the number of the unmarked scale lines and the difference between the adjacent reference scale values, that is, obtains the analog scale value corresponding to each scale line. The reading device obtains the analog dial according to each scale line and the corresponding analog scale value.
[0089] Specifically, the reading device obtains the to-be-tested image of the meter A with reference to Figure 3 , the reading device obtains the reference value as 0-10, the difference between the reference scale lines corresponding to the adjacent reference values is 1, and the number of the unmarked scale lines is 3, for example: when the adjacent reference values are 0 and 1, the unmarked scale lines correspond to the analog scale values of 0.25, 0.5 and 0.75 in the clockwise direction.
[0090] Step 204, obtaining the analog hand according to the dial feature information and the hand feature information.
[0091] In implementation, the reading device obtains the contour of the dial, obtains the geometric center of the contour (i.e., the center of the meter), and then takes the center of the meter as the tail of the hand. The reading device obtains the endpoint of the hand away from the center of the meter as the head of the hand according to the hand feature information, and connects the tail and the head of the hand to generate the analog hand.
[0092] Optionally, in order to improve the accuracy of the obtained center of the meter, the process of obtaining the center of the meter can further include the following contents:
[0093] In implementation, the reading device obtains the extended intersection points formed by the extension of each scale line. According to the hand feature information, the tail region of the hand is determined, which can be the largest circular region in the hand edge framed with the center of the meter as the center, or the largest square region in the hand edge framed with the center of the meter as the center. Among all the extended intersection points, the reading device selects all the extended intersection points located in the tail region of the hand (i.e., the target extended intersection points). The target extended intersection points are clustered to obtain the center of the meter.
[0094] Further, in another embodiment, in order to obtain a more accurate analog hand, the process of generating the analog hand includes the following contents:
[0095] In implementation, the reading device obtains the meter center according to the dial feature information and the hand feature information. The reading device generates a hand virtual frame surrounding the hand edge in the hand feature information and a plurality of connection lines connecting two ends of the sampling hand. The hand virtual frame can be obtained by the LSD straight line algorithm. Then, among the plurality of connection lines, a preset number of connection lines are selected as candidate lines according to length, and the selection manner can be selecting from long to short according to length, and the preset number can be 3 or 5. By selecting the connection lines with longer length and a preset number, the end points of the connection lines which are elongated due to image distortion are effectively avoided as the hand head, which is beneficial to improve the accuracy of the simulation hand.
[0096] Specifically, referring to Figure 3 , the simulation hand generation process of the meter A can be specifically as follows: the reading device first generates a hand region frame surrounding the hand edge in the meter A according to the LSD straight line algorithm, and selects four intersection points at two ends of the hand and the hand region frame, and the four intersection points are connected to form connection lines, and then selects three longer connection lines as candidate lines. The reading device generates a hand region frame with the hand virtual frame as the diagonal according to the five points of the hand region frame, and obtains the diagonal line of the hand region frame coinciding with the hand, and calculates the angle between the diagonal line and the three candidate lines. The reading device selects the candidate line with smaller angle and obtains two end points of the candidate line, and calculates the end point far away from the meter center as the hand head according to the position of the meter center and the position of the two end points of the candidate line, so as to obtain the simulation hand of the meter A.
[0097] In step 205, the target scale value corresponding to the simulation hand is obtained according to the simulation dial and the simulation hand.
[0098] In implementation, the reading device obtains the position of the simulation hand and the position of each scale line according to the simulation dial and the simulation hand, so as to determine the scale value (i.e. the target scale value) corresponding to the simulation hand.
[0099] Optionally, in another embodiment, in order to improve the accuracy of the read scale value, step 204 specifically includes the following contents:
[0100] In implementation, the reading device obtains an extended angle region formed by extending adjacent scale lines. The extended angle region where the analog hand is located (i.e. target extended angle region) is determined, and then a hand coverage region is formed according to the position of the scale line with smaller scale value (i.e. reference scale line) corresponding to the target extended angle region and the position of the analog hand, and the proportion of the hand coverage region in the target extended angle region (i.e. hand angle proportion) is determined. The reading device then obtains two target analog scale values corresponding to the target extended angle region. According to the difference between the two target analog scale values and the hand angle proportion, the scale value corresponding to the analog hand (i.e. target scale value) is calculated, and the calculation formula of the scale value of the analog hand is: scale value of analog hand = scale value corresponding to reference scale line + difference x hand angle proportion.
[0101] Optionally, in the process of obtaining the extended angle region, in order to improve the accuracy of the value pointed to by the analog hand, in another embodiment, the following steps are further included:
[0102] In implementation, the reading device obtains the center of the meter circle according to the dial feature information and the hand feature information. According to the dial feature information, the position of each scale line is obtained, which can be represented by the position of the center point of the scale line. Since the scale line is also distorted in the image to be measured, when obtaining the center point of the scale line, the reading device can generate a virtual scale line frame around the edge of the scale line, which can be a rectangular frame, so that the intersection of the diagonal of the scale line is the center point of the scale line. The reading device obtains the connecting line between the center of the meter circle and the center point of each scale line, and obtains the extended angle region formed by extending adjacent connecting lines. Compared with the angle region formed by the connecting lines between the two ends of the scale line and the center of the meter circle, the connecting line between the center point of the scale line and the center of the meter circle effectively reduces the probability of the angle region being too large or too small due to image distortion, thereby reducing the error of the value pointed to by the analog hand.
[0103] Further, in order to determine the meter angle proportion, after obtaining the extended angle region formed by extending adjacent connecting lines, the following contents are specifically included:
[0104] In implementation, the reading device establishes a rectangular coordinate system with the center of the meter circle as the zero point, generates the position coordinate of the head of the analog hand, and then generates the position coordinates of the center points of the two scale lines adjacent to the head of the analog hand, i.e. determines the extended angle region where the analog hand is located (i.e. target extended angle region). Among the position coordinates of the two scale line center points, the reading device selects the center point position coordinate corresponding to the scale line with smaller scale value and the position coordinate of the head of the analog hand to obtain the proportion of the analog hand in the target extended angle region (i.e. meter angle proportion).
[0105] In addition, in another embodiment, the process of obtaining the meter angle proportion can further include the following contents:
[0106] The reading device can also preset a scale line selection model, and select a scale line with a smaller scale value through a rectangular coordinate system established with the meter center as the zero point.
[0107] The reading device establishes a rectangular coordinate system with the meter center as the zero point, determines the quadrant in which the analog hand is located, obtains the horizontal coordinates of the scale lines corresponding to the target extension angle region when the analog hand is in the first and second quadrants, selects a scale line with a smaller horizontal coordinate value as the standard scale line, and obtains the meter angle proportion through the standard scale line and the target extension angle region; when the analog hand is in the third and fourth quadrants, the horizontal coordinates of the scale lines corresponding to the target extension angle region are obtained, a scale line with a larger horizontal coordinate value is selected as the standard scale line, and the meter angle proportion is obtained through the standard scale line and the target extension angle region.
[0108] Based on the same technical concept, referring to Figure 4 The embodiment of the present application also discloses a reading device of a pointer type meter, and a reading device of a pointer type meter includes an inspection robot and a reading device, as shown in Figure 4 The reading device includes:
[0109] The image acquisition module 401 is configured to acquire a sampling image of a meter to be measured as a to-be-measured image.
[0110] The feature acquisition module 402 is configured to acquire dial feature information and hand feature information in the to-be-measured image.
[0111] The dial acquisition module 403 is configured to acquire an analog dial according to the dial feature information, wherein the analog dial includes scale lines and corresponding analog scale values.
[0112] The hand acquisition module 404 is configured to acquire an analog hand according to the dial feature information and the hand feature information.
[0113] The scale value acquisition module 405 is configured to acquire a target scale value corresponding to the analog hand according to the analog dial and the analog hand.
[0114] Optionally, the image judgment module is configured to judge whether the to-be-measured image is a meter image of a preset type based on a preset first network model.
[0115] The hand and dial acquisition module is configured to acquire a sampling dial and a sampling hand in the meter image according to a preset second network model when the to-be-measured image is the meter image of the preset type.
[0116] The dial feature obtaining module is configured to obtain the dial feature information according to the sampling dial.
[0117] A hand feature obtaining module is configured to obtain hand feature information according to the sampling dial and the sampling hand.
[0118] Optionally, a center obtaining module is configured to obtain a meter center according to the dial feature information and the hand feature information.
[0119] A connection line generating module is configured to generate a hand virtual frame surrounding an edge of the sampling hand and a plurality of connection lines connecting two ends of the sampling hand according to the hand feature information.
[0120] A candidate line selecting module is configured to select a preset number of connection lines as candidate lines according to lengths of the plurality of connection lines.
[0121] An angle line selecting module is configured to construct a hand region frame with the hand virtual frame as a diagonal line, and select a target diagonal line coinciding with the hand virtual frame in the hand region frame.
[0122] A candidate line determining module is configured to obtain a target candidate line having a smallest angle with the target diagonal line from among the candidate lines.
[0123] A meter generating module is configured to generate a simulation hand with an end point of the target candidate line far away from the meter center as a hand head and the meter center as a hand tail.
[0124] Optionally, an intersection obtaining module is configured to obtain an extended intersection formed by extensions of the scale lines.
[0125] A hand head determining module is configured to determine a hand tail region according to the hand feature information.
[0126] An intersection selecting module is configured to select a target extended intersection located in the hand tail region from among the extended intersections.
[0127] A center obtaining module is configured to obtain the meter center by clustering the target extended intersection.
[0128] Optionally, a scale line obtaining module is configured to obtain the scale lines and the reference scale values in the dial feature information.
[0129] A scale value obtaining module is configured to obtain simulation scale values corresponding to the scale lines according to the scale lines and the reference scale values.
[0130] A dial obtaining module is configured to obtain a simulation dial according to the scale lines and the corresponding simulation scale values.
[0131] Optionally, an angle region obtaining module is configured to obtain an extended angle region formed by extensions of adjacent scale lines.
[0132] An angle proportion determining module is configured to determine a target extended angle region in which the simulation hand is located and a hand angle proportion.
[0133] a scale value simulation module, configured to obtain a target simulation scale value corresponding to a target extension angle region;
[0134] a hand scale reading module, configured to obtain a target scale value corresponding to a simulation hand according to the target simulation scale value and a hand angle proportion.
[0135] Optionally, a center obtaining module is configured to obtain a meter center according to dial feature information and hand feature information;
[0136] a line obtaining module, configured to obtain a line connecting the meter center and each scale line;
[0137] an angle region obtaining module, configured to obtain an extension angle region formed by adjacent lines.
[0138] The embodiment of the present application also discloses an electronic device, referring to Figure 5 The electronic device comprises a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor to perform the reading method of the pointer type meter.
[0139] The embodiment of the present application also discloses a computer readable storage medium which stores a computer program capable of being loaded and executed by the processor to perform the reading method of the pointer type meter, and the computer readable storage medium comprises, for example, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various storage program codes.
[0140] The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the protection scope of the application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on these embodiments, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
Claims
1. A method for reading a pointer-type meter, characterized in that, Includes the following steps: Acquire the sampled image of the meter under test as the test image; Obtain the dial feature information and hand feature information from the image to be tested; Based on the dial feature information, a simulated dial is obtained, wherein the simulated dial includes each scale line and the corresponding simulated scale value; Based on the dial feature information and the hand feature information, obtain the simulated watch hands; Based on the simulated dial and simulated hands, obtain the target scale value corresponding to the simulated hands; The process of obtaining the dial feature information and hand feature information from the image to be tested specifically includes the following steps: Based on a preset first network model, determine whether the image to be tested is a meter image of a preset type; If so, then according to the preset second network model, the sampled dial and sampled needles in the meter image are obtained; Based on the sampled dial, the dial feature information is obtained; Based on the sampling dial and sampling pointer, the pointer feature information is obtained; The step of obtaining the simulated watch hands based on the dial feature information and the hand feature information specifically includes the following steps: Based on the dial feature information and the hand feature information, the center of the meter is obtained; Based on the pointer feature information, a virtual pointer frame surrounding the edge of the sampling pointer and several connecting lines connecting the two ends of the sampling pointer are generated. Among the plurality of connecting lines, a predetermined number of connecting lines are selected as candidate lines according to their length; Construct a pointer region frame with the pointer virtual frame as the diagonal, and select a target diagonal line in the pointer region frame that coincides with the pointer virtual frame; Among the candidate lines, the target candidate line with the smallest angle between it and the target diagonal line is selected; A simulated pointer is generated by using the endpoint of the target line that is far from the center of the meter circle as the pointer head and the center of the meter circle as the pointer tail.
2. The method for reading a pointer-type meter according to claim 1, characterized in that, The step of obtaining a simulated watch face based on the watch face feature information specifically includes the following steps: Obtain the scale lines and reference scale values from the dial feature information; Based on each scale line and the reference scale value, obtain the simulated scale value corresponding to each scale line; Based on the scale lines and their corresponding simulated scale values, a simulated dial is obtained.
3. The method for reading a pointer-type meter according to claim 1, characterized in that, The step of obtaining the target scale value corresponding to the simulated hands based on the simulated dial and simulated hands specifically includes the following steps: Obtain the extended angle region formed by the extension of adjacent scale lines; Determine the target extended angle region where the simulated pointer is located and the percentage of the pointer angle; Obtain the target simulation scale value corresponding to the target extension angle region; Based on the target simulated scale value and the percentage of the pointer angle, the target scale value corresponding to the simulated pointer is obtained.
4. The method for reading a pointer-type meter according to claim 3, characterized in that, The step of obtaining the extended angle region formed by the extension of adjacent scale lines specifically includes the following steps: Based on the dial feature information and the hand feature information, the center of the meter is obtained; Obtain the line connecting the center of the meter to each scale line; Obtain the extended angle region formed by the extension of adjacent connecting lines.
5. A method for reading a pointer-type meter according to claim 1 or 4, characterized in that, The process of obtaining the watch center based on the dial feature information and the hand feature information includes the following steps: Obtain the intersection point formed by the extension of each scale line; Based on the hand feature information, determine the tail region of the hand; Among the extended intersections, select the target extended intersection located within the region of the tail of the dial needle; Clustering is performed on the intersection points of the target extensions to obtain the center of the meter circle.
6. A reading device for a pointer-type meter, characterized in that, include: The image acquisition module is used to acquire the sampled image of the meter under test as the image to be tested; The feature acquisition module is used to acquire dial feature information and hand feature information in the image to be tested; The dial acquisition module is used to acquire a simulated dial based on the dial feature information, wherein the simulated dial includes each scale line and the corresponding simulated scale value. The hand acquisition module is used to acquire simulated hands based on the dial feature information and the hand feature information. The process of obtaining the dial feature information and hand feature information from the image to be tested specifically includes the following steps: Based on a preset first network model, determine whether the image to be tested is a meter image of a preset type; If so, then according to the preset second network model, the sampled dial and sampled needles in the meter image are obtained; Based on the sampled dial, the dial feature information is obtained; Based on the sampling dial and sampling pointer, the pointer feature information is obtained; The step of obtaining the simulated watch hands based on the dial feature information and the hand feature information specifically includes the following steps: Based on the dial feature information and the hand feature information, the center of the meter is obtained; Based on the pointer feature information, a virtual pointer frame surrounding the edge of the sampling pointer and several connecting lines connecting the two ends of the sampling pointer are generated. Among the plurality of connecting lines, a predetermined number of connecting lines are selected as candidate lines according to their length; Construct a pointer region frame with the pointer virtual frame as the diagonal, and select a target diagonal line in the pointer region frame that coincides with the pointer virtual frame; Among the candidate lines, the target candidate line with the smallest angle between it and the target diagonal line is selected; Using the endpoint of the target candidate line furthest from the center of the meter circle as the head of the needle and the center of the meter circle as the tail of the needle, a simulated needle is generated. The scale value acquisition module is used to acquire the target scale value corresponding to the simulated dial and the simulated hands based on the simulated dial and the simulated hands.
7. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed as any one of claims 1 to 5.
Citation Information
Patent Citations
Virtual watch plate based pointer reading identifying method
CN105091922A
Reading correction system and method for inclined pointer type instrument image of transformer substation
CN112906694A