Instrument reading method and device, electronic equipment and storage medium
By using image recognition and instrument tilt correction technology, instrument readings are automatically generated, solving the problems of low efficiency and low accuracy of manual inspections, and improving the efficiency and accuracy of instrument reading.
Patent Information
- Application Number
- CN202410991761.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-15
AI Technical Summary
In existing technologies, manual inspection of instruments suffers from poor real-time performance, low efficiency, and high cost, especially in remote or dangerous locations where it is difficult to achieve high-precision instrument readings.
By acquiring the instrument's detection image, performing image recognition to obtain pointer and scale information, determining the scale point information in conjunction with the instrument's range, and performing instrument tilt correction, the target instrument image is obtained, ultimately achieving automated reading.
It enables automated instrument reading without manual inspection, improving reading efficiency, reducing reading difficulty, and effectively avoiding the problem of low accuracy caused by environmental interference, thus improving recognition accuracy.
Smart Images

Figure CN118968479A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of instruments, and in particular to an instrument reading method, device, electronic device and storage medium. Background Art
[0002] With the development of substation maintenance and management, intelligent equipment monitoring and unmanned booth duty have become rigid demands. In the current substation equipment and environmental monitoring, some have realized intelligent monitoring and real-time data collection, while pointer instruments are non-intelligent devices and have not yet realized automatic data collection and upload. Usually, manual inspections are used to read the instruments configured in the substation to understand the operating status of the equipment. However, manual inspections often lead to misreading or missed readings due to factors such as responsibility and visual fatigue, and have disadvantages in terms of accuracy and real-time performance; in addition, some booths located in remote areas with inconvenient transportation use manual inspection instruments, which have high traffic risks and high inspection costs. There is an urgent need to use intelligent methods and technologies to solve these problems, realize intelligent equipment monitoring, and provide support for centralized monitoring and operation and maintenance of traction substations. Summary of the invention
[0003] In order to solve the problems of poor real-time performance, low efficiency and high cost in manual inspection of instruments, the present application provides an instrument reading method, device, electronic device and storage medium.
[0004] In a first aspect, the present application provides a meter reading method, comprising:
[0005] Acquire instrument detection images;
[0006] Performing image recognition based on the instrument detection image to obtain pointer information and scale information;
[0007] Based on the pointer information and the scale information, and in combination with the preset instrument range corresponding to the instrument detection image, scale point information is determined;
[0008] According to the scale point information, the instrument tilt correction is performed on the instrument detection image to obtain a target instrument image;
[0009] An instrument reading is performed based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
[0010] Optionally, the determining the scale point information based on the pointer information and the scale information in combination with a preset instrument range corresponding to the instrument detection image includes:
[0011] Based on the pointer information and the scale information, adjusting the scale sequence to obtain scale sequence information;
[0012] Determine the scale value information corresponding to the scale sequence information according to the instrument range;
[0013] The scale point information is generated by using the scale order information and the scale value information.
[0014] Optionally, adjusting the scale sequence based on the pointer information and the scale information to obtain the scale sequence information includes:
[0015] Extracting at least two scale point coordinates from the scale information, and extracting the pointer center point coordinates from the pointer information;
[0016] Taking the coordinates of the center point of the pointer as the origin, a polar coordinate system is established;
[0017] Determine the angle difference between the coordinates of every two scale points according to the polar coordinate system;
[0018] Based on the coordinate difference, the scale point coordinates are sequentially adjusted to obtain the scale sequence information.
[0019] Optionally, determining the scale value information corresponding to the scale sequence information according to the instrument range includes:
[0020] Obtaining a preset measuring range of the instrument;
[0021] Extracting at least two scale point coordinates from the scale sequence information;
[0022] Using the instrument range, determine the scale value corresponding to each scale point coordinate;
[0023] The scale value information is generated according to each of the scale values.
[0024] Optionally, performing instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image includes:
[0025] Determine the instrument type corresponding to the instrument detection image;
[0026] When the instrument type belongs to a preset instrument type, obtaining standard scale information corresponding to the instrument type;
[0027] Determine the scale correspondence relationship information between the standard scale information and the scale point information;
[0028] According to the scale correspondence information, the instrument tilt correction is performed on the instrument detection image to obtain a target instrument image.
[0029] Optionally, after determining the instrument type corresponding to the instrument detection image, the method further includes:
[0030] When the instrument type does not belong to the preset instrument type, using the scale point coordinates in the scale point information to generate fitting ellipse information;
[0031] According to the fitting ellipse information, vector processing is performed on each of the scale point coordinates to obtain the correction point coordinates corresponding to each of the scale point coordinates;
[0032] Determine the coordinate correspondence information between the correction point coordinates and the scale point coordinates;
[0033] The coordinate correspondence information is used to perform instrument tilt correction on the instrument detection image to obtain a target instrument image.
[0034] Optionally, performing vector processing on each of the scale point coordinates according to the fitted ellipse information to obtain the correction point coordinates corresponding to each of the scale point coordinates includes:
[0035] Extracting the center coordinates, major axis vector and minor axis vector of the ellipse from the fitted ellipse information;
[0036] determining a length ratio between the major axis vector and the minor axis vector;
[0037] Generate a scale point vector according to the ellipse center coordinates and the scale point coordinates;
[0038] Performing vector correction on the scale point vector based on the major axis vector, the minor axis vector and the length ratio to obtain a corrected scale point vector;
[0039] The corrected scale point vector is used to generate the correction point coordinates.
[0040] In a second aspect, the present application provides a meter reading device, comprising:
[0041] An acquisition module is used to acquire instrument detection images;
[0042] An image recognition module, used to perform image recognition based on the instrument detection image to obtain pointer information and scale information;
[0043] A scale point module, used to determine the scale point information based on the pointer information and the scale information, combined with the preset instrument range corresponding to the instrument detection image;
[0044] A correction module, used to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image;
[0045] The reading module is used to perform instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
[0046] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0047] Memory, used to store computer programs;
[0048] The processor is used to implement the meter reading method described in any one of the first aspects when executing the program stored in the memory.
[0049] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the meter reading method as described in any one of the first aspects is implemented.
[0050] The embodiment of the present application acquires an instrument detection image, performs image recognition based on the instrument detection image, obtains pointer information and scale information, and determines scale point information based on the pointer information and scale information in combination with a preset instrument range corresponding to the instrument detection image, so as to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image, and then performs instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image, thereby achieving the purpose of performing instrument reading without manual inspection, solving the problems of low efficiency and high difficulty in performing manual inspection and reading of instruments in the existing related technology, and being able to improve the efficiency of instrument reading and reduce the difficulty of instrument reading. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0053] Figure 1 A schematic diagram of a flow chart of an instrument reading method provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of an application scenario of an instrument reading method provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of another application scenario of a meter reading method provided in an embodiment of the present application;
[0056] Figure 4A schematic diagram of another application scenario of an instrument reading method provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of another application scenario of an instrument reading method provided in an embodiment of the present application;
[0058] Figure 6 A schematic diagram of the structure of an instrument reading device provided in an embodiment of the present application;
[0059] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0061] Existing substations usually rely on staff on duty to obtain the operating status of each substation through staff inspections, which means that manual inspections of substation instruments are required. Manual inspections often lead to misreading or missed readings due to factors such as lack of concentration and visual fatigue, thereby reducing work efficiency. In addition, some places with dangerous working conditions and high safety risks (such as strong radiation and high temperature environments) are not suitable for manual inspections, which means that manual inspections of instruments are difficult.
[0062] Existing related technologies also provide methods for adaptively identifying instruments, such as using concentric circle search method, silhouette method, Hough straight line transformation method, etc. Although the above methods can be used to identify instruments, the recognition logic of the above methods is relatively simple and is easily affected by environmental interference, resulting in low accuracy. For example, it is easily affected by lighting and the recognition of thicker pointers is insufficient, that is, there is a problem of low recognition accuracy.
[0063] In order to solve the problem of low recognition accuracy in the instrument recognition method in the prior art, the present application provides an instrument reading method, device, electronic device and storage medium, which obtains an instrument detection image, performs image recognition based on the instrument detection image, obtains pointer information and scale information, and determines scale point information based on the pointer information and scale information in combination with a preset instrument range corresponding to the instrument detection image, so as to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image, and then performs instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image, thereby achieving the purpose of performing instrument reading without manual inspection, solving the problems of low efficiency and high difficulty in performing manual inspection and reading of instruments in the prior related technology, and can improve the instrument reading efficiency and reduce the difficulty of instrument reading; and wherein, by performing instrument tilt correction on the instrument detection image, the problem of low accuracy caused by environmental interference can be avoided, and the recognition accuracy can be effectively improved.
[0064] Figure 1 A flow chart of a meter reading method provided for an embodiment of the present application. The method can be applied to one or more electronic devices such as a client and a server. In addition, the execution subject of the method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute the method, or a plurality of electronic devices can cooperate with each other to execute the method. When the above-mentioned execution subject is software, the method can be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made here.
[0065] Figure 1 A schematic flow chart of an instrument reading method provided in an embodiment of the present application.
[0066] like Figure 1 As shown, the present application discloses an embodiment, providing a meter reading method, which may specifically include the following steps:
[0067] Step S110: Acquire instrument detection image;
[0068] Specifically, the instrument detection image in this embodiment represents an image of an instrument object that needs to read a numerical value. The instrument detection image can be collected by an image acquisition device configured in the substation, or obtained by an inspection robot taking inspection photos. Of course, it can also be determined by receiving an image sent by a server, and this embodiment does not make any specific limitations on this.
[0069] Step S120: performing image recognition based on the instrument detection image to obtain pointer information and scale information.
[0070] Specifically, after acquiring the instrument detection image, image recognition can be performed based on the instrument detection image to obtain pointer information and scale information, wherein the image recognition method can be to use a deep learning model for human key point detection to identify the key points of the instrument, such as the YOLOv8-pose model, and the pointer information represents the information of the pointer in the instrument detection image, such as the rotation center point of the pointer and the tip point pointed by the pointer, and the scale information represents the information corresponding to the scale in the instrument detection image, such as the position of the scale point and the scale value box in the image; it should be noted that the obtained pointer information may include a pointer object and object coordinates, for example, the pointer object is the rotation center point of the pointer, and the object coordinates are the position coordinates of the rotation center point of the pointer in the instrument detection image.
[0071] In one example, if Figure 2 As shown, when the YOLOv8-pose model is used to perform image recognition on the instrument detection image, the target detection frame corresponding to the pointer is obtained. At this time, the key point in the lower right corner of the target detection frame is the rotation center point of the pointer, and the key point in the upper left corner of the target detection frame is the tip point pointed by the pointer. At this time, the rotation center point of the pointer and the tip point pointed by the pointer and their position coordinates in the instrument detection image can be used to generate pointer information. Of course, the above is only an example for illustration. In specific implementation, adaptive adjustments can be made according to the scene and requirements, and this embodiment does not make specific limitations on this.
[0072] In another example, if Figure 3 As shown, the YOLOv8-pose model is used to perform image recognition on the instrument detection image to obtain the target detection frame corresponding to each scale. At this time, the target detection frame and the value contained therein are used as the numerical frame of the scale, and the key points on the edge of the target detection frame are used as the scale points. At this time, the numerical frame of the scale and the scale points and their position coordinates in the instrument detection image can be used to generate scale information. Of course, the above is only an example for illustration. In specific implementation, adaptive adjustments can be made according to the scene and requirements, and this embodiment does not make specific limitations on this.
[0073] It should be noted that since the instrument will have two sets of scale markings for the inner diameter and the outer diameter, after obtaining the pointer information and the scale information, the inner and outer diameters can be divided according to the pointer information and the scale information to obtain the inner diameter scale information corresponding to the inner diameter and the outer diameter scale information corresponding to the outer diameter. The subsequent steps S130-S150 can be performed according to the inner diameter scale information and the outer diameter scale information, respectively, thereby achieving the purpose of separately processing the two sets of scale markings for the inner diameter and the outer diameter.
[0074] In one example, each scale point in the scale information can be distinguished as an inner diameter scale or an outer diameter scale according to the distance between the scale point and the value box in the scale information and the pointer rotation center point. Specifically, the inner diameter scale is the one where the center of gravity of the rectangle of the value box is closer to the pointer rotation center than the corresponding scale point; the outer diameter scale is the one where the center of gravity of the rectangle of the value box is farther from the pointer rotation center than the corresponding scale point. Figure 4 As shown, the scale points on the outer ring scale, the center of the scale value box is farther away from the rotation center of the pointer, so the outer ring scale points and their scale value boxes can be used as outer diameter scale information, while the scale points on the inner ring scale, the center of the scale value box is closer to the rotation center of the pointer, so the inner ring scale points and their scale value boxes can be used as inner diameter scale information.
[0075] Step S130: Based on the pointer information and the scale information, the scale point information is determined in combination with the preset instrument range corresponding to the instrument detection image.
[0076] Specifically, after obtaining the pointer information and scale information, the preset instrument range corresponding to the instrument detection image can be obtained. The instrument range represents the range information corresponding to the instrument, that is, the instrument range can include scale points and scale values corresponding to the scale points. At this time, the scale point information can be determined based on the pointer information and scale information, combined with the preset instrument range corresponding to the instrument detection image. The specific combination method can be to use the pointer rotation center point in the pointer information as a reference, and sort and adjust the scale points and scale values in each scale information, so that the sorted and adjusted scale points and scale values match the instrument range, thereby obtaining the scale point information, so that the scale point information includes the position information corresponding to the scale points matching the instrument range and the scale values corresponding to the scale points.
[0077] Step S140: performing instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image.
[0078] Specifically, after obtaining the scale point information, the instrument detection image can be corrected for instrument tilt according to the scale point information to obtain a target instrument image, wherein the process of instrument tilt correction can be to obtain a standard instrument image corresponding to the instrument range, wherein the standard instrument image represents the coordinates of each scale under the standard state and its scale value, etc. At this time, the position information corresponding to the scale point contained in the scale point information and the scale value corresponding to the scale point can be associated with the coordinates of each scale contained in the standard instrument image and its scale value, so that N scale points can be selected, wherein N is a positive integer greater than 4, and a perspective transformation is performed to adjust the instrument detection image and the coordinates of each key point, thereby performing instrument tilt correction on the instrument detection image, thereby obtaining a corrected instrument detection image and the coordinates of the key points therein, and then the target instrument image can be generated based on the corrected instrument detection image and the coordinates of the key points therein.
[0079] In one example, the standard instrument image corresponding to the instrument range is obtained, including scale points A, scale points B, scale points C, and scale points D, and the coordinates (A1, A2) corresponding to scale point A, the coordinates (B1, B2) corresponding to scale point B, the coordinates (C1, C2) corresponding to scale point C, and the coordinates (D1, D2) corresponding to scale point D, and the scale value corresponding to scale point A is 0, the scale value corresponding to scale point B is 0.5, the scale value corresponding to scale point C is 1, and the scale value corresponding to scale point D is 1.5; at this time, the scale point information includes scale points A', Scale points B', C', D', and the coordinates (A'1, A'2) corresponding to scale point A', the coordinates (B'1, B'2) corresponding to scale point B', the coordinates (C'1, C'2) corresponding to scale point C', the coordinates (D'1, D'2) corresponding to scale point D', and the scale value corresponding to scale point A' is 0, the scale value corresponding to scale point B' is 0.5, the scale value corresponding to scale point C' is 1, and the scale value corresponding to scale point D' is 1.5; at this time, according to the corresponding relationship of the scale values, scale point A and scale point A' can be compared. The scale point B is associated with the scale point B', the scale point C is associated with the scale point C', and the scale point D is associated with the scale point D'. In this way, the coordinate difference between the coordinates (A'1, A'2) corresponding to the scale point A' and the coordinates (A1, A2) corresponding to the scale point A, the coordinate difference between the coordinates (B'1, B'2) corresponding to the scale point B' and the coordinates (B1, B2) corresponding to the scale point B, and the coordinate difference between the coordinates (C'1, C'2) corresponding to the scale point C and the coordinates (C1, C2) corresponding to the scale point C can be used. The instrument test image is perspective transformed based on the coordinate difference between the scale point D' and the coordinate difference between the coordinates (D'1, D'2) corresponding to the scale point D' and the coordinates (D1, D2) corresponding to the scale point D. The specific perspective transformation method can be to establish a coordinate mapping based on the coordinate difference between the coordinates before and after the transformation of the four points, and adjust the instrument detection image and the coordinates of each key point based on the coordinate mapping to obtain a corrected instrument detection image and the key point coordinates therein. At this time, the target instrument image can be generated based on the corrected instrument detection image and the key point coordinates therein. In this way, the problem of low instrument recognition accuracy caused by the shooting angle or other environmental factors can be avoided. By performing perspective transformation on the instrument test image, the instrument tilt correction of the instrument detection image is played, which can effectively improve the accuracy of instrument recognition.
[0080] Step S150: performing instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
[0081] Specifically, after obtaining the target instrument image, the instrument reading of the target instrument image can be performed to obtain the reading result corresponding to the instrument detection image, wherein the specific instrument reading method can be to use the pointer tip coordinates and the center coordinates in the target instrument image to calculate the polar coordinates pointed by the pointer, and determine the positions of the front and rear scale points of the pointer to record their angle values in the polar coordinate system, use the angle value to determine the corresponding scale point, and use the scale value corresponding to the scale point as the reading result.
[0082] In an optional embodiment of the present application, step S130 determines the scale point information based on the pointer information and the scale information, combined with the preset instrument range corresponding to the instrument detection image, and may specifically include the following steps: based on the pointer information and the scale information, adjust the scale sequence to obtain the scale sequence information; according to the instrument range, determine the scale value information corresponding to the scale sequence information; use the scale sequence information and the scale value information to generate the scale point information.
[0083] In this embodiment, after obtaining the pointer information and the scale information, since the key points are used for identification when the instrument detection image is identified, the order of each scale cannot be accurately determined. At this time, the scale order can be adjusted based on the pointer information and the scale information to obtain the scale order information. The scale order information includes the scale points and the order parameters corresponding to the scale points, for example, including scale point A, scale point B and scale point C. At this time, the order parameter corresponding to scale point A is 2, the order parameter corresponding to scale point B is 3, and the order parameter corresponding to scale point C is 1. At this time, it can be determined that the normal order of the scale points is scale point C, scale point A, and scale point B. Then, the scale value information corresponding to the scale order information can be determined according to the instrument range. Since the instrument range contains the scale points and their scale values corresponding to the standard state, it can be determined at this time. The scale value corresponding to the point, for example, the range information indicates that the scale value corresponding to scale point C is 0, the scale value corresponding to scale point A is 0.5, and the scale value corresponding to scale point B is 1; at this time, the scale value corresponding to each scale point in the scale sequence information can be determined according to the range information, thereby generating scale value information according to each scale value, that is, the scale value information contains the scale value corresponding to each scale point; and then the scale point information can be generated according to the scale sequence information and the scale value information, for example, each scale point in the scale sequence information and the scale value corresponding to the scale point can be combined to generate scale point information, so that the scale point information can contain the scale point and the scale value corresponding to the scale point. It should be noted that the scale point in this embodiment can represent the coordinate information corresponding to the scale point, and then the scale point information can contain one or more scale points and the scale value corresponding to the scale point.
[0084] In an optional embodiment of the present application, the scale order is adjusted based on the pointer information and the scale information to obtain the scale order information, which may specifically include the following steps: extracting at least two scale point coordinates from the scale information, and extracting the pointer center point coordinates from the pointer information; using the pointer center point coordinates as the origin to establish a polar coordinate system; determining the angle difference between each two scale point coordinates based on the polar coordinate system; and adjusting the scale point coordinates sequentially based on the coordinate difference to obtain the scale order information.
[0085] In this embodiment, in the process of adjusting the scale order, at least two scale point coordinates can be extracted from the scale information, each scale point coordinate is used to mark a scale point, and the pointer center point coordinates can be extracted from the pointer information, and the pointer center point coordinates are used to identify the center point of the pointer rotation, so that the pointer center point coordinates can be used as the origin to establish a polar coordinate system, and based on the polar coordinate system, the angle difference between each two scale point coordinates can be determined. Specifically, scale vectors can be established by respectively using the two scale point coordinates and the origin of the polar coordinate system, and then the angle between the two scale vectors is determined as the angle difference; then, based on the coordinate difference, the scale point coordinates can be sequentially adjusted to obtain the scale order information. Since the scale point coordinates are used to identify the scale points, the scale point coordinates are sequentially adjusted at this time, that is, the order of each scale point is adjusted, so that the scale points and scale point coordinates contained in the scale order information are sorted in a normal reading manner.
[0086] In one example, the scale point coordinates are first converted into a polar coordinate system with the pointer rotation center point as the origin, 0 degrees horizontally to the right, and the clockwise rotation direction as the positive direction. Then, the coordinates of each scale point are sorted according to the angle size, and the angle difference between the scale point coordinates corresponding to each adjacent scale point is calculated. The next scale point with the largest angle difference is selected as the starting point of the dial scale. Based on the scale point coordinates corresponding to the starting point, the coordinates of subsequent scale points are adjusted in order to obtain the scale sequence information sorted from the starting point to the end point of the range.
[0087] like Figure 4 As shown, Figure 4The outer diameter in is taken as the reference, the center point of the pointer rotation is taken as the origin, the horizontal right is 0 degrees, and the clockwise direction is arranged. The scale points corresponding to 200, 0, 40, 80, 120, and 160 and their scale point coordinates are obtained in turn. The angle difference between the scale point coordinates corresponding to each adjacent scale point is calculated, and it is determined that the scale point coordinates corresponding to the scale point 200 and the scale point 0 have the largest angle difference. At this time, the next scale point with the largest angle difference is selected as the starting point of the dial scale, that is, the scale point corresponding to the scale point 0 is used as the starting point of the dial scale. Taking the scale point coordinates corresponding to the starting point as the reference, after adjusting the order, the scale point sequence of 0, 40, 80, 120, 160, and 200 is obtained. The scale points and the coordinates corresponding to the scale points are sorted according to 0, 40, 80, 120, 160, and 200 to obtain the scale sequence information sorted from the starting point to the end point of the range.
[0088] In an optional embodiment of the present application, the scale value information corresponding to the scale sequence information is determined based on the instrument range, which may specifically include the following steps: obtaining a preset instrument range; extracting at least two scale point coordinates from the scale sequence information; using the instrument range to determine the scale value corresponding to each scale point coordinate; and generating scale value information based on each scale value.
[0089] In this embodiment, in the process of determining the scale value information corresponding to the scale sequence information, a preset instrument range can be obtained, and at least two scale point coordinates can be extracted from the scale sequence information, so that the instrument range can be used to determine the scale value corresponding to each scale point coordinate. Since the coordinates of each scale point in the scale sequence information are coordinates sorted according to the instrument range, the scale values in the standard order can be extracted from the instrument range at this time, and the scale values in this order are matched with the scale point coordinates extracted from the scale sequence information. At this time, the scale value corresponding to each scale point coordinate can be determined; and then the scale values can be sorted in the same sorting method as the scale point coordinates to generate scale value information, so that the scale values in the scale value information are sorted in the standard order.
[0090] In one example, when the scale values 0, 0.5, 1.0, and 1.5 are extracted in the standard order in the instrument range, at least the scale point coordinates (A1, A2), (B1, B2), (C1, C2), and (D1, D2) are extracted from the scale order information. At this time, the scale value corresponding to (A1, A2) can be determined to be 0, the scale value corresponding to (B1, B2) can be determined to be 0.5, the scale value corresponding to (C1, C2) can be determined to be 1.0, and the scale value corresponding to (D1, D2) can be determined to be 1.5. The scale value information obtained at this time is 0, 0.5, 1.0, and 1.5.
[0091] In an optional embodiment of the present application, instrument tilt correction is performed on the instrument detection image according to the scale point information to obtain a target instrument image, which may specifically include the following steps: determining the instrument type corresponding to the instrument detection image; when the instrument type belongs to a preset instrument type, obtaining standard scale information corresponding to the instrument type; determining the scale correspondence information between the standard scale information and the scale point information; and based on the scale correspondence information, performing instrument tilt correction on the instrument detection image to obtain a target instrument image.
[0092] In this embodiment, in the process of performing instrument tilt correction on the instrument detection image, the instrument type corresponding to the instrument detection image can be determined, and it can be judged whether the instrument type belongs to a preset instrument type. The preset instrument type indicates an instrument type that is pre-configured with standard scale information. When the instrument type belongs to the preset instrument type, the standard scale information corresponding to the instrument type can be obtained. The standard scale information indicates information related to each scale in the standard instrument image corresponding to the instrument type. At this time, the scale correspondence relationship information between the standard scale information and the scale point information can be determined. The scale correspondence relationship information indicates the coordinate correspondence relationship information between the standard scale information and the scale point information for the same scale, such as the standard scale information. The coordinates of the scale point A in the quasi-scale information are (A1, A2), and the coordinates of the scale point A in the scale point information are (A'1, A'2). At this time, the correspondence relationship of (A'1, A'2) perspectively transformed to (A1, A2) is the scale correspondence relationship information; the scale correspondence relationship information can then be used to perform instrument tilt correction on the instrument detection image to obtain the target instrument image, that is, the instrument test image can be perspectively transformed through the scale correspondence relationship information, and the instrument detection image and the coordinates of each key point can be adjusted to obtain the corrected instrument detection image and the coordinates of the key points therein. At this time, the target instrument image can be generated based on the corrected instrument detection image and the coordinates of the key points therein.
[0093] In an optional embodiment of the present application, after determining the instrument type corresponding to the instrument detection image, the following steps may be specifically included: when the instrument type does not belong to the preset instrument type, using the scale point coordinates in the scale point information to generate fitting ellipse information; performing vector processing on each scale point coordinate based on the fitting ellipse information to obtain the correction point coordinates corresponding to each scale point coordinate; determining the coordinate correspondence relationship information between the correction point coordinates and the scale point coordinates; using the coordinate correspondence relationship information to perform instrument tilt correction on the instrument detection image to obtain the target instrument image.
[0094] In this embodiment, when the instrument type does not belong to the preset instrument type, it can be determined that the instrument type at this time is not a type pre-configured with standard scale information, so that the scale point coordinates can be extracted from the scale point information, and the scale point coordinates in the scale point information are used to generate the fitted ellipse information, the fitted ellipse information represents an ellipse containing the coordinates of each scale point, and according to the fitted ellipse information, each scale point coordinate is vector processed to obtain the correction point coordinates corresponding to each scale point coordinate, wherein the vector processing method can establish a scale point vector corresponding to the scale point coordinate according to each scale point coordinate and the origin of the ellipse, and perform correction based on the scale point vector combined with the fitted ellipse information. Vector processing is performed to obtain the coordinates of the correction point; then the coordinate correspondence information between the correction point coordinates and the scale point coordinates can be determined. The coordinate correspondence information can be the relationship information of the perspective transformation of the scale point coordinates into the correction point coordinates. Subsequently, the coordinate correspondence information can be used to perform instrument tilt correction on the instrument detection image to obtain the target instrument image. That is, the instrument test image can be perspective transformed through the coordinate correspondence information, and the instrument detection image and the coordinates of each key point can be adjusted to obtain the corrected instrument detection image and the key point coordinates therein. At this time, the target instrument image can be generated based on the corrected instrument detection image and the key point coordinates therein.
[0095] In addition, when the instrument type does not belong to the preset instrument type, the scale value in the scale point information can be determined by using OCR technology to recognize the text on the instrument detection image. The OCR recognition result includes the recognized text and the rectangular text box where the text is located. The recognition results that only include numbers and decimal points in the recognized text are selected, converted into numerical values, and the rectangular text boxes of these results are compared with the numerical value boxes. For each numerical value box, the numerical value corresponding to the rectangular text box with the largest overlapping area is selected as the numerical value of the scale point at that location, that is, the scale value is obtained.
[0096] In an optional embodiment of the present application, vector processing is performed on each scale point coordinate based on the fitted ellipse information to obtain the correction point coordinates corresponding to each scale point coordinate, which may specifically include the following steps: extracting the ellipse center coordinates, the major axis vector and the minor axis vector from the fitted ellipse information; determining the length ratio between the major axis vector and the minor axis vector; generating the scale point vector based on the ellipse center coordinates and the scale point coordinates; performing vector correction on the scale point vector based on the major axis vector, the minor axis vector and the length ratio to obtain the corrected scale point vector; and using the corrected scale point vector to generate the correction point coordinates.
[0097] In this embodiment, in the process of performing vector processing on each scale point coordinate according to the fitted ellipse information to obtain the correction point coordinate corresponding to each scale point coordinate, the ellipse center coordinate, the major axis vector and the minor axis vector may be extracted from the fitted ellipse information, and the length ratio between the major axis vector and the minor axis vector may be determined, so as to generate the scale point vector according to the ellipse center coordinate and the scale point coordinate. The specific method of generating the scale point vector may be to establish a scale point vector with each scale point coordinate and the ellipse center, and then the scale point vector may be vector-corrected based on the major axis vector, the minor axis vector and the length ratio to obtain the corrected scale point vector. Specifically, the scale point vector may be dot-multiplied with the major axis vector and the minor axis vector of the ellipse respectively, and then multiplied by the direction vectors of the major axis and the minor axis respectively, so as to obtain the projection vector of the scale point vector on the minor axis and the major axis, and then the projection vector on the minor axis may be multiplied by the length ratio, and the projection vector on the major axis may be added to obtain the corrected scale point vector, and then the corrected scale point vector may be added to the ellipse center coordinate to obtain the corrected scale point coordinate, that is, to generate the correction point coordinate.
[0098] In one example, if Figure 5 As shown in the figure, the ellipse is the ellipse obtained by fitting, with the major axis a and the minor axis b, and the length ratio k = a / b. The point T on the ellipse is the scale point coordinate. First, the projection vectors OP and OQ of the scale point vector OT on the major axis a and the minor axis b are calculated; then the projection vector OQ on the minor axis is multiplied by the length ratio k to obtain the vector OR; finally, the vector OR is added to the vector OP to obtain the corrected scale point vector OT1. The coordinates of point O are added to the vector OT1 to obtain the corrected scale point coordinates T1, that is, the corrected point coordinates are T1.
[0099] like Figure 6 As shown, the present application also discloses an embodiment, providing a meter reading device, comprising:
[0100] An acquisition module 610 is used to acquire an instrument detection image;
[0101] An image recognition module 620 is used to perform image recognition based on the instrument detection image to obtain pointer information and scale information;
[0102] The scale point module 630 is used to determine the scale point information based on the pointer information and the scale information in combination with the preset instrument range corresponding to the instrument detection image;
[0103] A correction module 640 is used to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image;
[0104] The reading module 650 is used to perform instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
[0105] In an optional embodiment of the present application, the scale point module 630 may include:
[0106] A scale sequence adjustment unit, used to adjust the scale sequence based on the pointer information and the scale information to obtain the scale sequence information;
[0107] A first determining unit, configured to determine the scale value information corresponding to the scale sequence information according to the meter range;
[0108] The first generating unit is used to generate the scale point information by using the scale order information and the scale value information.
[0109] In an optional embodiment of the present application, the scale sequence adjustment unit may include:
[0110] A first extraction subunit, configured to extract at least two scale point coordinates from the scale information, and extract the pointer center point coordinates from the pointer information;
[0111] A polar coordinate system subunit, used to establish a polar coordinate system by taking the coordinates of the center point of the pointer as the origin;
[0112] A first determining subunit, configured to determine the angle difference between the coordinates of every two scale points according to the polar coordinate system;
[0113] The sequence adjustment subunit is used to sequentially adjust the coordinates of the scale points based on the coordinate difference to obtain the scale sequence information.
[0114] In an optional embodiment of the present application, the first determining unit may include:
[0115] An acquisition subunit, used for acquiring a preset measuring range of the instrument;
[0116] A second extraction subunit, used to extract at least two scale point coordinates from the scale sequence information;
[0117] A second determination subunit is used to determine the scale value corresponding to each of the scale point coordinates using the instrument range;
[0118] The first generating subunit is used to generate the scale value information according to each of the scale values.
[0119] In an optional embodiment of the present application, the correction module 640 may include:
[0120] A second determining unit, used to determine the instrument type corresponding to the instrument detection image;
[0121] an acquisition unit, configured to acquire standard scale information corresponding to the instrument type when the instrument type belongs to a preset instrument type;
[0122] A third determining unit, used to determine scale correspondence information between the standard scale information and the scale point information;
[0123] The first tilt correction unit is used to perform instrument tilt correction on the instrument detection image according to the scale correspondence information to obtain a target instrument image.
[0124] In an optional embodiment of the present application, the correction module 640 may further include:
[0125] A second generating unit, configured to generate fitting ellipse information by using the scale point coordinates in the scale point information when the instrument type does not belong to the preset instrument type;
[0126] A vector processing unit, used for performing vector processing on each of the scale point coordinates according to the fitting ellipse information, to obtain the correction point coordinates corresponding to each of the scale point coordinates;
[0127] A fourth determining unit, used to determine coordinate correspondence information between the correction point coordinates and the scale point coordinates;
[0128] The second tilt correction unit is used to perform instrument tilt correction on the instrument detection image by using the coordinate correspondence information to obtain a target instrument image.
[0129] In an optional embodiment of the present application, the vector processing unit may include:
[0130] A third extraction subunit is used to extract the ellipse center coordinates, the major axis vector and the minor axis vector from the fitted ellipse information;
[0131] A third determining subunit, configured to determine a length ratio between the major axis vector and the minor axis vector;
[0132] A second generating subunit, used for generating a scale point vector according to the ellipse center coordinates and the scale point coordinates;
[0133] a vector correction subunit, configured to perform vector correction on the scale point vector based on the major axis vector, the minor axis vector and the length ratio to obtain a corrected scale point vector;
[0134] The third generating subunit is used to generate the correction point coordinates by using the corrected scale point vector.
[0135] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0136] like Figure 7 As shown, an embodiment of the present application provides an electronic device, including a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740;
[0137] Memory 730, for storing computer programs;
[0138] In one embodiment of the present application, the processor 710, when executing the program stored in the memory 730, implements the instrument reading method provided by any of the aforementioned method embodiments, by acquiring an instrument detection image, performing image recognition based on the instrument detection image, obtaining pointer information and scale information, and determining scale point information based on the pointer information and scale information, in combination with a preset instrument range corresponding to the instrument detection image, so as to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image, and then perform instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image, thereby achieving the purpose of performing instrument reading without manual inspection, solving the problems of low efficiency and high difficulty in performing manual inspection and reading of instruments in the existing related technology, and being able to improve the efficiency of instrument reading and reduce the difficulty of instrument reading; and wherein, by performing instrument tilt correction on the instrument detection image, being able to avoid the problem of low accuracy due to environmental interference, being able to effectively improve the recognition accuracy.
[0139] The embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, an instrument reading method as provided in any of the aforementioned method embodiments is implemented, by acquiring an instrument detection image, performing image recognition based on the instrument detection image, obtaining pointer information and scale information, and determining scale point information based on the pointer information and scale information in combination with a preset instrument range corresponding to the instrument detection image, so as to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image, and then perform instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image, thereby achieving the purpose of performing instrument reading without manual inspection, solving the problems of low efficiency and high difficulty in performing manual inspection and reading of instruments in the existing related technology, and being able to improve the efficiency of instrument reading and reduce the difficulty of instrument reading; and wherein, by performing instrument tilt correction on the instrument detection image, the problem of low accuracy due to environmental interference can be avoided, and the recognition accuracy can be effectively improved.
[0140] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0141] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0142] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for reading an instrument, It is characterized in that include: Acquire instrument detection images; Performing image recognition based on the instrument detection image to obtain pointer information and scale information; Based on the pointer information and the scale information, combined with the instrument range corresponding to the instrument detection image, scale point information is determined; According to the scale point information, the instrument tilt correction is performed on the instrument detection image to obtain a target instrument image; An instrument reading is performed based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
2. The method according to claim 1, It is characterized in that The step of determining the scale point information based on the pointer information and the scale information in combination with the instrument range corresponding to the instrument detection image includes: Based on the pointer information and the scale information, adjusting the scale sequence to obtain scale sequence information; Determine the scale value information corresponding to the scale sequence information according to the instrument range; The scale point information is generated by using the scale order information and the scale value information.
3. The method according to claim 2, It is characterized in that The step of adjusting the scale sequence based on the pointer information and the scale information to obtain the scale sequence information includes: Extracting at least two scale point coordinates from the scale information, and extracting the pointer center point coordinates from the pointer information; Taking the coordinates of the center point of the pointer as the origin, a polar coordinate system is established; Determine the angle difference between the coordinates of every two scale points according to the polar coordinate system; Based on the coordinate difference, the scale point coordinates are sequentially adjusted to obtain the scale sequence information.
4. The method according to claim 2, It is characterized in that The step of determining the scale value information corresponding to the scale sequence information according to the instrument range includes: Obtaining a preset measuring range of the instrument; Extracting at least two scale point coordinates from the scale sequence information; Using the instrument range, determine the scale value corresponding to each scale point coordinate; The scale value information is generated according to each of the scale values.
5. The method according to claim 1, It is characterized in that The step of performing instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image includes: Determine the instrument type corresponding to the instrument detection image; When the instrument type belongs to a preset instrument type, obtaining standard scale information corresponding to the instrument type; Determine the scale correspondence relationship information between the standard scale information and the scale point information; According to the scale correspondence information, the instrument tilt correction is performed on the instrument detection image to obtain a target instrument image.
6. The method according to claim 5, It is characterized in that After determining the instrument type corresponding to the instrument detection image, the method further includes: When the instrument type does not belong to the preset instrument type, using the scale point coordinates in the scale point information to generate fitting ellipse information; According to the fitting ellipse information, vector processing is performed on each of the scale point coordinates to obtain the correction point coordinates corresponding to each of the scale point coordinates; Determine the coordinate correspondence information between the correction point coordinates and the scale point coordinates; The coordinate correspondence information is used to perform instrument tilt correction on the instrument detection image to obtain a target instrument image.
7. The method according to claim 6, It is characterized in that The step of performing vector processing on each of the scale point coordinates according to the fitting ellipse information to obtain the correction point coordinates corresponding to each of the scale point coordinates includes: Extracting the center coordinates, major axis vector and minor axis vector of the ellipse from the fitted ellipse information; determining a length ratio between the major axis vector and the minor axis vector; Generate a scale point vector according to the ellipse center coordinates and the scale point coordinates; Performing vector correction on the scale point vector based on the major axis vector, the minor axis vector and the length ratio to obtain a corrected scale point vector; The corrected scale point vector is used to generate the correction point coordinates.
8. A meter reading device, It is characterized in that include: An acquisition module is used to acquire instrument detection images; An image recognition module, used to perform image recognition based on the instrument detection image to obtain pointer information and scale information; A scale point module, used to determine the scale point information based on the pointer information and the scale information, combined with the preset instrument range corresponding to the instrument detection image; A correction module, used to perform instrument tilt correction on the instrument detection image according to the scale point information to obtain a target instrument image; The reading module is used to perform instrument reading based on the target instrument image to obtain a reading result corresponding to the instrument detection image.
9. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the meter reading method described in any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the meter reading method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Pointer type instrument inclination correction method and system
CN111488874A
Pointer type instrument image tilt correction method
CN112801094A
Dial plate state detection method and device
CN114511691A
Neural network-based pointer instrument identification method
CN116246101A
Reading identification method and device, electronic equipment and storage medium
CN117079281A
Cited By
Pointer meter reading identification method and device and electronic equipment
CN120014616A
